summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Redlewski <predlewski@gmail.com>2015-06-24 18:44:39 +0200
committerMichel Dänzer <michel@daenzer.net>2015-06-25 16:47:33 +0900
commitddaba449e8d6fe9fc0d97085e4045843fd8d7af9 (patch)
treed4012f578a98ca29cae2aed63346e69ded0f0ff3
parentacc11877423ecd81a6e0a7f38466f80e43efee20 (diff)
Disable CRTCs when disabling the outputs
When turning the outputs off (DPMSModeOff), CRTCs stayed enabled. This led to higher gpu temperatures than with fglrx driver. v2: when entering DPMS also disable active CRTCs v3: use drmmode_set_mode_major() for enabling CRTCs when leaving DPMS Signed-off-by: Piotr Redlewski <predlewski@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/drmmode_display.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 205ef6a8..4291f4d3 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -342,7 +342,18 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
static void
drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
- /* Nothing to do. drmmode_do_crtc_dpms() is called as appropriate */
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
+
+ /* Disable unused CRTCs */
+ if (!crtc->enabled || mode != DPMSModeOn) {
+ drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ 0, 0, 0, NULL, 0, NULL);
+ return;
+ }
+
+ crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation,
+ crtc->x, crtc->y);
}
static PixmapPtr