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