From patchwork Fri Sep 7 04:19:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 10591599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FBEA5A4 for ; Fri, 7 Sep 2018 04:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E75C2ADA2 for ; Fri, 7 Sep 2018 04:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 729072ADA8; Fri, 7 Sep 2018 04:22:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBB332ADA2 for ; Fri, 7 Sep 2018 04:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=C2DCJa0QJGrnkjIVirfDIyUP3KvpGRaz+ogSdiKqbJg=; b=aci57iSaHLWCJG LP3xXbxLR/AIqXLshcNOYNf0rVgsW0dXXRhqlO3tyFNOjr2O1SKZRyjPZlEVm9m3Rtjl8P7bennGa 9z0qa+eG2PNZ8UXuAeUg13EiF3AOsrnzqWwYWjlDjtFqNdvssPHtwATgEWOGvRYJNC1MdJSA7AR3u DLjzzTn2y0dwgP9f8KLEWe5hk2tGj4SqM1Shex9FUOk2M4CTyAMKmHbezHf9zpeGSaTtE+brrX+Pf 8yoXF5Ptv6BycayGtT7u+0Kir+uE1SeUGwxHSk9D1+dXOS9MWOexMOS7pgOMWDgokTBeER8hur6nl 3qT5UfsXWS1N8WnGn7pg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fy8HZ-0000H3-S5; Fri, 07 Sep 2018 04:22:10 +0000 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76] helo=wens.csie.org) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fy8FX-0006Z6-3y for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2018 04:20:07 +0000 Received: by wens.csie.org (Postfix, from userid 1000) id AE35D5FCFF; Fri, 7 Sep 2018 12:19:50 +0800 (CST) From: Chen-Yu Tsai To: Thierry Reding , David Airlie , Rob Herring , Mark Rutland , Maxime Ripard Subject: [PATCH v2 0/6] drm/sun4i: Support color dithering for LCD panels Date: Fri, 7 Sep 2018 12:19:42 +0800 Message-Id: <20180907041948.19913-1-wens@csie.org> X-Mailer: git-send-email 2.19.0.rc1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180906_212003_355472_585CEA62 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jonathan Liu , linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This is v2 of my sun4i-drm LCD color dithering series. v1 was from back in April [1]. Most of the driver code is unchanged. Changes since v1: - Explicitly list properties from the simple-panel binding that apply to the Bananapi 7" panel - Moved an incorrectly squashed change from patch 3 to patch 1, where it belongs [1] https://patchwork.ozlabs.org/cover/900725/ Original cover letter follows: Dithering is a method of approximating a color from a mixture of other colors when the required color isn't available. It reduces color banding artifacts that can be observed when displaying gradients (e.g. grayscale gradients). This may occur when the image that needs to be displayed is 24-bit but the LCD panel is a lower bit depth and does not perform dithering on its own. The TCON (LCD controller) found in Allwinner SoCs has hardware support for dithering on channel 0, the channel used to feed LCD panels. This series adds support for it. Patch 1 reworks the mode set function for the CPU interface to pass the encoder object, so it can be passed to other helper functions. Patch 2 renames the dithering related register macros to reflect the fact that dithering is only supported on channel 0. Patch 3 adds support for dithering on all LCD panel output types. Patch 4 adds support for Banana Pi's 7" DPI LCD panel. Patch 5 adds a pinmux setting for RGB888 for the Allwinner A20 SoC. This change has been sent by others before. Patch 6 provides an example for enabling the Banana Pi 7" DPI LCD panel on the Banana Pi M1+. This should not be merged. I will likely rework this into an overlay in the future. Note that I was only able to test dithering with DPI, as I do not have other panel types. However the underlying concept and core code is the same, as are the drm objects accessed. Nevertheless I'm hoping Jonathan can test LVDS and Maxime can test MIPI DSI. Also it seems pwm-backlight hardware is unusable at the moment. I'm not sure whether the pwm-backlight or sun4i-pwm driver is to blame. I had to manually poke the pwm registers so the LCD backlight wouldn't be completely black. Regards ChenYu Chen-Yu Tsai (5): drm/sun4i: tcon: Pass drm_encoder * into sun4i_tcon0_mode_set_cpu drm/sun4i: tcon: Rename Dithering related register macros drm/panel: simple: Add support for Banana Pi 7" S070WV20-CT16 panel ARM: dts: sun7i: add pinmux setting for RGB888 output for LCD0 [DO NOT MERGE] ARM: dts: sun7i: bananapi-m1-plus: Enable Bananapi 7" 800x480 RGB LCD panel Jonathan Liu (1): drm/sun4i: tcon: Add dithering support for RGB565/RGB666 LCD panels .../display/panel/bananapi,s070wv20-ct16.txt | 12 +++ .../boot/dts/sun7i-a20-bananapi-m1-plus.dts | 56 ++++++++++++++ arch/arm/boot/dts/sun7i-a20.dtsi | 11 +++ drivers/gpu/drm/panel/panel-simple.c | 25 ++++++ drivers/gpu/drm/sun4i/sun4i_tcon.c | 76 ++++++++++++++++--- drivers/gpu/drm/sun4i/sun4i_tcon.h | 27 ++++--- 6 files changed, 186 insertions(+), 21 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16.txt