From patchwork Wed Feb 22 15:18:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9587007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A85C06020B for ; Wed, 22 Feb 2017 15:24:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF2228609 for ; Wed, 22 Feb 2017 15:24:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ECCC28657; Wed, 22 Feb 2017 15:24:17 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 271C328609 for ; Wed, 22 Feb 2017 15:24:16 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=WfBWeUOfAufgm2n3rBmWE1PRQFyVYlwuYvE3M9xlIg4=; b=kjviWDQZSVd/6KtmeTS3O6eC8a 3ytd/CPE54BqXFvfBuFo61hCgVzq8aHEgEQ9smBpwi2yH1f6oJuGBX3/xlGUTB8AU4ypltp5evcSr i1OQJANyRC+Bi6w9sluFLwLkgOx07KQOwHkyvbcnE3350IFMWoEhNQ+rwkpKbhI/DxtknfT4fHOlX 1dFUeTJ4nUHBaSWSF3AsGZnB7JWqTJZKwYNzNioGNICORq/re0+VIBMXlko+fJCMCDJwe/2et/8dZ O4FDJv0JcPHJVEJ8AqsGSKYVA40zeS05OV8RdMIysJNc/fXCk8didbEr0+EX9E6/yuqaQMpIBAweB E7a2XJ0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cgYlx-0006vg-OF; Wed, 22 Feb 2017 15:24:05 +0000 Received: from forward15m.cmail.yandex.net ([2a02:6b8:b030::9c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgYlN-0006aZ-53 for linux-arm-kernel@lists.infradead.org; Wed, 22 Feb 2017 15:23:39 +0000 Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [37.140.190.27]) by forward15m.cmail.yandex.net (Yandex) with ESMTP id EA21822602; Wed, 22 Feb 2017 18:23:02 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 274C25080E3E; Wed, 22 Feb 2017 18:22:52 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZbnmgsRLHQ-MfauBSKl; Wed, 22 Feb 2017 18:22:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aosc.xyz; s=mail; t=1487776971; bh=LEi477J28DaGdZA/KVNISFmv/yy0WOI7gJb6hISzOro=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=iUnxpIoQihGN9t0jOU2M99loSLzMYHXMN5d10ABeRLdchrOBdVV4etT4HFMjKZSU6 XMYGcM+8ZrM+NkSH3dxvwgO896dz/DOFEK2sReMeveW1R9REToggJ4pRgdw3J98TPD 0d+yDC1NRBLkHvqLww0ZnKnEw5JA+sGHtqFFDo5k= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@aosc.xyz X-Yandex-ForeignMX: US X-Yandex-Suid-Status: 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 1130000036118848 From: Icenowy Zheng To: Rob Herring , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , David Airlie Subject: [PATCH 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines Date: Wed, 22 Feb 2017 23:18:50 +0800 Message-Id: <20170222151854.3280-5-icenowy@aosc.xyz> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170222151854.3280-1-icenowy@aosc.xyz> References: <20170222151854.3280-1-icenowy@aosc.xyz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170222_072329_628637_36E9BE2C X-CRM114-Status: GOOD ( 25.16 ) 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: Jean-Francois Moine , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Icenowy Zheng , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 Allwinner have a new "Display Engine 2.0" in there new SoCs, which comes in a new "Display Engine" (mixers instead of old backends and frontends). Add support for the mixer on Allwinner V3s SoC; it's the simplest one. Signed-off-by: Icenowy Zheng --- drivers/gpu/drm/sun4i/Kconfig | 8 + drivers/gpu/drm/sun4i/Makefile | 1 + drivers/gpu/drm/sun4i/sun4i_crtc.c | 6 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 38 +++- drivers/gpu/drm/sun4i/sun4i_drv.h | 1 + drivers/gpu/drm/sun4i/sun4i_layer.c | 92 ++++++-- drivers/gpu/drm/sun4i/sun4i_layer.h | 1 + drivers/gpu/drm/sun4i/sun8i_mixer.c | 417 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun8i_mixer.h | 133 ++++++++++++ 9 files changed, 674 insertions(+), 23 deletions(-) create mode 100644 drivers/gpu/drm/sun4i/sun8i_mixer.c create mode 100644 drivers/gpu/drm/sun4i/sun8i_mixer.h diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig index a4b357db8856..8df401fff145 100644 --- a/drivers/gpu/drm/sun4i/Kconfig +++ b/drivers/gpu/drm/sun4i/Kconfig @@ -12,3 +12,11 @@ config DRM_SUN4I Choose this option if you have an Allwinner SoC with a Display Engine. If M is selected the module will be called sun4i-drm. + +config DRM_SUN4I_DE2 + bool "Support Display Engine 2.0" + depends on DRM_SUN4I + default MACH_SUN8I + help + Choose this option if you have an Allwinner SoC with a + "Display Engine 2.0". diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile index d625a82a6e5f..890e6e50dfee 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -9,5 +9,6 @@ sun4i-tcon-y += sun4i_dotclock.o obj-$(CONFIG_DRM_SUN4I) += sun4i-drm.o sun4i-tcon.o obj-$(CONFIG_DRM_SUN4I) += sun4i_backend.o +obj-$(CONFIG_DRM_SUN4I) += sun8i_mixer.o obj-$(CONFIG_DRM_SUN4I) += sun6i_drc.o obj-$(CONFIG_DRM_SUN4I) += sun4i_tv.o diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index 4a192210574f..4d2228454726 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -25,6 +25,7 @@ #include