Fix eglCreateImage() from a packed dma_buf surface with a non-zero offset to pixels data. In particular, this fixes support for planar YUV surfaces when they are individually mapped on a per-plane basis, i.e. when the OES_EGL_image_external is not used and user application wants to use its own shader code for composition, or processing on individual plane (OCL).
v2: fixed check for tile boundary. Signed-off-by: Gwenole Beauchesne <gwenole.beauche...@intel.com> --- src/mesa/drivers/dri/i965/intel_screen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 1e3d58f..5005b5c 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -737,6 +737,13 @@ intel_create_image_from_fds(__DRIscreen *screen, image->strides[index] = strides[index]; } + if (f->nplanes == 1) { + image->offset = image->offsets[0]; + if (image->region->tiling != I915_TILING_NONE && (image->offset & 0xfff)) + _mesa_warning(NULL, + "intel_create_image_from_fds: offset not on tile boundary"); + } + intel_setup_image_from_dimensions(image); return image; -- 1.7.9.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev