Workaround for a bug in xrandr

Michel Dänzer michel at daenzer.net
Mon Apr 28 02:35:45 PDT 2014


On 27.04.2014 02:48, Christian König wrote:
> Hi everyone,
> 
> today I noticed that with X server 1.15.1 and current xf86-video-ati
> master that page flipping won't work any more after I switched the mode
> using xrandr. It looks like Ilija Hadzic already stumbled over the same
> issue back in 2012 but didn't reported it upstream (at least I couldn't
> find any reference to it):
> https://github.com/ihadzic/vcrtcm-doc/blob/master/patches/X_1_12/0001-xf86-crtc-HACK-do-not-touch-DPMS-in-xf86DisableUnuse.patch
> 
> 
> Basic problem is that xrandr calls xf86DisableUnusedFunctions while
> switching the mode which in turn calls the DPMS off function which is
> then never turned on again. This results in both page flipping getting
> disabled and vblank handling not working any more.
> 
> Attached is a workaround for xf86-video-ati which just turn DPMS on
> again when the mode set happens, but I'm pretty sure that this isn't the
> right solution to the problem.
> 
> Ideas?

Someone on the xorg-devel mailing list might have one, adding to Cc.


> From 18b745f0ea94c3f7048d11ef5b86b652019c9fed Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig at amd.com>
> Date: Sat, 26 Apr 2014 19:39:46 +0200
> Subject: [PATCH] workaround for xrandr turning DPMS off, but never on again
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  src/drmmode_display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index fc99128..a0a1ea1 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -457,6 +457,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
>  	uint32_t tiling_flags = 0;
>  	int height;
>  
> +	/* workaround for xrandr turning DPMS off, but never on again */
> +	drmmode_crtc_dpms(crtc, DPMSModeOn);
> +
>  	if (info->allowColorTiling) {
>  		if (info->ChipFamily >= CHIP_FAMILY_R600)
>  			tiling_flags |= RADEON_TILING_MICRO;
> -- 1.9.1 



-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer


More information about the xorg-driver-ati mailing list