Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915: Add the darkscreen debugfs under crtc
Date: Wed, 25 Oct 2023 14:21:43 +0300	[thread overview]
Message-ID: <871qdj9cc8.fsf@intel.com> (raw)
In-Reply-To: <20231025102734.2783492-3-nemesa.garg@intel.com>

On Wed, 25 Oct 2023, Nemesa Garg <nemesa.garg@intel.com> wrote:
> Add debugfs entry for darkscreen to know the status
> bpc and timer value .

Superfluous space before '.'.

>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
>  .../gpu/drm/i915/display/intel_darkscreen.c   | 38 +++++++++++++++++++
>  .../drm/i915/display/intel_display_debugfs.c  |  2 +
>  2 files changed, 40 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_darkscreen.c b/drivers/gpu/drm/i915/display/intel_darkscreen.c
> index ef68dbc7a296..c6490c16fdb5 100644
> --- a/drivers/gpu/drm/i915/display/intel_darkscreen.c
> +++ b/drivers/gpu/drm/i915/display/intel_darkscreen.c
> @@ -67,3 +67,41 @@ void dark_screen_enable(struct intel_crtc_state *crtc_state)
>  	intel_de_rmw(dev_priv, DARK_SCREEN(crtc->config->cpu_transcoder), 0, DARK_SCREEN_DETECT |
>  		       DARK_SCREEN_DONE);
>  }
> +
> +static int intel_darkscreen_debugfs_status_get(void *data, u64 *val)
> +{
> +	struct intel_crtc *crtc = data;
> +
> +	*val = crtc->dark_screen.enable;
> +
> +	return 0;
> +}
> +
> +static int intel_darkscreen_debugfs_status_set(void *data, u64 val)
> +{
> +	struct intel_crtc *crtc = data;
> +	struct intel_crtc_state *crtc_state;
> +
> +	crtc->dark_screen.enable = val;
> +
> +	crtc_state = to_intel_crtc_state(crtc->base.state);
> +
> +	if (crtc_state)
> +		dark_screen_enable(crtc_state);

Can it be enabled on the fly?

The function returns early if !enable. So how do you *disable* this
thing?

> +
> +	return 0;
> +}
> +
> +/*
> + * Check the status whether the darkscreen
> + * is enabled or not.
> + */

Useless comment.

> +DEFINE_DEBUGFS_ATTRIBUTE(intel_darkscreen_debugfs_status_fops,
> +			 intel_darkscreen_debugfs_status_get,
> +			 intel_darkscreen_debugfs_status_set, "%llu\n");
> +
> +void intel_darkscreen_crtc_debugfs_add(struct intel_crtc *crtc)
> +{
> +	debugfs_create_file("i915_darkscreen_status", 0644, crtc->base.debugfs_entry,
> +			    crtc, &intel_darkscreen_debugfs_status_fops);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 2836826f8c05..27a6141eab3e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -33,6 +33,7 @@
>  #include "intel_psr.h"
>  #include "intel_psr_regs.h"
>  #include "intel_wm.h"
> +#include "intel_darkscreen.h"
>  
>  static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
>  {
> @@ -1539,6 +1540,7 @@ void intel_crtc_debugfs_add(struct intel_crtc *crtc)
>  	intel_drrs_crtc_debugfs_add(crtc);
>  	intel_fbc_crtc_debugfs_add(crtc);
>  	hsw_ips_crtc_debugfs_add(crtc);
> +	intel_darkscreen_crtc_debugfs_add(crtc);
>  
>  	debugfs_create_file("i915_current_bpc", 0444, root, crtc,
>  			    &i915_current_bpc_fops);

-- 
Jani Nikula, Intel

  reply	other threads:[~2023-10-25 11:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 10:27 [Intel-gfx] [PATCH 0/2] Enable Darkscreen Feature Nemesa Garg
2023-10-25 10:27 ` [Intel-gfx] [PATCH 1/2] drm/i915: Add Darkscreen registers and timer handler Nemesa Garg
2023-10-25 11:18   ` Jani Nikula
2023-10-25 10:27 ` [Intel-gfx] [PATCH 2/2] drm/i915: Add the darkscreen debugfs under crtc Nemesa Garg
2023-10-25 11:21   ` Jani Nikula [this message]
2023-10-25 20:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Enable Darkscreen Feature Patchwork
2023-10-25 20:04 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-25 20:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-27  6:32 ` [Intel-gfx] ✗ 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=871qdj9cc8.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nemesa.garg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox