[PATCH xf86-video-amdgpu v2 4/7] Update color properties on output_get_property
sunpeng.li at amd.com
sunpeng.li at amd.com
Fri Jun 15 21:05:28 UTC 2018
From: "Leo (Sunpeng) Li" <sunpeng.li at amd.com>
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 at amd.com>
---
src/drmmode_display.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 42e8ba3..a7d532c 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;
}
--
2.7.4
More information about the amd-gfx
mailing list