From patchwork Thu Mar 16 20:47:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9629319 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 72CA860249 for ; Thu, 16 Mar 2017 20:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 619952868D for ; Thu, 16 Mar 2017 20:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54B5228691; Thu, 16 Mar 2017 20:50:54 +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 DEB6C2868D for ; Thu, 16 Mar 2017 20:50:52 +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=j6KmHogYZU2f2nqgjJ/XrVOG7JK4TNF0zZ8MF2Tzv5A=; b=jLuMmFJlS4RJDexzTquTlV7o+U rDY1hi5eRqhS+MFsO5RhLz/SPeeWk/dKG2WI+0reATOM3vAdFRAI7LgV9ws5VEobDDw6vo8nwdioW 5c+LEFamrUSUTFba0zM1C0dIyTJ3BdGQCz8sUEemWQ3OOUDHN4yBwK6PhPDizD9stYp/eiOg6gvpj VZ3T9Uq7sfFXNZOueSh384ThZuJ5odTZzpku68KmWjjSkeuvkrCXburduvVLV7HMPif364CCRC3ap bWEZqAwquocK901RXEgdD0IAznB5KIPuAXIDQx007lyWr8X2Q2wTjNw8wdR8MBOR1Ak82RIDYhxqy wwUcEDIQ==; 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 1cocMB-0000ds-1J; Thu, 16 Mar 2017 20:50:47 +0000 Received: from forward17o.cmail.yandex.net ([37.9.109.214]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cocLb-0006tS-8W for linux-arm-kernel@lists.infradead.org; Thu, 16 Mar 2017 20:50:30 +0000 Received: from smtp3j.mail.yandex.net (smtp3j.mail.yandex.net [95.108.130.68]) by forward17o.cmail.yandex.net (Yandex) with ESMTP id CDA042143B; Thu, 16 Mar 2017 23:49:45 +0300 (MSK) Received: from smtp3j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3j.mail.yandex.net (Yandex) with ESMTP id 645A16240FAD; Thu, 16 Mar 2017 23:49:39 +0300 (MSK) Received: by smtp3j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cN2NeqrDXI-nWNSRQ4v; Thu, 16 Mar 2017 23:49:36 +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=1489697378; bh=sUHNy4wLddF5U2EISB2/fec2zVU40aAh9SoSva98oSY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=mOmYGROUhLd0HrXrRMDu5TU+5EAfFLKu2VY3GEcP+HNW/NxnVAvqXWI2DPywBUn8J aSGrRYRft824tjHSRBCWZl4dCu41+kd4zZ8yswsMoci1/wyXQHRWXH34TK/Q0hL6kk OnMLzCSxaUsUWVvKf6vsGtG9tMvgmRSNcxcXscXw= Authentication-Results: smtp3j.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 1130000036118848 From: Icenowy Zheng To: Rob Herring , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec Subject: [PATCH v2 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines Date: Fri, 17 Mar 2017 04:47:44 +0800 Message-Id: <20170316204748.8596-5-icenowy@aosc.xyz> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170316204748.8596-1-icenowy@aosc.xyz> References: <20170316204748.8596-1-icenowy@aosc.xyz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170316_135012_383024_BE86F1B3 X-CRM114-Status: GOOD ( 25.26 ) 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, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, 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. Currently a lot of functions are still missing -- more investigations are needed to gain enough infomation for them. Signed-off-by: Icenowy Zheng --- Changes in v2: - Rebase on current linux-next (with Chen-Yu's some refactors) - Removed currently broken overlay plane. drivers/gpu/drm/sun4i/Kconfig | 9 + drivers/gpu/drm/sun4i/Makefile | 3 +- drivers/gpu/drm/sun4i/sun4i_crtc.c | 14 +- drivers/gpu/drm/sun4i/sun4i_crtc.h | 2 + drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.h | 1 + drivers/gpu/drm/sun4i/sun4i_layer.c | 94 +++++++-- drivers/gpu/drm/sun4i/sun4i_layer.h | 3 + drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +- drivers/gpu/drm/sun4i/sun8i_mixer.c | 385 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sun4i/sun8i_mixer.h | 166 ++++++++++++++++ 11 files changed, 658 insertions(+), 22 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..0fa989f955e7 100644 --- a/drivers/gpu/drm/sun4i/Kconfig +++ b/drivers/gpu/drm/sun4i/Kconfig @@ -12,3 +12,12 @@ 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 + select SUN8I_DE2_CCU + 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 59b757350a1f..3e7e2b2eb386 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -1,5 +1,7 @@ sun4i-drm-y += sun4i_drv.o sun4i-drm-y += sun4i_framebuffer.o +sun4i-drm-y += sun4i_backend.o +sun4i-drm-$(CONFIG_DRM_SUN4I_DE2) += sun8i_mixer.o sun4i-tcon-y += sun4i_tcon.o sun4i-tcon-y += sun4i_rgb.o @@ -8,6 +10,5 @@ sun4i-tcon-y += sun4i_crtc.o sun4i-tcon-y += sun4i_layer.o obj-$(CONFIG_DRM_SUN4I) += sun4i-drm.o sun4i-tcon.o -obj-$(CONFIG_DRM_SUN4I) += sun4i_backend.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 3c876c3a356a..bf2aa0ffd35c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -26,8 +26,8 @@ #include