public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
@ 2016-08-03 21:17 Rodrigo Vivi
  2016-08-03 21:17 ` [PATCH 2/2] drm: Remove legacy drm_wait_one_vblank(dev, pipe) Rodrigo Vivi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rodrigo Vivi @ 2016-08-03 21:17 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Rodrigo Vivi

No functional change.

This is the last user of legacy function so we will be able
to clean up drm_irq.c a bit.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_drv.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 50cdc89..37a3ae8 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1202,7 +1202,10 @@ intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
 static inline void
 intel_wait_for_vblank(struct drm_device *dev, int pipe)
 {
-	drm_wait_one_vblank(dev, pipe);
+	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
+
+	drm_crtc_wait_one_vblank(crtc);
 }
 static inline void
 intel_wait_for_vblank_if_active(struct drm_device *dev, int pipe)
-- 
2.5.5

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

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

* [PATCH 2/2] drm: Remove legacy drm_wait_one_vblank(dev, pipe).
  2016-08-03 21:17 [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Rodrigo Vivi
@ 2016-08-03 21:17 ` Rodrigo Vivi
  2016-08-04  5:40 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Patchwork
  2016-08-04  7:38 ` [Intel-gfx] [PATCH 1/2] " Jani Nikula
  2 siblings, 0 replies; 5+ messages in thread
From: Rodrigo Vivi @ 2016-08-03 21:17 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Rodrigo Vivi

Now that this is not used anywhere else anymore we can go ahead
and remove the legacy version.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/drm_irq.c | 35 +++++++++++------------------------
 include/drm/drm_irq.h     |  1 -
 2 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 523419a..6250518 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1194,16 +1194,17 @@ void drm_crtc_vblank_put(struct drm_crtc *crtc)
 EXPORT_SYMBOL(drm_crtc_vblank_put);
 
 /**
- * drm_wait_one_vblank - wait for one vblank
- * @dev: DRM device
- * @pipe: CRTC index
+ * drm_crtc_wait_one_vblank - wait for one vblank
+ * @crtc: DRM crtc
  *
- * This waits for one vblank to pass on @pipe, using the irq driver interfaces.
- * It is a failure to call this when the vblank irq for @pipe is disabled, e.g.
+ * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
+ * It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
  * due to lack of driver support or because the crtc is off.
  */
-void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
+void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
+	unsigned int pipe = drm_crtc_index(crtc);
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 	int ret;
 	u32 last;
@@ -1211,33 +1212,19 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
 	if (WARN_ON(pipe >= dev->num_crtcs))
 		return;
 
-	ret = drm_vblank_get(dev, pipe);
+	ret = drm_crtc_vblank_get(crtc);
 	if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", pipe, ret))
 		return;
 
-	last = drm_vblank_count(dev, pipe);
+	last = drm_crtc_vblank_count(crtc);
 
 	ret = wait_event_timeout(vblank->queue,
-				 last != drm_vblank_count(dev, pipe),
+				 last != drm_crtc_vblank_count(crtc),
 				 msecs_to_jiffies(100));
 
 	WARN(ret == 0, "vblank wait timed out on crtc %i\n", pipe);
 
-	drm_vblank_put(dev, pipe);
-}
-EXPORT_SYMBOL(drm_wait_one_vblank);
-
-/**
- * drm_crtc_wait_one_vblank - wait for one vblank
- * @crtc: DRM crtc
- *
- * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
- * It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
- * due to lack of driver support or because the crtc is off.
- */
-void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
-{
-	drm_wait_one_vblank(crtc->dev, drm_crtc_index(crtc));
+	drm_crtc_vblank_put(crtc);
 }
 EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
 
diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
index 406f954..b90d5ee 100644
--- a/include/drm/drm_irq.h
+++ b/include/drm/drm_irq.h
@@ -148,7 +148,6 @@ extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
 extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
 extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
-extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
 extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_reset(struct drm_crtc *crtc);
-- 
2.5.5

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

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

* ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
  2016-08-03 21:17 [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Rodrigo Vivi
  2016-08-03 21:17 ` [PATCH 2/2] drm: Remove legacy drm_wait_one_vblank(dev, pipe) Rodrigo Vivi
@ 2016-08-04  5:40 ` Patchwork
  2016-08-04  7:38 ` [Intel-gfx] [PATCH 1/2] " Jani Nikula
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2016-08-04  5:40 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
URL   : https://patchwork.freedesktop.org/series/10627/
State : failure

== Summary ==

Applying: drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
Applying: drm: Remove legacy drm_wait_one_vblank(dev, pipe).
fatal: sha1 information is lacking or useless (drivers/gpu/drm/drm_irq.c).
error: could not build fake ancestor
Patch failed at 0002 drm: Remove legacy drm_wait_one_vblank(dev, pipe).
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

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

* Re: [Intel-gfx] [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
  2016-08-03 21:17 [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Rodrigo Vivi
  2016-08-03 21:17 ` [PATCH 2/2] drm: Remove legacy drm_wait_one_vblank(dev, pipe) Rodrigo Vivi
  2016-08-04  5:40 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Patchwork
@ 2016-08-04  7:38 ` Jani Nikula
  2016-08-04  7:52   ` Ville Syrjälä
  2 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2016-08-04  7:38 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Rodrigo Vivi

On Thu, 04 Aug 2016, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> No functional change.
>
> This is the last user of legacy function so we will be able
> to clean up drm_irq.c a bit.
>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_drv.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 50cdc89..37a3ae8 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1202,7 +1202,10 @@ intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
>  static inline void
>  intel_wait_for_vblank(struct drm_device *dev, int pipe)
>  {
> -	drm_wait_one_vblank(dev, pipe);
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
> +
> +	drm_crtc_wait_one_vblank(crtc);

With these changes, in almost all intel_wait_for_vblank() call paths
we'll have crtc available, so we end up calling
intel_wait_for_vblank(intel_crtc->pipe), which will then be converted
back to drm_crtc via dev_priv->pipe_to_crtc_mapping[pipe], and again to
pipe using drm_crtc_index(crtc)...

I'm tempted to say we should *first* replace all intel_wait_for_vblank()
calls with drm_crtc_wait_one_vblank() where possible. After that, we
might just call
drm_crtc_wait_one_vblank(dev_priv->pipe_to_crtc_mapping[pipe])
everywhere else.

BR,
Jani.



>  }
>  static inline void
>  intel_wait_for_vblank_if_active(struct drm_device *dev, int pipe)

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one.
  2016-08-04  7:38 ` [Intel-gfx] [PATCH 1/2] " Jani Nikula
@ 2016-08-04  7:52   ` Ville Syrjälä
  0 siblings, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2016-08-04  7:52 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel, Rodrigo Vivi

On Thu, Aug 04, 2016 at 10:38:02AM +0300, Jani Nikula wrote:
> On Thu, 04 Aug 2016, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > No functional change.
> >
> > This is the last user of legacy function so we will be able
> > to clean up drm_irq.c a bit.
> >
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_drv.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 50cdc89..37a3ae8 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1202,7 +1202,10 @@ intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state)
> >  static inline void
> >  intel_wait_for_vblank(struct drm_device *dev, int pipe)
> >  {
> > -	drm_wait_one_vblank(dev, pipe);
> > +	struct drm_i915_private *dev_priv = to_i915(dev);
> > +	struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
> > +
> > +	drm_crtc_wait_one_vblank(crtc);
> 
> With these changes, in almost all intel_wait_for_vblank() call paths
> we'll have crtc available, so we end up calling
> intel_wait_for_vblank(intel_crtc->pipe), which will then be converted
> back to drm_crtc via dev_priv->pipe_to_crtc_mapping[pipe], and again to
> pipe using drm_crtc_index(crtc)...
> 
> I'm tempted to say we should *first* replace all intel_wait_for_vblank()
> calls with drm_crtc_wait_one_vblank() where possible. After that, we
> might just call
> drm_crtc_wait_one_vblank(dev_priv->pipe_to_crtc_mapping[pipe])
> everywhere else.

On a slight tangent, I'd like to see patches to 
s/dev_priv->pipe_to_crtc_mapping[pipe]/whatever_is_the_function_name(pipe)/
and make those functions return intel_crtc instead of drm_crtc.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-08-04  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 21:17 [PATCH 1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Rodrigo Vivi
2016-08-03 21:17 ` [PATCH 2/2] drm: Remove legacy drm_wait_one_vblank(dev, pipe) Rodrigo Vivi
2016-08-04  5:40 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] drm/i915: Use drm_crtc_vblank_wait_one_vblank instead the legacy one Patchwork
2016-08-04  7:38 ` [Intel-gfx] [PATCH 1/2] " Jani Nikula
2016-08-04  7:52   ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox