Mesa (staging/19.0): virgl: Assume sRGB write control for older guest kernels or virglrenderer hosts

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 21 18:22:25 UTC 2019


Module: Mesa
Branch: staging/19.0
Commit: 4e3f82cde4dc0734c53d10dab211c5dd08fe9b01
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e3f82cde4dc0734c53d10dab211c5dd08fe9b01

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Mon Jun 17 08:44:14 2019 +0200

virgl: Assume sRGB write control for older guest kernels or virglrenderer hosts

When the host virglrenderer is an older version that doesn't check the sRGB write
control feature, or when the guest kernel doesn't support CAPS v2, then the guest
will only report support for GL 2.1 on a GL 3.3 host, even though it was supporting
3.3 with earlier guest mesa versions.

By also checking the host feature check version this regression can be avoided.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110921
Fixes: 2845939d6a72
   virgl: Set sRGB write control CAP based on host capabilities

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Chia-I Wu <olvaffe at gmail.com>
(cherry-picked from commit 2b87753a84da7a1bd8a84f26f3cd0e03cc52c930)

---

 src/gallium/drivers/virgl/virgl_screen.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 17fa5fc51cc..d1e00dd4ef9 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -347,7 +347,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_NATIVE_FENCE_FD:
       return vscreen->vws->supports_fences;
    case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL:
-      return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_SRGB_WRITE_CONTROL;
+      return (vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_SRGB_WRITE_CONTROL) ||
+            (vscreen->caps.caps.v2.host_feature_check_version < 1);
    default:
       return u_pipe_screen_get_param_defaults(screen, param);
    }




More information about the mesa-commit mailing list