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: 145063 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1215600ljw; Fri, 24 Aug 2018 05:24:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYi790+c7hy4a3l6iWu9GeBzQDFmIgajIUCp2yqOmCbzGa36xCTzq5byjkRBpsGQx/HqfGy X-Received: by 2002:a63:f94f:: with SMTP id q15-v6mr1469208pgk.213.1535113453900; Fri, 24 Aug 2018 05:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535113453; cv=none; d=google.com; s=arc-20160816; b=dvPpFsxeYRDLZdbRrHnSysoJzIEFAvaVZI+AwHj2FNmIa1sN4rWSyTA1K3QwPoXdD0 1+hA2lM3blWna5X24NChwQY0qDE4caSLtKx7wck1t+r+kLOqwERnZztip3r2teeAkVdV 0d70y4uAgReklSyYv5OTc2YPMv7SLq0+rraVaPi/gIJXN45C5m2Z2vAghyMq/N4aUsXd CoPelJhckzz5tJQGlbbKDT9pVAquWCz9zVClPJ9aqLfoF4jxSeIbzXS6qJSTnpE80f2s BVysMNqg3xNgNhBp1mqfP9n6ZSgOb/qYeh/GwpeJamRRu77O68fkYMj+SY1LAfL0ToeK NiEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=Hr7S3wsAJtUU6w/phzMRu0fGt1x8Sr68nkEVIj5/dBA=; b=OMeoXLG6HDz8XzOZHouAZTzYDYayoSawkARZM5W1L+cdpQZ8utJcWmANtoY1X+im1q KekFEfRduUDaAZ/mI3Jf+z2DEu31tzAjJQv2o8G/vqpL2avFxlXfUaDGl4KApwXSJ1t/ xUwA/1QKqixCQj1FomAO7Y7IRMehCiL9HbbWb6jEoxbHVV4TNtoLmGeJ9SZRfzbC8lQG GZjml5lZFN5WKvbRwiR6i61bKrr0LbPIiWXa+TowNWTh65+sfk5+9PGDdA7HUXndjrAe eo3VsrDo959KoLmS4wzMYGL1xlfkzpwCFlrupMxuUDa5mOmxp9HfVqzEfW0VeYS9TZnK TA2A== 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 h3-v6si6109496pls.150.2018.08.24.05.24.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 05:24:13 -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 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-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" 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