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

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Oct 28 22:46:19 2022 -0400

gallium: Default to PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT

Supported in all hardware and software drivers. Only that don't support
are virgl and svga, depending on host capabilities. I don't think
there's anything to be done there. This does give fewer places to screw
up the CAPs, though, because everyone wants ARB_buffer_storage.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Emma Anholt <[email protected]>
Reviewed-by: Marek Ol<C5><A1><C3><A1>k <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19392>

---

 src/gallium/auxiliary/util/u_screen.c            | 8 ++++++++
 src/gallium/drivers/asahi/agx_pipe.c             | 1 -
 src/gallium/drivers/crocus/crocus_screen.c       | 1 -
 src/gallium/drivers/d3d12/d3d12_screen.cpp       | 1 -
 src/gallium/drivers/etnaviv/etnaviv_screen.c     | 1 -
 src/gallium/drivers/freedreno/freedreno_screen.c | 1 -
 src/gallium/drivers/i915/i915_screen.c           | 1 -
 src/gallium/drivers/iris/iris_screen.c           | 1 -
 src/gallium/drivers/lima/lima_screen.c           | 1 -
 src/gallium/drivers/llvmpipe/lp_screen.c         | 2 --
 src/gallium/drivers/panfrost/pan_screen.c        | 1 -
 src/gallium/drivers/r300/r300_screen.c           | 1 -
 src/gallium/drivers/r600/r600_pipe.c             | 1 -
 src/gallium/drivers/radeonsi/si_get.c            | 1 -
 src/gallium/drivers/softpipe/sp_screen.c         | 1 -
 src/gallium/drivers/v3d/v3d_screen.c             | 1 -
 src/gallium/drivers/vc4/vc4_screen.c             | 1 -
 src/gallium/drivers/zink/zink_screen.c           | 1 -
 18 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_screen.c 
b/src/gallium/auxiliary/util/u_screen.c
index 063651fa530..1d40692bd26 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -185,7 +185,15 @@ u_pipe_screen_get_param_defaults(struct pipe_screen 
*pscreen,
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
    case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS: /* Enables ARB_texture_gather 
*/
    case PIPE_CAP_TEXTURE_GATHER_SM5:
+      return 0;
+
+   /* All new drivers should support persistent/coherent mappings. This CAP
+    * should only be unset by layered drivers whose host drivers cannot support
+    * coherent mappings.
+    */
    case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
+      return 1;
+
    case PIPE_CAP_FAKE_SW_MSAA:
    case PIPE_CAP_TEXTURE_QUERY_LOD:
       return 0;
diff --git a/src/gallium/drivers/asahi/agx_pipe.c 
b/src/gallium/drivers/asahi/agx_pipe.c
index 409164fefe2..67631c4842c 100644
--- a/src/gallium/drivers/asahi/agx_pipe.c
+++ b/src/gallium/drivers/asahi/agx_pipe.c
@@ -731,7 +731,6 @@ agx_get_param(struct pipe_screen* pscreen, enum pipe_cap 
param)
    case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
    case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
    case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_DEPTH_CLIP_DISABLE:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
    case PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES:
diff --git a/src/gallium/drivers/crocus/crocus_screen.c 
b/src/gallium/drivers/crocus/crocus_screen.c
index d17feefe9bf..32fe0e93369 100644
--- a/src/gallium/drivers/crocus/crocus_screen.c
+++ b/src/gallium/drivers/crocus/crocus_screen.c
@@ -162,7 +162,6 @@ crocus_get_param(struct pipe_screen *pscreen, enum pipe_cap 
param)
    case PIPE_CAP_TEXTURE_BARRIER:
    case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
    case PIPE_CAP_START_INSTANCE:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
    case PIPE_CAP_VS_LAYER_VIEWPORT:
diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp 
b/src/gallium/drivers/d3d12/d3d12_screen.cpp
index 0e9d0453ae0..5446d5b5d2a 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp
@@ -265,7 +265,6 @@ d3d12_get_param(struct pipe_screen *pscreen, enum pipe_cap 
param)
       return screen->opts.PSSpecifiedStencilRefSupported;
 
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_TEXTURE_QUERY_LOD:
    case PIPE_CAP_VS_INSTANCEID:
    case PIPE_CAP_TGSI_TEX_TXF_LZ:
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c 
b/src/gallium/drivers/etnaviv/etnaviv_screen.c
index e8774189135..c9684a58b2e 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
@@ -159,7 +159,6 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_FRONTEND_NOOP:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
       return 1;
    case PIPE_CAP_NATIVE_FENCE_FD:
       return screen->drm_version >= ETNA_DRM_VERSION_FENCE_FD;
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index b7b92a13d2e..58e9e5a694d 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -198,7 +198,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
    case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
    case PIPE_CAP_TEXTURE_BARRIER:
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index a3480425e5b..b9e7b4dd1a2 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -393,7 +393,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
    case PIPE_CAP_ANISOTROPIC_FILTER:
    case PIPE_CAP_NPOT_TEXTURES:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
    case PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX:
    case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
diff --git a/src/gallium/drivers/iris/iris_screen.c 
b/src/gallium/drivers/iris/iris_screen.c
index 609a86e3c9a..ce6a66cb710 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -222,7 +222,6 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap 
param)
    case PIPE_CAP_CUBE_MAP_ARRAY:
    case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
    case PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_TEXTURE_QUERY_LOD:
    case PIPE_CAP_SAMPLE_SHADING:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
