forked from Minki/linux
drm/i915: Fix GEN8_MCR_SELECTOR programming
fls returns bit positions starting from one for the lsb and the MCR register expects zero based (sub)slice addressing. Incorrent MCR programming can have the effect of directing MMIO reads of registers in the 0xb100-0xb3ff range to invalid subslice returning zeroes instead of actual content. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Fixes:1e40d4aea5
("drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads") Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20190717180624.20354-2-tvrtko.ursulin@linux.intel.com (cherry picked from commit15160879d4
) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
6d61f716a0
commit
0bbfdce345
@ -969,9 +969,14 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type)
|
||||
u32 intel_calculate_mcr_s_ss_select(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
|
||||
unsigned int slice = fls(sseu->slice_mask) - 1;
|
||||
unsigned int subslice;
|
||||
u32 mcr_s_ss_select;
|
||||
u32 slice = fls(sseu->slice_mask);
|
||||
u32 subslice = fls(sseu->subslice_mask[slice]);
|
||||
|
||||
GEM_BUG_ON(slice >= ARRAY_SIZE(sseu->subslice_mask));
|
||||
subslice = fls(sseu->subslice_mask[slice]);
|
||||
GEM_BUG_ON(!subslice);
|
||||
subslice--;
|
||||
|
||||
if (IS_GEN(dev_priv, 10))
|
||||
mcr_s_ss_select = GEN8_MCR_SLICE(slice) |
|
||||
|
Loading…
Reference in New Issue
Block a user