intel-xe.lists.freedesktop.org archive mirror
 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>,
	"Luca Coelho" <luciano.coelho@intel.com>
Subject: Re: [PATCH v4 9/9] drm/i915/dmc: use struct intel_display more
Date: Wed, 17 Apr 2024 10:31:50 -0400	[thread overview]
Message-ID: <Zh_dVoy11dTY1IaM@intel.com> (raw)
In-Reply-To: <06bc9fd9d0472e899bd9d50f3b10a6066c1a0238.1713358679.git.jani.nikula@intel.com>

On Wed, Apr 17, 2024 at 04:02:47PM +0300, Jani Nikula wrote:
> Now that the intel_de_ functions and DISPLAY_VER() accept struct
> intel_display *, use it more.
> 
> Cc: Luca Coelho <luciano.coelho@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

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

> ---
>  drivers/gpu/drm/i915/display/intel_dmc_wl.c | 24 +++++++++------------
>  1 file changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> index e79c45e36722..d9864b9cc429 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> @@ -66,8 +66,8 @@ static void intel_dmc_wl_work(struct work_struct *work)
>  {
>  	struct intel_dmc_wl *wl =
>  		container_of(work, struct intel_dmc_wl, work.work);
> -	struct drm_i915_private *i915 =
> -		container_of(wl, struct drm_i915_private, display.wl);
> +	struct intel_display *display =
> +		container_of(wl, struct intel_display, wl);
>  	unsigned long flags;
>  
>  	spin_lock_irqsave(&wl->lock, flags);
> @@ -76,9 +76,9 @@ static void intel_dmc_wl_work(struct work_struct *work)
>  	if (!refcount_read(&wl->refcount))
>  		goto out_unlock;
>  
> -	__intel_de_rmw_nowl(i915, DMC_WAKELOCK1_CTL, DMC_WAKELOCK_CTL_REQ, 0);
> +	__intel_de_rmw_nowl(display, DMC_WAKELOCK1_CTL, DMC_WAKELOCK_CTL_REQ, 0);
>  
> -	if (__intel_de_wait_for_register_nowl(i915, DMC_WAKELOCK1_CTL,
> +	if (__intel_de_wait_for_register_nowl(display, DMC_WAKELOCK1_CTL,
>  					      DMC_WAKELOCK_CTL_ACK, 0,
>  					      DMC_WAKELOCK_CTL_TIMEOUT)) {
>  		WARN_RATELIMIT(1, "DMC wakelock release timed out");
> @@ -111,7 +111,7 @@ static bool __intel_dmc_wl_supported(struct intel_display *display)
>  {
>  	struct drm_i915_private *i915 = to_i915(display->drm);
>  
> -	if (DISPLAY_VER(i915) < 20 ||
> +	if (DISPLAY_VER(display) < 20 ||
>  	    !intel_dmc_has_payload(i915) ||
>  	    !display->params.enable_dmc_wl)
>  		return false;
> @@ -121,11 +121,10 @@ static bool __intel_dmc_wl_supported(struct intel_display *display)
>  
>  void intel_dmc_wl_init(struct intel_display *display)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_dmc_wl *wl = &display->wl;
>  
>  	/* don't call __intel_dmc_wl_supported(), DMC is not loaded yet */
> -	if (DISPLAY_VER(i915) < 20 || !display->params.enable_dmc_wl)
> +	if (DISPLAY_VER(display) < 20 || !display->params.enable_dmc_wl)
>  		return;
>  
>  	INIT_DELAYED_WORK(&wl->work, intel_dmc_wl_work);
> @@ -135,7 +134,6 @@ void intel_dmc_wl_init(struct intel_display *display)
>  
>  void intel_dmc_wl_enable(struct intel_display *display)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_dmc_wl *wl = &display->wl;
>  	unsigned long flags;
>  
> @@ -152,7 +150,7 @@ void intel_dmc_wl_enable(struct intel_display *display)
>  	 * wakelock, because we're just enabling it, so call the
>  	 * non-locking version directly here.
>  	 */
> -	__intel_de_rmw_nowl(i915, DMC_WAKELOCK_CFG, 0, DMC_WAKELOCK_CFG_ENABLE);
> +	__intel_de_rmw_nowl(display, DMC_WAKELOCK_CFG, 0, DMC_WAKELOCK_CFG_ENABLE);
>  
>  	wl->enabled = true;
>  	wl->taken = false;
> @@ -163,7 +161,6 @@ void intel_dmc_wl_enable(struct intel_display *display)
>  
>  void intel_dmc_wl_disable(struct intel_display *display)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_dmc_wl *wl = &display->wl;
>  	unsigned long flags;
>  
> @@ -178,7 +175,7 @@ void intel_dmc_wl_disable(struct intel_display *display)
>  		goto out_unlock;
>  
>  	/* Disable wakelock in DMC */
> -	__intel_de_rmw_nowl(i915, DMC_WAKELOCK_CFG, DMC_WAKELOCK_CFG_ENABLE, 0);
> +	__intel_de_rmw_nowl(display, DMC_WAKELOCK_CFG, DMC_WAKELOCK_CFG_ENABLE, 0);
>  
>  	refcount_set(&wl->refcount, 0);
>  	wl->enabled = false;
> @@ -190,7 +187,6 @@ void intel_dmc_wl_disable(struct intel_display *display)
>  
>  void intel_dmc_wl_get(struct intel_display *display, i915_reg_t reg)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_dmc_wl *wl = &display->wl;
>  	unsigned long flags;
>  
> @@ -219,10 +215,10 @@ void intel_dmc_wl_get(struct intel_display *display, i915_reg_t reg)
>  	 * run yet.
>  	 */
>  	if (!wl->taken) {
> -		__intel_de_rmw_nowl(i915, DMC_WAKELOCK1_CTL, 0,
> +		__intel_de_rmw_nowl(display, DMC_WAKELOCK1_CTL, 0,
>  				    DMC_WAKELOCK_CTL_REQ);
>  
> -		if (__intel_de_wait_for_register_nowl(i915, DMC_WAKELOCK1_CTL,
> +		if (__intel_de_wait_for_register_nowl(display, DMC_WAKELOCK1_CTL,
>  						      DMC_WAKELOCK_CTL_ACK,
>  						      DMC_WAKELOCK_CTL_ACK,
>  						      DMC_WAKELOCK_CTL_TIMEOUT)) {
> -- 
> 2.39.2
> 

  reply	other threads:[~2024-04-17 14:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 13:02 [PATCH v4 0/9] drm/i915: better high level abstraction for display Jani Nikula
2024-04-17 13:02 ` [PATCH v4 1/9] drm/i915/display: add intel_display -> drm_device backpointer Jani Nikula
2024-04-17 13:02 ` [PATCH v4 2/9] drm/i915/display: add generic to_intel_display() macro Jani Nikula
2024-04-17 13:02 ` [PATCH v4 3/9] drm/i915: add generic __to_intel_display() Jani Nikula
2024-04-17 13:02 ` [PATCH v4 4/9] drm/i915/display: accept either i915 or display for feature tests Jani Nikula
2024-04-17 13:58   ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 5/9] drm/i915/quirks: convert struct drm_i915_private to struct intel_display Jani Nikula
2024-04-17 13:02 ` [PATCH v4 6/9] drm/i915/display: rename __intel_wait_for_register_nowl() to indicate intel_de_ Jani Nikula
2024-04-17 13:59   ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 7/9] drm/i915/dmc: convert dmc wakelock interface to struct intel_display Jani Nikula
2024-04-17 14:31   ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 8/9] drm/i915/de: allow intel_display and drm_i915_private for de functions Jani Nikula
2024-04-17 14:00   ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 9/9] drm/i915/dmc: use struct intel_display more Jani Nikula
2024-04-17 14:31   ` Rodrigo Vivi [this message]
2024-04-18 18:21     ` Jani Nikula
2024-04-17 13:26 ` ✓ CI.Patch_applied: success for drm/i915: better high level abstraction for display (rev3) Patchwork
2024-04-17 13:26 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-17 13:27 ` ✓ CI.KUnit: success " Patchwork
2024-04-17 13:39 ` ✓ CI.Build: " Patchwork
2024-04-17 13:42 ` ✓ CI.Hooks: " Patchwork
2024-04-17 14:00 ` ✗ CI.checksparse: warning " Patchwork
2024-04-17 14:25 ` ✓ CI.BAT: success " Patchwork
2024-04-18 23:43 ` ✗ 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=Zh_dVoy11dTY1IaM@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=luciano.coelho@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;
as well as URLs for NNTP newsgroup(s).