From patchwork Fri Aug 24 12:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10575303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F3AE1579 for ; Fri, 24 Aug 2018 12:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FD192BC4A for ; Fri, 24 Aug 2018 12:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6332E2BC71; Fri, 24 Aug 2018 12:23:24 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 E92BB2BC4A for ; Fri, 24 Aug 2018 12:23:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE83D6E68E; Fri, 24 Aug 2018 12:23:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 284E36E68E for ; Fri, 24 Aug 2018 12:23:21 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id p6-v6so6738408ljc.5 for ; Fri, 24 Aug 2018 05:23:21 -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; bh=gfllPtJ+9tbHzNRINUucaWYDz+UthYqpxfYOXkC0Z8U=; b=rdpSsEQ0gEFrLQ5yetYAW/hpBySkdTadTNEf61x0RtU7jhoMg9iqx/ezDO/A/+/hoa ZgNeYIzbWsXB3W4ks/lRUzEKTM8CTTZUQWsY1JFvSsT1ZwTZkYCkzdXU97zCrDpf8dbQ WZZtriVUGtWKZ1t1jnVGmhQvAOzUYkNnH5WsMFCIINmmrCzVzSnvDonSEq2Q8Fin6GcM 8BVBU6aGWLqarJdpyMV0WGZhXR+2f3wmgtOQSOXpR56RQfA4nhknSSGVZAxxLPcOFqQV 0pEfPyAsWVhycXmJgYcfgLLsPR+yUR/SoR4+UcIj+soKB9A6ijZX+zQKF5luJskNpu6v sp1Q== X-Gm-Message-State: APzg51C9OQjZjQIwdz1ZL1vlvPy8F1PmorecMa3KE4KXBixWZS2pZCxb 1wTnp7qPA3Nhx2ZArAnSK7vi6A== X-Google-Smtp-Source: ANB0VdaxKHW5J0ykQ/7zl/Sfc7B//sXOhJZs86cga/Myi1tRpgAsNeHyw3f9oUcwXounjp8UzbJAUw== X-Received: by 2002:a2e:4782:: with SMTP id u124-v6mr1320075lja.40.1535113399599; Fri, 24 Aug 2018 05:23:19 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v10-v6sm1175464ljg.12.2018.08.24.05.23.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 05:23:18 -0700 (PDT) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , Liviu Dudau , devicetree@vger.kernel.org Subject: [PATCH 1/2] drm/bridge: Add virtual display DT bindings Date: Fri, 24 Aug 2018 14:23:08 +0200 Message-Id: <20180824122308.3092-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 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: Lorenzo Pieralisi , Liviu Dudau , dri-devel@lists.freedesktop.org, Ryan Harkin , robh+dt@kernel.org, Sudeep Holla , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds bindings for a virtual display to be used with displays inside entirely virtual environments which do not emulate things like monitors but just need timing information to be supplied to its display controller. This is inspired by earlier work by Liviu Dudau. Cc: Liviu Dudau Cc: Ryan Harkin Signed-off-by: Linus Walleij --- .../display/bridge/virtual-display-bridge.txt | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/virtual-display-bridge.txt diff --git a/Documentation/devicetree/bindings/display/bridge/virtual-display-bridge.txt b/Documentation/devicetree/bindings/display/bridge/virtual-display-bridge.txt new file mode 100644 index 000000000000..ea4f5a91ab94 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/virtual-display-bridge.txt @@ -0,0 +1,62 @@ +Virtual Display Bridge + +This represents a display that is contained within an emulated +environment. + +This means that the display engine mainly expects some timing +parameters to be written into it, and after that the emulator will +respond by creating a virtual display with the requested +resolution characteristics. + +As the operating system cannot "detect" such a display, rather the +emulator will respond to what the controller outputs, a +chicken-and-egg problem needs to be solved: the resolution and +timing characteristics need to be defined and set up somewhere. + +The virtual display bridge solves this by defining a bridge with +all timing characteristics encoded into the device tree node. + +Required properies: +- compatible: shall be "virtual-display-bridge" + +Required subnodes: +- display-timings: contains in turn a display timing node + see display-timing.txt +- ports: contains the display ports, see media/video-interfaces.txt + +Example: + +bridge { + compatible = "virtual-display-bridge"; + #address-cells = <1>; + #size-cells = <0>; + + display-timings { + /* Some standard VGA timing */ + timing0 { + clock-frequency = <23750>; + hactive = <640>; + vactive = <480>; + hfront-porch = <48>; + hback-porch = <16>; + hsync-len = <96>; + vfront-porch = <33>; + vback-porch = <9>; + vsync-len = <3>; + vrefresh = <60>; + }; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + display_bridge_in: endpoint { + remote-endpoint = <&foo>; + }; + }; + }; +}; From patchwork Fri Aug 24 12:23:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10575305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20BAF1579 for ; Fri, 24 Aug 2018 12:23:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 111E22BB93 for ; Fri, 24 Aug 2018 12:23:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 052292BC5E; Fri, 24 Aug 2018 12:23:44 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 7D4AB2BB93 for ; Fri, 24 Aug 2018 12:23:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DD656E695; Fri, 24 Aug 2018 12:23:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FE3C6E695 for ; Fri, 24 Aug 2018 12:23:40 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id c21-v6so6550826lfh.3 for ; Fri, 24 Aug 2018 05:23:40 -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; bh=Zd7G5GUEoXMxDam+FYx8jRD+4uXxs50Qgf0/NVD3H7c=; b=P+JtpKOCstxph1M+w9tm9myhDCDTUXIY2+z1aO0kn+A4XEkdr4FhE9MlUcgTvXAFBA Z65SBRCV6jerKn3lGS1F7RQVVJM1TtcL6gxyzxiVbZO21XXdW2AXjsGVbXtt2d5z1AK9 jRAk5pDEDbBN986GNRzmIEddG6uuW3tYa/zU9/vLa95rZRUM7iM2TvGwJy1xCQmAKsEE sBoo/9hET6egTdKFTMq+1koxvfNaGsta2SMDVXho1VRcvP2lphmMzAWUi1/PxzS8WIYJ mBx+JkyJkk9VuSXPaMEa6BRzt5CRhNHIPHVjtnefRIx4tWXSggueVFNloCCZXRwJ5Geb E70g== X-Gm-Message-State: APzg51ACWVUy6iNVsi5ZchnIH1r71SnKFg9E97jG8gnfeKQr4nLQQNNW SpiojdS9eP1dsS1M+ucUBqaupQ== X-Google-Smtp-Source: ANB0VdaXiL8EI4fW+GswIUdDTvTUcAwyavDKX9A7yRPSanhE6l708TkXTrQN8M6BUOGo5HdqYmYmLw== X-Received: by 2002:a19:cb93:: with SMTP id b141-v6mr1192427lfg.119.1535113418967; Fri, 24 Aug 2018 05:23:38 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 14-v6sm1198285ljc.74.2018.08.24.05.23.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 05:23:37 -0700 (PDT) From: Linus Walleij To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , Liviu Dudau Subject: [PATCH 2/2] drm/bridge: Add support for a virtual display bridge Date: Fri, 24 Aug 2018 14:23:32 +0200 Message-Id: <20180824122332.3238-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 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: Lorenzo Pieralisi , Liviu Dudau , dri-devel@lists.freedesktop.org, Ryan Harkin , Sudeep Holla , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds a very small and simple driver to read a virtual display characteristic from the device tree and reflect it back into DRM so a display driver in a virtual environment knows how to configure its output. This was created for the ARM RTSM aemv8a emulator as a way forward to convert all ARM reference designs to use the PL11x DRM driver. Cc: Liviu Dudau Cc: Ryan Harkin Signed-off-by: Linus Walleij --- drivers/gpu/drm/bridge/Kconfig | 10 ++ drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/virtual-display.c | 186 +++++++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 drivers/gpu/drm/bridge/virtual-display.c diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index fa2c7997e2fd..cfb61305b3f6 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -126,6 +126,16 @@ config DRM_TI_TFP410 ---help--- Texas Instruments TFP410 DVI/HDMI Transmitter driver +config DRM_VIRTUAL_DISPLAY_BRIDGE + tristate "Virtual Display Bridge support" + depends on OF + select DRM_KMS_HELPER + select VIDEOMODE_HELPERS + help + Support for virtualized environments where the avilable + resolution is controlled by software configuration in + the device tree. + source "drivers/gpu/drm/bridge/analogix/Kconfig" source "drivers/gpu/drm/bridge/adv7511/Kconfig" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 35f88d48ec20..2bdf67d98972 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,4 +14,5 @@ obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o +obj-$(CONFIG_DRM_VIRTUAL_DISPLAY_BRIDGE) += virtual-display.o obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/virtual-display.c b/drivers/gpu/drm/bridge/virtual-display.c new file mode 100644 index 000000000000..ab55b3d6be8a --- /dev/null +++ b/drivers/gpu/drm/bridge/virtual-display.c @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * (C) Copyright 2018 Linus Walleij + */ + +#include +#include +#include +#include +#include +#include