2021-06-21 06:45:59

by Tomohito Esaki

[permalink] [raw]
Subject: [PATH 0/4] [RFC] Support virtual DRM

Hello
Sorry, there was a typo in the dri-devel mail address, so I've resend it.
---

Virtual DRM splits the overlay planes of a display controller into multiple
virtual devices to allow each plane to be accessed by each process.

This makes it possible to overlay images output from multiple processes on a
display. For example, one process displays the camera image without compositor
while another process overlays the UI.

Virtual DRM driver doesn’t directly control the display hardware and has no
access to the physical bus. Instead, the virtual DRM driver issues requests to
the standard DRM device driver (parent) when the hardware needs to be
controlled. The parent is modified to notify the virtual DRM driver of
interruptevents from the display hardware. Therefore, in order to use virtual
DRM, each DRM device driver needs to add code to support virutal DRM.

The only driver supported in this patch series is rcar-du. This patch series
is divided into multiple. The first patch adds vDRM feature to DRM, and the
second patch support vDRM for the rcar-du driver. The other patches add
documentation.

In particular, I would appreciate your advice on the following points:
* virtual DRM generalization
I've only tested with rcar-du, is there anything I should consider to make
virtual DRM work with other drivers?

* Integration to upstream
I think it is a good idea to add virtual DRM to the DRM core functionality,
but I would appreciate any suggestions on what needs to be improved for
integration to upstream.

* dumb_create and fb_create callback
I think that the dumb_create and fb_create callbacks need to be done by the
parent, and it is preferable to use the parent's callbacks as they are.
However, since the dumb buffer needs to be registered in the parent and
the fb handle needs to be registered in the drm_file of the vDRM, the
dumb_create callbacks from the parent driver cannot be used as is.
Therefore, the current implementation of the dumb_create callback is
workarround.
What do you think is the best way to deal with this issue?


Tomohito Esaki (4):
Add Virtual DRM device driver
rcar-du: Add support virtual DRM device
dt-bindings: display: Add virtual DRM
doc-rst: Add virtual DRM documentation

.../devicetree/bindings/display/vdrm.yaml | 67 ++
Documentation/gpu/drivers.rst | 1 +
Documentation/gpu/vdrm.rst | 51 ++
drivers/gpu/drm/Kconfig | 7 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/rcar-du/Kconfig | 4 +
drivers/gpu/drm/rcar-du/Makefile | 1 +
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 42 +
drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 13 +
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 13 +
drivers/gpu/drm/rcar-du/rcar_du_drv.h | 3 +
drivers/gpu/drm/rcar-du/rcar_du_vdrm.c | 191 ++++
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h | 67 ++
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 22 +
drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 1 +
drivers/gpu/drm/vdrm/vdrm_api.h | 68 ++
drivers/gpu/drm/vdrm/vdrm_drv.c | 859 ++++++++++++++++++
drivers/gpu/drm/vdrm/vdrm_drv.h | 80 ++
18 files changed, 1491 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/vdrm.yaml
create mode 100644 Documentation/gpu/vdrm.rst
create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_vdrm.c
create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_vdrm.h
create mode 100644 drivers/gpu/drm/vdrm/vdrm_api.h
create mode 100644 drivers/gpu/drm/vdrm/vdrm_drv.c
create mode 100644 drivers/gpu/drm/vdrm/vdrm_drv.h

--
2.25.1


2021-06-21 06:46:21

by Tomohito Esaki

[permalink] [raw]
Subject: [PATH 4/4] doc-rst: Add virtual DRM documentation

Signed-off-by: Tomohito Esaki <[email protected]>
---
Documentation/gpu/drivers.rst | 1 +
Documentation/gpu/vdrm.rst | 51 +++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
create mode 100644 Documentation/gpu/vdrm.rst

diff --git a/Documentation/gpu/drivers.rst b/Documentation/gpu/drivers.rst
index b4a0ed3ca961..bad0226de972 100644
--- a/Documentation/gpu/drivers.rst
+++ b/Documentation/gpu/drivers.rst
@@ -19,6 +19,7 @@ GPU Driver Documentation
xen-front
afbc
komeda-kms
+ vdrm

.. only:: subproject and html

