drm/i915/wopcm: Handle pre-programmed WOPCM registers
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 20 Jan 2022 21:29:47 +0000 (13:29 -0800)
committerDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Wed, 26 Jan 2022 19:47:24 +0000 (11:47 -0800)
commitdb3b3f3e62279b914e1958e93e057fc4d8dee263
tree1900cd41c79b7725443c14f8c13405fe232d9288
parent8295524a2d5550b56e800ac779a183b7f4d8c33c
drm/i915/wopcm: Handle pre-programmed WOPCM registers

Starting from DG2, some of the programming previously done by i915 and
the GuC has been moved to the GSC and the relevant registers are no
longer writable by either CPU or GuC. This is also referred to as GuC
deprivilege.
On the i915 side, this affects the WOPCM registers: these are no longer
programmed by the driver and we do instead expect to find them already
set. This can lead to verification failures because in i915 we cheat a bit
with the WOPCM size defines, to keep the code common across platforms, by
sometimes using a smaller WOPCM size that the actual HW support (which isn't
a problem because the extra size is not needed if the FW fits in the smaller
chunk), while the pre-programmed values can use the actual size.
Given tha the new programming entity is trusted, relax the amount of the
checks done on the pre-programmed values by not limiting the max
programmed size. In the extremely unlikely scenario that the registers
have been misprogrammed, we will still fail later at DMA time.

v2: drop special case for DG2 G10 A0 (Alan)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: John Harrison <john.c.harrison@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220120212947.3440448-1-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_reg.h
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/intel_device_info.h
drivers/gpu/drm/i915/intel_wopcm.c