Skip to content

Commit 74745b0

Browse files
rodrigovividanvet
authored andcommitted
drm/i915: Organize PDP regs 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 1eb0f00 commit 74745b0

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

drivers/gpu/drm/i915/i915_gpu_error.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -912,26 +912,20 @@ static void i915_record_ring_state(struct drm_device *dev,
912912

913913
ering->vm_info.gfx_mode = I915_READ(RING_MODE_GEN7(ring));
914914

915-
switch (INTEL_INFO(dev)->gen) {
916-
case 9:
917-
case 8:
915+
if (IS_GEN6(dev))
916+
ering->vm_info.pp_dir_base =
917+
I915_READ(RING_PP_DIR_BASE_READ(ring));
918+
else if (IS_GEN7(dev))
919+
ering->vm_info.pp_dir_base =
920+
I915_READ(RING_PP_DIR_BASE(ring));
921+
else if (INTEL_INFO(dev)->gen >= 8)
918922
for (i = 0; i < 4; i++) {
919923
ering->vm_info.pdp[i] =
920924
I915_READ(GEN8_RING_PDP_UDW(ring, i));
921925
ering->vm_info.pdp[i] <<= 32;
922926
ering->vm_info.pdp[i] |=
923927
I915_READ(GEN8_RING_PDP_LDW(ring, i));
924928
}
925-
break;
926-
case 7:
927-
ering->vm_info.pp_dir_base =
928-
I915_READ(RING_PP_DIR_BASE(ring));
929-
break;
930-
case 6:
931-
ering->vm_info.pp_dir_base =
932-
I915_READ(RING_PP_DIR_BASE_READ(ring));
933-
break;
934-
}
935929
}
936930
}
937931

0 commit comments

Comments
 (0)