[PATCH 4/4] drm/i915: Add set_protpery function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Shashank Sharma <shashank.sharma@xxxxxxxxx>

Add set_property function in CRTC ops.
This function will be required for color correction properties.
Userspace will do a set_property operation on CRTC object, to
do display tuning or color correction.

Signed-off-by: Shashank Sharma <shashank.sharma@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a289b44..7e3cdb2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11503,11 +11503,29 @@ out_config:
 	return ret;
 }
 
+static int intel_crtc_set_property(struct drm_crtc *crtc,
+			    struct drm_property *property, uint64_t val)
+{
+	struct drm_device *dev = crtc->dev;
+
+	DRM_DEBUG_DRIVER("\n");
+
+	/* CSC correction */
+	if (property == dev->mode_config.csc_property) {
+		if (!intel_clrmgr_set_csc(crtc, property, val)) {
+			DRM_ERROR("Failed to set CSC correction\n");
+			return -EFAULT;
+		}
+		DRM_DEBUG_DRIVER("Set CSC correction successful\n");
+	}
+}
+
 static const struct drm_crtc_funcs intel_crtc_funcs = {
 	.gamma_set = intel_crtc_gamma_set,
 	.set_config = intel_crtc_set_config,
 	.destroy = intel_crtc_destroy,
 	.page_flip = intel_crtc_page_flip,
+	.set_property = intel_crtc_set_property,
 };
 
 static bool ibx_pch_dpll_get_hw_state(struct drm_i915_private *dev_priv,
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux