From 29de2859e296b4e9f0b4ae7564c353c5518f3f08 Mon Sep 17 00:00:00 2001 From: "Leo Li (Sunpeng)" Date: Fri, 15 Jun 2018 17:05:28 -0400 Subject: Update color properties on output_get_property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notify RandR of any updated color properties on the output's CRTC when its get_property() hook is called. v2: Remove per-CRTC check for color management support. Signed-off-by: Leo (Sunpeng) Li Signed-off-by: Michel Dänzer --- src/drmmode_display.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index b30bf76..baffa88 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2125,6 +2125,27 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property, static Bool drmmode_output_get_property(xf86OutputPtr output, Atom property) { + drmmode_crtc_private_ptr drmmode_crtc; + enum drmmode_cm_prop cm_prop_id; + int ret; + + /* First, see if it's a cm property */ + cm_prop_id = get_cm_enum_from_str(NameForAtom(property)); + if (output->crtc && cm_prop_id != CM_INVALID_PROP) { + drmmode_crtc = output->crtc->driver_private; + + ret = rr_configure_and_change_cm_property(output, drmmode_crtc, + cm_prop_id); + if (ret) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "Error getting color property: %d\n", + ret); + return FALSE; + } + return TRUE; + } + + /* Otherwise, must be an output property. */ return TRUE; } -- cgit v1.2.3