From d8e2f9d9476b907b78cb27b84bbe05d0340816f4 Mon Sep 17 00:00:00 2001 From: Chen_Hao5 Date: Thu, 7 Sep 2023 16:53:22 +0800 Subject: [PATCH] [Decode] Disable Media Reset on Linux ADL platform and also non-Xe platforms Media Reset is not supported on non-Xe platforms from linux kmd side, so removing watch dog timer instruction from umd side. --- media_driver/linux/common/os/mos_os_specific.c | 17 ++++++++++++----- .../linux/gen12/ddi/media_sku_wa_g12.cpp | 2 +- .../linux/common/os/private/mos_os_specific.cpp | 9 +++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c index 460a18d246e..db8644a1ed9 100644 --- a/media_driver/linux/common/os/mos_os_specific.c +++ b/media_driver/linux/common/os/mos_os_specific.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2022, Intel Corporation +* Copyright (c) 2009-2023, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -7336,6 +7336,17 @@ MOS_STATUS Mos_Specific_InitInterface( } } + // Check SKU table to detect if simulation environment (HAS) is enabled + pSkuTable = pOsInterface->pfnGetSkuTable(pOsInterface); + MOS_OS_CHK_NULL(pSkuTable); + + // disable Media Reset for non-xe platform who has no media reset support on Linux + if(!MEDIA_IS_SKU(pSkuTable, FtrSWMediaReset)) + { + pOsInterface->bMediaReset = false; + pOsInterface->umdMediaResetEnable = false; + } + // initialize MOS_CP interface pOsInterface->osCpInterface = Create_MosCpInterface(pOsInterface); if (pOsInterface->osCpInterface == nullptr) @@ -7344,10 +7355,6 @@ MOS_STATUS Mos_Specific_InitInterface( return MOS_STATUS_UNKNOWN; } - // Check SKU table to detect if simulation environment (HAS) is enabled - pSkuTable = pOsInterface->pfnGetSkuTable(pOsInterface); - MOS_OS_CHK_NULL(pSkuTable); - #if (_DEBUG || _RELEASE_INTERNAL) // read the "Force VDBOX" user feature key // 0: not force diff --git a/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp b/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp index 69a987342a7..f854598167e 100644 --- a/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp +++ b/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp @@ -531,7 +531,6 @@ static bool InitAdlsMediaSku(struct GfxDeviceInfo *devInfo, MEDIA_WR_SKU(skuTable, FtrDecodeHEVC422VTScalaDisable, 1); MEDIA_WR_SKU(skuTable, FtrE2ECompression, 1); - //RPL-S if (drvInfo->devId == 0xA780 || drvInfo->devId == 0xA781 || @@ -615,6 +614,7 @@ static bool InitAdlpMediaWa(struct GfxDeviceInfo *devInfo, //ADL-P not need this MEDIA_WR_WA(waTable, Wa_1409820462, 0); MEDIA_WR_WA(waTable, WaDisableClearCCS, 1); + return true; } diff --git a/media_softlet/linux/common/os/private/mos_os_specific.cpp b/media_softlet/linux/common/os/private/mos_os_specific.cpp index 255d5a0db71..4dc2536d134 100644 --- a/media_softlet/linux/common/os/private/mos_os_specific.cpp +++ b/media_softlet/linux/common/os/private/mos_os_specific.cpp @@ -3639,6 +3639,15 @@ MOS_STATUS Mos_Specific_InitInterface( osInterface->trinityPath = TRINITY_DISABLED; osInterface->umdMediaResetEnable = true; + // disable Media Reset for non-xe platform who has no media reset support on Linux + auto skuTable = osInterface->pfnGetSkuTable(osInterface); + MOS_OS_CHK_NULL_RETURN(skuTable); + if(!MEDIA_IS_SKU(skuTable, FtrSWMediaReset)) + { + osInterface->bMediaReset = false; + osInterface->umdMediaResetEnable = false; + } + pMediaWatchdog = getenv("INTEL_MEDIA_RESET_WATCHDOG"); if (pMediaWatchdog != nullptr) {