diff --git a/Documentation/gpu/vdrm.rst b/Documentation/gpu/vdrm.rst
new file mode 100644
index 000000000000..2ab1699c2f42
--- /dev/null
+++ b/Documentation/gpu/vdrm.rst
@@ -0,0 +1,51 @@
+=============================
+ drm/vdrm virtual DRM driver
+=============================
+
+Virtual DRM splits the overlay planes of a display controller into multiple
+virtual devices to allow each plane to be accessed by each process.
+
+This makes it possible to overlay images output from multiple processes on a
+display. For example, one process displays the camera image without compositor
+while another process overlays the UI.
+
+The virtual DRM creates standalone virtual device and make DRM planes from a
+master device (e.g. card0) accessible via one or more virtual device. However,
+these plane are no longer accessible from the original device.
+Each virtual device (and plane) can be accessed via a separate device file.
+
+The virtual DRM driver doesn't directly control the display hardware and has
+no access to the physical bus. Instead, the virtual DRM driver issues requests
+to the standard DRM device driver ("master" driver) when the hardware needs to
+be controlled. The master driver is modified to notify the virtual DRM driver
+of interrupt events from the display hardware.
+
+Plane position and size
+=======================
+The initial position, size and z-position of the plane used in virtual DRM is
+specified in the device tree. The position and size of the planes are set as
+properties and can be updated. The name of each property is as
+follows:
+* vdrm_offset_x: x-coordinate of the left-top of the plane on the screen
+* vdrm_offset_y: y-coordinate of the left-top of the plane on the screen
+* vdrm_width: width of the plane
+* vdrm_height: height of the plane
+
+Virtual DRM Functions Reference
+===============================
+
+.. kernel-doc:: drivers/gpu/drm/vdrm/vdrm_api.h
+ :internal:
+
+.. kernel-doc:: drivers/gpu/drm/vdrm/vdrm_drv.c
+ :export:
+
+Driver limitations
+==================
+1. Each virtual DRM device only supports one plane per CRTC.
+
+2. Virtual DRM doesn't support hot plug connector.
+
+3. If virtual DRM has multiple CRTCs, the initial position and size of the
+ virtual DRM planes is the same for all planes, since they cannot be set
+ for each plane in the device tree.
--
2.25.1

2021-06-21 06:46:25

by Tomohito Esaki

[permalink] [raw]
Subject: [PATH 3/4] dt-bindings: display: Add virtual DRM

Add device tree bindings documentation for virtual DRM.

Signed-off-by: Tomohito Esaki <[email protected]>
---
.../devicetree/bindings/display/vdrm.yaml | 67 +++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/vdrm.yaml

diff --git a/Documentation/devicetree/bindings/display/vdrm.yaml b/Documentation/devicetree/bindings/display/vdrm.yaml
new file mode 100644
index 000000000000..6493bb0fc09f
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/vdrm.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/vdrm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Virtual DRM Device Tree Bindings
+
+description:
+ This document defines device tree properties virtual DRM. The initial
+ position, size and z-position of the plane used in the virtual DRM is
+ specified.
+ The current limitation is that these settings are applied to all crtc.
+
+properties:
+ compatible:
+ const: virt-drm
+
+patternProperties:
+ "^plane(@.*)?$":
+ description: Information of the planes used in virtual DRM
+ type: object
+
+ properties:
+ x:
+ type: int
+ description: x-coordinate of the left-top of the plane in pixels
+
+ y:
+ type: int
+ description: y-coordinate of the left-top of the plane in pixels
+
+ width:
+ type: int
+ description: width of the plane in pixels
+
+ height:
+ type: int
+ description: height of the plane in pixels
+
+ zpos:
+ type: int
+ description: z-position of the plane
+
+ required:
+ - x
+ - y
+ - width
+ - height
+ - zpos
+
+required:
+ - compatible
+ - "^plane(@.*)?$"
+
+examples:
+ - |
+ vdrm@0 {
+ compatible = "virt-drm";
+ plane@0 {
+ x = <200>;
+ y = <100>;
+ width = <800>;
+ height = <600>;
+ zpos = <1>;
+ };
+ };
--
2.25.1

2021-06-21 06:46:41

by Tomohito Esaki

[permalink] [raw]
Subject: [PATH 2/4] rcar-du: Add support virtual DRM device

In order to use vDRM, it is necessary that the vDRM device is registered
to du decice in the device tree.
The "vdrms" key is added in du node and the vDRM device node is specified.
For example:
----------
& du {
...
vdrms = <&vdrm0>;
};
----------

Signed-off-by: Tomohito Esaki <[email protected]>
---
drivers/gpu/drm/rcar-du/Kconfig | 4 +
drivers/gpu/drm/rcar-du/Makefile | 1 +
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 42 ++++++
drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 13 ++
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 13 ++
drivers/gpu/drm/rcar-du/rcar_du_drv.h | 3 +
drivers/gpu/drm/rcar-du/rcar_du_vdrm.c | 191 +++++++++++++++++++++++++
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h | 67 +++++++++
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 22 +++
drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 1 +
10 files changed, 357 insertions(+)
create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_vdrm.c
create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_vdrm.h

diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
index b47e74421e34..6747f69c8593 100644
--- a/drivers/gpu/drm/rcar-du/Kconfig
+++ b/drivers/gpu/drm/rcar-du/Kconfig
@@ -50,3 +50,7 @@ config DRM_RCAR_WRITEBACK
bool
default y if ARM64
depends on DRM_RCAR_DU
+
+config DRM_RCAR_DU_VDRM
+ tristate "Virtual DRM for R-Car DU"
+ depends on DRM_RCAR_DU && DRM_VDRM
diff --git a/drivers/gpu/drm/rcar-du/Makefile b/drivers/gpu/drm/rcar-du/Makefile
index 4d1187ccc3e5..b589b974a9f3 100644
--- a/drivers/gpu/drm/rcar-du/Makefile
+++ b/drivers/gpu/drm/rcar-du/Makefile
@@ -14,6 +14,7 @@ rcar-du-drm-$(CONFIG_DRM_RCAR_LVDS) += rcar_du_of.o \
rcar_du_of_lvds_r8a7796.dtb.o
rcar-du-drm-$(CONFIG_DRM_RCAR_VSP) += rcar_du_vsp.o
rcar-du-drm-$(CONFIG_DRM_RCAR_WRITEBACK) += rcar_du_writeback.o
+rcar-du-drm-$(CONFIG_DRM_RCAR_DU_VDRM) += rcar_du_vdrm.o

obj-$(CONFIG_DRM_RCAR_CMM) += rcar_cmm.o
obj-$(CONFIG_DRM_RCAR_DU) += rcar-du-drm.o
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index ea7e39d03545..7d48db24090b 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -32,6 +32,11 @@
#include "rcar_du_vsp.h"
#include "rcar_lvds.h"

+#include "rcar_du_vdrm.h"
+#ifdef CONFIG_DRM_RCAR_DU_VDRM
+#include "../vdrm/vdrm_api.h"
+#endif
+
static u32 rcar_du_crtc_read(struct rcar_du_crtc *rcrtc, u32 reg)
{
struct rcar_du_device *rcdu = rcrtc->dev;
@@ -1293,5 +1298,42 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,

rcar_du_crtc_crc_init(rcrtc);

+ INIT_LIST_HEAD(&rcrtc->vdrm_displays);
+ ret = rcar_du_vdrm_crtc_init(rcrtc, swindex);
+ if (ret < 0) {
+ dev_err(rcdu->dev,
+ "failed to initialize crtc %u for vDRM\n", swindex);
+ return ret;
+ }
+
+ return 0;
+}
+
+int rcar_du_crtc_add_vdrm_display(struct rcar_du_crtc *rcrtc,
+ struct vdrm_display *vdisplay)
+{
+ struct rcar_du_vdrm_display *disp;
+
+ disp = kzalloc(sizeof(*disp), GFP_KERNEL);
+ if (!disp)
+ return -ENOMEM;
+
+ disp->display = vdisplay;
+ INIT_LIST_HEAD(&disp->head);
+ list_add_tail(&disp->head, &rcrtc->vdrm_displays);
+
return 0;
}
+
+void rcar_du_crtc_remove_vdrm_displays(struct rcar_du_crtc *rcrtc)
+{
+ struct rcar_du_vdrm_display *disp, *tmp;
+
+ if (!rcrtc->dev)
+ return;
+
+ list_for_each_entry_safe(disp, tmp, &rcrtc->vdrm_displays, head) {
+ list_del(&disp->head);
+ kfree(disp);
+ }
+}
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
index 5f2940c42225..1f749f0061e5 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
@@ -21,6 +21,12 @@

struct rcar_du_group;
struct rcar_du_vsp;
+struct vdrm_display;
+
+struct rcar_du_vdrm_display {
+ struct vdrm_display *display;
+ struct list_head head;
+};

/**
* struct rcar_du_crtc - the CRTC, representing a DU superposition processor
@@ -43,6 +49,7 @@ struct rcar_du_vsp;
* @vsp: VSP feeding video to this CRTC
* @vsp_pipe: index of the VSP pipeline feeding video to this CRTC
* @writeback: the writeback connector
+ * @vdrm_displays: display list for virtual DRM
*/
struct rcar_du_crtc {
struct drm_crtc crtc;
@@ -73,6 +80,8 @@ struct rcar_du_crtc {
unsigned int sources_count;

struct drm_writeback_connector writeback;
+
+ struct list_head vdrm_displays;
};

#define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc)
@@ -111,4 +120,8 @@ void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc);

void rcar_du_crtc_dsysr_clr_set(struct rcar_du_crtc *rcrtc, u32 clr, u32 set);

+int rcar_du_crtc_add_vdrm_display(struct rcar_du_crtc *rcrtc,
+ struct vdrm_display *vdisplay);
+void rcar_du_crtc_remove_vdrm_displays(struct rcar_du_crtc *rcrtc);
+
#endif /* __RCAR_DU_CRTC_H__ */
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index bfbff90588cb..42f0f5e0144f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -29,6 +29,7 @@
#include "rcar_du_kms.h"
#include "rcar_du_of.h"
#include "rcar_du_regs.h"
+#include "rcar_du_vdrm.h"

