mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
lib/igt_fb: Fix domain tracking for GTT cairo surfaces
If we create a cairo surface using a GTT mmaping, then we need to use the GTT access domain. cairo surfaces created with a blit temporary (for unfenced surfaces) still use the CPU domain. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
5533f22c35
commit
18d0b1efb8
@ -967,6 +967,7 @@ static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
|
|||||||
cairo_format,
|
cairo_format,
|
||||||
fb->width, fb->height,
|
fb->width, fb->height,
|
||||||
blit->linear.stride);
|
blit->linear.stride);
|
||||||
|
fb->domain = I915_GEM_DOMAIN_GTT;
|
||||||
|
|
||||||
cairo_surface_set_user_data(fb->cairo_surface,
|
cairo_surface_set_user_data(fb->cairo_surface,
|
||||||
(cairo_user_data_key_t *)create_cairo_surface__blit,
|
(cairo_user_data_key_t *)create_cairo_surface__blit,
|
||||||
@ -989,6 +990,7 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
|
|||||||
cairo_image_surface_create_for_data(ptr,
|
cairo_image_surface_create_for_data(ptr,
|
||||||
drm_format_to_cairo(fb->drm_format),
|
drm_format_to_cairo(fb->drm_format),
|
||||||
fb->width, fb->height, fb->stride);
|
fb->width, fb->height, fb->stride);
|
||||||
|
fb->domain = I915_GEM_DOMAIN_GTT;
|
||||||
|
|
||||||
cairo_surface_set_user_data(fb->cairo_surface,
|
cairo_surface_set_user_data(fb->cairo_surface,
|
||||||
(cairo_user_data_key_t *)create_cairo_surface__gtt,
|
(cairo_user_data_key_t *)create_cairo_surface__gtt,
|
||||||
@ -1005,8 +1007,7 @@ static cairo_surface_t *get_cairo_surface(int fd, struct igt_fb *fb)
|
|||||||
create_cairo_surface__gtt(fd, fb);
|
create_cairo_surface__gtt(fd, fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
gem_set_domain(fd, fb->gem_handle,
|
gem_set_domain(fd, fb->gem_handle, fb->domain, fb->domain);
|
||||||
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
|
|
||||||
|
|
||||||
igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS);
|
igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS);
|
||||||
return fb->cairo_surface;
|
return fb->cairo_surface;
|
||||||
|
@ -54,6 +54,7 @@ struct igt_fb {
|
|||||||
uint64_t tiling;
|
uint64_t tiling;
|
||||||
unsigned size;
|
unsigned size;
|
||||||
cairo_surface_t *cairo_surface;
|
cairo_surface_t *cairo_surface;
|
||||||
|
unsigned domain;
|
||||||
uint32_t src_x;
|
uint32_t src_x;
|
||||||
uint32_t src_y;
|
uint32_t src_y;
|
||||||
uint32_t src_w;
|
uint32_t src_w;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user