From patchwork Mon Oct 6 15:37:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 5038271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 044489F2F1 for ; Mon, 6 Oct 2014 15:38:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 621D12014A for ; Mon, 6 Oct 2014 15:38:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8221D2016C for ; Mon, 6 Oct 2014 15:38:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A04E46E3C9; Mon, 6 Oct 2014 08:38:05 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F0436E3C9 for ; Mon, 6 Oct 2014 08:38:02 -0700 (PDT) Received: by mail.free-electrons.com (Postfix, from userid 106) id 1268F895; Mon, 6 Oct 2014 17:38:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB autolearn=ham version=3.3.1 Received: from localhost.localdomain (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 530D9504; Mon, 6 Oct 2014 17:38:06 +0200 (CEST) From: Boris Brezillon To: David Airlie , dri-devel@lists.freedesktop.org Subject: [RFC 1/7] drm: add DPI bus support Date: Mon, 6 Oct 2014 17:37:47 +0200 Message-Id: <1412609873-1894-2-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412609873-1894-1-git-send-email-boris.brezillon@free-electrons.com> References: <1412609873-1894-1-git-send-email-boris.brezillon@free-electrons.com> Cc: Laurent Pinchart X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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 The DPI bus is a parallel bus used to interface with video components. This bus provide some control signals (HSYNC, VSYNC) and a parallel data bus used to transfer content to slave devices (panels, encoders, ...) This DPI layer is providing a way to negotiate a video format suiting all the activated DPI devices on the bus. As usual with busses, there are two ends: - the host: this is the device aggregating the devices on a DPI bus. It is also responsible for choosing the best format given the devices connected on its bus. - the device: it's describing a specific hardware (a panel, an encoder, or any other DRM device), and as such is attached to a driver. This driver will typically create a DRM encoder (and possibly the associated connector) and attach it to the DRM device embedding the DPI bus. This approach will ease the work of display controllers, and hopefully provide a standard way to bind slave DRM devices to DRM devices (assuming your device is connected on DPI bus). The term MIPI DPI or even DPI might not be the appropriate one as MIPI DPI is a standard specify more things than just the video bus format being used on the bus. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/Kconfig | 4 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_mipi_dpi.c | 369 +++++++++++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dpi.h | 169 +++++++++++++++++++ 4 files changed, 543 insertions(+) create mode 100644 drivers/gpu/drm/drm_mipi_dpi.c create mode 100644 include/drm/drm_mipi_dpi.h diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 2d97f7e..8ad8983 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -20,6 +20,10 @@ menuconfig DRM details. You should also select and configure AGP (/dev/agpgart) support if it is available for your platform. +config DRM_MIPI_DPI + bool + depends on DRM + config DRM_MIPI_DSI bool depends on DRM diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index abb4f29..a77b2bc 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o CFLAGS_drm_trace_points.o := -I$(src) obj-$(CONFIG_DRM) += drm.o +obj-$(CONFIG_DRM_MIPI_DPI) += drm_mipi_dpi.o obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o obj-$(CONFIG_DRM_USB) += drm_usb.o obj-$(CONFIG_DRM_TTM) += ttm/ diff --git a/drivers/gpu/drm/drm_mipi_dpi.c b/drivers/gpu/drm/drm_mipi_dpi.c new file mode 100644 index 0000000..403922c --- /dev/null +++ b/drivers/gpu/drm/drm_mipi_dpi.c @@ -0,0 +1,369 @@ +/* + * MIPI DPI Bus + * + * Copyright (C) 2014, Atmel + * Copyright (C) 2014, Free Electrons + * + * Author: Boris Brezillon + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include + +#include +#include +#include +#include +#include + +#include