drm/i915: Organize INSTDONE report for future.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 3 Dec 2014 12:55:28 +0000 (04:55 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 17 Dec 2014 17:18:43 +0000 (18:18 +0100)
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>
drivers/gpu/drm/i915/i915_gpu_error.c

index d172d13b020c96b884ef4889c8299a972bc5d8b2..be5c9908659b20ce0f6a5eacc18bfadb545d8052 100644 (file)
@@ -1356,26 +1356,15 @@ void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone)
        struct drm_i915_private *dev_priv = dev->dev_private;
        memset(instdone, 0, sizeof(*instdone) * I915_NUM_INSTDONE_REG);
 
-       switch (INTEL_INFO(dev)->gen) {
-       case 2:
-       case 3:
+       if (IS_GEN2(dev) || IS_GEN3(dev))
                instdone[0] = I915_READ(INSTDONE);
-               break;
-       case 4:
-       case 5:
-       case 6:
+       else if (IS_GEN4(dev) || IS_GEN5(dev) || IS_GEN6(dev)) {
                instdone[0] = I915_READ(INSTDONE_I965);
                instdone[1] = I915_READ(INSTDONE1);
-               break;
-       default:
-               WARN_ONCE(1, "Unsupported platform\n");
-       case 7:
-       case 8:
-       case 9:
+       } else if (INTEL_INFO(dev)->gen >= 7) {
                instdone[0] = I915_READ(GEN7_INSTDONE_1);
                instdone[1] = I915_READ(GEN7_SC_INSTDONE);
                instdone[2] = I915_READ(GEN7_SAMPLER_INSTDONE);
                instdone[3] = I915_READ(GEN7_ROW_INSTDONE);
-               break;
        }
 }