From patchwork Wed Feb 22 15:23:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9587597 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 EC7BC601AE for ; Thu, 23 Feb 2017 01:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB32828716 for ; Thu, 23 Feb 2017 01:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF9FD28733; Thu, 23 Feb 2017 01:08:23 +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 80D3828716 for ; Thu, 23 Feb 2017 01:08:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E570E6E90F; Thu, 23 Feb 2017 01:07:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 439 seconds by postgrey-1.35 at gabe; Wed, 22 Feb 2017 15:32:48 UTC Received: from forward6j.cmail.yandex.net (forward6j.cmail.yandex.net [5.255.227.107]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84FC188A58 for ; Wed, 22 Feb 2017 15:32:48 +0000 (UTC) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [95.108.130.59]) by forward6j.cmail.yandex.net (Yandex) with ESMTP id CB2D722939; Wed, 22 Feb 2017 18:25:25 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id EF6483C80EE0; Wed, 22 Feb 2017 18:25:14 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id xCa00HOZOx-P3e0jQl5; Wed, 22 Feb 2017 18:25:11 +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=1487777113; bh=LEi477J28DaGdZA/KVNISFmv/yy0WOI7gJb6hISzOro=; h=From:To:Cc:Subject:Date:Message-Id; b=BeBnFosClNLLGWwOeihq5HxcECFODvr87p6vgVLEci+BEFRf47bPa0v0ikxW6YH6s 3U+Ess7W7kbkJUUwmYo4Opl+HJLBvMQeXxHuIMtOsiGMEWuayrLUesmXxSwjL6YJTr VvTmlbxw+UApRn3E0ofV2+ZAy5lgAbQMdRq11Mrg= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@aosc.xyz X-Yandex-ForeignMX: FR 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:23:06 +0800 Message-Id: <20170222152310.3719-5-icenowy@aosc.xyz> X-Mailer: git-send-email 2.11.1 X-Mailman-Approved-At: Thu, 23 Feb 2017 01:07:27 +0000 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 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. 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