blob: 97b4a9e6ca7ab601b39d7bc557ceff4a7e616672 [file] [log] [blame]
From e96c2b6fa701d4fb5f808160234294c0b0106364 Mon Sep 17 00:00:00 2001
From: CarlZhang <carl.zhang@intel.com>
Date: Fri, 3 Apr 2020 22:25:58 +0800
Subject: [PATCH] [Decode] add SW WA to diable calculation of the UV offset by
gmmlib on TGL
GMMlib CPU BLT call will add/remove padding, it will change the UV offset
Change-Id: Ifacbd29daa99148c384164ac65143e046b80973a
---
media_driver/linux/common/ddi/media_libva.cpp | 3 ++-
media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp
index 70fdd182e..bdaa323be 100755
--- a/media_driver/linux/common/ddi/media_libva.cpp
+++ b/media_driver/linux/common/ddi/media_libva.cpp
@@ -4328,6 +4328,7 @@ VAStatus DdiMedia_DeriveImage (
vaimg->offsets[0] = 0;
break;
case Media_Format_R5G6B5:
+ vaimg->format.bits_per_pixel = 16;
vaimg->data_size = mediaSurface->iPitch * mediaSurface->iHeight;
vaimg->num_planes = 1;
vaimg->pitches[0] = mediaSurface->iPitch;
@@ -4438,7 +4439,7 @@ VAStatus DdiMedia_DeriveImage (
vaimg->pitches[1] =
vaimg->pitches[2] = mediaSurface->iPitch;
vaimg->offsets[0] = 0;
- if(MEDIA_IS_WA(&mediaCtx->WaTable, FtrE2ECompression))
+ if(MEDIA_IS_WA(&mediaCtx->WaTable, WaDisableGmmLibOffsetInDeriveImage))
{
vaimg->offsets[1] = mediaSurface->iHeight * mediaSurface->iPitch;
vaimg->offsets[2] = vaimg->offsets[1] + 1;
diff --git a/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp b/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp
index e14dc3569..be6c49dca 100644
--- a/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp
+++ b/media_driver/linux/gen12/ddi/media_sku_wa_g12.cpp
@@ -308,6 +308,10 @@ static bool InitTglMediaWa(struct GfxDeviceInfo *devInfo,
MEDIA_WR_WA(waTable, Wa16KInputHeightNV12Planar420, 1);
+ /*software wa to disable calculate the UV offset by gmmlib
+ CPU blt call will add/remove padding on the platform*/
+ MEDIA_WR_WA(waTable, WaDisableGmmLibOffsetInDeriveImage, 1);
+
return true;
}