From: "Leo (Sunpeng) Li" <sunpeng.li@xxxxxxx> The functions insert into the output resource creation, and property change functions. CRTC destroy is also hooked-up for proper cleanup of the CRTC property list. Signed-off-by: Leo (Sunpeng) Li <sunpeng.li at amd.com> --- src/drmmode_display.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 23f9ad3..1966fd2 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1336,7 +1336,7 @@ static xf86CrtcFuncsRec drmmode_crtc_funcs = { .shadow_create = drmmode_crtc_shadow_create, .shadow_allocate = drmmode_crtc_shadow_allocate, .shadow_destroy = drmmode_crtc_shadow_destroy, - .destroy = NULL, /* XXX */ + .destroy = drmmode_crtc_destroy, .set_scanout_pixmap = drmmode_set_scanout_pixmap, }; @@ -1933,6 +1933,9 @@ static void drmmode_output_create_resources(xf86OutputPtr output) } } } + + if (output->crtc) + drmmode_crtc_create_resources(output->crtc, output); } /** @@ -2009,6 +2012,20 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property, AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn); int i; + if (output->crtc) { + int ret; + ret = drmmode_crtc_set_property(output->crtc, property, value); + if (ret == 0) + return TRUE; + if (ret < 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "Set CRTC mode property failed with %d\n", + ret); + return FALSE; + } + /* Else, continue */ + } + for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; -- 2.7.4