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: 9629535 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 70EDB60244 for ; Fri, 17 Mar 2017 00:48:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6096B28649 for ; Fri, 17 Mar 2017 00:48:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 552AE2866F; Fri, 17 Mar 2017 00:48:45 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A7F3628649 for ; Fri, 17 Mar 2017 00:48:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B5666EC5A; Fri, 17 Mar 2017 00:48:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from forward17o.cmail.yandex.net (forward17o.cmail.yandex.net [37.9.109.214]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2D306EB1E for ; Thu, 16 Mar 2017 20:49:50 +0000 (UTC) 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-Mailman-Approved-At: Fri, 17 Mar 2017 00:48:40 +0000 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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