diff mbox

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

Message ID 1410243796-11172-5-git-send-email-shashank.sharma@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sharma, Shashank Sept. 9, 2014, 6:23 a.m. UTC
From: Shashank Sharma <shashank.sharma@intel.com>

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@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff mbox

Patch

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,