Lines Matching +defs:pixel +defs:size

152 static uint32_t gem_create(int fd, int size)
157 create.size = size;
212 gem_pwrite.size = len;
217 static void *gem_mmap(int fd, uint32_t handle, int size, unsigned prot, int domain)
227 mmap_arg.size = size;
239 ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_arg.offset);
248 munmap(ptr, size);
283 static void gem_fill(int fd, uint32_t handle, uint32_t pixel, uint32_t size, int domain)
287 ptr = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE, domain);
291 for (s = 0; s < size; s += 4)
292 ptr[s/4] = pixel;
293 munmap(ptr, size);
315 static int check_pixel(int fd, uint32_t handle, uint32_t stride, uint32_t size,
323 ptr = gem_mmap(fd, handle, size, PROT_READ, domain);
328 printf("pixel[%d, %d]:%d = %08x\n", x, y, bpp, ptr[(y * stride + x)/4]);
331 munmap(ptr, size);
360 static int gpu_fill(int device, int handle, int width, int height, int pitch, int bpp, int tiling, uint32_t pixel)
396 batch[len++] = pixel;
435 uint32_t pixel = 0xffff00ff;
489 if (gpu_fill(device, handle, width, height, stride, 32, I915_TILING_NONE, pixel)) {
498 if (ptr[y_loc[y]*width + x_loc[x]] != pixel) {
499 printf("pixel[%d, %d]:%d = %08x\n", x, y, 32, ptr[y_loc[y] * width + x_loc[x]]);
508 pixel, 32)) {
536 const uint32_t pixel = 0xffff00ff;
560 printf("Creating %dx%d (source stride=%d, size=%d, domain=%d)\n",
570 gem_fill(device, src, pixel, src_size, domain);
584 pixel, bpp))
596 printf("Comparing %dx%d (destination stride=%d, size=%d)\n",
613 pixel, bpp, GTT))
647 const uint32_t pixel = 0xffff00ff;
664 printf("Creating %dx%d (destination stride=%d, size=%d, domain=%d)\n",
674 gem_fill(device, dst, ~pixel, dst_size, domain);
702 pixel, bpp, domain))
724 const uint32_t pixel = 0xffff00ff;
732 int stride, size, fd;
748 size = lseek(fd, 0, SEEK_END);
754 fd, bpp, stride, size);
760 printf("%s: Filling src with %08x, reading dst\n", __func__, pixel);
766 pixel, 32))
769 printf("%s: Filling dst with %08x, reading src\n", __func__, ~pixel);
775 ~pixel, 32))
781 printf("%s: Filling src with %08x, reading fd\n", __func__, pixel);
787 if (!check_pixel(device, handle, stride, size,
789 pixel, bpp, GTT))
792 printf("%s: Filling fd with %08x, reading src\n", __func__, ~pixel);
793 if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel))
799 ~pixel, 32))
805 printf("%s: Filling dst with %08x, reading fd\n", __func__, pixel);
811 if (!check_pixel(device, handle, stride, size,
813 pixel, bpp, GTT))
816 printf("%s: Filling fd with %08x, reading dst\n", __func__, ~pixel);
817 if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel))
823 ~pixel, 32))
832 printf("%s: Closed original src, filling dst with %08x, reading fd\n", __func__, pixel);
838 if (!check_pixel(device, handle, stride, size,
840 pixel, bpp, GTT))