Skip to content

Commit fe8b708

Browse files
mattropejnikula
authored andcommitted
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]> (cherry picked from commit 415d126) Signed-off-by: Jani Nikula <[email protected]>
1 parent c09f6b4 commit fe8b708

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
@@ -1529,15 +1529,34 @@ create_scratch(struct i915_address_space *vm, int count)
15291529
return ERR_PTR(err);
15301530
}
15311531

1532+
static const struct {
1533+
u32 start;
1534+
u32 end;
1535+
} mcr_ranges_gen8[] = {
1536+
{ .start = 0x5500, .end = 0x55ff },
1537+
{ .start = 0x7000, .end = 0x7fff },
1538+
{ .start = 0x9400, .end = 0x97ff },
1539+
{ .start = 0xb000, .end = 0xb3ff },
1540+
{ .start = 0xe000, .end = 0xe7ff },
1541+
{},
1542+
};
1543+
15321544
static bool mcr_range(struct drm_i915_private *i915, u32 offset)
15331545
{
1546+
int i;
1547+
1548+
if (INTEL_GEN(i915) < 8)
1549+
return false;
1550+
15341551
/*
1535-
* Registers in this range are affected by the MCR selector
1552+
* Registers in these ranges are affected by the MCR selector
15361553
* which only controls CPU initiated MMIO. Routing does not
15371554
* work for CS access so we cannot verify them on this path.
15381555
*/
1539-
if (INTEL_GEN(i915) >= 8 && (offset >= 0xb000 && offset <= 0xb4ff))
1540-
return true;
1556+
for (i = 0; mcr_ranges_gen8[i].start; i++)
1557+
if (offset >= mcr_ranges_gen8[i].start &&
1558+
offset <= mcr_ranges_gen8[i].end)
1559+
return true;
15411560

15421561
return false;
15431562
}

0 commit comments

Comments
 (0)