Call drmmode_do_crtc_dpms from drmmode_crtc_dpms as well
PATCH 1/2 Call drmmode_do_crtc_dpms from drmmode_crtc_dpms as well
From: Michel Dänzer <[email protected]>
Leo pointed out that drmmode_do_crtc_dpms wasn't getting called when turning off an output with
xrandr --output <output> --off
This meant that the vblank sequence number and timestamp wouldn't be saved before turning off the CRTC in this case.
--- src/drmmode_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
src/drmmode_display.c +1 -2
@@ -342,8 +342,7 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)/* Disable unused CRTCs and enable/disable active CRTCs */ if (!crtc->enabled || mode != DPMSModeOn) { -drmmode_crtc_wait_pending_event (drmmode_crtc, pAMDGPUEnt->fd, - drmmode_crtc->flip_pending); +drmmode_do_crtc_dpms (crtc, DPMSModeOff);drmModeSetCrtc (pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,0 ,0 ,0 ,NULL ,0 ,NULL );drmmode_fb_reference (pAMDGPUEnt->fd, &drmmode_crtc->fb,NULL );
Signature · 6 lines
2.17.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180518103354.13165-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 2/2 Use drmmode_crtc_dpms in drmmode_set_desired_modes
From: Michel Dänzer <[email protected]>
Simplifies the latter slightly.
--- src/drmmode_display.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
src/drmmode_display.c +1 -8
@@ -2660,7 +2660,6 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) {xf86CrtcConfigPtr config =XF86_CRTC_CONFIG_PTR (pScrn); -AMDGPUEntPtr pAMDGPUEnt =AMDGPUEntPriv (pScrn);unsigned num_desired =0 , num_on =0 ;int c;
@@ -2668,18 +2667,12 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,if (set_hw) {for (c =0 ; c < config->num_crtc; c++) {xf86CrtcPtr crtc = config->crtc[c]; -drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;/* Skip disabled CRTCs */ if (crtc->enabled)continue ; -drmmode_do_crtc_dpms (crtc, DPMSModeOff); -drmModeSetCrtc (pAMDGPUEnt->fd, - drmmode_crtc->mode_crtc->crtc_id, -0 ,0 ,0 ,NULL ,0 ,NULL ); -drmmode_fb_reference (pAMDGPUEnt->fd, - &drmmode_crtc->fb,NULL ); +drmmode_crtc_dpms (crtc, DPMSModeOff); } }
Signature · 6 lines
2.17.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Leo Li
Reviewed-by Leo (Sunpeng) LiQuoted 5 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
Leo pointed out that
drmmode_do_crtc_dpmswasn't getting called when turning off an output with
Quoted 7 lines
xrandr --output <output> --offThis meant that the vblank sequence number and timestamp wouldn't be saved before turning off the CRTC in this case.
Reported-by Leo (Sunpeng) Li <[email protected]>Signed-off-by Michel Dänzer <[email protected]>
Series is
Quoted 10 lines
--- src/drmmode_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)src/drmmode_display.c +0
-0
src/drmmode_display.c drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) · line 348
Quoted 9 lines
src/drmmode_display.c +1
-2@@ -342,8 +342,7 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)/* Disable unused CRTCs and enable/disable active CRTCs */ if (!crtc->enabled || mode != DPMSModeOn) { -drmmode_crtc_wait_pending_event (drmmode_crtc, pAMDGPUEnt->fd, - drmmode_crtc->flip_pending); +drmmode_do_crtc_dpms (crtc, DPMSModeOff);drmModeSetCrtc (pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,0 ,0 ,0 ,NULL ,0 ,NULL );drmmode_fb_reference (pAMDGPUEnt->fd, &drmmode_crtc->fb,NULL );
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx