blob: a4e96830085b02de4b9445b8ea1eee2b9f35ce38 [file] [log] [blame]
From 5b49d6003bf5472d0eb33dbec94987cac78633f0 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] [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.
---
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 1a6b3477512b..2a6e1d356734 100755
--- a/media_driver/agnostic/common/vp/hal/vphal.cpp
+++ b/media_driver/agnostic/common/vp/hal/vphal.cpp
@@ -556,6 +556,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 7b2fd4b15529..0ad58a7c1896 100644
--- a/media_driver/agnostic/common/vp/hal/vphal_renderer.h
+++ b/media_driver/agnostic/common/vp/hal/vphal_renderer.h
@@ -301,6 +301,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.17.1