From patchwork Tue Feb 18 10:42:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akash.goel@intel.com X-Patchwork-Id: 3668421 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 1C8A9BF13A for ; Tue, 18 Feb 2014 10:40:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46451201D3 for ; Tue, 18 Feb 2014 10:40:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 24A0A2020F for ; Tue, 18 Feb 2014 10:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CFF8FAA24; Tue, 18 Feb 2014 02:40:30 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 45AABFAA24 for ; Tue, 18 Feb 2014 02:40:28 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 18 Feb 2014 02:40:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,501,1389772800"; d="scan'208";a="483344471" Received: from akashgoe-desktop.iind.intel.com ([10.223.82.34]) by fmsmga002.fm.intel.com with ESMTP; 18 Feb 2014 02:40:01 -0800 From: akash.goel@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 18 Feb 2014 16:12:04 +0530 Message-Id: <1392720124-3069-1-git-send-email-akash.goel@intel.com> X-Mailer: git-send-email 1.8.5.2 Cc: Akash Goel Subject: [Intel-gfx] [PATCH] drm/i915: Added a new Panel-fitter property for connectors X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.8 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: Akash Goel Added a Panel-fitter enable/disable property support for the connectors. NOTE: By default, the value for the property will be disabled. Signed-off-by: G Pallavi Signed-off-by: Akash Goel --- drivers/gpu/drm/i915/i915_drv.h | 8 ++++++++ drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_modes.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 8c64831..a07f6cd 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1560,6 +1560,7 @@ typedef struct drm_i915_private { struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; + struct drm_property *force_pfit_property; uint32_t hw_context_size; struct list_head context_list; @@ -1613,6 +1614,13 @@ enum hdmi_force_audio { HDMI_AUDIO_ON, /* force turn on HDMI audio */ }; +enum panel_fitter { + PFIT_OFF, + AUTOSCALE, + PILLARBOX, + LETTERBOX, +}; + #define I915_GTT_OFFSET_NONE ((u32)-1) struct drm_i915_gem_object_ops { diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index a4ffc02..db6ea3e 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -819,6 +819,7 @@ int intel_connector_update_modes(struct drm_connector *connector, int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); void intel_attach_force_audio_property(struct drm_connector *connector); void intel_attach_broadcast_rgb_property(struct drm_connector *connector); +void intel_attach_force_pfit_property(struct drm_connector *connector); /* intel_overlay.c */ diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c index 0e860f3..967e080 100644 --- a/drivers/gpu/drm/i915/intel_modes.c +++ b/drivers/gpu/drm/i915/intel_modes.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "intel_drv.h" #include "i915_drv.h" @@ -126,3 +127,33 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector) drm_object_attach_property(&connector->base, prop, 0); } + +static const struct drm_prop_enum_list pfit_names[] = { + { PFIT_OFF, "pfit off" }, + { AUTO_SCALE, "Auto scale" }, + { PILLAR_BOX, "PillarBox" }, + { LETTER_BOX, "LetterBox" }, +}; + +void +intel_attach_force_pfit_property(struct drm_connector *connector) +{ + struct drm_device *dev = connector->dev; + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_property *prop; + struct drm_mode_object *obj = &connector->base; + + prop = dev_priv->force_pfit_property; + if (prop == NULL) { + prop = drm_property_create_enum(dev, 0, + "pfit", + pfit_names, + ARRAY_SIZE(pfit_names)); + if (prop == NULL) + return; + + dev_priv->force_pfit_property = prop; + } + + drm_object_attach_property(obj, prop, 0); +}