summaryrefslogtreecommitdiff
path: root/src/drmmode_display.h
diff options
context:
space:
mode:
authorIlija Hadzic <ilijahadzic@gmail.com>2013-05-08 22:39:40 -0400
committerMichel Dänzer <michel@daenzer.net>2013-05-29 15:09:13 +0200
commit5fd2eb5d12cea32927a9e6c6ce4afd18aa7d046a (patch)
tree14fe7c18e24b44a589cadf03577422e80f278b7d /src/drmmode_display.h
parente41ad30d09be4962cfb1942b0b9f63875dbb2d2a (diff)
drmmode: calculate interpolated vblanks while in dpms-off state
This adds provisions for interpolating vblanks while the CRTC is in DPMS-off state. When entering DPMS-off state, we record the last vblank time, sequence number and frame rate in CRTC-private structure. When going back to DPMS-on state we read the current time and calculate how long we have been off. Then we derive how many vblanks that would have been had the CRTC remained running. These are the interpolated vblanks. Finally, we accumulate the number of interpolated vblanks in CRTC-private structure to get the number of interpolated vblanks over the system lifetime. v2: Track frame rate instead of vblank period. The former eliminates some roundoff errors. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/drmmode_display.h')
-rw-r--r--src/drmmode_display.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index add2ee48..2fccfda7 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -76,6 +76,10 @@ typedef struct {
struct radeon_bo *rotate_bo;
unsigned rotate_fb_id;
int dpms_mode;
+ CARD64 dpms_last_ust;
+ uint32_t dpms_last_seq;
+ int dpms_last_fps;
+ uint32_t interpolated_vblanks;
uint16_t lut_r[256], lut_g[256], lut_b[256];
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;