blob: afb33b007cb122c277da1f2ba2114597c4a659fa [file] [log] [blame]
From 06651724ed461ab48490a68d53fa95008fa871f8 Mon Sep 17 00:00:00 2001
From: Yu Kang Ku <yu.kang.ku@intel.com>
Date: Wed, 22 Apr 2020 22:26:48 -0700
Subject: [PATCH 3/5] [VP] Explicitly initialize maxSrcRect of VphalRenderer
The maxSrcRect member keeps track of the maximum rectangle
among a set of source surfaces. There is a need to
explicitly re-initialize this member in VphalState::Render
prior to calling the main render function. This is so that
the maxSrcRect value for the last set of surfaces does not
get re-used for the current set of surfaces.
This fixes https://github.com/intel/media-driver/issues/905.
(cherry picked from commit 07a818120af884fefb6a0a4e5894a150aa5447cb)
---
media_driver/agnostic/common/vp/hal/vphal.cpp | 5 +++++
.../agnostic/common/vp/hal/vphal_renderer.h | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/media_driver/agnostic/common/vp/hal/vphal.cpp b/media_driver/agnostic/common/vp/hal/vphal.cpp
index ed3fc7e3..f7cefa0c 100755
--- a/media_driver/agnostic/common/vp/hal/vphal.cpp
+++ b/media_driver/agnostic/common/vp/hal/vphal.cpp
@@ -562,6 +562,11 @@ MOS_STATUS VphalState::Render(
VPHAL_PUBLIC_CHK_NULL(pcRenderParams);
RenderParams = *pcRenderParams;
+ // Explicitly initialize the maxSrcRect of VphalRenderer
+ // so that the maxSrcRect for the last set of surfaces does not get
+ // re-used for the current set of surfaces.
+ m_renderer->InitMaxSrcRect();
+
if (VpHal_IsAvsSampleForMultiStreamsEnabled(pcRenderParams))
{
eStatus = VpHal_RenderWithAvsForMultiStreams(m_renderer, pcRenderParams);
diff --git a/media_driver/agnostic/common/vp/hal/vphal_renderer.h b/media_driver/agnostic/common/vp/hal/vphal_renderer.h
index c7931558..193b7c5f 100644
--- a/media_driver/agnostic/common/vp/hal/vphal_renderer.h
+++ b/media_driver/agnostic/common/vp/hal/vphal_renderer.h
@@ -302,6 +302,21 @@ public:
//!
virtual MOS_STATUS UpdateRenderGpuContext(MOS_GPU_CONTEXT renderGpuContext);
+ //!
+ //! \brief Explicitly initialize the maxSrcRect member
+ //! \details The maxSrcRect member keeps track of the maximum rectangle
+ //! among a set of source surfaces. There is a need to
+ //! explicitly re-initialize this member in VphalState::Render
+ //! prior to calling the main render function. This is so that
+ //! the maxSrcRect value for the last set of surfaces does not
+ //! get re-used for the current set of surfaces.
+ //! \return void
+ //!
+ void InitMaxSrcRect()
+ {
+ maxSrcRect = {0, 0, 0, 0};
+ }
+
protected:
//!
//! \brief Prepare input surface list for top level render processing
--
2.26.2