Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org,  intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 2/5] drm/i915/pps: convert intel_wakeref_t to struct ref_tracker *
Date: Mon, 01 Dec 2025 10:09:58 +0200	[thread overview]
Message-ID: <8d2565f42336b0685d7f25e986cffbcdfd8d4470.camel@coelho.fi> (raw)
In-Reply-To: <e7afaea1a609485f91669a7d3c5d3fde0e0dbf8b.1764076995.git.jani.nikula@intel.com>

On Tue, 2025-11-25 at 15:24 +0200, Jani Nikula wrote:
> Under the hood, intel_wakeref_t is just struct ref_tracker *. Use the
> actual underlying type both for clarity (we *are* using intel_wakeref_t
> as a pointer though it doesn't look like one) and to help i915, xe and
> display coexistence without custom types.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux.c | 2 +-
>  drivers/gpu/drm/i915/display/intel_pps.c    | 7 +++----
>  drivers/gpu/drm/i915/display/intel_pps.h    | 9 ++++-----
>  3 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> index 809799f63e32..38e03f3efac5 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> @@ -246,7 +246,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
>  	u32 aux_clock_divider;
>  	enum intel_display_power_domain aux_domain;
>  	intel_wakeref_t aux_wakeref;
> -	intel_wakeref_t pps_wakeref = NULL;
> +	struct ref_tracker *pps_wakeref = NULL;
>  	int i, ret, recv_bytes;
>  	int try, clock = 0;
>  	u32 status;
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index 34376255b85c..b217ec7aa758 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -67,10 +67,10 @@ static const char *pps_name(struct intel_dp *intel_dp)
>  	return "PPS <invalid>";
>  }
>  
> -intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp)
> +struct ref_tracker *intel_pps_lock(struct intel_dp *intel_dp)
>  {
>  	struct intel_display *display = to_intel_display(intel_dp);
> -	intel_wakeref_t wakeref;
> +	struct ref_tracker *wakeref;
>  
>  	/*
>  	 * See vlv_pps_reset_all() why we need a power domain reference here.
> @@ -81,8 +81,7 @@ intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp)
>  	return wakeref;
>  }
>  
> -intel_wakeref_t intel_pps_unlock(struct intel_dp *intel_dp,
> -				 intel_wakeref_t wakeref)
> +struct ref_tracker *intel_pps_unlock(struct intel_dp *intel_dp, struct ref_tracker *wakeref)
>  {
>  	struct intel_display *display = to_intel_display(intel_dp);
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.h b/drivers/gpu/drm/i915/display/intel_pps.h
> index ad5c458ccdaf..f7c96d75be45 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.h
> +++ b/drivers/gpu/drm/i915/display/intel_pps.h
> @@ -8,20 +8,19 @@
>  
>  #include <linux/types.h>
>  
> -#include "intel_wakeref.h"
> -
>  enum pipe;
>  struct intel_connector;
>  struct intel_crtc_state;
>  struct intel_display;
>  struct intel_dp;
>  struct intel_encoder;
> +struct ref_tracker;
>  
> -intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp);
> -intel_wakeref_t intel_pps_unlock(struct intel_dp *intel_dp, intel_wakeref_t wakeref);
> +struct ref_tracker *intel_pps_lock(struct intel_dp *intel_dp);
> +struct ref_tracker *intel_pps_unlock(struct intel_dp *intel_dp, struct ref_tracker *wakeref);
>  
>  #define __with_intel_pps_lock(dp, wf) \
> -	for (intel_wakeref_t (wf) = intel_pps_lock(dp); (wf); (wf) = intel_pps_unlock((dp), (wf)))
> +	for (struct ref_tracker *(wf) = intel_pps_lock(dp); (wf); (wf) = intel_pps_unlock((dp), (wf)))
>  
>  #define with_intel_pps_lock(dp) \
>  	__with_intel_pps_lock((dp), __UNIQUE_ID(wakeref))


Reviewed-by: Luca Coelho <luciano.coelho@intel.com>

--
Cheers,
Luca.

  reply	other threads:[~2025-12-01  8:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 13:24 [PATCH v2 0/5] drm/i915/display: switch from intel_wakeref_t to struct ref_tracker * Jani Nikula
2025-11-25 13:24 ` [PATCH v2 1/5] drm/i915/pps: drop wakeref parameter from with_intel_pps_lock() Jani Nikula
2025-12-01  8:06   ` Luca Coelho
2025-11-25 13:24 ` [PATCH v2 2/5] drm/i915/pps: convert intel_wakeref_t to struct ref_tracker * Jani Nikula
2025-12-01  8:09   ` Luca Coelho [this message]
2025-11-25 13:24 ` [PATCH v2 3/5] drm/i915/power: drop wakeref parameter from with_intel_display_power*() Jani Nikula
2025-12-01  8:11   ` Luca Coelho
2025-11-25 13:24 ` [PATCH v2 4/5] drm/i915/power: convert intel_wakeref_t to struct ref_tracker * Jani Nikula
2025-12-01  8:15   ` Luca Coelho
2025-12-01 12:25     ` Jani Nikula
2025-12-01 12:28       ` Luca Coelho
2025-12-01 13:38         ` Jani Nikula
2025-11-25 13:24 ` [PATCH v2 5/5] drm/{i915,xe}/display: drop intel_wakeref.h usage Jani Nikula
2025-12-01  8:17   ` Luca Coelho
2025-11-25 20:07 ` ✗ CI.checkpatch: warning for drm/i915/display: switch from intel_wakeref_t to struct ref_tracker * (rev2) Patchwork
2025-11-25 20:09 ` ✓ CI.KUnit: success " Patchwork
2025-11-25 20:24 ` ✗ CI.checksparse: warning " Patchwork
2025-11-25 20:49 ` ✓ Xe.CI.BAT: success " Patchwork
2025-11-25 23:24 ` ✗ Xe.CI.Full: 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=8d2565f42336b0685d7f25e986cffbcdfd8d4470.camel@coelho.fi \
    --to=luca@coelho.fi \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox