From patchwork Fri Sep 23 07:24:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 76826 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp424686qgf; Fri, 23 Sep 2016 00:25:24 -0700 (PDT) X-Received: by 10.66.34.101 with SMTP id y5mr10187621pai.95.1474615524722; Fri, 23 Sep 2016 00:25:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g70si6483235pfc.293.2016.09.23.00.25.24; Fri, 23 Sep 2016 00:25:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965097AbcIWHZX (ORCPT + 7 others); Fri, 23 Sep 2016 03:25:23 -0400 Received: from mail.kernel.org ([198.145.29.136]:59902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965087AbcIWHZV (ORCPT ); Fri, 23 Sep 2016 03:25:21 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CE352042B; Fri, 23 Sep 2016 07:25:17 +0000 (UTC) Received: from localhost.localdomain (unknown [85.203.21.26]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4BCC203C2; Fri, 23 Sep 2016 07:25:10 +0000 (UTC) From: Shawn Guo To: Daniel Vetter , David Airlie Cc: Rob Herring , Mark Rutland , Baoyou Xie , Jun Nie , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Guo Subject: [PATCH 2/2] drm: zte: add initial vou drm driver Date: Fri, 23 Sep 2016 15:24:09 +0800 Message-Id: <1474615449-16893-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474615449-16893-1-git-send-email-shawn.guo@linaro.org> References: <1474615449-16893-1-git-send-email-shawn.guo@linaro.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It adds the initial ZTE VOU display controller DRM driver. There are still some features to be added, like overlay plane, scaling, and more output devices support. But it's already useful with dual CRTCs and HDMI monitor working. It's been tested on Debian Jessie LXDE desktop with modesetting driver. Signed-off-by: Shawn Guo --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/zte/Kconfig | 8 + drivers/gpu/drm/zte/Makefile | 8 + drivers/gpu/drm/zte/zx_crtc.c | 711 +++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/zte/zx_crtc.h | 47 +++ drivers/gpu/drm/zte/zx_drm_drv.c | 258 ++++++++++++++ drivers/gpu/drm/zte/zx_drm_drv.h | 22 ++ drivers/gpu/drm/zte/zx_hdmi.c | 540 +++++++++++++++++++++++++++++ drivers/gpu/drm/zte/zx_plane.c | 362 ++++++++++++++++++++ drivers/gpu/drm/zte/zx_plane.h | 26 ++ 11 files changed, 1985 insertions(+) create mode 100644 drivers/gpu/drm/zte/Kconfig create mode 100644 drivers/gpu/drm/zte/Makefile create mode 100644 drivers/gpu/drm/zte/zx_crtc.c create mode 100644 drivers/gpu/drm/zte/zx_crtc.h create mode 100644 drivers/gpu/drm/zte/zx_drm_drv.c create mode 100644 drivers/gpu/drm/zte/zx_drm_drv.h create mode 100644 drivers/gpu/drm/zte/zx_hdmi.c create mode 100644 drivers/gpu/drm/zte/zx_plane.c create mode 100644 drivers/gpu/drm/zte/zx_plane.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 483059a22b1b..a91f8cecbe0f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -223,6 +223,8 @@ source "drivers/gpu/drm/hisilicon/Kconfig" source "drivers/gpu/drm/mediatek/Kconfig" +source "drivers/gpu/drm/zte/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 439d89b25ae0..fe461c94d266 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -85,3 +85,4 @@ obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/ obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/ obj-$(CONFIG_DRM_ARCPGU)+= arc/ obj-y += hisilicon/ +obj-$(CONFIG_DRM_ZTE) += zte/ diff --git a/drivers/gpu/drm/zte/Kconfig b/drivers/gpu/drm/zte/Kconfig new file mode 100644 index 000000000000..4065b2840f1c --- /dev/null +++ b/drivers/gpu/drm/zte/Kconfig @@ -0,0 +1,8 @@ +config DRM_ZTE + tristate "DRM Support for ZTE SoCs" + depends on DRM && ARCH_ZX + select DRM_KMS_CMA_HELPER + select DRM_KMS_FB_HELPER + select DRM_KMS_HELPER + help + Choose this option to enable DRM on ZTE ZX SoCs. diff --git a/drivers/gpu/drm/zte/Makefile b/drivers/gpu/drm/zte/Makefile new file mode 100644 index 000000000000..b40968dc749f --- /dev/null +++ b/drivers/gpu/drm/zte/Makefile @@ -0,0 +1,8 @@ +zxdrm-y := \ + zx_drm_drv.o \ + zx_crtc.o \ + zx_plane.o \ + zx_hdmi.o + +obj-$(CONFIG_DRM_ZTE) += zxdrm.o + diff --git a/drivers/gpu/drm/zte/zx_crtc.c b/drivers/gpu/drm/zte/zx_crtc.c new file mode 100644 index 000000000000..531541482e1f --- /dev/null +++ b/drivers/gpu/drm/zte/zx_crtc.c @@ -0,0 +1,711 @@ +/* + * Copyright 2016 Linaro Ltd. + * Copyright 2016 ZTE Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include