/* -----------------------------------------------------------------------------
* Device Information
@@ -552,6 +553,8 @@ static int rcar_du_remove(struct platform_device *pdev)
struct rcar_du_device *rcdu = platform_get_drvdata(pdev);
struct drm_device *ddev = &rcdu->ddev;

+ rcar_du_vdrms_fini(rcdu);
+
drm_dev_unregister(ddev);

drm_kms_helper_poll_fini(ddev);
@@ -584,6 +587,11 @@ static int rcar_du_probe(struct platform_device *pdev)
if (IS_ERR(rcdu->mmio))
return PTR_ERR(rcdu->mmio);

+ /* Initialize the vDRM device */
+ ret = rcar_du_vdrms_init(rcdu);
+ if (ret < 0)
+ return ret;
+
/* DRM/KMS objects */
ret = rcar_du_modeset_init(rcdu);
if (ret < 0) {
@@ -607,6 +615,11 @@ static int rcar_du_probe(struct platform_device *pdev)

drm_fbdev_generic_setup(&rcdu->ddev, 32);

+ /* Register the vDRM device */
+ ret = rcar_du_vdrms_register(rcdu);
+ if (ret)
+ DRM_WARN("Setup virtual device failed.\n");
+
return 0;

error:
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
index 02ca2d0e1b55..327f3a250cbe 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
@@ -97,6 +97,9 @@ struct rcar_du_device {
unsigned int dpad0_source;
unsigned int dpad1_source;
unsigned int vspd1_sink;
+
+ struct vdrm_device **vdrms;
+ int num_vdrms;
};

static inline struct rcar_du_device *to_rcar_du_device(struct drm_device *dev)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vdrm.c b/drivers/gpu/drm/rcar-du/rcar_du_vdrm.c
new file mode 100644
index 000000000000..1f09ead92418
--- /dev/null
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vdrm.c
@@ -0,0 +1,191 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * rcar_du_vdrm.c -- R-Car Display Unit Virtual DRMs
+ *
+ * Copyright (C) 2021 Renesas Electronics Corporation
+ */
+
+#include <linux/of_device.h>
+
+#include <drm/drm_print.h>
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_vblank.h>
+#include <drm/drm_fourcc.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <media/vsp1.h>
+
+#include "rcar_du_vdrm.h"
+#include "rcar_du_kms.h"
+#include "rcar_du_crtc.h"
+#include "rcar_du_vsp.h"
+
+static int rcar_du_vdrm_dumb_create(struct drm_file *file,
+ struct drm_device *dev,
+ struct drm_mode_create_dumb *args)
+{
+ /*
+ * TODO:
+ * This is Warkarround.
+ * In the future, this function will be removed.
+ * The vdrm will be modified to directly call the dumb_create
+ * callback of the du driver.
+ */
+ unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+ unsigned int align;
+
+ /*
+ * The R8A7779 DU requires a 16 pixels pitch alignment as documented.
+ */
+ align = 16 * args->bpp / 8;
+
+ args->pitch = roundup(min_pitch, align);
+
+ return drm_gem_cma_dumb_create_internal(file, dev, args);
+}
+
+static void rcar_du_vdrm_crtc_flush(struct drm_crtc *crtc)
+{
+ struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+ rcar_du_vsp_atomic_flush(rcrtc);
+}
+
+static struct vdrm_funcs vdrm_funcs = {
+ .dumb_create = rcar_du_vdrm_dumb_create,
+ .crtc_flush = rcar_du_vdrm_crtc_flush,
+};
+
+void rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status)
+{
+ struct rcar_du_vdrm_display *disp;
+
+ list_for_each_entry(disp, &crtc->vdrm_displays, head) {
+ vdrm_drv_handle_vblank(disp->display);
+ if (status & VSP1_DU_STATUS_COMPLETE)
+ vdrm_drv_finish_page_flip(disp->display);
+ }
+}
+
+int rcar_du_vdrm_count(struct rcar_du_device *rcdu)
+{
+ const struct device_node *np = rcdu->dev->of_node;
+ int num;
+
+ num = of_property_count_u32_elems(np, "vdrms");
+ if (num < 0)
+ return 0;
+
+ return num;
+}
+
+int rcar_du_vdrms_init(struct rcar_du_device *rcdu)
+{
+ struct vdrm_device *vdrm;
+ int num_vdrms;
+ int i, ret;
+
+ num_vdrms = rcar_du_vdrm_count(rcdu);
+ if (num_vdrms == 0)
+ return 0;
+
+ rcdu->vdrms = kcalloc(num_vdrms, sizeof(vdrm), GFP_KERNEL);
+ if (!rcdu->vdrms)
+ return -1;
+
+ DRM_INFO("VDRM: num vdrm = %d\n", num_vdrms);
+
+ for (i = 0; i < num_vdrms; i++) {
+ struct of_phandle_args args;
+ const struct device_node *np = rcdu->dev->of_node;
+
+ ret = of_parse_phandle_with_fixed_args(np, "vdrms", 0, i,
+ &args);
+ if (ret < 0) {
+ DRM_WARN("VDRM: failed get vdrm%d.\n", i);
+ goto err;
+ }
+
+ vdrm = vdrm_drv_init(&rcdu->ddev, args.np, 0, NULL,
+ &vdrm_funcs);
+ of_node_put(args.np);
+ if (IS_ERR(vdrm)) {
+ ret = PTR_ERR(vdrm);
+ goto err;
+ }
+
+ rcdu->vdrms[i] = vdrm;
+ rcdu->num_vdrms++;
+ }
+
+ return 0;
+
+err:
+ rcar_du_vdrms_fini(rcdu);
+ rcdu->num_vdrms = 0;
+ return ret;
+}
+
+int rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
+ struct rcar_du_vsp_plane *plane,
+ const struct drm_plane_funcs *funcs,
+ const struct drm_plane_helper_funcs *helper_funcs,
+ const u32 *formats, unsigned int num_formats,
+ int max_zpos)
+{
+ return vdrm_drv_plane_init(vdrm, &plane->plane, funcs,
+ helper_funcs, formats, num_formats,
+ max_zpos);
+}
+
+int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index)
+{
+ struct rcar_du_device *rcdu;
+ int i;
+
+ rcdu = crtc->dev;
+ for (i = 0; i < rcdu->num_vdrms; i++) {
+ struct vdrm_display *vdisplay;
+ int plane_index = crtc->vsp->num_planes + i;
+ struct drm_plane *plane =
+ &crtc->vsp->planes[plane_index].plane;
+
+ vdisplay = vdrm_drv_display_init(rcdu->vdrms[i], &crtc->crtc,
+ plane);
+ if (IS_ERR(vdisplay))
+ return PTR_ERR(vdisplay);
+
+ rcar_du_crtc_add_vdrm_display(crtc, vdisplay);
+ }
+
+ return 0;
+}
+
+int rcar_du_vdrms_register(struct rcar_du_device *rcdu)
+{
+ int i, ret;
+
+ for (i = 0; i < rcdu->num_vdrms; i++) {
+ ret = vdrm_drv_register(rcdu->vdrms[i]);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+void rcar_du_vdrms_fini(struct rcar_du_device *rcdu)
+{
+ int i;
+
+ for (i = 0; i < rcdu->num_vdrms; i++) {
+ if (rcdu->vdrms[i])
+ vdrm_drv_fini(rcdu->vdrms[i]);
+ }
+
+ for (i = 0; i < RCAR_DU_MAX_CRTCS; i++)
+ rcar_du_crtc_remove_vdrm_displays(&rcdu->crtcs[i]);
+
+ kfree(rcdu->vdrms);
+}
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vdrm.h b/drivers/gpu/drm/rcar-du/rcar_du_vdrm.h
new file mode 100644
index 000000000000..b12706ceee54
--- /dev/null
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vdrm.h
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * rcar_du_vdrm.h -- R-Car Display Unit Virtual DRMs
+ *
+ * Copyright (C) 2021 Renesas Electronics Corporation
+ */
+
+#ifndef __RCAR_DU_VDRM_H__
+#define __RCAR_DU_VDRM_H__
+
+#include <drm/drm_atomic.h>
+
+#include "rcar_du_drv.h"
+#include "../vdrm/vdrm_api.h"
+
+#ifdef CONFIG_DRM_RCAR_DU_VDRM
+
+void rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status);
+void rcar_du_vdrm_vblank_event(struct rcar_du_crtc *crtc);
+int rcar_du_vdrm_count(struct rcar_du_device *rcdu);
+int rcar_du_vdrms_init(struct rcar_du_device *rcdu);
+int rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
+ struct rcar_du_vsp_plane *plane,
+ const struct drm_plane_funcs *funcs,
+ const struct drm_plane_helper_funcs *helper_funcs,
+ const u32 *formats, unsigned int num_formats,
+ int max_zpos);
+int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index);
+int rcar_du_vdrms_register(struct rcar_du_device *rcdu);
+void rcar_du_vdrms_fini(struct rcar_du_device *rcdu);
+
+#else
+
+static inline void
+rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status) { }
+static inline void rcar_du_vdrm_vblank_event(struct rcar_du_crtc *crtc) { }
+static inline int rcar_du_vdrm_count(struct rcar_du_device *rcdu)
+{
+ return 0;
+}
+static inline int rcar_du_vdrms_init(struct rcar_du_device *rcdu)
+{
+ return 0;
+}
+static inline int
+rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
+ struct rcar_du_vsp_plane *plane,
+ const struct drm_plane_funcs *funcs,
+ const struct drm_plane_helper_funcs *helper_funcs,
+ const u32 *formats, unsigned int num_formats,
+ int max_zpos)
+{
+ return 0;
+}
+static inline int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index)
+{
+ return 0;
+}
+static inline int rcar_du_vdrms_register(struct rcar_du_device *rcdu)
+{
+ return 0;
+}
+static inline void rcar_du_vdrms_fini(struct rcar_du_device *rcdu) { }
+
+#endif
+
+#endif /* __RCAR_DU_VDRM_H__ */
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 23e41c83c875..7666441f0005 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -31,6 +31,7 @@
#include "rcar_du_kms.h"
#include "rcar_du_vsp.h"
#include "rcar_du_writeback.h"
+#include "rcar_du_vdrm.h"

