All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 5/6] drm/i915/audio: be explicit about intel_wakeref_t conversions
Date: Thu, 26 Sep 2024 16:49:50 -0400	[thread overview]
Message-ID: <ZvXI7vLZzcQfwowX@intel.com> (raw)
In-Reply-To: <9d2a2c2399e70f36e0d68d88136ac688f02988fe.1726680898.git.jani.nikula@intel.com>

On Wed, Sep 18, 2024 at 08:35:47PM +0300, Jani Nikula wrote:
> Use explicit casts to convert between intel_wakeref_t and unsigned long,
> to not rely on intel_wakeref_t underlying type remaining unsigned long,
> allowing us to change it as needed. (And yes, this is indeed preparation
> for changing the typedef for intel_wakeref_t.)

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index f5e7eefab2f1..32aa9ec1a204 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -982,12 +982,12 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
>  {
>  	struct intel_display *display = to_intel_display(kdev);
>  	struct drm_i915_private *i915 = to_i915(display->drm);
> -	intel_wakeref_t ret;
> +	intel_wakeref_t wakeref;
>  
>  	/* Catch potential impedance mismatches before they occur! */
>  	BUILD_BUG_ON(sizeof(intel_wakeref_t) > sizeof(unsigned long));
>  
> -	ret = intel_display_power_get(i915, POWER_DOMAIN_AUDIO_PLAYBACK);
> +	wakeref = intel_display_power_get(i915, POWER_DOMAIN_AUDIO_PLAYBACK);
>  
>  	if (i915->display.audio.power_refcount++ == 0) {
>  		if (DISPLAY_VER(i915) >= 9) {
> @@ -1007,7 +1007,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
>  				     0, AUD_PIN_BUF_ENABLE);
>  	}
>  
> -	return ret;
> +	return (unsigned long)wakeref;
>  }
>  
>  static void i915_audio_component_put_power(struct device *kdev,
> @@ -1015,13 +1015,14 @@ static void i915_audio_component_put_power(struct device *kdev,
>  {
>  	struct intel_display *display = to_intel_display(kdev);
>  	struct drm_i915_private *i915 = to_i915(display->drm);
> +	intel_wakeref_t wakeref = (intel_wakeref_t)cookie;
>  
>  	/* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */
>  	if (--i915->display.audio.power_refcount == 0)
>  		if (IS_GEMINILAKE(i915))
>  			glk_force_audio_cdclk(i915, false);
>  
> -	intel_display_power_put(i915, POWER_DOMAIN_AUDIO_PLAYBACK, cookie);
> +	intel_display_power_put(i915, POWER_DOMAIN_AUDIO_PLAYBACK, wakeref);
>  }
>  
>  static void i915_audio_component_codec_wake_override(struct device *kdev,
> -- 
> 2.39.2
> 

  reply	other threads:[~2024-09-26 20:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 17:35 [PATCH v2 0/6] drm/i915: wakeref fixes and improvements Jani Nikula
2024-09-18 17:35 ` [PATCH v2 1/6] drm/i915/gem: fix bitwise and logical AND mixup Jani Nikula
2024-09-26 20:40   ` Rodrigo Vivi
2024-09-27  8:38     ` Jani Nikula
2024-09-30 13:54       ` Jani Nikula
2024-09-30 14:23         ` Matthew Auld
2024-09-30 14:58           ` Jani Nikula
2024-09-18 17:35 ` [PATCH v2 2/6] drm/i915: use INTEL_WAKEREF_DEF instead of magic -1 for intel_wakeref_t Jani Nikula
2024-09-26 20:45   ` Rodrigo Vivi
2024-09-18 17:35 ` [PATCH v2 3/6] drm/i915/display: return 0 instead of false for disabled power wakeref Jani Nikula
2024-09-26 20:46   ` Rodrigo Vivi
2024-09-18 17:35 ` [PATCH v2 4/6] drm/i915/gt: add a macro for mock gt wakeref special value and use it Jani Nikula
2024-09-26 20:49   ` Rodrigo Vivi
2024-09-18 17:35 ` [PATCH v2 5/6] drm/i915/audio: be explicit about intel_wakeref_t conversions Jani Nikula
2024-09-26 20:49   ` Rodrigo Vivi [this message]
2024-09-18 17:35 ` [PATCH v2 6/6] drm/i915: switch intel_wakeref_t underlying type to struct ref_tracker * Jani Nikula
2024-09-26 20:52   ` Rodrigo Vivi
2024-09-18 18:24 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: wakeref fixes and improvements (rev2) Patchwork
2024-09-18 18:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-09-18 18:36 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-18 21:37 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: wakeref fixes and improvements (rev3) Patchwork
2024-09-18 21:37 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-09-18 21:38 ` ✓ CI.Patch_applied: success for drm/i915: wakeref fixes and improvements (rev2) Patchwork
2024-09-18 21:39 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-18 21:40 ` ✓ CI.KUnit: success " Patchwork
2024-09-18 21:46 ` ✓ Fi.CI.BAT: success for drm/i915: wakeref fixes and improvements (rev3) Patchwork
2024-09-18 21:51 ` ✓ CI.Build: success for drm/i915: wakeref fixes and improvements (rev2) Patchwork
2024-09-18 21:54 ` ✓ CI.Hooks: " Patchwork
2024-09-18 21:55 ` ✗ CI.checksparse: warning " Patchwork
2024-09-18 22:14 ` ✓ CI.BAT: success " Patchwork
2024-09-19  9:25 ` ✗ Fi.CI.IGT: failure for drm/i915: wakeref fixes and improvements (rev3) Patchwork
2024-09-19 11:05 ` ✗ CI.FULL: failure for drm/i915: wakeref fixes and improvements (rev2) 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=ZvXI7vLZzcQfwowX@intel.com \
    --to=rodrigo.vivi@intel.com \
    --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 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.