On NVL-P, the primary GT's WOPCM gained an extra 8MiB for the Memory URB. As such, we need to bump the maximum size in the driver so that the driver is able to load without erroring out thinking that the WOPCM is too small.
FIXME: The wopcm code in xe driver is a bit confusing. For the case where the offsets for GUC WOPCM are already locked, it appears we are using the maximum overall WOPCM size instead of the sizes relative to each type of GT. The function __check_layout() should be checking against the latter. Bspec: 67090 Reviewed-by: Dnyaneshwar Bhadane <[email protected]> Signed-off-by: Gustavo Sousa <[email protected]> --- drivers/gpu/drm/xe/xe_wopcm.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_wopcm.c b/drivers/gpu/drm/xe/xe_wopcm.c index dde4f4967ca3..900daf1d1b1b 100644 --- a/drivers/gpu/drm/xe/xe_wopcm.c +++ b/drivers/gpu/drm/xe/xe_wopcm.c @@ -55,8 +55,6 @@ #define MTL_WOPCM_SIZE SZ_4M #define WOPCM_SIZE SZ_2M -#define MAX_WOPCM_SIZE SZ_8M - /* 16KB WOPCM (RSVD WOPCM) is reserved from HuC firmware top. */ #define WOPCM_RESERVED_SIZE SZ_16K @@ -186,6 +184,14 @@ u32 xe_wopcm_size(struct xe_device *xe) WOPCM_SIZE; } +static u32 max_wopcm_size(struct xe_device *xe) +{ + if (xe->info.platform == XE_NOVALAKE_P) + return SZ_16M; + else + return SZ_8M; +} + /** * xe_wopcm_init() - Initialize the WOPCM structure. * @wopcm: pointer to xe_wopcm. @@ -227,8 +233,11 @@ int xe_wopcm_init(struct xe_wopcm *wopcm) * When the GuC wopcm base and size are preprogrammed by * BIOS/IFWI, check against the max allowed wopcm size to * validate if the programmed values align to the wopcm layout. + * + * FIXME: This is giving the maximum overall WOPCM size and not + * the size relative to each GT. */ - wopcm->size = MAX_WOPCM_SIZE; + wopcm->size = max_wopcm_size(xe); goto check; } -- 2.52.0