static void rcar_du_vsp_complete(void *private, unsigned int status, u32 crc)
{
@@ -45,6 +46,8 @@ static void rcar_du_vsp_complete(void *private, unsigned int status, u32 crc)
rcar_du_writeback_complete(crtc);

drm_crtc_add_crc_entry(&crtc->crtc, false, 0, &crc);
+
+ rcar_du_vdrm_crtc_complete(crtc, status);
}

void rcar_du_vsp_enable(struct rcar_du_crtc *crtc)
@@ -373,6 +376,8 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
unsigned int num_planes;
unsigned int i;
int ret;
+ int num_vdrms;
+ int vdrm_index = 0;

/* Find the VSP device and initialize it. */
pdev = of_find_device_by_node(np);
@@ -395,6 +400,8 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
*/
num_planes = rcdu->info->gen >= 3 ? 5 : 4;

+ num_vdrms = rcar_du_vdrm_count(rcdu);
+
vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL);
if (!vsp->planes)
return -ENOMEM;
@@ -408,6 +415,21 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
plane->vsp = vsp;
plane->index = i;

+ if (i >= num_planes - num_vdrms) {
+ ret = rcar_du_vdrm_plane_init(rcdu->vdrms[vdrm_index],
+ plane,
+ &rcar_du_vsp_plane_funcs,
+ &rcar_du_vsp_plane_helper_funcs,
+ rcar_du_vsp_formats,
+ ARRAY_SIZE(rcar_du_vsp_formats),
+ num_planes - 1);
+ if (ret < 0)
+ return ret;
+
+ vdrm_index++;
+ continue;
+ }
+
ret = drm_universal_plane_init(&rcdu->ddev, &plane->plane,
crtcs, &rcar_du_vsp_plane_funcs,
rcar_du_vsp_formats,
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
index 9b4724159378..0209def9fa6f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
@@ -16,6 +16,7 @@ struct drm_framebuffer;
struct rcar_du_format_info;
struct rcar_du_vsp;
struct sg_table;
+struct vdrm_display;

struct rcar_du_vsp_plane {
struct drm_plane plane;
--
2.25.1

2021-06-21 11:27:08

by kernel test robot

[permalink] [raw]
Subject: Re: [PATH 2/4] rcar-du: Add support virtual DRM device

Hi Tomohito,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on drm-intel/for-linux-next drm-tip/drm-tip linus/master v5.13-rc7 next-20210618]
[cannot apply to pinchartl-media/drm/du/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Tomohito-Esaki/Support-virtual-DRM/20210621-144611
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/cc44235a16ab2596f4eae5c4e9011e884ce89691
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tomohito-Esaki/Support-virtual-DRM/20210621-144611
git checkout cc44235a16ab2596f4eae5c4e9011e884ce89691
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:60:6: error: redefinition of 'rcar_du_vdrm_crtc_complete'
60 | void rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:35:1: note: previous definition of 'rcar_du_vdrm_crtc_complete' was here
35 | rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status) { }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:71:5: error: redefinition of 'rcar_du_vdrm_count'
71 | int rcar_du_vdrm_count(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:37:19: note: previous definition of 'rcar_du_vdrm_count' was here
37 | static inline int rcar_du_vdrm_count(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:83:5: error: redefinition of 'rcar_du_vdrms_init'
83 | int rcar_du_vdrms_init(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:41:19: note: previous definition of 'rcar_du_vdrms_init' was here
41 | static inline int rcar_du_vdrms_init(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:130:5: error: redefinition of 'rcar_du_vdrm_plane_init'
130 | int rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:46:1: note: previous definition of 'rcar_du_vdrm_plane_init' was here
46 | rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:142:5: error: redefinition of 'rcar_du_vdrm_crtc_init'
142 | int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:55:19: note: previous definition of 'rcar_du_vdrm_crtc_init' was here
55 | static inline int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:165:5: error: redefinition of 'rcar_du_vdrms_register'
165 | int rcar_du_vdrms_register(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:59:19: note: previous definition of 'rcar_du_vdrms_register' was here
59 | static inline int rcar_du_vdrms_register(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:178:6: error: redefinition of 'rcar_du_vdrms_fini'
178 | void rcar_du_vdrms_fini(struct rcar_du_device *rcdu)
| ^~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/rcar-du/rcar_du_vdrm.c:19:
drivers/gpu/drm/rcar-du/rcar_du_vdrm.h:63:20: note: previous definition of 'rcar_du_vdrms_fini' was here
63 | static inline void rcar_du_vdrms_fini(struct rcar_du_device *rcdu) { }
| ^~~~~~~~~~~~~~~~~~


vim +/rcar_du_vdrm_crtc_complete +60 drivers/gpu/drm/rcar-du/rcar_du_vdrm.c

59
> 60 void rcar_du_vdrm_crtc_complete(struct rcar_du_crtc *crtc, unsigned int status)
61 {
62 struct rcar_du_vdrm_display *disp;
63
64 list_for_each_entry(disp, &crtc->vdrm_displays, head) {
65 vdrm_drv_handle_vblank(disp->display);
66 if (status & VSP1_DU_STATUS_COMPLETE)
67 vdrm_drv_finish_page_flip(disp->display);
68 }
69 }
70
> 71 int rcar_du_vdrm_count(struct rcar_du_device *rcdu)
72 {
73 const struct device_node *np = rcdu->dev->of_node;
74 int num;
75
76 num = of_property_count_u32_elems(np, "vdrms");
77 if (num < 0)
78 return 0;
79
80 return num;
81 }
82
> 83 int rcar_du_vdrms_init(struct rcar_du_device *rcdu)
84 {
85 struct vdrm_device *vdrm;
86 int num_vdrms;
87 int i, ret;
88
89 num_vdrms = rcar_du_vdrm_count(rcdu);
90 if (num_vdrms == 0)
91 return 0;
92
93 rcdu->vdrms = kcalloc(num_vdrms, sizeof(vdrm), GFP_KERNEL);
94 if (!rcdu->vdrms)
95 return -1;
96
97 DRM_INFO("VDRM: num vdrm = %d\n", num_vdrms);
98
99 for (i = 0; i < num_vdrms; i++) {
100 struct of_phandle_args args;
101 const struct device_node *np = rcdu->dev->of_node;
102
103 ret = of_parse_phandle_with_fixed_args(np, "vdrms", 0, i,
104 &args);
105 if (ret < 0) {
106 DRM_WARN("VDRM: failed get vdrm%d.\n", i);
107 goto err;
108 }
109
110 vdrm = vdrm_drv_init(&rcdu->ddev, args.np, 0, NULL,
111 &vdrm_funcs);
112 of_node_put(args.np);
113 if (IS_ERR(vdrm)) {
114 ret = PTR_ERR(vdrm);
115 goto err;
116 }
117
118 rcdu->vdrms[i] = vdrm;
119 rcdu->num_vdrms++;
120 }
121
122 return 0;
123
124 err:
125 rcar_du_vdrms_fini(rcdu);
126 rcdu->num_vdrms = 0;
127 return ret;
128 }
129
> 130 int rcar_du_vdrm_plane_init(struct vdrm_device *vdrm,
131 struct rcar_du_vsp_plane *plane,
132 const struct drm_plane_funcs *funcs,
133 const struct drm_plane_helper_funcs *helper_funcs,
134 const u32 *formats, unsigned int num_formats,
135 int max_zpos)
136 {
137 return vdrm_drv_plane_init(vdrm, &plane->plane, funcs,
138 helper_funcs, formats, num_formats,
139 max_zpos);
140 }
141
> 142 int rcar_du_vdrm_crtc_init(struct rcar_du_crtc *crtc, int index)
143 {
144 struct rcar_du_device *rcdu;
145 int i;
146
147 rcdu = crtc->dev;
148 for (i = 0; i < rcdu->num_vdrms; i++) {
149 struct vdrm_display *vdisplay;
150 int plane_index = crtc->vsp->num_planes + i;
151 struct drm_plane *plane =
152 &crtc->vsp->planes[plane_index].plane;
153
154 vdisplay = vdrm_drv_display_init(rcdu->vdrms[i], &crtc->crtc,
155 plane);
156 if (IS_ERR(vdisplay))
157 return PTR_ERR(vdisplay);
158
159 rcar_du_crtc_add_vdrm_display(crtc, vdisplay);
160 }
161
162 return 0;
163 }
164
> 165 int rcar_du_vdrms_register(struct rcar_du_device *rcdu)
166 {
167 int i, ret;
168
169 for (i = 0; i < rcdu->num_vdrms; i++) {
170 ret = vdrm_drv_register(rcdu->vdrms[i]);
171 if (ret)
172 return ret;
173 }
174
175 return 0;
176 }
177
> 178 void rcar_du_vdrms_fini(struct rcar_du_device *rcdu)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (8.66 kB)
.config.gz (77.25 kB)
Download all attachments

2021-06-21 17:43:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATH 3/4] dt-bindings: display: Add virtual DRM

On Mon, 21 Jun 2021 15:44:02 +0900, Tomohito Esaki wrote:
> Add device tree bindings documentation for virtual DRM.
>
> Signed-off-by: Tomohito Esaki <[email protected]>
> ---
> .../devicetree/bindings/display/vdrm.yaml | 67 +++++++++++++++++++
> 1 file changed, 67 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/vdrm.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/display/vdrm.yaml:39:1: [error] syntax error: found character '\t' that cannot start any token (syntax)

dtschema/dtc warnings/errors:
make[1]: *** Deleting file 'Documentation/devicetree/bindings/display/vdrm.example.dts'
Traceback (most recent call last):
File "/usr/local/bin/dt-extract-example", line 45, in <module>
binding = yaml.load(open(args.yamlfile, encoding='utf-8').read())
File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/main.py", line 434, in load
return constructor.get_single_data()
File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", line 120, in get_single_data
node = self.composer.get_single_node()
File "_ruamel_yaml.pyx", line 706, in _ruamel_yaml.CParser.get_single_node
File "_ruamel_yaml.pyx", line 724, in _ruamel_yaml.CParser._compose_document
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
File "_ruamel_yaml.pyx", line 731, in _ruamel_yaml.CParser._compose_node
File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
ruamel.yaml.scanner.ScannerError: while scanning a plain scalar
in "<unicode string>", line 38, column 15
found a tab character that violates indentation
in "<unicode string>", line 39, column 1
make[1]: *** [Documentation/devicetree/bindings/Makefile:20: Documentation/devicetree/bindings/display/vdrm.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
./Documentation/devicetree/bindings/display/vdrm.yaml: while scanning a plain scalar
in "<unicode string>", line 38, column 15
found a tab character that violates indentation
in "<unicode string>", line 39, column 1
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/vdrm.yaml: ignoring, error parsing file
warning: no schema found in file: ./Documentation/devicetree/bindings/display/vdrm.yaml
make: *** [Makefile:1416: dt_binding_check] Error 2
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1494913

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-06-22 04:20:59

by Tomohito Esaki

[permalink] [raw]
Subject: Re: [PATH 3/4] dt-bindings: display: Add virtual DRM

Hi, Rob

Thank you for the error report and advice.
I will recheck DT binding.

Best regards
Tomohito Esaki

On 2021/06/22 2:40, Rob Herring wrote:
> On Mon, 21 Jun 2021 15:44:02 +0900, Tomohito Esaki wrote:
>> Add device tree bindings documentation for virtual DRM.
>>
>> Signed-off-by: Tomohito Esaki <[email protected]>
>> ---
>> .../devicetree/bindings/display/vdrm.yaml | 67 +++++++++++++++++++
>> 1 file changed, 67 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/display/vdrm.yaml
>>
>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
> ./Documentation/devicetree/bindings/display/vdrm.yaml:39:1: [error] syntax error: found character '\t' that cannot start any token (syntax)
>
> dtschema/dtc warnings/errors:
> make[1]: *** Deleting file 'Documentation/devicetree/bindings/display/vdrm.example.dts'
> Traceback (most recent call last):
> File "/usr/local/bin/dt-extract-example", line 45, in <module>
> binding = yaml.load(open(args.yamlfile, encoding='utf-8').read())
> File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/main.py", line 434, in load
> return constructor.get_single_data()
> File "/usr/local/lib/python3.8/dist-packages/ruamel/yaml/constructor.py", line 120, in get_single_data
> node = self.composer.get_single_node()
> File "_ruamel_yaml.pyx", line 706, in _ruamel_yaml.CParser.get_single_node
> File "_ruamel_yaml.pyx", line 724, in _ruamel_yaml.CParser._compose_document
> File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
> File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
> File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
> File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
> File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
> File "_ruamel_yaml.pyx", line 731, in _ruamel_yaml.CParser._compose_node
> File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
> ruamel.yaml.scanner.ScannerError: while scanning a plain scalar
> in "<unicode string>", line 38, column 15
> found a tab character that violates indentation
> in "<unicode string>", line 39, column 1
> make[1]: *** [Documentation/devicetree/bindings/Makefile:20: Documentation/devicetree/bindings/display/vdrm.example.dts] Error 1
> make[1]: *** Waiting for unfinished jobs....
> ./Documentation/devicetree/bindings/display/vdrm.yaml: while scanning a plain scalar
> in "<unicode string>", line 38, column 15
> found a tab character that violates indentation
> in "<unicode string>", line 39, column 1
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/vdrm.yaml: ignoring, error parsing file
> warning: no schema found in file: ./Documentation/devicetree/bindings/display/vdrm.yaml
> make: *** [Makefile:1416: dt_binding_check] Error 2
> \ndoc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/patch/1494913
>
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.
>

2021-06-22 08:09:30

by Simon Ser

[permalink] [raw]
Subject: Re: [PATH 0/4] [RFC] Support virtual DRM

On Monday, June 21st, 2021 at 08:43, Tomohito Esaki <[email protected]> wrote:

> Virtual DRM splits the overlay planes of a display controller into multiple
> virtual devices to allow each plane to be accessed by each process.
> This makes it possible to overlay images output from multiple processes on a
> display. For example, one process displays the camera image without compositor
> while another process overlays the UI.

Updating the KMS state from multiple processes doesn't sound like a
good idea. This opens up synchronization and global device limits
issues.

Are you aware of DRM leasing?

2021-06-22 16:55:55

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATH 3/4] dt-bindings: display: Add virtual DRM

On Mon, Jun 21, 2021 at 03:44:02PM +0900, Tomohito Esaki wrote:
> Add device tree bindings documentation for virtual DRM.

DRM is a Linuxism. What's virtual DRM? Why does it need to be in DT?
What's the usecase? You're going to need a lot more reasoning to justify
this for DT.

>
> Signed-off-by: Tomohito Esaki <[email protected]>
> ---
> .../devicetree/bindings/display/vdrm.yaml | 67 +++++++++++++++++++
> 1 file changed, 67 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/vdrm.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/vdrm.yaml b/Documentation/devicetree/bindings/display/vdrm.yaml
> new file mode 100644
> index 000000000000..6493bb0fc09f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/vdrm.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/vdrm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Virtual DRM Device Tree Bindings
> +
> +description:
> + This document defines device tree properties virtual DRM. The initial
> + position, size and z-position of the plane used in the virtual DRM is
> + specified.
> + The current limitation is that these settings are applied to all crtc.
> +
> +properties:
> + compatible:
> + const: virt-drm
> +
> +patternProperties:
> + "^plane(@.*)?$":
> + description: Information of the planes used in virtual DRM
> + type: object
> +
> + properties:
> + x:
> + type: int
> + description: x-coordinate of the left-top of the plane in pixels
> +
> + y:
> + type: int
> + description: y-coordinate of the left-top of the plane in pixels
> +
> + width:
> + type: int
> + description: width of the plane in pixels
> +
> + height:
> + type: int
> + description: height of the plane in pixels
> +
> + zpos:
> + type: int
> + description: z-position of the plane
> +
> + required:
> + - x
> + - y
> + - width
> + - height
> + - zpos
> +
> +required:
> + - compatible
> + - "^plane(@.*)?$"
> +
> +examples:
> + - |
> + vdrm@0 {
> + compatible = "virt-drm";
> + plane@0 {
> + x = <200>;
> + y = <100>;
> + width = <800>;
> + height = <600>;
> + zpos = <1>;
> + };
> + };
> --
> 2.25.1
>
>