frontend/dri: Implement mapping individual planes.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 25 May 2020 13:53:59 +0000 (15:53 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 May 2020 09:12:33 +0000 (09:12 +0000)
commitad609bf55a87200ab11ad7cf31420dcfd8dfc141
treee570ffaf8ad9d449994a5ef4664439e0e1fb11f8
parenta2ee293422c09c9ecc8150ad70d29273e28c6a71
frontend/dri: Implement mapping individual planes.

It is kinda surprising that

image2 = fromPlanar(image, 2, NULL)
mapImage(..., image2, ...)

does not map the third plane.

This implements that behavior in the case where the DRI frontend
lowers the multi-planar textures.

In the case it doesn't this would need driver support. AFAIU at
least etnaviv is impacted, and while it looks possible, I don't
have the etnaviv knowledge to implement it.

Instead of silently returning weird results (either always plane 0
or possibly something interleaved) this adds an error return on
mapping multi-planar textures otherwise.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5200>
src/gallium/frontends/dri/dri2.c
src/gallium/frontends/dri/dri_screen.h