From patchwork Wed Apr 24 12:40:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 162780 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp610654jan; Wed, 24 Apr 2019 05:40:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvyEJSY8Ssj9l7abHF/RTG9vAf21DoVf0f8X1cuzaxDi0Ix8VysySY4/TfI4brv7t/TMZI X-Received: by 2002:aa7:8019:: with SMTP id j25mr33711431pfi.77.1556109615856; Wed, 24 Apr 2019 05:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556109615; cv=none; d=google.com; s=arc-20160816; b=SfgRbU3OKEBft0uKCJAwiu2awDHUVNgYbvSCcpClynlT6IrTGGKfnfal9UK0glTcdC SyV7ZRlvr3QhdpEDhEAWDt2cFklrnSqn0GJIBmgjc+dX4Ctpm92TtvPPkEC8vBX0KdxL byeOhvqixraQrvHEB1+Wd5ua/VKQCS8sNASjhYJqM+oybESyYRYSkuntpGicQkB15mEh vUM1P7nhqxngLMSwvJcjzmFDax8AEGOJ9F5XC01dRsv3dmg8SkqPu1vuPlZSh1phNfeV yCZlrtQyz5txUA5gRZa+ixCC946OoefQK3ye98j1PmEqjQmUl7qnHt8ZKXn8/SFG8fln azxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=MLKaoKMQCYLuGSrOkH7uswL/h1hW11pqqYbD2uZjsdw=; b=qXIpe3Zix8ZCFGdFW2pK8PcxM699tpRMp/z/I7A5WeI5+SI/MNGX9yoNLwj376A6sC QVqEEZwXf6UFqm8v2ymOxoLYeBZOtbGBBu4ho9Ia7TRvgHY4Zf1/3GSB5V52DT1YiFRh 2C15oBMbkSzsggdK3N4gYmgAX+IwI1syzkvTJ+7+UVcbQ5j3o05lm2XQpQR4ctoFcGyG 2TofKXZ3grlzO741ZrmMRI58MVMpImbRLRX3V5k2n0jDLxbA0XjMA8z4jRMk/JdTNNQQ nL6WwJ46elUgBOMwubv30M2eUKzdBZvFbYoIQYs4ChOU+BoGhJ5r7/SlhPiiQsJMfoK1 cnoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id d2si18315206pgh.499.2019.04.24.05.40.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 05:40:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8FF989289; Wed, 24 Apr 2019 12:40:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A25689289 for ; Wed, 24 Apr 2019 12:40:11 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id f23so16757006ljc.0 for ; Wed, 24 Apr 2019 05:40:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U74lXXkmK9wYYLA4viDHSVeI6jx9nkznH5mYN4SUErY=; b=j5kSMI8JOj6pR6GpERXSgHORX4ER7Cr4GR4P24MW7kz8sKFJI60lPh8TvOhuoSQ7x0 ypeuEKbfCG830PGN6pAQB582exMqI+tlmP/ihx6mwDb2TFlQeG8FT/Qcb5yavIXU3DVk 48mER1MclUEMbs9JA8IYcv6FT7ss9jSfBvb/ma4HWJSTYdiaSE90QqpJOPgtl/Ts0PiD 4djWKgX9E8TK+D8EKiR/o/JCKXQypUvSJvsx5W494jKRk1yZsL6d8YlbjfxFih3skPGd rYRQ9Y9ZwdY6WHAbn9y203piUfRlXJW8tPa13vSq2f3GQa2T86wfYCKrjtNrK6McXEye R6+g== X-Gm-Message-State: APjAAAUsNc/PXF1JtoKtBZfbMiCMLI2PO87ebvtpQpN8onRayjsaIJfY ILbsY2Pk9mXQgJQ9gjbifH5o2mSFghM= X-Received: by 2002:a2e:6c08:: with SMTP id h8mr3267885ljc.145.1556109607447; Wed, 24 Apr 2019 05:40:07 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x6sm4305180lfe.67.2019.04.24.05.40.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 05:40:06 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH v2] drm/mcde: Add new driver for ST-Ericsson MCDE Date: Wed, 24 Apr 2019 14:40:01 +0200 Message-Id: <20190424124001.13391-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U74lXXkmK9wYYLA4viDHSVeI6jx9nkznH5mYN4SUErY=; b=dIZ7v8WhLpTZ/iYdiW+gdEWXJGvI/6LOc5unnVG74+qOkf8bXAm+WmKDeJ3YM5GlNz LicUbICzLfvfqJ0MqqF0HKLbPGHcdrbiZNMC7xHk+qVrE867lBVHzXKB103ia+QzvMy0 PaikPQ2d2wnvd5ZpDLoQhkZx7aIuPzFEivzPW66q4GfgeNmPaVCQ1tpZrGlLWHZdibO1 KTCrWB2P47e65CpSHDpwweAm6PyOgaHgJ3/h2HVBE+pNBlH5LyvpGF4CXEGl2ptqygj4 npwYyMMVmblQ4kWiGOuvniHt9BC+xFTTyZ3d25bUhfiblbgHJRobYcAN4eFK4rlxQANQ mclw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds a new DRM driver for the ST-Ericsson Multi Channel Display Engine, MCDE display controller. This hardware has three independent DSI hosts and can composit and display several memory buffers onto an LCD display. It was developed for several years inside of ST-Ericsson and shipped with a few million mobile phones from Sony and Samsung, as well as with the Snowball community development board. The driver is currently pretty rudimentary but supports a simple framebuffer so we can get penguins and graphics when using these SoCs. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Replace the quirky custom encoder structure and hacks in the FBDEV core with a straight-forward internal DSI bridge which is in turn connected to the panel bridge. It works like a charm, much to my surprise. - Drop the panel port graph parsing for the DSI host to panels: the panels are children of the DSI node, so just spin over the children and take the first working panel. - Move clock lookup and handling for the DSI HS and LP clocks to the DSI driver file as this is now cleanly associated with respective DSI port. --- Documentation/gpu/drivers.rst | 1 + Documentation/gpu/mcde.rst | 8 + MAINTAINERS | 7 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/mcde/Kconfig | 18 + drivers/gpu/drm/mcde/Makefile | 3 + drivers/gpu/drm/mcde/mcde_display.c | 1292 ++++++++++++++++++++++++ drivers/gpu/drm/mcde/mcde_drm.h | 47 + drivers/gpu/drm/mcde/mcde_drv.c | 540 ++++++++++ drivers/gpu/drm/mcde/mcde_dsi.c | 1424 +++++++++++++++++++++++++++ 11 files changed, 3343 insertions(+) create mode 100644 Documentation/gpu/mcde.rst create mode 100644 drivers/gpu/drm/mcde/Kconfig create mode 100644 drivers/gpu/drm/mcde/Makefile create mode 100644 drivers/gpu/drm/mcde/mcde_display.c create mode 100644 drivers/gpu/drm/mcde/mcde_drm.h create mode 100644 drivers/gpu/drm/mcde/mcde_drv.c create mode 100644 drivers/gpu/drm/mcde/mcde_dsi.c diff --git a/Documentation/gpu/drivers.rst b/Documentation/gpu/drivers.rst index 044a7025477c..4bfb7068e9f7 100644 --- a/Documentation/gpu/drivers.rst +++ b/Documentation/gpu/drivers.rst @@ -7,6 +7,7 @@ GPU Driver Documentation amdgpu amdgpu-dc i915 + mcde meson pl111 tegra diff --git a/Documentation/gpu/mcde.rst b/Documentation/gpu/mcde.rst new file mode 100644 index 000000000000..c69e977defda --- /dev/null +++ b/Documentation/gpu/mcde.rst @@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +======================================================= + drm/mcde ST-Ericsson MCDE Multi-channel display engine +======================================================= + +.. kernel-doc:: drivers/gpu/drm/mcde/mcde_drv.c + :doc: ST-Ericsson MCDE DRM Driver diff --git a/MAINTAINERS b/MAINTAINERS index e17ebf70b548..60fcc5b9ffce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5026,6 +5026,13 @@ S: Maintained F: drivers/gpu/drm/tinydrm/st7735r.c F: Documentation/devicetree/bindings/display/sitronix,st7735r.txt +DRM DRIVER FOR ST-ERICSSON MCDE +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/mcde/ +F: Documentation/devicetree/bindings/display/ste,mcde.txt + DRM DRIVER FOR TDFX VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/tdfx/ diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index bd943a71756c..11bf0f060288 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -329,6 +329,8 @@ source "drivers/gpu/drm/tve200/Kconfig" source "drivers/gpu/drm/xen/Kconfig" +source "drivers/gpu/drm/mcde/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 1ac55c65eac0..d38e6b233e78 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -109,3 +109,4 @@ obj-$(CONFIG_DRM_TINYDRM) += tinydrm/ obj-$(CONFIG_DRM_PL111) += pl111/ obj-$(CONFIG_DRM_TVE200) += tve200/ obj-$(CONFIG_DRM_XEN) += xen/ +obj-$(CONFIG_DRM_MCDE) += mcde/ diff --git a/drivers/gpu/drm/mcde/Kconfig b/drivers/gpu/drm/mcde/Kconfig new file mode 100644 index 000000000000..b3990126562c --- /dev/null +++ b/drivers/gpu/drm/mcde/Kconfig @@ -0,0 +1,18 @@ +config DRM_MCDE + tristate "DRM Support for ST-Ericsson MCDE (Multichannel Display Engine)" + depends on DRM + depends on CMA + depends on ARM || COMPILE_TEST + depends on OF + select MFD_SYSCON + select DRM_MIPI_DSI + select DRM_BRIDGE + select DRM_PANEL_BRIDGE + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE + help + Choose this option for DRM support for the ST-Ericsson MCDE + Multi-Channel Display Engine. + If M is selected the module will be called mcde_drm. diff --git a/drivers/gpu/drm/mcde/Makefile b/drivers/gpu/drm/mcde/Makefile new file mode 100644 index 000000000000..fe28f4e0fe46 --- /dev/null +++ b/drivers/gpu/drm/mcde/Makefile @@ -0,0 +1,3 @@ +mcde_drm-y += mcde_drv.o mcde_dsi.o mcde_display.o + +obj-$(CONFIG_DRM_MCDE) += mcde_drm.o diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c new file mode 100644 index 000000000000..06eac3315a64 --- /dev/null +++ b/drivers/gpu/drm/mcde/mcde_display.c @@ -0,0 +1,1292 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Linus Walleij + * Parts of this file were based on the MCDE driver by Marcus Lorentzon + * (C) ST-Ericsson SA 2013 + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include