Commit 3a5f9281 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/debugfs: clean up LPSP status

parent 802fd961
Loading
Loading
Loading
Loading
+11 −26
Original line number Diff line number Diff line
@@ -1324,9 +1324,6 @@ static int i915_drrs_status(struct seq_file *m, void *unused)
	return 0;
}

#define LPSP_STATUS(COND) (COND ? seq_puts(m, "LPSP: enabled\n") : \
				seq_puts(m, "LPSP: disabled\n"))

static bool
intel_lpsp_power_well_enabled(struct drm_i915_private *i915,
			      enum i915_power_well_id power_well_id)
@@ -1345,32 +1342,20 @@ intel_lpsp_power_well_enabled(struct drm_i915_private *i915,
static int i915_lpsp_status(struct seq_file *m, void *unused)
{
	struct drm_i915_private *i915 = node_to_i915(m->private);

	if (DISPLAY_VER(i915) >= 13) {
		LPSP_STATUS(!intel_lpsp_power_well_enabled(i915,
							   SKL_DISP_PW_2));
	bool lpsp_enabled = false;

	if (DISPLAY_VER(i915) >= 13 || IS_DISPLAY_VER(i915, 9, 10)) {
		lpsp_enabled = !intel_lpsp_power_well_enabled(i915, SKL_DISP_PW_2);
	} else if (IS_DISPLAY_VER(i915, 11, 12)) {
		lpsp_enabled = !intel_lpsp_power_well_enabled(i915, ICL_DISP_PW_3);
	} else if (IS_HASWELL(i915) || IS_BROADWELL(i915)) {
		lpsp_enabled = !intel_lpsp_power_well_enabled(i915, HSW_DISP_PW_GLOBAL);
	} else {
		seq_puts(m, "LPSP: not supported\n");
		return 0;
	}

	switch (DISPLAY_VER(i915)) {
	case 12:
	case 11:
		LPSP_STATUS(!intel_lpsp_power_well_enabled(i915, ICL_DISP_PW_3));
		break;
	case 10:
	case 9:
		LPSP_STATUS(!intel_lpsp_power_well_enabled(i915, SKL_DISP_PW_2));
		break;
	default:
		/*
		 * Apart from HASWELL/BROADWELL other legacy platform doesn't
		 * support lpsp.
		 */
		if (IS_HASWELL(i915) || IS_BROADWELL(i915))
			LPSP_STATUS(!intel_lpsp_power_well_enabled(i915, HSW_DISP_PW_GLOBAL));
		else
			seq_puts(m, "LPSP: not supported\n");
	}
	seq_printf(m, "LPSP: %s\n", enableddisabled(lpsp_enabled));

	return 0;
}