svga: Allow sRGB format with PIPE_BIND_DISPLAY_TARGET binding flag on vgpu10.
authorNeha Bhende <bhenden@vmware.com>
Thu, 4 May 2017 18:25:18 +0000 (11:25 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 3 Oct 2017 18:07:05 +0000 (12:07 -0600)
This patch allows to use sRGB formats for DISPLAY_TARGET on vgpu10.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_screen.c

index 08cc50f6664286a159ed0de0ae7434f87ba9f1e3..7901e819de4299f57f670d6243cc2288ea3aa88c 100644 (file)
@@ -762,8 +762,10 @@ svga_is_format_supported( struct pipe_screen *screen,
       return FALSE;
    }
 
-   /* we don't support sRGB rendering into display targets */
-   if (util_format_is_srgb(format) && (bindings & PIPE_BIND_DISPLAY_TARGET)) {
+   if (!ss->sws->have_vgpu10 &&
+       util_format_is_srgb(format) &&
+       (bindings & PIPE_BIND_DISPLAY_TARGET)) {
+       /* We only support sRGB rendering with vgpu10 */
       return FALSE;
    }
 
@@ -794,6 +796,9 @@ svga_is_format_supported( struct pipe_screen *screen,
       case SVGA3D_B8G8R8A8_UNORM:
       case SVGA3D_B8G8R8X8_UNORM:
       case SVGA3D_B5G6R5_UNORM:
+      case SVGA3D_B8G8R8X8_UNORM_SRGB:
+      case SVGA3D_B8G8R8A8_UNORM_SRGB:
+      case SVGA3D_R8G8B8A8_UNORM_SRGB:
          break;
 
       /* Often unsupported/problematic. This means we end up with the same