[PATCH xf86-video-amdgpu 10/13] Push staged color properties when DPMS state toggles On

Michel Dänzer michel at daenzer.net
Wed May 16 17:10:16 UTC 2018


On 2018-05-03 08:31 PM, sunpeng.li at amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li at amd.com>
> 
> This will persist color management properties on a CRTC across DPMS
> state changes.
> 
> Signed-off-by: Leo (Sunpeng) Li <sunpeng.li at amd.com>
> ---
>  src/drmmode_display.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 45c582c..06ae902 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1294,6 +1294,7 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
>  	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
>  	CARD64 ust;
>  	int ret;
> +	int i;
>  
>  	if (drmmode_crtc->dpms_mode == DPMSModeOn && mode != DPMSModeOn) {
>  		uint32_t seq;
> @@ -1341,6 +1342,11 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
>  			drmmode_crtc->interpolated_vblanks += delta_seq;
>  		}
>  
> +		for (i = 0; i < CM_NUM_PROPS; i++) {
> +			if (i == CM_GAMMA_LUT_SIZE || i == CM_DEGAMMA_LUT_SIZE)
> +				continue;
> +			drmmode_crtc_push_cm_prop(crtc, i);
> +		}
>  	}
>  	drmmode_crtc->dpms_mode = mode;
>  }
> 

This and patch 11 smell like workarounds for a kernel issue. The kernel
should preserve the property values regardless of DPMS state.

This probably explains something I just discovered: the legacy gamma LUT
becomes ineffective after turning a CRTC off and on again with DC,
whereas it's preserved without DC.


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


More information about the amd-gfx mailing list