[PATCH xf86-video-amdgpu 3/5] Keep CRTC properties consistent

Michel Dänzer michel at daenzer.net
Mon Apr 9 15:03:32 UTC 2018


On 2018-03-26 10:00 PM, sunpeng.li at amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li at amd.com>
> 
> In cases where CRTC properties are updated without going through
> RRChangeOutputProperty, we don't update the properties in user land.
> 
> Consider setting legacy gamma. It doesn't go through
> RRChangeOutputProperty, but modifies the CRTC's color management
> properties. Unless they are updated, the user properties will remain
> stale.

Can you describe a bit more how the legacy gamma and the new properties
interact?


> Therefore, add a function to update user CRTC properties by querying DRM,
> and call it whenever legacy gamma is changed.

Note that drmmode_crtc_gamma_do_set is called from
drmmode_set_mode_major, i.e. on every modeset or under some
circumstances when a DRI3 client stops page flipping.


> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 1966fd2..45457c4 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -61,8 +61,13 @@
>  
>  #define DEFAULT_NOMINAL_FRAME_RATE 60
>  
> +/* Forward declarations */
> +
>  static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
>  
> +static void drmmode_crtc_update_resources(xf86CrtcPtr crtc);

Can you move the drmmode_crtc_update_resources such that the forward
declaration isn't necessary?


>  static Bool
>  AMDGPUZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, char *output_name)
>  {
> @@ -768,6 +773,7 @@ drmmode_crtc_gamma_do_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
>  
>  	drmModeCrtcSetGamma(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,
>  			    size, red, green, blue);
> +	drmmode_crtc_update_resources(crtc);
>  }
>  
>  Bool
> @@ -1653,10 +1659,15 @@ static Bool drmmode_property_ignore(drmModePropertyPtr prop)
>  * Configure and change the given output property through randr. Currently
>  * ignores DRM_MODE_PROP_ENU property types. Used as part of create_resources.
>  *
> +* @output: The output to configure and change the property on.
> +* @pmode_prop: The driver-private property object.

These two should have been added in patch 1.


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


More information about the amd-gfx mailing list