public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] UXA: Wait until a pageflip actually completes to report it.
@ 2014-05-06  6:05 Jamey Sharp
  2014-05-07 15:55 ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Jamey Sharp @ 2014-05-06  6:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: Theo Hill

UXA was reporting page-flip completion as soon as the flip was scheduled
with the kernel, instead of waiting for the kernel to indicate that the
flip had actually completed.

Moving the DRI2SwapComplete call to the right place fixes all of our
Piglit tests for OML_sync_control when run on xf86-video-intel/UXA,
aside from a bit of difficult-to-reproduce flakiness when using a
divisor > 1.

This also eliminates a compile-time and run-time warning when built
against an xserver with "Warn on DRI2SwapComplete with constant UST/MSC"
applied.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Theo Hill <Theo0x48@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
---
 src/uxa/intel_dri.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c
index ca58052..3745767 100644
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -932,10 +932,6 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 
 	/* Then flip DRI2 pointers and update the screen pixmap */
 	I830DRI2ExchangeBuffers(intel, info->front, info->back);
-	DRI2SwapComplete(info->client, draw, 0, 0, 0,
-			 DRI2_EXCHANGE_COMPLETE,
-			 info->event_complete,
-			 info->event_data);
 	return TRUE;
 }
 
@@ -1090,6 +1086,12 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
 		assert(intel->pending_flip[flip_info->pipe] == flip_info);
 		intel->pending_flip[flip_info->pipe] = NULL;
 
+		DRI2SwapComplete(flip_info->client, drawable,
+				 frame, tv_sec, tv_usec,
+				 DRI2_EXCHANGE_COMPLETE,
+				 flip_info->event_complete,
+				 flip_info->event_data);
+
 		chain = flip_info->chain;
 		if (chain) {
 			DrawablePtr chain_drawable = NULL;
-- 
1.9.2

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

end of thread, other threads:[~2014-05-08 21:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06  6:05 [PATCH] UXA: Wait until a pageflip actually completes to report it Jamey Sharp
2014-05-07 15:55 ` Chris Wilson
2014-05-08  5:44   ` Jamey Sharp
2014-05-08  6:08     ` Chris Wilson
2014-05-08 15:54       ` Eric Anholt
2014-05-08 20:43         ` Chris Wilson
2014-05-08 20:55           ` Eric Anholt
2014-05-08 21:09             ` Chris Wilson

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