summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorGwenole Beauchesne <[email protected]>2014-03-10 16:55:21 +0100
committerGwenole Beauchesne <[email protected]>2014-03-25 18:56:41 +0100
commit3bd65dc8a1fec7bba643ffe1fdec8dc2b87ca585 (patch)
tree104b391a6ac529aebe89e674f103ec0414cd181b /src/mesa/drivers
parent1c290680742ce5cb9a0a1019d0f971689335aabc (diff)
i965: fix dma_buf import with non-zero offset.
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). Signed-off-by: Gwenole Beauchesne <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 0788a1b8e5f..8cb1260433a 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -646,6 +646,7 @@ intel_create_image_from_fds(__DRIscreen *screen,
{
struct intel_screen *intelScreen = screen->driverPrivate;
struct intel_image_format *f;
+ uint32_t mask_x, mask_y;
__DRIimage *image;
int i, index;
@@ -679,6 +680,14 @@ intel_create_image_from_fds(__DRIscreen *screen,
image->strides[index] = strides[index];
}
+ if (f->nplanes == 1) {
+ image->offset = image->offsets[0];
+ intel_region_get_tile_masks(image->region, &mask_x, &mask_y, false);
+ if (image->offset & mask_x)
+ _mesa_warning(NULL,
+ "intel_create_image_from_fds: offset not on tile boundary");
+ }
+
intel_setup_image_from_dimensions(image);
return image;