diff --git a/src/gallium/drivers/lima/lima_screen.c 
b/src/gallium/drivers/lima/lima_screen.c
index fc49cbe66c5..b01cfe8e4ff 100644
--- a/src/gallium/drivers/lima/lima_screen.c
+++ b/src/gallium/drivers/lima/lima_screen.c
@@ -107,7 +107,6 @@ lima_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
    case PIPE_CAP_TEXTURE_SWIZZLE:
    case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
    case PIPE_CAP_TEXTURE_BARRIER:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_SURFACE_SAMPLE_COUNT:
       return 1;
 
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 799ff158e15..a4d7b405a44 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -242,8 +242,6 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
    case PIPE_CAP_TES_LAYER_VIEWPORT:
    case PIPE_CAP_VS_LAYER_VIEWPORT:
       return 1;
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
-      return 1;
    case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
       return 4;
    case PIPE_CAP_VS_WINDOW_SPACE_POSITION:
diff --git a/src/gallium/drivers/panfrost/pan_screen.c 
b/src/gallium/drivers/panfrost/pan_screen.c
index 2f2b291be0c..7cba67a8d3e 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -113,7 +113,6 @@ panfrost_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
         case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
         case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
         case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
-        case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
         case PIPE_CAP_DEPTH_CLIP_DISABLE:
         case PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE:
         case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 240443df632..849ce059579 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -140,7 +140,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
         case PIPE_CAP_CONDITIONAL_RENDER:
         case PIPE_CAP_TEXTURE_BARRIER:
         case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
-        case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
         case PIPE_CAP_CLIP_HALFZ:
         case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
         case PIPE_CAP_LEGACY_MATH_RULES:
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index aebeb69f374..13b8b29c7e4 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -292,7 +292,6 @@ static int r600_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
        case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
        case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
        case PIPE_CAP_TEXTURE_MULTISAMPLE:
-       case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
        case PIPE_CAP_VS_WINDOW_SPACE_POSITION:
        case PIPE_CAP_VS_LAYER_VIEWPORT:
        case PIPE_CAP_SAMPLE_SHADING:
diff --git a/src/gallium/drivers/radeonsi/si_get.c 
b/src/gallium/drivers/radeonsi/si_get.c
index ff5292495cd..2a5d4851c91 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -90,7 +90,6 @@ static int si_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
    case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
    case PIPE_CAP_VS_LAYER_VIEWPORT:
    case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_SAMPLE_SHADING:
    case PIPE_CAP_DRAW_INDIRECT:
    case PIPE_CAP_CLIP_HALFZ:
diff --git a/src/gallium/drivers/softpipe/sp_screen.c 
b/src/gallium/drivers/softpipe/sp_screen.c
index e3a12e9f265..e6941de0936 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -232,7 +232,6 @@ softpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
       return 4;
    case PIPE_CAP_TEXTURE_GATHER_SM5:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_TEXTURE_QUERY_LOD:
       return 1;
    case PIPE_CAP_VS_WINDOW_SPACE_POSITION:
diff --git a/src/gallium/drivers/v3d/v3d_screen.c 
b/src/gallium/drivers/v3d/v3d_screen.c
index 05f1620ef57..7ab7435d835 100644
--- a/src/gallium/drivers/v3d/v3d_screen.c
+++ b/src/gallium/drivers/v3d/v3d_screen.c
@@ -117,7 +117,6 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
         switch (param) {
                 /* Supported features (boolean caps). */
         case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
-        case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
         case PIPE_CAP_NPOT_TEXTURES:
         case PIPE_CAP_BLEND_EQUATION_SEPARATE:
         case PIPE_CAP_TEXTURE_MULTISAMPLE:
diff --git a/src/gallium/drivers/vc4/vc4_screen.c 
b/src/gallium/drivers/vc4/vc4_screen.c
index 97429478af8..aec151168fe 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -140,7 +140,6 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
                 /* Supported features (boolean caps). */
         case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
         case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
-        case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
         case PIPE_CAP_NPOT_TEXTURES:
         case PIPE_CAP_BLEND_EQUATION_SEPARATE:
         case PIPE_CAP_TEXTURE_MULTISAMPLE:
diff --git a/src/gallium/drivers/zink/zink_screen.c 
b/src/gallium/drivers/zink/zink_screen.c
index 8eae99e9e29..0edfbf7501b 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -536,7 +536,6 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap 
param)
    case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
    case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
-   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
    case PIPE_CAP_SHADER_ARRAY_COMPONENTS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:

Reply via email to