blob: c50d91ecd4dc5953d4bb060270fdb59c330404ec [file] [log] [blame]
From 90de0f7a1e9b7dc9ef34423739ffacf2fe917584 Mon Sep 17 00:00:00 2001
From: dmitrybrazhkin <dmitry.brazhkin@intel.com>
Date: Fri, 9 Jul 2021 06:02:10 +0800
Subject: [PATCH 1/2] [Encode] Fix default MMC enabling for JPEG encoder
m_mmcState should be initialized after m_hwInterface, since m_hwInterface->m_enableCodecMmc is used as a condition for enabling/disabling MMC. So move InitMmcState() from CodechalEncodeJpegStateG12 constructor (where m_hwInterface is not inited) to CodechalEncodeJpegStateG12::Initialize()
---
.../agnostic/gen12/codec/hal/codechal_encode_jpeg_g12.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/media_driver/agnostic/gen12/codec/hal/codechal_encode_jpeg_g12.cpp b/media_driver/agnostic/gen12/codec/hal/codechal_encode_jpeg_g12.cpp
index 84296273c7cf..e6d8826b7a12 100644
--- a/media_driver/agnostic/gen12/codec/hal/codechal_encode_jpeg_g12.cpp
+++ b/media_driver/agnostic/gen12/codec/hal/codechal_encode_jpeg_g12.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2017-2019, Intel Corporation
+* Copyright (c) 2017-2021, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -36,7 +36,6 @@ CodechalEncodeJpegStateG12::CodechalEncodeJpegStateG12(
m_sinlgePipeVeState(nullptr)
{
CODECHAL_ENCODE_FUNCTION_ENTER;
- InitMmcState();
CODECHAL_ENCODE_CHK_NULL_NO_STATUS_RETURN(m_osInterface);
Mos_SetVirtualEngineSupported(m_osInterface, true);
@@ -150,6 +149,7 @@ MOS_STATUS CodechalEncodeJpegStateG12::Initialize(CodechalSetting *settings)
CODECHAL_ENCODE_CHK_NULL_RETURN(m_miInterface);
CODECHAL_ENCODE_CHK_NULL_RETURN(settings);
+ CODECHAL_ENCODE_CHK_STATUS_RETURN(InitMmcState());
CODECHAL_ENCODE_CHK_STATUS_RETURN(CodechalEncoderState::Initialize(settings));
// Picture Level Commands
--
2.29.0