diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-11-01 22:55:28 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-11-05 18:09:45 +0200 |
commit | f3da419dbfce476990c462073dfafed10ecd732e (patch) | |
tree | 25d0e4a1d243c17b334bb73a3fee613aba0dd1c3 | |
parent | 9c33e5f74f510db349c51e9454070e84e3b0367d (diff) |
lib/igt_fb: Use linear.fb in the converter
The converter operates between the linear and shadow fbs. When using
the blitter path there is no particular reason to assume that the
linear fb and actual fb have the same strides for instance. Thus
consulting the actual fb for metadata is not really correct.
We can also simplify the mmap() path by copying all the original
fb metadata into linear.fb as there we map the original fb directly.
We just have to keep clearing linear.fb.gem_handle so that the
dtor knows which kind of beast it's got.
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
-rw-r--r-- | lib/igt_fb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c index a59b5a88..97310f70 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -1946,7 +1946,7 @@ static void destroy_cairo_surface__convert(void *arg) struct fb_convert cvt = { .dst = { .ptr = blit->base.linear.map, - .fb = blit->base.fb, + .fb = &blit->base.linear.fb, }, .src = { @@ -1987,18 +1987,16 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb) fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED) { setup_linear_mapping(fd, fb, &blit->base.linear); } else { + blit->base.linear.fb = *fb; blit->base.linear.fb.gem_handle = 0; blit->base.linear.map = map_bo(fd, fb); igt_assert(blit->base.linear.map); - blit->base.linear.fb.size = fb->size; - memcpy(blit->base.linear.fb.strides, fb->strides, sizeof(fb->strides)); - memcpy(blit->base.linear.fb.offsets, fb->offsets, sizeof(fb->offsets)); } cvt.dst.ptr = blit->shadow_ptr; cvt.dst.fb = &blit->shadow_fb; cvt.src.ptr = blit->base.linear.map; - cvt.src.fb = blit->base.fb; + cvt.src.fb = &blit->base.linear.fb; fb_convert(&cvt); fb->cairo_surface = |