Commit d2e0540a authored by Gustavo Sousa's avatar Gustavo Sousa
Browse files

drm/xe/nvlp: Bump maximum WOPCM size



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: default avatarDnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Link: https://patch.msgid.link/20260206-nvl-p-upstreaming-v3-15-636e1ad32688@intel.com


Signed-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
parent d59d94f9
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -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;
	}