From patchwork Mon Jul 6 04:16:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak M X-Patchwork-Id: 6719771 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35390C05AC for ; Mon, 6 Jul 2015 04:11:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 084F3203A0 for ; Mon, 6 Jul 2015 04:11:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4AFDC2069E for ; Mon, 6 Jul 2015 04:11:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C2B56E310; Sun, 5 Jul 2015 21:11:54 -0700 (PDT) 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 00FAC6E310 for ; Sun, 5 Jul 2015 21:11:52 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 05 Jul 2015 21:11:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,412,1432623600"; d="scan'208";a="723434507" Received: from mdeepakubuntudesk01-desktop.iind.intel.com ([10.223.25.91]) by orsmga001.jf.intel.com with ESMTP; 05 Jul 2015 21:11:48 -0700 From: Deepak M To: intel-gfx@lists.freedesktop.org Date: Mon, 6 Jul 2015 09:46:07 +0530 Message-Id: <1436156167-16127-4-git-send-email-m.deepak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436156167-16127-1-git-send-email-m.deepak@intel.com> References: <1436156167-16127-1-git-send-email-m.deepak@intel.com> Cc: Deepak M Subject: [Intel-gfx] [CABC PATCH v1 3/3][RFC] drm/i915: CABC support for backlight control X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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=-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 In CABC (Content Adaptive Brightness Control) content grey level scale can be increased while simultaneously decreasing brightness of the backlight to achieve same perceived brightness. The CABC is not standardized and panel vendors are free to follow their implementation. The CABC implementaion here assumes that the panels use standard SW register for control. In this design there will be no PWM signal from the SoC and DCS commands are sent to enable and control the backlight brightness. Signed-off-by: Deepak M --- drivers/gpu/drm/i915/intel_dsi.h | 13 +++ drivers/gpu/drm/i915/intel_panel.c | 226 +++++++++++++++++++++++++++++++++++- include/video/mipi_display.h | 8 ++ 3 files changed, 242 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h index c39e39d..1f33cb2 100644 --- a/drivers/gpu/drm/i915/intel_dsi.h +++ b/drivers/gpu/drm/i915/intel_dsi.h @@ -34,6 +34,19 @@ #define DSI_DUAL_LINK_FRONT_BACK 1 #define DSI_DUAL_LINK_PIXEL_ALT 2 +#define CABC_OFF (0 << 0) +#define CABC_USER_INTERFACE_IMAGE (1 << 0) +#define CABC_STILL_PICTURE (2 << 0) +#define CABC_VIDEO_MODE (3 << 0) + +#define CABC_BACKLIGHT (1 << 2) +#define CABC_DIMMING_DISPLAY (1 << 3) +#define CABC_BCTRL (1 << 5) + +#define CABC_PORT_A 0x00 +#define CABC_PORT_C 0x01 +#define CABC_PORT_A_AND_C 0x02 + struct intel_dsi_host; struct intel_dsi { diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 55aad23..7aa211e 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -32,7 +32,10 @@ #include #include +#include