Skip to content

Commit 415d126

Browse files
committed
drm/i915: Handle all MCR ranges
The bspec documents multiple MCR ranges; make sure they're all captured by the driver. Bspec: 13991, 52079 Fixes: 592a7c5 ("drm/i915: Extend non readable mcr range") Cc: Mika Kuoppala <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Mika Kuoppala <[email protected]>
1 parent bb4328f commit 415d126

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,15 +1648,34 @@ create_scratch(struct i915_address_space *vm, int count)
16481648
return ERR_PTR(err);
16491649
}
16501650

1651+
static const struct {
1652+
u32 start;
1653+
u32 end;
1654+
} mcr_ranges_gen8[] = {
1655+
{ .start = 0x5500, .end = 0x55ff },
1656+
{ .start = 0x7000, .end = 0x7fff },
1657+
{ .start = 0x9400, .end = 0x97ff },
1658+
{ .start = 0xb000, .end = 0xb3ff },
1659+
{ .start = 0xe000, .end = 0xe7ff },
1660+
{},
1661+
};
1662+
16511663
static bool mcr_range(struct drm_i915_private *i915, u32 offset)
16521664
{
1665+
int i;
1666+
1667+
if (INTEL_GEN(i915) < 8)
1668+
return false;
1669+
16531670
/*
1654-
* Registers in this range are affected by the MCR selector
1671+
* Registers in these ranges are affected by the MCR selector
16551672
* which only controls CPU initiated MMIO. Routing does not
16561673
* work for CS access so we cannot verify them on this path.
16571674
*/
1658-
if (INTEL_GEN(i915) >= 8 && (offset >= 0xb000 && offset <= 0xb4ff))
1659-
return true;
1675+
for (i = 0; mcr_ranges_gen8[i].start; i++)
1676+
if (offset >= mcr_ranges_gen8[i].start &&
1677+
offset <= mcr_ranges_gen8[i].end)
1678+
return true;
16601679

16611680
return false;
16621681
}

0 commit comments

Comments
 (0)