svga: Add a more elaborate format compatibility determination v2
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 7 Apr 2017 12:54:56 +0000 (14:54 +0200)
committerBrian Paul <brianp@vmware.com>
Sat, 29 Apr 2017 03:03:06 +0000 (21:03 -0600)
commitca59fd17061aeffc55847755de1ed2b6600bcf84
tree505c8124ea41e46c08a46e9b2c5fb866d800a204
parent18d5c452d04ff426158051b6bfea41af41c0059d
svga: Add a more elaborate format compatibility determination v2

dri3 is a bit sloppy about its format compatibility requirements, so add
a possibility to import xrgb surfaces as argb textures and vice versa.

At the same time, make the svga_texture_from_handle() function a bit more
readable and fix the error path where we leaked a winsys surface.

v2: Addressed review comments by Brian.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_format.c
src/gallium/drivers/svga/svga_format.h
src/gallium/drivers/svga/svga_resource_texture.c