Commit ee71434e authored by Aravind Iddamsetty's avatar Aravind Iddamsetty Committed by Daniele Ceraolo Spurio
Browse files

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: default avatarAravind Iddamsetty <aravind.iddamsetty@intel.com>
Signed-off-by: default avatarDaniele 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: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221108020600.3575467-5-daniele.ceraolospurio@intel.com
parent 00b4c0ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ WOPCM
WOPCM Layout
~~~~~~~~~~~~

.. kernel-doc:: drivers/gpu/drm/i915/intel_wopcm.c
.. kernel-doc:: drivers/gpu/drm/i915/gt/intel_wopcm.c
   :doc: WOPCM Layout

GuC
+3 −2
Original line number Diff line number Diff line
@@ -127,9 +127,11 @@ gt-y += \
	gt/intel_sseu.o \
	gt/intel_sseu_debugfs.o \
	gt/intel_timeline.o \
	gt/intel_wopcm.o \
	gt/intel_workarounds.o \
	gt/shmem_utils.o \
	gt/sysfs_engines.o

# x86 intel-gtt module support
gt-$(CONFIG_X86) += gt/intel_ggtt_gmch.o
# autogenerated null render state
@@ -183,8 +185,7 @@ i915-y += \
	  i915_trace_points.o \
	  i915_ttm_buddy_manager.o \
	  i915_vma.o \
	  i915_vma_resource.o \
	  intel_wopcm.o
	  i915_vma_resource.o

# general-purpose microcontroller (GuC) support
i915-y += gt/uc/intel_uc.o \
+1 −1
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ static int init_ggtt(struct i915_ggtt *ggtt)
	 * why.
	 */
	ggtt->pin_bias = max_t(u32, I915_GTT_PAGE_SIZE,
			       intel_wopcm_guc_size(&ggtt->vm.i915->wopcm));
			       intel_wopcm_guc_size(&ggtt->vm.gt->wopcm));

	ret = intel_vgt_balloon(ggtt);
	if (ret)
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ void intel_gt_common_init_early(struct intel_gt *gt)
	seqcount_mutex_init(&gt->tlb.seqno, &gt->tlb.invalidate_lock);
	intel_gt_pm_init_early(gt);

	intel_wopcm_init_early(&gt->wopcm);
	intel_uc_init_early(&gt->uc);
	intel_rps_init_early(&gt->rps);
}
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "intel_migrate_types.h"
#include "intel_wakeref.h"
#include "pxp/intel_pxp_types.h"
#include "intel_wopcm.h"

struct drm_i915_private;
struct i915_ggtt;
@@ -101,6 +102,7 @@ struct intel_gt {

	struct intel_uc uc;
	struct intel_gsc gsc;
	struct intel_wopcm wopcm;

	struct {
		/* Serialize global tlb invalidations */
Loading