Skip to contentSkip to conversation

Call drmmode_do_crtc_dpms from drmmode_crtc_dpms as well

PATCH In review Michel Dänzer 2 participants 3 messages May 18, 2018 – May 24, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

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
index 0ee89961a..5d4627810 100644
@@ -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

#2 lore raw

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
index 5d4627810..8a1a201a8 100644
@@ -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
Reviewed-by Leo (Sunpeng) Li
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

Leo pointed out that drmmode_do_crtc_dpms wasn't getting called when turning off an output with

Quoted 7 lines
  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.

Series is

Quoted 10 lines
---
  src/drmmode_display.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
src/drmmode_display.c +0 -0
index 0ee89961a..5d4627810 100644

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