From 3d4952631c480a5a5dcfe0ba3866224dc82ea9b8 Mon Sep 17 00:00:00 2001 From: Wang_PengX Date: Tue, 29 Aug 2023 12:55:50 +0800 Subject: [PATCH] [VP] VPBLT accessing regkey per frame refine VPBLT accessing regkey --- .../agnostic/common/vp/hal/vp_common_tools.h | 9 +++++- .../agnostic/common/vp/hal/vphal_ddi.c | 8 +++++- .../common/vp/ddi/media_libva_vp_tools.c | 26 ++++++++++++++++- .../vp/hal/packet/vp_vebox_cmd_packet.cpp | 11 +++----- .../vp/hal/pipeline/vp_feature_report.cpp | 8 +++++- .../vp/hal/pipeline/vp_feature_report.h | 4 ++- .../common/vp/hal/pipeline/vp_pipeline.cpp | 19 ++----------- .../linux/common/vp/ddi/ddi_vp_functions.cpp | 28 ++++++++++++++++++- 8 files changed, 83 insertions(+), 30 deletions(-) diff --git a/media_common/agnostic/common/vp/hal/vp_common_tools.h b/media_common/agnostic/common/vp/hal/vp_common_tools.h index 1f43a12499f..4b6a4a58fdd 100644 --- a/media_common/agnostic/common/vp/hal/vp_common_tools.h +++ b/media_common/agnostic/common/vp/hal/vp_common_tools.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022, Intel Corporation +* Copyright (c) 2022-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"), @@ -169,6 +169,10 @@ typedef struct _VP_CONFIG bool isPacketReusedReported; // Reported vp packet reused. bool isDnEnabled; // true if vp Dn enabled. bool isDnEnabledReported; // Reported vp Dn reported + uint32_t dwCurrentVeboxScalability; // Current Vebox Scalability + uint32_t dwReportedVeboxScalability; // Reported Vebox Scalability + uint32_t dwCurrentVPApogeios; // Current VP Apogieos + uint32_t dwReportedVPApogeios; // Reported VP Apogieos // Configurations for cache control uint32_t dwDndiReferenceBuffer; @@ -196,6 +200,9 @@ typedef struct _VP_CONFIG // Optimize Cpu timing for VEBOX/SFC bool bOptimizeCpuTiming; + + // Output Regkey for whitelist + bool bOutputRegkey; } VP_CONFIG, *PVP_CONFIG; //! diff --git a/media_driver/agnostic/common/vp/hal/vphal_ddi.c b/media_driver/agnostic/common/vp/hal/vphal_ddi.c index 56bb82dc348..fdb44fd5b4a 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_ddi.c +++ b/media_driver/agnostic/common/vp/hal/vphal_ddi.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2021, 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"), @@ -217,6 +217,12 @@ void VpHal_DdiReportFeatureMode( pConfigValues->dwCurrentCompositionMode = pReport->GetFeatures().compositionMode; pConfigValues->dwCurrentScdMode = pReport->GetFeatures().diScdMode; + // Report Vebox Scalability + pConfigValues->dwCurrentVeboxScalability = pReport->GetFeatures().VeboxScalability; + + // Report VP Apogeios + pConfigValues->dwCurrentVPApogeios = pReport->GetFeatures().VPApogeios; + VP_DDI_NORMALMESSAGE("VP Feature Report: \ OutputPipeMode %d, \ HDRMode %d, \ diff --git a/media_driver/linux/common/vp/ddi/media_libva_vp_tools.c b/media_driver/linux/common/vp/ddi/media_libva_vp_tools.c index 05ed59c1e1f..c40eef31b72 100644 --- a/media_driver/linux/common/vp/ddi/media_libva_vp_tools.c +++ b/media_driver/linux/common/vp/ddi/media_libva_vp_tools.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2021, 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"), @@ -645,6 +645,8 @@ void VpConfigValuesInit( #if (_DEBUG || _RELEASE_INTERNAL) pConfigValues->dwRTOldCacheSettingReported = LIBVA_VP_CONFIG_NOT_REPORTED; #endif + pConfigValues->dwReportedVeboxScalability = LIBVA_VP_CONFIG_NOT_REPORTED; + pConfigValues->dwReportedVPApogeios = LIBVA_VP_CONFIG_NOT_REPORTED; } void VpFeatureReport( @@ -715,6 +717,28 @@ void VpFeatureReport( MediaUserSetting::Group::Sequence); #endif #endif //(_DEBUG || _RELEASE_INTERNAL) + + if (pConfig->dwCurrentVeboxScalability != pConfig->dwReportedVeboxScalability) + { + ReportUserSetting( + userSettingPtr, + __MEDIA_USER_FEATURE_VALUE_ENABLE_VEBOX_SCALABILITY_MODE, + pConfig->dwCurrentVeboxScalability, + MediaUserSetting::Group::Device); + + pConfig->dwReportedVeboxScalability = pConfig->dwCurrentVeboxScalability; + } + + if (pConfig->dwCurrentVPApogeios != pConfig->dwReportedVPApogeios) + { + ReportUserSetting( + userSettingPtr, + __MEDIA_USER_FEATURE_VALUE_VPP_APOGEIOS_ENABLE, + pConfig->dwCurrentVPApogeios, + MediaUserSetting::Group::Sequence); + + pConfig->dwReportedVPApogeios = pConfig->dwCurrentVPApogeios; + } } VAStatus VpReportFeatureMode(PDDI_VP_CONTEXT pVpCtx) diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp index 6534d5b6366..50ce80076f6 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_vebox_cmd_packet.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018-2022, Intel Corporation +* Copyright (c) 2018-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"), @@ -1947,19 +1947,16 @@ MOS_STATUS VpVeboxCmdPacket::RenderVeboxCmd( if (bMultipipe) { scalability->SetCurrentPipeIndex(inputPipe); - VP_RENDER_CHK_STATUS_RETURN(ReportUserSetting(m_userSettingPtr, __MEDIA_USER_FEATURE_VALUE_ENABLE_VEBOX_SCALABILITY_MODE, true, MediaUserSetting::Group::Device)); - } - else - { - VP_RENDER_CHK_STATUS_RETURN(ReportUserSetting(m_userSettingPtr, __MEDIA_USER_FEATURE_VALUE_ENABLE_VEBOX_SCALABILITY_MODE, false, MediaUserSetting::Group::Device)); } + auto report = (VpFeatureReport *)(m_hwInterface->m_reporting); + report->GetFeatures().VeboxScalability = bMultipipe; + MT_LOG2(MT_VP_HAL_RENDER_VE, MT_NORMAL, MT_VP_MHW_VE_SCALABILITY_EN, bMultipipe, MT_VP_MHW_VE_SCALABILITY_USE_SFC, m_IsSfcUsed); return eStatus; } - void VpVeboxCmdPacket::AddCommonOcaMessage(PMOS_COMMAND_BUFFER pCmdBufferInUse, MOS_CONTEXT_HANDLE pOsContext, PMOS_INTERFACE pOsInterface, PRENDERHAL_INTERFACE pRenderHal, PMHW_MI_MMIOREGISTERS pMmioRegisters) { VP_FUNC_CALL(); diff --git a/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.cpp b/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.cpp index b9b78be9db4..2321c75c854 100644 --- a/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.cpp +++ b/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021, Intel Corporation +* Copyright (c) 2021-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"), @@ -131,6 +131,12 @@ void VpFeatureReport::SetConfigValues( configValues->dwCurrentCompositionMode = m_features.compositionMode; configValues->dwCurrentScdMode = m_features.diScdMode; + // Report Vebox Scalability + configValues->dwCurrentVeboxScalability = m_features.VeboxScalability; + + // Report VP Apogeios + configValues->dwCurrentVPApogeios = m_features.VPApogeios; + VP_PUBLIC_NORMALMESSAGE( "VP Feature Report: \ OutputPipeMode %d, \ diff --git a/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.h b/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.h index 6946ed8a7af..a7271412462 100644 --- a/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.h +++ b/media_softlet/agnostic/common/vp/hal/pipeline/vp_feature_report.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021, Intel Corporation +* Copyright (c) 2021-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"), @@ -73,6 +73,8 @@ class VpFeatureReport #if (_DEBUG || _RELEASE_INTERNAL) uint8_t rtOldCacheSetting = 0; //!< Render Target old cache usage #endif + bool VeboxScalability = false; //!< Vebox Scalability flag + bool VPApogeios = false; //!< VP Apogeios flag }; virtual ~VpFeatureReport(){}; diff --git a/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp b/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp index 9c0b1393363..5cce9c01e3c 100644 --- a/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp +++ b/media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018-2022, Intel Corporation +* Copyright (c) 2018-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"), @@ -207,22 +207,7 @@ MOS_STATUS VpPipeline::UserFeatureReport() MediaPipeline::UserFeatureReport(); - if (m_currentFrameAPGEnabled) - { - ReportUserSetting( - m_userSettingPtr, - __MEDIA_USER_FEATURE_VALUE_VPP_APOGEIOS_ENABLE, - uint32_t(1), - MediaUserSetting::Group::Sequence); - } - else - { - ReportUserSetting( - m_userSettingPtr, - __MEDIA_USER_FEATURE_VALUE_VPP_APOGEIOS_ENABLE, - uint32_t(0), - MediaUserSetting::Group::Sequence); - } + m_reporting->GetFeatures().VPApogeios = m_currentFrameAPGEnabled; #if (_DEBUG || _RELEASE_INTERNAL) //INTER_FRAME_MEMORY_NINJA_START_COUNTER will be reported in ReportIFNCC(true) function which runs in VpPipeline::Prepare() diff --git a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp index 842102d55ce..7ebad0b59b8 100644 --- a/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp +++ b/media_softlet/linux/common/vp/ddi/ddi_vp_functions.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021-2022, Intel Corporation +* Copyright (c) 2021-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"), @@ -1530,6 +1530,9 @@ void DdiVpFunctions::VpConfigValuesInit( configValues->dwScalerCompressModeReported = LIBVA_VP_CONFIG_NOT_REPORTED; configValues->dwPrimaryCompressibleReported = LIBVA_VP_CONFIG_NOT_REPORTED; configValues->dwPrimaryCompressModeReported = LIBVA_VP_CONFIG_NOT_REPORTED; + + configValues->dwReportedVeboxScalability = LIBVA_VP_CONFIG_NOT_REPORTED; + configValues->dwReportedVPApogeios = LIBVA_VP_CONFIG_NOT_REPORTED; return; } @@ -1627,6 +1630,29 @@ void DdiVpFunctions::VpFeatureReport(PVP_CONFIG config, PDDI_VP_CONTEXT vpCtx) #endif #endif //(_DEBUG || _RELEASE_INTERNAL) + + if (config->dwCurrentVeboxScalability != config->dwReportedVeboxScalability) + { + ReportUserSetting( + userSettingPtr, + __MEDIA_USER_FEATURE_VALUE_ENABLE_VEBOX_SCALABILITY_MODE, + config->dwCurrentVeboxScalability, + MediaUserSetting::Group::Device); + + config->dwReportedVeboxScalability = config->dwCurrentVeboxScalability; + } + + if (config->dwCurrentVPApogeios != config->dwReportedVPApogeios) + { + ReportUserSetting( + userSettingPtr, + __MEDIA_USER_FEATURE_VALUE_VPP_APOGEIOS_ENABLE, + config->dwCurrentVPApogeios, + MediaUserSetting::Group::Sequence); + + config->dwReportedVPApogeios = config->dwCurrentVPApogeios; + } + return; }