[Intel-xe] [PATCH] drm/xe: Fix wopcm size

Lucas De Marchi lucas.demarchi at intel.com
Thu Feb 16 23:17:26 UTC 2023


On Wed, Feb 15, 2023 at 07:33:29PM +0530, Balasubramani Vivekanandan wrote:
>The wopcm size returned by xe_wopcm_size function is used in calculating
>the GuC wopcm base offset and the GuC wopcm size. It is also used to
>find the size of the wopcm space to be reserved at the bottom of the
>GGTT address space. So it is the per-GT wopcm size and not the total
>wopcm area used by all GTs.
>Fix the wopcm size to 2MB which is the wopcm size per-GT for platforms
>above Gen11.

Bspec 67948 contradicts this. It says WOPCM may be 1, 2, 4 or 8 MB and
you have to read the registers set up by BIOS to figure that out.

It seems there's some confusion in xe_wopcm between WOPCM_SIZE
(the total size of WOPCM) and GUC_WOPCM_SIZE (the GuC's size in the
wopcm region)?

Lucas De Marchi

>
>Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan at intel.com>
>---
> drivers/gpu/drm/xe/xe_wopcm.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_wopcm.c b/drivers/gpu/drm/xe/xe_wopcm.c
>index 8fe182afa06c..a88d02357cb6 100644
>--- a/drivers/gpu/drm/xe/xe_wopcm.c
>+++ b/drivers/gpu/drm/xe/xe_wopcm.c
>@@ -46,12 +46,6 @@
>  */
>
> /* Default WOPCM size is 2MB from Gen11, 1MB on previous platforms */
>-#define DGFX_WOPCM_SIZE			SZ_4M	/* FIXME: Larger size require
>-						   for 2 tile PVC, do a proper
>-						   probe sooner or later */
>-#define MTL_WOPCM_SIZE			SZ_4M	/* FIXME: Larger size require
>-						   for MTL, do a proper probe
>-						   sooner or later */
> #define GEN11_WOPCM_SIZE		SZ_2M
> /* 16KB WOPCM (RSVD WOPCM) is reserved from HuC firmware top. */
> #define WOPCM_RESERVED_SIZE		SZ_16K
>@@ -178,9 +172,7 @@ static int __wopcm_init_regs(struct xe_device *xe, struct xe_gt *gt,
>
> u32 xe_wopcm_size(struct xe_device *xe)
> {
>-	return IS_DGFX(xe) ? DGFX_WOPCM_SIZE :
>-		xe->info.platform == XE_METEORLAKE ? MTL_WOPCM_SIZE :
>-		GEN11_WOPCM_SIZE;
>+	return GEN11_WOPCM_SIZE;
> }
>
> /**
>-- 
>2.34.1
>


More information about the Intel-xe mailing list