All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()
@ 2017-04-10  8:53 Michal Wajdeczko
  2017-04-10  9:11 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-04-10  9:47 ` [PATCH] " Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Wajdeczko @ 2017-04-10  8:53 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni

There is no need to use macros as we can use generic function.
And we can save ~2000 bytes in driver footprint.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b6b40cd..63f9dae4 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7697,22 +7697,30 @@ static void ironlake_init_pch_refclk(struct drm_i915_private *dev_priv)
 
 static void lpt_reset_fdi_mphy(struct drm_i915_private *dev_priv)
 {
+	int ret;
 	uint32_t tmp;
 
 	tmp = I915_READ(SOUTH_CHICKEN2);
 	tmp |= FDI_MPHY_IOSFSB_RESET_CTL;
 	I915_WRITE(SOUTH_CHICKEN2, tmp);
 
-	if (wait_for_us(I915_READ(SOUTH_CHICKEN2) &
-			FDI_MPHY_IOSFSB_RESET_STATUS, 100))
+	ret = __intel_wait_for_register_fw(dev_priv,
+					   SOUTH_CHICKEN2,
+					   FDI_MPHY_IOSFSB_RESET_STATUS,
+					   FDI_MPHY_IOSFSB_RESET_STATUS,
+					   100, 0, &tmp);
+	if (ret)
 		DRM_ERROR("FDI mPHY reset assert timeout\n");
 
-	tmp = I915_READ(SOUTH_CHICKEN2);
 	tmp &= ~FDI_MPHY_IOSFSB_RESET_CTL;
 	I915_WRITE(SOUTH_CHICKEN2, tmp);
 
-	if (wait_for_us((I915_READ(SOUTH_CHICKEN2) &
-			 FDI_MPHY_IOSFSB_RESET_STATUS) == 0, 100))
+	ret = __intel_wait_for_register_fw(dev_priv,
+					   SOUTH_CHICKEN2,
+					   FDI_MPHY_IOSFSB_RESET_STATUS,
+					   0,
+					   100, 0, &tmp);
+	if (ret)
 		DRM_ERROR("FDI mPHY reset de-assert timeout\n");
 }
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()
  2017-04-10  8:53 [PATCH] drm/i915: Use wait_for_register in lpt_reset_fdi_mphy() Michal Wajdeczko
@ 2017-04-10  9:11 ` Patchwork
  2017-04-10  9:47 ` [PATCH] " Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-04-10  9:11 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()
URL   : https://patchwork.freedesktop.org/series/22758/
State : success

== Summary ==

Series 22758v1 drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()
https://patchwork.freedesktop.org/api/1.0/series/22758/revisions/1/mbox/

Test gem_exec_flush:
        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:427s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:428s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:567s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:514s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time:544s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:492s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:483s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:407s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:408s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:425s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:489s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:470s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:450s
fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:568s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:460s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time:567s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:461s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:487s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:433s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:533s
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29  time:402s

d86f5fa557fdf089bdb5b51f625a7f5967f11015 drm-tip: 2017y-04m-10d-06h-38m-49s UTC integration manifest
bb5c4e4 drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4453/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Use wait_for_register in lpt_reset_fdi_mphy()
  2017-04-10  8:53 [PATCH] drm/i915: Use wait_for_register in lpt_reset_fdi_mphy() Michal Wajdeczko
  2017-04-10  9:11 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-04-10  9:47 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2017-04-10  9:47 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: intel-gfx, Paulo Zanoni

On Mon, Apr 10, 2017 at 08:53:25AM +0000, Michal Wajdeczko wrote:
> There is no need to use macros as we can use generic function.
> And we can save ~2000 bytes in driver footprint.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b6b40cd..63f9dae4 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7697,22 +7697,30 @@ static void ironlake_init_pch_refclk(struct drm_i915_private *dev_priv)
>  
>  static void lpt_reset_fdi_mphy(struct drm_i915_private *dev_priv)
>  {
> +	int ret;
>  	uint32_t tmp;
>  
>  	tmp = I915_READ(SOUTH_CHICKEN2);
>  	tmp |= FDI_MPHY_IOSFSB_RESET_CTL;
>  	I915_WRITE(SOUTH_CHICKEN2, tmp);
>  
> -	if (wait_for_us(I915_READ(SOUTH_CHICKEN2) &
> -			FDI_MPHY_IOSFSB_RESET_STATUS, 100))
> +	ret = __intel_wait_for_register_fw(dev_priv,
> +					   SOUTH_CHICKEN2,
> +					   FDI_MPHY_IOSFSB_RESET_STATUS,
> +					   FDI_MPHY_IOSFSB_RESET_STATUS,
> +					   100, 0, &tmp);
> +	if (ret)
>  		DRM_ERROR("FDI mPHY reset assert timeout\n");

If we aren't using ret, and if the function remains neatly aligned I
would have just done

	if ( __intel_wait_for_register_fw(dev_priv, ...))
  		DRM_ERROR("FDI mPHY reset assert timeout\n");

I would also let it have a 10ms max timeout - there's no downside. We
didn't before because of the expense of the wait_for() loops, and this
must be a waitable context.

Hmm. We do want __inte_wait_for_register_fw:
	might_sleep_if(fast_timeout_us > 10 || slow_timeout_ms);
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-10  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10  8:53 [PATCH] drm/i915: Use wait_for_register in lpt_reset_fdi_mphy() Michal Wajdeczko
2017-04-10  9:11 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-10  9:47 ` [PATCH] " Chris Wilson

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.