Skip to content

Commit 563f94f

Browse files
rodrigovividanvet
authored andcommitted
drm/i915: Organize INSTDONE report for future.
Let's be optimistic that for future platforms this will remain the same and reorg a bit. This reorg in if blocks instead of switch make life easier for future platform support addition. Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 74745b0 commit 563f94f

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/gpu/drm/i915/i915_gpu_error.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,26 +1356,15 @@ void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone)
13561356
struct drm_i915_private *dev_priv = dev->dev_private;
13571357
memset(instdone, 0, sizeof(*instdone) * I915_NUM_INSTDONE_REG);
13581358

1359-
switch (INTEL_INFO(dev)->gen) {
1360-
case 2:
1361-
case 3:
1359+
if (IS_GEN2(dev) || IS_GEN3(dev))
13621360
instdone[0] = I915_READ(INSTDONE);
1363-
break;
1364-
case 4:
1365-
case 5:
1366-
case 6:
1361+
else if (IS_GEN4(dev) || IS_GEN5(dev) || IS_GEN6(dev)) {
13671362
instdone[0] = I915_READ(INSTDONE_I965);
13681363
instdone[1] = I915_READ(INSTDONE1);
1369-
break;
1370-
default:
1371-
WARN_ONCE(1, "Unsupported platform\n");
1372-
case 7:
1373-
case 8:
1374-
case 9:
1364+
} else if (INTEL_INFO(dev)->gen >= 7) {
13751365
instdone[0] = I915_READ(GEN7_INSTDONE_1);
13761366
instdone[1] = I915_READ(GEN7_SC_INSTDONE);
13771367
instdone[2] = I915_READ(GEN7_SAMPLER_INSTDONE);
13781368
instdone[3] = I915_READ(GEN7_ROW_INSTDONE);
1379-
break;
13801369
}
13811370
}

0 commit comments

Comments
 (0)