diff options
author | Leo Li (Sunpeng) <sunpeng.li@amd.com> | 2018-06-15 17:05:28 -0400 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2018-06-26 17:31:37 +0200 |
commit | 29de2859e296b4e9f0b4ae7564c353c5518f3f08 (patch) | |
tree | 051a560a6c1f6177dc5d5bff18f71eb108fa1995 | |
parent | 639acf54b4de6f62000d12cc6dbf4f5e49cae888 (diff) |
Update color properties on output_get_property
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 <sunpeng.li@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r-- | src/drmmode_display.c | 21 |
1 files changed, 21 insertions, 0 deletions
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; } |