Mesa (master): virgl: Add a caps feature check version

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 29 07:55:43 UTC 2019


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Wed Mar 27 09:07:36 2019 +0100

virgl: Add a caps feature check version

When we add new feature checks on the host side that is used to
enable a cap conditionally that was enabled unconditionally before
we might end up with a feature regression when a new mesa version
is used with an old virglrenderer version that doesn't check for
that cap.

To work around this problem add a version id to the caps that corresponds
to the features that are actually checked on the host and check that
version too when enabling the cap.

Fixes: 2ee197d6e84aa37638d423363aca183952816067
    virgl: Enable mixed color FBO attachemnets only when the host supports it

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Pohsien Wang <pwang at chromium.org>

---

 src/gallium/drivers/virgl/virgl_hw.h     | 1 +
 src/gallium/drivers/virgl/virgl_screen.c | 3 ++-
 src/gallium/drivers/virgl/virgl_winsys.h | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h
index 1a4f193d8b1..ed88b6cf8d3 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -363,6 +363,7 @@ struct virgl_caps_v2 {
         uint32_t max_atomic_counter_buffers[6];
         uint32_t max_combined_atomic_counters;
         uint32_t max_combined_atomic_counter_buffers;
+        uint32_t host_feature_check_version;
 };
 
 union virgl_caps {
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 1ad8863bfca..33ebd9324f5 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -144,7 +144,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VERTEX_COLOR_CLAMPED:
       return vscreen->caps.caps.v1.bset.color_clamping;
    case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
-      return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_FBO_MIXED_COLOR_FORMATS;
+      return (vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_FBO_MIXED_COLOR_FORMATS) ||
+            (vscreen->caps.caps.v2.host_feature_check_version < 1);
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return vscreen->caps.caps.v1.glsl_level;
    case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
diff --git a/src/gallium/drivers/virgl/virgl_winsys.h b/src/gallium/drivers/virgl/virgl_winsys.h
index face3f0243f..e7f15327db0 100644
--- a/src/gallium/drivers/virgl/virgl_winsys.h
+++ b/src/gallium/drivers/virgl/virgl_winsys.h
@@ -152,5 +152,6 @@ static inline void virgl_ws_fill_new_caps_defaults(struct virgl_drm_caps *caps)
    caps->caps.v2.max_image_samples = 0;
    caps->caps.v2.max_compute_work_group_invocations = 0;
    caps->caps.v2.max_compute_shared_memory_size = 0;
+   caps->caps.v2.host_feature_check_version = 0;
 }
 #endif




More information about the mesa-commit mailing list