1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/i915/gt/intel_wopcm.h
Aravind Iddamsetty ee71434eeb drm/i915/mtl: Handle wopcm per-GT and limit calculations.
With MTL standalone media architecture the wopcm layout has changed,
with separate partitioning in WOPCM for the root GT GuC and the media
GT GuC. The size of WOPCM is 4MB with the lower 2MB reserved for the
media GT and the upper 2MB for the root GT.

Given that MTL has GuC deprivilege, the WOPCM registers are pre-locked
by the bios. Therefore, we can skip all the math for the partitioning
and just limit ourselves to sanity-checking the values.

v2: fix makefile file ordering (Jani)
v3: drop XELPM_SAMEDIA_WOPCM_SIZE, check huc instead of VDBOX (John)
v4: further clarify commit message, remove blank line (John)

Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: John Harrison <john.c.harrison@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221108020600.3575467-5-daniele.ceraolospurio@intel.com
2022-11-14 10:11:47 -08:00

60 lines
1.2 KiB
C

/*
* SPDX-License-Identifier: MIT
*
* Copyright © 2017-2018 Intel Corporation
*/
#ifndef _INTEL_WOPCM_H_
#define _INTEL_WOPCM_H_
#include <linux/types.h>
/**
* struct intel_wopcm - Overall WOPCM info and WOPCM regions.
* @size: Size of overall WOPCM.
* @guc: GuC WOPCM Region info.
* @guc.base: GuC WOPCM base which is offset from WOPCM base.
* @guc.size: Size of the GuC WOPCM region.
*/
struct intel_wopcm {
u32 size;
struct {
u32 base;
u32 size;
} guc;
};
/**
* intel_wopcm_guc_base()
* @wopcm: intel_wopcm structure
*
* Returns the base of the WOPCM shadowed region.
*
* Returns:
* 0 if GuC is not present or not in use.
* Otherwise, the GuC WOPCM base.
*/
static inline u32 intel_wopcm_guc_base(struct intel_wopcm *wopcm)
{
return wopcm->guc.base;
}
/**
* intel_wopcm_guc_size()
* @wopcm: intel_wopcm structure
*
* Returns size of the WOPCM shadowed region.
*
* Returns:
* 0 if GuC is not present or not in use.
* Otherwise, the GuC WOPCM size.
*/
static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm)
{
return wopcm->guc.size;
}
void intel_wopcm_init_early(struct intel_wopcm *wopcm);
void intel_wopcm_init(struct intel_wopcm *wopcm);
#endif