[Intel-gfx] [PATCH 1/5] drm/i915/debugfs: clean up LPSP status
Rodrigo Vivi
rodrigo.vivi at intel.com
Wed Sep 1 16:13:03 UTC 2021
On Mon, Aug 30, 2021 at 03:53:40PM +0300, Jani Nikula wrote:
> Clean up the LPSP status printout. No functional changes.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> .../drm/i915/display/intel_display_debugfs.c | 37 ++++++-------------
> 1 file changed, 11 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 8fdacb252bb1..d2a14a9c6857 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1323,9 +1323,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)
> @@ -1344,32 +1341,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;
> }
> --
> 2.20.1
>
More information about the Intel-gfx
mailing list