From cf4b5e159802ff3a37e75372b425312b91cb2c08 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 23 May 2024 19:00:19 +0000 Subject: [PATCH] Update Addrlib gfx10 files Update changes to gfx10 addrlib files from: https://gitlab.freedesktop.org/mesa/mesa.git mesa top commit: 4d298673da9b05d826b960eece2e715a6b187330 Change-Id: I6015c827d3e9b1fbde034686432670958f424a1d Signed-off-by: Chris Freehill --- .../hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp | 6 +++--- runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp index c1db4128b7..f79289e113 100644 --- a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp +++ b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp @@ -1058,7 +1058,6 @@ ChipFamily Gfx10Lib::HwlConvertChipFamily( ADDR_ASSERT(!"Unknown chip revision"); } break; - case FAMILY_RMB: if (ASICREV_IS_REMBRANDT(chipRevision)) { @@ -2652,7 +2651,7 @@ BOOL_32 Gfx10Lib::ValidateSwModeParams( { if (((swizzleMask & Gfx10Rsrc3dSwModeMask) == 0) || (prt && ((swizzleMask & Gfx10Rsrc3dPrtSwModeMask) == 0)) || - (thin3d && ((swizzleMask & Gfx10Rsrc3dThinSwModeMask) == 0))) + (thin3d && ((swizzleMask & Gfx10Rsrc3dViewAs2dSwModeMask) == 0))) { ADDR_ASSERT_ALWAYS(); valid = FALSE; @@ -2969,7 +2968,8 @@ ADDR_E_RETURNCODE Gfx10Lib::HwlGetPreferredSurfaceSetting( if (pIn->flags.view3dAs2dArray) { - allowedSwModeSet.value &= Gfx10Rsrc3dThinSwModeMask; + // SW_LINEAR can be used for 3D thin images, including BCn image format. + allowedSwModeSet.value &= Gfx10Rsrc3dViewAs2dSwModeMask; } break; diff --git a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.h b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.h index f13dcb2f39..a8421e92ad 100644 --- a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.h +++ b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.h @@ -146,6 +146,8 @@ const UINT_32 Gfx10Rsrc3dThin64KBSwModeMask = (1u << ADDR_SW_64KB_Z_X) | const UINT_32 Gfx10Rsrc3dThinSwModeMask = Gfx10Rsrc3dThin64KBSwModeMask | Gfx10BlkVarSwModeMask; +const UINT_32 Gfx10Rsrc3dViewAs2dSwModeMask = Gfx10Rsrc3dThinSwModeMask | Gfx10LinearSwModeMask; + const UINT_32 Gfx10Rsrc3dThickSwModeMask = Gfx10Rsrc3dSwModeMask & ~(Gfx10Rsrc3dThinSwModeMask | Gfx10LinearSwModeMask); const UINT_32 Gfx10Rsrc3dThick4KBSwModeMask = Gfx10Rsrc3dThickSwModeMask & Gfx10Blk4KBSwModeMask;