st/dri: replace format conversion functions with single mapping table
authorLucas Stach <l.stach@pengutronix.de>
Thu, 17 May 2018 09:03:57 +0000 (11:03 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Tue, 18 Dec 2018 18:19:45 +0000 (19:19 +0100)
commit433ca3127a3b94bfe9a513e7c7ce594e09e1359f
tree0ff5ee44afb8f413f51e7b069e9f09df2b6a087e
parent67174d40f1ab4376d7dbef1e01eb1866ad332db0
st/dri: replace format conversion functions with single mapping table

Each time I have to touch the buffer import/export functions in the dri
state tracker I get lost in the maze of functions converting between
DRI_IMAGE_FOURCC, DRI_IMAGE_FORMAT, DRI_IMAGE_COMPONENTS and pipe format.

Rip it out and replace by a single table, which defines the correspondence
between the different representations.

Also this now stores all the known representations in the __DRIimageRec,
to avoid the loss of information we currently have when importing a buffer
with a fourcc, which doesn't have a corresponding dri format.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri_screen.h