i965: implement (un)mapImage
authorJulien Isorce <jisorce@oblong.com>
Mon, 6 Nov 2017 10:08:25 +0000 (10:08 +0000)
committerJulien Isorce <jisorce@oblong.com>
Tue, 14 Nov 2017 14:23:13 +0000 (14:23 +0000)
commitb904ad7d21a5d0472ffb80b81abe24afb2da3289
treea89b7aa21c25e6e00bc8e46cf7ad87a69b17e421
parent8a7d4092d260b3781a443171e20ba0d2c8772131
i965: implement (un)mapImage

Already implemented for Gallium drivers.

Useful for gbm_bo_(un)map.

Tests:
  By porting wayland/weston/clients/simple-dmabuf-drm.c to GBM.
  kmscube --mode=rgba
  kmscube --mode=nv12-1img
  kmscube --mode=nv12-2img
  piglit ext_image_dma_buf_import-refcount -auto
  piglit ext_image_dma_buf_import-transcode-nv12-as-r8-gr88 -auto
  piglit ext_image_dma_buf_import-sample_rgb -fmt=XR24 -alpha-one -auto
  piglit ext_image_dma_buf_import-sample_rgb -fmt=AR24 -auto
  piglit ext_image_dma_buf_import-sample_yuv -fmt=NV12 -auto
  piglit ext_image_dma_buf_import-sample_yuv -fmt=YU12 -auto
  piglit ext_image_dma_buf_import-sample_yuv -fmt=YV12 -auto

v2: add early return if (flag & MAP_INTERNAL_MASK)
v3: take input rect into account and test with kmscube and piglit.
v4: handle wraparound and bo reference.
v5: indent, exclude 0 width and height on the boundary, map bo
    independently of the image.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
src/mesa/drivers/dri/i965/intel_screen.c