From 0acd48abc6391f96f929f1f4c89ce973a56ddf39 Mon Sep 17 00:00:00 2001 From: Vincent Cheah Beng Keat Date: Thu, 1 Aug 2024 18:21:03 +0800 Subject: [PATCH] Set Scanout by default recommend to flag all potential scanout surface as SCNAOUT. This is required to fix DMA DRM render on XE. Signed-off-by: Cheah, Vincent Beng Keat --- media_softlet/linux/common/os/xe/mos_bufmgr_xe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media_softlet/linux/common/os/xe/mos_bufmgr_xe.c b/media_softlet/linux/common/os/xe/mos_bufmgr_xe.c index 71e1188390f..291ce2dfb35 100644 --- a/media_softlet/linux/common/os/xe/mos_bufmgr_xe.c +++ b/media_softlet/linux/common/os/xe/mos_bufmgr_xe.c @@ -1295,6 +1295,10 @@ mos_bo_alloc_xe(struct mos_bufmgr *bufmgr, */ create.cpu_caching = alloc->ext.cpu_cacheable ? DRM_XE_GEM_CPU_CACHING_WB : DRM_XE_GEM_CPU_CACHING_WC; + if ((strcmp(alloc->name, "MEDIA") == 0 || strcmp(alloc->name, "Media") == 0) + && create.cpu_caching == DRM_XE_GEM_CPU_CACHING_WC) + create.flags |= DRM_XE_GEM_CREATE_FLAG_SCANOUT; + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_XE_GEM_CREATE, &create);