summaryrefslogtreecommitdiffstats
path: root/src/glx/dri3_priv.h
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-03-14 18:53:42 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-10-29 15:13:58 -0700
commit26122e09a304061e46690e1b9da2e36a527b3e2e (patch)
tree2c22a14cb1dbcf5ebf733b41e6d462418a14fee3 /src/glx/dri3_priv.h
parent62b07b934ecce1f370f3566ad3613341ff86aba1 (diff)
downloadexternal_mesa3d-26122e09a304061e46690e1b9da2e36a527b3e2e.zip
external_mesa3d-26122e09a304061e46690e1b9da2e36a527b3e2e.tar.gz
external_mesa3d-26122e09a304061e46690e1b9da2e36a527b3e2e.tar.bz2
glx/dri3: Implement LIBGL_SHOW_FPS=1 for DRI3/Present.
v2: Use the UST value provided in the PRESENT_COMPLETE_NOTIFY event rather than gettimeofday(), which gives us the presentation time instead of the time when SwapBuffers was called. Suggested by Keith Packard. This relies on the fact that the X DRI3/Present implementations use microseconds for UST. v3: Properly ignore PresentCompleteKindMSCNotify; multiply in 64 bits (caught by Keith Packard). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Keith Packard <keithp@keithp.com> [v3] Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v1]
Diffstat (limited to 'src/glx/dri3_priv.h')
-rw-r--r--src/glx/dri3_priv.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index bdfe224..8e46640 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -138,7 +138,7 @@ struct dri3_screen {
int fd;
int is_different_gpu;
- Bool show_fps;
+ int show_fps_interval;
};
struct dri3_context
@@ -198,6 +198,10 @@ struct dri3_drawable {
xcb_present_event_t eid;
xcb_gcontext_t gc;
xcb_special_event_t *special_event;
+
+ /* LIBGL_SHOW_FPS support */
+ uint64_t previous_ust;
+ unsigned frames;
};