modesetting: Track the CRTC's DPMS mode.

We don't want to try to vblank synchronize to monitors which are off.

In order to handle that properly, we need to know the CRTC's DPMS mode.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Kenneth Graunke 2014-12-18 17:55:29 -08:00 committed by Keith Packard
parent b51f804b1c
commit 8affaade2c
2 changed files with 6 additions and 12 deletions

View File

@ -193,18 +193,8 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,
static void
drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
#if 0
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
// drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
// drmmode_ptr drmmode = drmmode_crtc->drmmode;
/* bonghits in the randr 1.2 - uses dpms to disable crtc - bad buzz */
if (mode == DPMSModeOff) {
// drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
// 0, 0, 0, NULL, 0, NULL);
}
#endif
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_crtc->dpms_mode = mode;
}
#if 0
@ -347,6 +337,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
if (crtc->scrn->pScreen)
xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen);
crtc->funcs->dpms(crtc, DPMSModeOn);
/* go through all the outputs and force DPMS them back on? */
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];

View File

@ -86,6 +86,7 @@ typedef struct {
drmmode_ptr drmmode;
drmModeCrtcPtr mode_crtc;
uint32_t vblank_pipe;
int dpms_mode;
struct dumb_bo *cursor_bo;
Bool cursor_up;
unsigned rotate_fb_id;