[Mesa-dev] [PATCH] radeonsi: don't enable surf index on shareable images.

Dave Airlie airlied at gmail.com
Fri Aug 11 04:35:04 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This fixes the SteamVR menus, which were broken by this feature.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/winsys/amdgpu/drm/amdgpu_surface.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
index 99e4d77..2cbff58 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
@@ -97,12 +97,15 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
     * always use consecutive surface indices when FMASK is allocated between
     * them.
     */
-   if (flags & RADEON_SURF_FMASK)
-      config.info.surf_index = &ws->surf_index_fmask;
-   else if (!(flags & RADEON_SURF_Z_OR_SBUFFER))
-      config.info.surf_index = &ws->surf_index_color;
-   else
-      config.info.surf_index = NULL;
+   if (!(flags & RADEON_SURF_SHAREABLE)) {
+     if (flags & RADEON_SURF_FMASK)
+       config.info.surf_index = &ws->surf_index_fmask;
+     else if (!(flags & RADEON_SURF_Z_OR_SBUFFER))
+       config.info.surf_index = &ws->surf_index_color;
+     else
+       config.info.surf_index = NULL;
+   } else
+     config.info.surf_index = NULL;
 
    return ac_compute_surface(ws->addrlib, &ws->info, &config, mode, surf);
 }
-- 
2.9.4



More information about the mesa-dev mailing list