Skip to content

Commit 12a3eb9

Browse files
chenhao5-Intelintel-mediadev
authored andcommitted
[Encode] Add HuC load status check logic for VP9 encode on Gen12 platforms
HuC load may be failed. This patch is to add huc load status check for VP9 encode on Gen12 platforms.
1 parent 8fbf3b8 commit 12a3eb9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

media_driver/agnostic/gen12/codec/hal/codechal_vdenc_vp9_g12.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "mhw_mi_g12_X.h"
4040
#include "mhw_render_g12_X.h"
4141
#include "codechal_mmc_encode_vp9_g12.h"
42+
#include "codechal_hw_g12_X.h"
4243

4344
#define MAXPATH 512
4445

@@ -5735,12 +5736,18 @@ MOS_STATUS CodechalVdencVp9StateG12::HuCBrcInitReset()
57355736
// Store HUC_STATUS2 register bit 6 before HUC_Start command
57365737
// This bit will be cleared by HW at the end of a HUC workload
57375738
// (HUC_Start command with last start bit set).
5738-
CODECHAL_DEBUG_TOOL(
5739-
CODECHAL_ENCODE_CHK_STATUS_RETURN(StoreHuCStatus2Register(&cmdBuffer));
5740-
)
5739+
CODECHAL_ENCODE_CHK_STATUS_RETURN(StoreHuCStatus2Register(&cmdBuffer));
57415740

5741+
// HuC Status 2 report in Status Report
57425742
CODECHAL_ENCODE_CHK_STATUS_RETURN(StoreHuCStatus2Report(&cmdBuffer));
57435743

5744+
// Check HuC_STATUS2 bit6, if bit6 > 0 HW continue execution following cmd, otherwise it send a COND BB END cmd.
5745+
uint32_t compareOperation = mhw_mi_g12_X::MI_CONDITIONAL_BATCH_BUFFER_END_CMD::COMPARE_OPERATION_MADGREATERTHANIDD;
5746+
auto hwInterface = dynamic_cast<CodechalHwInterfaceG12 *>(m_hwInterface);
5747+
CODECHAL_ENCODE_CHK_NULL_RETURN(hwInterface);
5748+
CODECHAL_ENCODE_CHK_STATUS_RETURN(hwInterface->SendCondBbEndCmd(
5749+
&m_resHucStatus2Buffer, 0, 0, false, false, compareOperation, &cmdBuffer));
5750+
57445751
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_hucInterface->AddHucStartCmd(&cmdBuffer, true));
57455752

57465753
// wait Huc completion (use HEVC bit for now)

0 commit comments

Comments
 (0)