All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/pps: move pps debugfs file to intel_pps.c
Date: Mon, 8 Apr 2024 15:13:54 +0300	[thread overview]
Message-ID: <ZhPfgmnCtHql8VXL@intel.com> (raw)
In-Reply-To: <20240408094357.3085319-1-jani.nikula@intel.com>

On Mon, Apr 08, 2024 at 12:43:57PM +0300, Jani Nikula wrote:
> Continue with placing debugfs next to the implementation.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  .../drm/i915/display/intel_display_debugfs.c  | 27 ++--------------
>  drivers/gpu/drm/i915/display/intel_pps.c      | 32 +++++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_pps.h      |  2 ++
>  3 files changed, 36 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 5235f8758ef1..0feffe8d4e45 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -31,6 +31,7 @@
>  #include "intel_hdmi.h"
>  #include "intel_hotplug.h"
>  #include "intel_panel.h"
> +#include "intel_pps.h"
>  #include "intel_psr.h"
>  #include "intel_psr_regs.h"
>  #include "intel_wm.h"
> @@ -1095,27 +1096,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
>  	intel_display_debugfs_params(i915);
>  }
>  
> -static int i915_panel_show(struct seq_file *m, void *data)
> -{
> -	struct intel_connector *connector = m->private;
> -	struct intel_dp *intel_dp = intel_attached_dp(connector);
> -
> -	if (connector->base.status != connector_status_connected)
> -		return -ENODEV;
> -
> -	seq_printf(m, "Panel power up delay: %d\n",
> -		   intel_dp->pps.panel_power_up_delay);
> -	seq_printf(m, "Panel power down delay: %d\n",
> -		   intel_dp->pps.panel_power_down_delay);
> -	seq_printf(m, "Backlight on delay: %d\n",
> -		   intel_dp->pps.backlight_on_delay);
> -	seq_printf(m, "Backlight off delay: %d\n",
> -		   intel_dp->pps.backlight_off_delay);
> -
> -	return 0;
> -}
> -DEFINE_SHOW_ATTRIBUTE(i915_panel);
> -
>  static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
>  {
>  	struct intel_connector *connector = m->private;
> @@ -1560,12 +1540,9 @@ void intel_connector_debugfs_add(struct intel_connector *connector)
>  		return;
>  
>  	intel_drrs_connector_debugfs_add(connector);
> +	intel_pps_connector_debugfs_add(connector);
>  	intel_psr_connector_debugfs_add(connector);
>  
> -	if (connector_type == DRM_MODE_CONNECTOR_eDP)
> -		debugfs_create_file("i915_panel_timings", 0444, root,
> -				    connector, &i915_panel_fops);
> -
>  	if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
>  	    connector_type == DRM_MODE_CONNECTOR_HDMIA ||
>  	    connector_type == DRM_MODE_CONNECTOR_HDMIB) {
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index b5d9920f8341..88a44d93f82b 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -1670,6 +1670,38 @@ void intel_pps_setup(struct drm_i915_private *i915)
>  		i915->display.pps.mmio_base = PPS_BASE;
>  }
>  
> +static int intel_pps_show(struct seq_file *m, void *data)
> +{
> +	struct intel_connector *connector = m->private;
> +	struct intel_dp *intel_dp = intel_attached_dp(connector);
> +
> +	if (connector->base.status != connector_status_connected)
> +		return -ENODEV;

That check seems completely pointless. Could be removed as a
followup.

Hmm. The other question that comes to mind is whether anyone has
ever used this file? I for sure have not. So I'm wondering if we
could just nuke the whole thing?

Anyways
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +
> +	seq_printf(m, "Panel power up delay: %d\n",
> +		   intel_dp->pps.panel_power_up_delay);
> +	seq_printf(m, "Panel power down delay: %d\n",
> +		   intel_dp->pps.panel_power_down_delay);
> +	seq_printf(m, "Backlight on delay: %d\n",
> +		   intel_dp->pps.backlight_on_delay);
> +	seq_printf(m, "Backlight off delay: %d\n",
> +		   intel_dp->pps.backlight_off_delay);
> +
> +	return 0;
> +}
> +DEFINE_SHOW_ATTRIBUTE(intel_pps);
> +
> +void intel_pps_connector_debugfs_add(struct intel_connector *connector)
> +{
> +	struct dentry *root = connector->base.debugfs_entry;
> +	int connector_type = connector->base.connector_type;
> +
> +	if (connector_type == DRM_MODE_CONNECTOR_eDP)
> +		debugfs_create_file("i915_panel_timings", 0444, root,
> +				    connector, &intel_pps_fops);
> +
> +}
> +
>  void assert_pps_unlocked(struct drm_i915_private *dev_priv, enum pipe pipe)
>  {
>  	i915_reg_t pp_reg;
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.h b/drivers/gpu/drm/i915/display/intel_pps.h
> index a2c2467e3c22..07ef96ca8da2 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.h
> +++ b/drivers/gpu/drm/i915/display/intel_pps.h
> @@ -51,6 +51,8 @@ void vlv_pps_init(struct intel_encoder *encoder,
>  void intel_pps_unlock_regs_wa(struct drm_i915_private *i915);
>  void intel_pps_setup(struct drm_i915_private *i915);
>  
> +void intel_pps_connector_debugfs_add(struct intel_connector *connector);
> +
>  void assert_pps_unlocked(struct drm_i915_private *i915, enum pipe pipe);
>  
>  #endif /* __INTEL_PPS_H__ */
> -- 
> 2.39.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-04-08 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  9:43 [PATCH] drm/i915/pps: move pps debugfs file to intel_pps.c Jani Nikula
2024-04-08 12:13 ` Ville Syrjälä [this message]
2024-04-10 11:38   ` Jani Nikula
2024-04-08 19:16 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-04-08 19:30 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-10  2:25 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZhPfgmnCtHql8VXL@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.