From ca13c09d2cbca155df10c0c62a5d34ce4771a736 Mon Sep 17 00:00:00 2001 From: shawnli2 Date: Tue, 8 Aug 2023 12:51:46 +0800 Subject: [PATCH] [Decode] optimize media reset threshold optimize media reset threshold for more platform --- .../Xe_M/Xe_XPM_base/hw/mhw_mi_xe_xpm_base_impl.h | 15 +++++---------- .../hw/mhw_mi_xe_lpm_plus_base_next_impl.h | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_base/hw/mhw_mi_xe_xpm_base_impl.h b/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_base/hw/mhw_mi_xe_xpm_base_impl.h index 79aa17fae9..435b5d5bcd 100644 --- a/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_base/hw/mhw_mi_xe_xpm_base_impl.h +++ b/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_base/hw/mhw_mi_xe_xpm_base_impl.h @@ -223,22 +223,17 @@ class Impl : public mi::Impl } else { - if ((frameWidth * frameHeight) >= (16000 * 16000)) - { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_16Kx16K_WATCHDOG_THRESHOLD_IN_MS; - } - else if ((frameWidth * frameHeight) >= (7680 * 4320)) + if ((frameWidth * frameHeight) >= (7680 * 4320)) { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_16K_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_8K_WATCHDOG_THRESHOLD_IN_MS; } - else if (((frameWidth * frameHeight) < (1280 * 720)) && MEDIA_IS_WA(waTable, WaSliceMissingMB)) + else if ((frameWidth * frameHeight) >= (3840 * 2160)) { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_720P_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_4K_WATCHDOG_THRESHOLD_IN_MS; } else { - // 60ms should be enough for decoder with resolution smaller than 8k - MediaResetParam.watchdogCountThreshold = MHW_MI_DEFAULT_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_720P_WATCHDOG_THRESHOLD_IN_MS; } } diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/hw/mhw_mi_xe_lpm_plus_base_next_impl.h b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/hw/mhw_mi_xe_lpm_plus_base_next_impl.h index bf4390e86a..bb77c7bf9a 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/hw/mhw_mi_xe_lpm_plus_base_next_impl.h +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/hw/mhw_mi_xe_lpm_plus_base_next_impl.h @@ -324,22 +324,17 @@ class Impl : public mi::Impl } else { - if ((frameWidth * frameHeight) >= (16000 * 16000)) - { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_16Kx16K_WATCHDOG_THRESHOLD_IN_MS; - } - else if ((frameWidth * frameHeight) >= (7680 * 4320)) + if ((frameWidth * frameHeight) >= (7680 * 4320)) { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_16K_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_8K_WATCHDOG_THRESHOLD_IN_MS; } - else if (((frameWidth * frameHeight) < (1280 * 720)) && MEDIA_IS_WA(waTable, WaSliceMissingMB)) + else if ((frameWidth * frameHeight) >= (3840 * 2160)) { - MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_720P_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_4K_WATCHDOG_THRESHOLD_IN_MS; } else { - // 60ms should be enough for decoder with resolution smaller than 8k - MediaResetParam.watchdogCountThreshold = MHW_MI_DEFAULT_WATCHDOG_THRESHOLD_IN_MS; + MediaResetParam.watchdogCountThreshold = MHW_MI_DECODER_720P_WATCHDOG_THRESHOLD_IN_MS; } }