Mesa (master): svga: Allow format differences in 16-bit RGBA surface sharing

Thomas Hellstrom thomash at kemper.freedesktop.org
Wed Jun 7 17:48:11 UTC 2017


Module: Mesa
Branch: master
Commit: 1887faf73b379f28eb6c73bdb790dbcc97213b3a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1887faf73b379f28eb6c73bdb790dbcc97213b3a

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Tue May 30 15:02:19 2017 +0200

svga: Allow format differences in 16-bit RGBA surface sharing

For the purpose of surface sharing, treat SVGA3D_R5G6B5 and
SVGA3D_B5G6R5_UNORM as identical formats.
This fixes the following piglit tests with dri3/xa:

glx at glx-visuals-depth -pixmap
glx at glx-visuals-stencil -pixmap

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Deepak Singh Rawat <drawat at vmware.com>
Reviewed-by: Charmaine Lee <charmainel at vmware.com>

---

 src/gallium/drivers/svga/svga_format.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c
index 3a2f7df242..7b06a16c3f 100644
--- a/src/gallium/drivers/svga/svga_format.c
+++ b/src/gallium/drivers/svga/svga_format.c
@@ -1862,12 +1862,16 @@ static const SVGA3dSurfaceFormat compat_r8[] = {
 static const SVGA3dSurfaceFormat compat_g8r8[] = {
    SVGA3D_R8G8_UNORM, SVGA3D_NV12, 0
 };
+static const SVGA3dSurfaceFormat compat_r5g6b5[] = {
+   SVGA3D_R5G6B5, SVGA3D_B5G6R5_UNORM, 0
+};
 
 static const struct format_compat_entry format_compats[] = {
    {PIPE_FORMAT_B8G8R8X8_UNORM, compat_x8r8g8b8},
    {PIPE_FORMAT_B8G8R8A8_UNORM, compat_x8r8g8b8},
    {PIPE_FORMAT_R8_UNORM, compat_r8},
-   {PIPE_FORMAT_R8G8_UNORM, compat_g8r8}
+   {PIPE_FORMAT_R8G8_UNORM, compat_g8r8},
+   {PIPE_FORMAT_B5G6R5_UNORM, compat_r5g6b5}
 };
 
 /**




More information about the mesa-commit mailing list