anv/video: only report matching memory types for protected sessions

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 794b0496e9 ("anv: enable protected memory")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26519>
This commit is contained in:
Lionel Landwerlin
2023-12-05 13:29:48 +02:00
committed by Marge Bot
parent e8a96e6ba0
commit 4ff1b0f751
+13 -1
View File
@@ -371,7 +371,19 @@ anv_GetVideoSessionMemoryRequirementsKHR(VkDevice _device,
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_video_session, vid, videoSession);
uint32_t memory_types = (1ull << device->physical->memory.type_count) - 1;
uint32_t memory_types = 0;
for (uint32_t i = 0; i < device->physical->memory.type_count; i++) {
/* Have the protected buffer bit match only the memory types with the
* equivalent bit.
*/
if (!!(vid->vk.flags & VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR) !=
!!(device->physical->memory.types[i].propertyFlags &
VK_MEMORY_PROPERTY_PROTECTED_BIT))
continue;
memory_types |= 1ull << i;
}
switch (vid->vk.op) {
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:
get_h264_video_session_mem_reqs(vid,