diff --git a/media_driver/linux/Xe_M/ddi/media_sku_wa_xe.cpp b/media_driver/linux/Xe_M/ddi/media_sku_wa_xe.cpp index 55d5f9907a1..70cd33cfb8b 100644 --- a/media_driver/linux/Xe_M/ddi/media_sku_wa_xe.cpp +++ b/media_driver/linux/Xe_M/ddi/media_sku_wa_xe.cpp @@ -825,6 +825,16 @@ static bool InitDg2MediaSku(struct GfxDeviceInfo *devInfo, // Enable HVS Denoise MEDIA_WR_SKU(skuTable, FtrHVSDenoise, 1); + #define IS_SERVER_SKU(d) (((d) >= 0x56C0) && ((d) <= 0x56C1)) + if (IS_SERVER_SKU(drvInfo->devId)) + { + drvInfo->isServer = 1; + } + else + { + drvInfo->isServer = 0; + } + return true; } diff --git a/media_driver/linux/common/os/hwinfo_linux.c b/media_driver/linux/common/os/hwinfo_linux.c index c3ac1ab50d4..229b5a20831 100644 --- a/media_driver/linux/common/os/hwinfo_linux.c +++ b/media_driver/linux/common/os/hwinfo_linux.c @@ -176,7 +176,7 @@ MOS_STATUS HWInfo_GetGfxInfo(int32_t fd, MOS_USER_FEATURE_VALUE_DATA UserFeatureData; #endif - LinuxDriverInfo drvInfo = {18, 3, 0, 23172, 3, 1, 0, 1, 0, 0, 1, 0}; + LinuxDriverInfo drvInfo = {18, 3, 0, 23172, 3, 1, 0, 1, 0, 0, 1, 0, 0}; if (!Mos_Solo_IsEnabled(nullptr) && HWInfoGetLinuxDrvInfo(fd, &drvInfo) != MOS_STATUS_SUCCESS) { MOS_OS_ASSERTMESSAGE("Failed to get the chipset id\n"); @@ -341,6 +341,10 @@ MOS_STATUS HWInfo_GetGfxInfo(int32_t fd, { MOS_OS_NORMALMESSAGE("Init Media SystemInfo successfully\n"); } + if (drvInfo.isServer) + { + mos_set_platform_information(pDrmBufMgr, PLATFORM_INFORMATION_IS_SERVER); + } /* disable it on Linux */ MEDIA_WR_SKU(skuTable, FtrPerCtxtPreemptionGranularityControl, 0); diff --git a/media_driver/linux/common/os/i915/include/mos_bufmgr.h b/media_driver/linux/common/os/i915/include/mos_bufmgr.h index 48178f02451..ecd65c6ed89 100644 --- a/media_driver/linux/common/os/i915/include/mos_bufmgr.h +++ b/media_driver/linux/common/os/i915/include/mos_bufmgr.h @@ -431,4 +431,7 @@ drm_export bool mos_gem_bo_is_exec_object_async(struct mos_linux_bo *bo); } #endif +#define PLATFORM_INFORMATION_IS_SERVER 0x1 +uint64_t mos_get_platform_information(struct mos_bufmgr *bufmgr); +void mos_set_platform_information(struct mos_bufmgr *bufmgr, uint64_t p); #endif /* INTEL_BUFMGR_H */ diff --git a/media_driver/linux/common/os/i915/include/mos_bufmgr_priv.h b/media_driver/linux/common/os/i915/include/mos_bufmgr_priv.h index 20a3f4bd64a..65ba0208f03 100644 --- a/media_driver/linux/common/os/i915/include/mos_bufmgr_priv.h +++ b/media_driver/linux/common/os/i915/include/mos_bufmgr_priv.h @@ -346,6 +346,7 @@ struct mos_bufmgr { int debug; uint32_t *get_reserved = nullptr; bool has_full_vd = true; + uint64_t platform_information = 0; }; #define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) diff --git a/media_driver/linux/common/os/i915/mos_bufmgr.c b/media_driver/linux/common/os/i915/mos_bufmgr.c index d6e8be7a6b1..99c969b49b2 100644 --- a/media_driver/linux/common/os/i915/mos_bufmgr.c +++ b/media_driver/linux/common/os/i915/mos_bufmgr.c @@ -5245,3 +5245,15 @@ int mos_query_hw_ip_version(int fd, struct i915_engine_class_instance engine, vo { return -1; } + +uint64_t mos_get_platform_information(struct mos_bufmgr *bufmgr) +{ + assert(bufmgr); + return bufmgr->platform_information; +} + +void mos_set_platform_information(struct mos_bufmgr *bufmgr, uint64_t p) +{ + assert(bufmgr); + bufmgr->platform_information |= p; +} diff --git a/media_driver/linux/common/os/i915_production/mos_bufmgr.c b/media_driver/linux/common/os/i915_production/mos_bufmgr.c index ef18c945859..4f6b0599658 100644 --- a/media_driver/linux/common/os/i915_production/mos_bufmgr.c +++ b/media_driver/linux/common/os/i915_production/mos_bufmgr.c @@ -5695,3 +5695,15 @@ int mos_query_hw_ip_version(int fd, struct i915_engine_class_instance engine, vo { return -1; } + +uint64_t mos_get_platform_information(struct mos_bufmgr *bufmgr) +{ + assert(bufmgr); + return bufmgr->platform_information; +} + +void mos_set_platform_information(struct mos_bufmgr *bufmgr, uint64_t p) +{ + assert(bufmgr); + bufmgr->platform_information |= p; +} diff --git a/media_driver/linux/common/os/i915_production/mos_bufmgr_priv.h b/media_driver/linux/common/os/i915_production/mos_bufmgr_priv.h index 6ce2173eaa8..a0ed4a59037 100644 --- a/media_driver/linux/common/os/i915_production/mos_bufmgr_priv.h +++ b/media_driver/linux/common/os/i915_production/mos_bufmgr_priv.h @@ -348,6 +348,7 @@ struct mos_bufmgr { uint32_t *get_reserved = nullptr; uint32_t tile_id = 0; bool has_full_vd = true; + uint64_t platform_information = 0; }; #define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) diff --git a/media_driver/linux/common/os/linux_system_info.h b/media_driver/linux/common/os/linux_system_info.h index e23f658ef9d..910c8121f54 100644 --- a/media_driver/linux/common/os/linux_system_info.h +++ b/media_driver/linux/common/os/linux_system_info.h @@ -56,6 +56,7 @@ struct LinuxDriverInfo uint32_t hasHuc : 1; uint32_t hasPpgtt : 1; uint32_t hasPreemption : 1; + uint32_t isServer : 1; }; struct LinuxCodecInfo diff --git a/media_driver/linux/common/os/memory_policy_manager_specific.cpp b/media_driver/linux/common/os/memory_policy_manager_specific.cpp index 57b0f7d0360..1b7e0d7f256 100644 --- a/media_driver/linux/common/os/memory_policy_manager_specific.cpp +++ b/media_driver/linux/common/os/memory_policy_manager_specific.cpp @@ -54,5 +54,15 @@ int MemoryPolicyManager::UpdateMemoryPolicyWithWA( } } + if(memPolicyPar->isServer) + { + if (strcmp(memPolicyPar->resName, "MOS CmdBuf") == 0 || + strcmp(memPolicyPar->resName, "BatchBuffer") == 0 + ) + { + mem_type = MOS_MEMPOOL_SYSTEMMEMORY; + } + } + return 0; } \ No newline at end of file diff --git a/media_driver/linux/ult/libdrm_mock/mos_bufmgr_mock.c b/media_driver/linux/ult/libdrm_mock/mos_bufmgr_mock.c index 064ac6c84fb..d7738bd1986 100644 --- a/media_driver/linux/ult/libdrm_mock/mos_bufmgr_mock.c +++ b/media_driver/linux/ult/libdrm_mock/mos_bufmgr_mock.c @@ -4357,3 +4357,15 @@ bool mos_gem_bo_is_softpin(struct mos_linux_bo *bo) return bo_gem->is_softpin; } + +uint64_t mos_get_platform_information(struct mos_bufmgr *bufmgr) +{ + assert(bufmgr); + return bufmgr->platform_information; +} + +void mos_set_platform_information(struct mos_bufmgr *bufmgr, uint64_t p) +{ + assert(bufmgr); + bufmgr->platform_information |= p; +} diff --git a/media_softlet/agnostic/common/shared/memory_policy_manager.h b/media_softlet/agnostic/common/shared/memory_policy_manager.h index 785e41d0aa4..3cb904e409b 100644 --- a/media_softlet/agnostic/common/shared/memory_policy_manager.h +++ b/media_softlet/agnostic/common/shared/memory_policy_manager.h @@ -49,6 +49,7 @@ struct MemoryPolicyParameter const char* resName; uint32_t uiType; int preferredMemType; + bool isServer; }; class MemoryPolicyManager diff --git a/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp b/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp index ef0bec8fa3a..705672b74ce 100644 --- a/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp +++ b/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp @@ -236,6 +236,7 @@ MOS_STATUS GraphicsResourceSpecificNext::Allocate(OsContextNext* osContextPtr, C memPolicyPar.resInfo = gmmResourceInfoPtr; memPolicyPar.resName = params.m_name.c_str(); memPolicyPar.preferredMemType = params.m_memType; + memPolicyPar.isServer = PLATFORM_INFORMATION_IS_SERVER & mos_get_platform_information(pOsContextSpecific->GetBufMgr()); mem_type = MemoryPolicyManager::UpdateMemoryPolicy(&memPolicyPar); }