diff mbox series

[2/4] drm/i915/dmc_wl: Show description string for enable_dmc_wl

Message ID 20241219221429.109668-3-gustavo.sousa@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dmc_wl: Support extra values for dmc_wl_enable for debugging | expand

Commit Message

Gustavo Sousa Dec. 19, 2024, 10:14 p.m. UTC
We already provide the value resulting from sanitization of
enable_dmc_wl in dmesg, however the reader will need to either have the
meanings memorized or look them up in the parameter's documentation.
Let's make things easier by providing a short human-readable name for
the parameter in dmesg.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc_wl.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

Bhadane, Dnyaneshwar Dec. 30, 2024, 11:25 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Gustavo
> Sousa
> Sent: Friday, December 20, 2024 3:44 AM
> To: intel-xe@lists.freedesktop.org; intel-gfx@lists.freedesktop.org
> Subject: [PATCH 2/4] drm/i915/dmc_wl: Show description string for
> enable_dmc_wl
> 
> We already provide the value resulting from sanitization of enable_dmc_wl in
> dmesg, however the reader will need to either have the meanings memorized or
> look them up in the parameter's documentation.
> Let's make things easier by providing a short human-readable name for the
> parameter in dmesg.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>

Dnyaneshwar
> ---
>  drivers/gpu/drm/i915/display/intel_dmc_wl.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> index cff841521ca0..2315c6318b51 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> @@ -279,6 +279,8 @@ static bool __intel_dmc_wl_supported(struct
> intel_display *display)
> 
>  static void intel_dmc_wl_sanitize_param(struct intel_display *display)  {
> +	const char *desc;
> +
>  	if (!HAS_DMC_WAKELOCK(display)) {
>  		display->params.enable_dmc_wl =
> ENABLE_DMC_WL_DISABLED;
>  	} else if (display->params.enable_dmc_wl < 0) { @@ -294,8 +296,20 @@
> static void intel_dmc_wl_sanitize_param(struct intel_display *display)
>  		    display->params.enable_dmc_wl < 0 ||
>  		    display->params.enable_dmc_wl >=
> ENABLE_DMC_WL_MAX);
> 
> -	drm_dbg_kms(display->drm, "Sanitized enable_dmc_wl value: %d\n",
> -		    display->params.enable_dmc_wl);
> +	switch (display->params.enable_dmc_wl) {
> +	case ENABLE_DMC_WL_DISABLED:
> +		desc = "disabled";
> +		break;
> +	case ENABLE_DMC_WL_ENABLED:
> +		desc = "enabled";
> +		break;
> +	default:
> +		desc = "unknown";
> +		break;
> +	}
> +
> +	drm_dbg_kms(display->drm, "Sanitized enable_dmc_wl value: %d
> (%s)\n",
> +		    display->params.enable_dmc_wl, desc);
>  }
> 
>  void intel_dmc_wl_init(struct intel_display *display)
> --
> 2.47.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index cff841521ca0..2315c6318b51 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -279,6 +279,8 @@  static bool __intel_dmc_wl_supported(struct intel_display *display)
 
 static void intel_dmc_wl_sanitize_param(struct intel_display *display)
 {
+	const char *desc;
+
 	if (!HAS_DMC_WAKELOCK(display)) {
 		display->params.enable_dmc_wl = ENABLE_DMC_WL_DISABLED;
 	} else if (display->params.enable_dmc_wl < 0) {
@@ -294,8 +296,20 @@  static void intel_dmc_wl_sanitize_param(struct intel_display *display)
 		    display->params.enable_dmc_wl < 0 ||
 		    display->params.enable_dmc_wl >= ENABLE_DMC_WL_MAX);
 
-	drm_dbg_kms(display->drm, "Sanitized enable_dmc_wl value: %d\n",
-		    display->params.enable_dmc_wl);
+	switch (display->params.enable_dmc_wl) {
+	case ENABLE_DMC_WL_DISABLED:
+		desc = "disabled";
+		break;
+	case ENABLE_DMC_WL_ENABLED:
+		desc = "enabled";
+		break;
+	default:
+		desc = "unknown";
+		break;
+	}
+
+	drm_dbg_kms(display->drm, "Sanitized enable_dmc_wl value: %d (%s)\n",
+		    display->params.enable_dmc_wl, desc);
 }
 
 void intel_dmc_wl_init(struct intel_display *display)