Commit 955cdc7f authored by Matt Roper's avatar Matt Roper Committed by Greg Kroah-Hartman

drm/i915: Handle all MCR ranges

commit fe8b7085 upstream.

The bspec documents multiple MCR ranges; make sure they're all captured
by the driver.

Bspec: 13991, 52079
Fixes: 592a7c5e ("drm/i915: Extend non readable mcr range")
Cc: Mika Kuoppala <[email protected]>
Signed-off-by: default avatarMatt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]Reviewed-by: default avatarMika Kuoppala <[email protected]>
(cherry picked from commit 415d1269975d3fc21c13a6ae8de7b5fe0e6febb1)
Signed-off-by: default avatarJani Nikula <[email protected]>
Signed-off-by: default avatarGreg Kroah-Hartman <[email protected]>
parent 93d35bbd
......@@ -1504,15 +1504,34 @@ create_scratch(struct i915_address_space *vm, int count)
return ERR_PTR(err);
}
static const struct {
u32 start;
u32 end;
} mcr_ranges_gen8[] = {
{ .start = 0x5500, .end = 0x55ff },
{ .start = 0x7000, .end = 0x7fff },
{ .start = 0x9400, .end = 0x97ff },
{ .start = 0xb000, .end = 0xb3ff },
{ .start = 0xe000, .end = 0xe7ff },
{},
};
static bool mcr_range(struct drm_i915_private *i915, u32 offset)
{
int i;
if (INTEL_GEN(i915) < 8)
return false;
/*
* Registers in this range are affected by the MCR selector
* Registers in these ranges are affected by the MCR selector
* which only controls CPU initiated MMIO. Routing does not
* work for CS access so we cannot verify them on this path.
*/
if (INTEL_GEN(i915) >= 8 && (offset >= 0xb000 && offset <= 0xb4ff))
return true;
for (i = 0; mcr_ranges_gen8[i].start; i++)
if (offset >= mcr_ranges_gen8[i].start &&
offset <= mcr_ranges_gen8[i].end)
return true;
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment