dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once
@ 2016-06-24  7:59 Michel Dänzer
  2016-06-24  8:17 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2016-06-24  7:59 UTC (permalink / raw)
  To: dri-devel

From: Michel Dänzer <michel.daenzer@amd.com>

Consolidate the _DRM_VBLANK_NEXTONMISS handling between drm_wait_vblank
and drm_queue_vblank_event.

This is a cleanup spotted while working on other changes.

(The way it was previously handled could also theoretically result in
drm_queue_vblank_event unnecessarily bumping vblwait->request.sequence,
if the vblank counter happened to increment between the
drm_vblank_count(_and_time) calls in each function, but that's unlikely)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/drm_irq.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 3c1a6f1..39ea4fc 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1685,12 +1685,6 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
 
 	seq = drm_vblank_count_and_time(dev, pipe, &now);
 
-	if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) &&
-	    (seq - vblwait->request.sequence) <= (1 << 23)) {
-		vblwait->request.sequence = seq + 1;
-		vblwait->reply.sequence = vblwait->request.sequence;
-	}
-
 	DRM_DEBUG("event on vblank count %d, current %d, crtc %u\n",
 		  vblwait->request.sequence, seq, pipe);
 
@@ -1787,6 +1781,11 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
 		goto done;
 	}
 
+	if ((flags & _DRM_VBLANK_NEXTONMISS) &&
+	    (seq - vblwait->request.sequence) <= (1 << 23)) {
+		vblwait->request.sequence = seq + 1;
+	}
+
 	if (flags & _DRM_VBLANK_EVENT) {
 		/* must hold on to the vblank ref until the event fires
 		 * drm_vblank_put will be called asynchronously
@@ -1794,11 +1793,6 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
 		return drm_queue_vblank_event(dev, pipe, vblwait, file_priv);
 	}
 
-	if ((flags & _DRM_VBLANK_NEXTONMISS) &&
-	    (seq - vblwait->request.sequence) <= (1<<23)) {
-		vblwait->request.sequence = seq + 1;
-	}
-
 	DRM_DEBUG("waiting on vblank count %d, crtc %u\n",
 		  vblwait->request.sequence, pipe);
 	vblank->last_wait = vblwait->request.sequence;
-- 
2.8.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once
  2016-06-24  7:59 [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once Michel Dänzer
@ 2016-06-24  8:17 ` Chris Wilson
  2016-07-11  7:04   ` Michel Dänzer
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-06-24  8:17 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: dri-devel

On Fri, Jun 24, 2016 at 04:59:47PM +0900, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> Consolidate the _DRM_VBLANK_NEXTONMISS handling between drm_wait_vblank
> and drm_queue_vblank_event.
> 
> This is a cleanup spotted while working on other changes.
> 
> (The way it was previously handled could also theoretically result in
> drm_queue_vblank_event unnecessarily bumping vblwait->request.sequence,
> if the vblank counter happened to increment between the
> drm_vblank_count(_and_time) calls in each function, but that's unlikely)
> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

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

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

* Re: [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once
  2016-06-24  8:17 ` Chris Wilson
@ 2016-07-11  7:04   ` Michel Dänzer
  2016-07-12 10:55     ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2016-07-11  7:04 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter; +Cc: dri-devel

On 24.06.2016 17:17, Chris Wilson wrote:
> On Fri, Jun 24, 2016 at 04:59:47PM +0900, Michel Dänzer wrote:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> Consolidate the _DRM_VBLANK_NEXTONMISS handling between drm_wait_vblank
>> and drm_queue_vblank_event.
>>
>> This is a cleanup spotted while working on other changes.
>>
>> (The way it was previously handled could also theoretically result in
>> drm_queue_vblank_event unnecessarily bumping vblwait->request.sequence,
>> if the vblank counter happened to increment between the
>> drm_vblank_count(_and_time) calls in each function, but that's unlikely)
>>
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks, Chris!


Daniel, can you pick this up?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once
  2016-07-11  7:04   ` Michel Dänzer
@ 2016-07-12 10:55     ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-07-12 10:55 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: Daniel Vetter, dri-devel

On Mon, Jul 11, 2016 at 04:04:41PM +0900, Michel Dänzer wrote:
> On 24.06.2016 17:17, Chris Wilson wrote:
> > On Fri, Jun 24, 2016 at 04:59:47PM +0900, Michel Dänzer wrote:
> >> From: Michel Dänzer <michel.daenzer@amd.com>
> >>
> >> Consolidate the _DRM_VBLANK_NEXTONMISS handling between drm_wait_vblank
> >> and drm_queue_vblank_event.
> >>
> >> This is a cleanup spotted while working on other changes.
> >>
> >> (The way it was previously handled could also theoretically result in
> >> drm_queue_vblank_event unnecessarily bumping vblwait->request.sequence,
> >> if the vblank counter happened to increment between the
> >> drm_vblank_count(_and_time) calls in each function, but that's unlikely)
> >>
> >> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Thanks, Chris!
> 
> 
> Daniel, can you pick this up?

Done. Thanks for patch&review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-07-12 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-24  7:59 [PATCH] drm: Only handle _DRM_VBLANK_NEXTONMISS once Michel Dänzer
2016-06-24  8:17 ` Chris Wilson
2016-07-11  7:04   ` Michel Dänzer
2016-07-12 10:55     ` Daniel Vetter

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