Lines Matching +defs:pixel +defs:size
157 static uint32_t gem_create(int fd, int size)
162 create.size = size;
217 gem_pwrite.size = len;
222 static void *gem_mmap(int fd, uint32_t handle, int size, unsigned prot, int domain)
232 mmap_arg.size = size;
244 ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_arg.offset);
253 munmap(ptr, size);
288 static void gem_fill(int fd, uint32_t handle, uint32_t pixel, uint32_t size, int domain)
292 ptr = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE, domain);
296 for (s = 0; s < size; s += 4)
297 ptr[s/4] = pixel;
298 munmap(ptr, size);
320 static int check_pixel(int fd, uint32_t handle, uint32_t stride, uint32_t size,
328 ptr = gem_mmap(fd, handle, size, PROT_READ, domain);
333 printf("pixel[%d, %d]:%d = %08x\n", x, y, bpp, ptr[(y * stride + x)/4]);
336 munmap(ptr, size);
365 static int gpu_fill(int device, int handle, int width, int height, int pitch, int bpp, int tiling, uint32_t pixel)
401 batch[len++] = pixel;
440 uint32_t pixel = 0xffff00ff;
494 if (gpu_fill(device, handle, width, height, stride, 32, I915_TILING_NONE, pixel)) {
503 if (ptr[y_loc[y]*width + x_loc[x]] != pixel) {
504 printf("pixel[%d, %d]:%d = %08x\n", x, y, 32, ptr[y_loc[y] * width + x_loc[x]]);
513 pixel, 32)) {
541 const uint32_t pixel = 0xffff00ff;
565 printf("Creating %dx%d (source stride=%d, size=%d, domain=%d)\n",
575 gem_fill(device, src, pixel, src_size, domain);
589 pixel, bpp))
601 printf("Comparing %dx%d (destination stride=%d, size=%d)\n",
618 pixel, bpp, GTT))
652 const uint32_t pixel = 0xffff00ff;
669 printf("Creating %dx%d (destination stride=%d, size=%d, domain=%d)\n",
679 gem_fill(device, dst, ~pixel, dst_size, domain);
707 pixel, bpp, domain))
729 const uint32_t pixel = 0xffff00ff;
737 int stride, size, fd;
753 size = lseek(fd, 0, SEEK_END);
759 fd, bpp, stride, size);
765 printf("%s: Filling src with %08x, reading dst\n", __func__, pixel);
771 pixel, 32))
774 printf("%s: Filling dst with %08x, reading src\n", __func__, ~pixel);
780 ~pixel, 32))
786 printf("%s: Filling src with %08x, reading fd\n", __func__, pixel);
792 if (!check_pixel(device, handle, stride, size,
794 pixel, bpp, GTT))
797 printf("%s: Filling fd with %08x, reading src\n", __func__, ~pixel);
798 if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel))
804 ~pixel, 32))
810 printf("%s: Filling dst with %08x, reading fd\n", __func__, pixel);
816 if (!check_pixel(device, handle, stride, size,
818 pixel, bpp, GTT))
821 printf("%s: Filling fd with %08x, reading dst\n", __func__, ~pixel);
822 if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel))
828 ~pixel, 32))
837 printf("%s: Closed original src, filling dst with %08x, reading fd\n", __func__, pixel);
843 if (!check_pixel(device, handle, stride, size,
845 pixel, bpp, GTT))