From 54204f753279978d3b6001728c695195bfd1a562 Mon Sep 17 00:00:00 2001 From: Vincent Cheah Beng Keat Date: Wed, 4 Sep 2024 17:48:22 +0800 Subject: [PATCH] [Media Common] 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 29b2f97f22c..e43b76b8a44 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);