From patchwork Tue Sep 9 06:23:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sharma, Shashank" X-Patchwork-Id: 4866121 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75744C0338 for ; Tue, 9 Sep 2014 06:18:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 984142015D for ; Tue, 9 Sep 2014 06:18:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B9398200D0 for ; Tue, 9 Sep 2014 06:18:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 53ABD6E38C; Mon, 8 Sep 2014 23:18:16 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id C22646E38A for ; Mon, 8 Sep 2014 23:18:14 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by orsmga102.jf.intel.com with ESMTP; 08 Sep 2014 23:12:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,491,1406617200"; d="scan'208";a="476245655" Received: from shashanks-desktop.iind.intel.com ([10.223.26.11]) by azsmga001.ch.intel.com with ESMTP; 08 Sep 2014 23:18:11 -0700 From: shashank.sharma@intel.com To: intel-gfx@lists.freedesktop.org, matthew.d.roper@intel.com, sonika.jindal@intel.com Date: Tue, 9 Sep 2014 11:53:14 +0530 Message-Id: <1410243796-11172-3-git-send-email-shashank.sharma@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410243796-11172-1-git-send-email-shashank.sharma@intel.com> References: <20140726015853.GA8878@intel.com> <1410243796-11172-1-git-send-email-shashank.sharma@intel.com> Cc: daniel.vetter@intel.com Subject: [Intel-gfx] [PATCH 2/4] drm/i915: Plug-in color manager attach X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shashank Sharma This patch does following things: 1. Adds new function to attach color proprties with corresponsing crtc / plane objects. 2. Call these attach functions, from corresponding crtc/plane init functions. Signed-off-by: Shashank Sharma --- drivers/gpu/drm/i915/intel_clrmgr.c | 25 +++++++++++-------------- drivers/gpu/drm/i915/intel_clrmgr.h | 22 ++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_sprite.c | 3 +++ 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_clrmgr.c b/drivers/gpu/drm/i915/intel_clrmgr.c index 0def917..ac0a890 100644 --- a/drivers/gpu/drm/i915/intel_clrmgr.c +++ b/drivers/gpu/drm/i915/intel_clrmgr.c @@ -32,20 +32,17 @@ #include "i915_reg.h" #include "intel_clrmgr.h" -/* Names to register with color properties */ -const char *clrmgr_property_names[] = { - /* csc */ - "csc-correction", - /* gamma */ - "gamma-correction", - /* contrast */ - "contrast", - /* brightness */ - "brightness", - /* hue_saturation */ - "hue_saturation" - /* add a new prop name here */ -}; +void +intel_attach_plane_color_correction(struct intel_plane *intel_plane) +{ + DRM_DEBUG_DRIVER("\n"); +} + +void +intel_attach_pipe_color_correction(struct intel_crtc *intel_crtc) +{ + DRM_DEBUG_DRIVER("\n"); +} int intel_clrmgr_create_color_properties(struct drm_device *dev) { diff --git a/drivers/gpu/drm/i915/intel_clrmgr.h b/drivers/gpu/drm/i915/intel_clrmgr.h index 1b7e906..8cff487 100644 --- a/drivers/gpu/drm/i915/intel_clrmgr.h +++ b/drivers/gpu/drm/i915/intel_clrmgr.h @@ -50,6 +50,28 @@ enum clrmgr_tweaks { }; /* +* intel_attach_plane_color_correction: +* Attach plane level color correction DRM properties to +* corresponding plane objects. +* This function should be called from plane initialization function +* for each plane +* input: intel_plane * +*/ +void +intel_attach_plane_color_correction(struct intel_plane *intel_plane); + +/* +* intel_attach_pipe_color_correction: +* Attach pipe level color correction DRM properties to +* corresponding CRTC objects. +* This function should be called from CRTC initialization function +* for each CRTC +* input: intel_crtc * +*/ +void +intel_attach_pipe_color_correction(struct intel_crtc *intel_crtc); + +/* * intel_clrmgr_init: * Create drm properties for color correction * Allocate memory to store current color correction diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index df2dcbd..a289b44 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12017,6 +12017,8 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); + intel_attach_pipe_color_correction(intel_crtc); + WARN_ON(drm_crtc_index(&intel_crtc->base) != intel_crtc->pipe); return; diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index fd5f271..cc061de 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -36,6 +36,7 @@ #include "intel_drv.h" #include #include "i915_drv.h" +#include "intel_clrmgr.h" static int usecs_to_scanlines(const struct drm_display_mode *mode, int usecs) { @@ -1395,6 +1396,8 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) dev->mode_config.rotation_property, intel_plane->rotation); + intel_attach_plane_color_correction(intel_plane); + out: return ret; }