radeonsi: enable PIPE_CAP_DEVICE_PROTECTED_CONTENT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index d162e06..cd7a338 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -183,6 +183,9 @@
case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
return sscreen->info.has_gpu_reset_status_query;
+ case PIPE_CAP_DEVICE_PROTECTED_CONTENT:
+ return sscreen->info.has_tmz_support;
+
case PIPE_CAP_TEXTURE_MULTISAMPLE:
return sscreen->info.has_2d_tiling;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 839c5a3..e8b95dc 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -1470,8 +1470,13 @@
flags |= RADEON_FLAG_NO_CPU_ACCESS;
if (info.alloc_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
flags |= RADEON_FLAG_GTT_WC;
- if (info.alloc_flags & AMDGPU_GEM_CREATE_ENCRYPTED)
+ if (info.alloc_flags & AMDGPU_GEM_CREATE_ENCRYPTED) {
+ /* Imports are always possible even if the importer isn't using TMZ.
+ * For instance libweston needs to import the buffer to be able to determine
+ * if it can be used for scanout.
+ */
flags |= RADEON_FLAG_ENCRYPTED;
+ }
/* Initialize the structure. */
simple_mtx_init(&bo->lock, mtx_plain);