forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
drm: Add Virtual DRM device driver
Virtual DRM splits the resources of an overlay plane 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 compositor's drawing of 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 devices. However, these plane are no longer accessible from the original device. Each virtual device (and plane) can be accessed via a separate device file. Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
- Loading branch information
1 parent
b7b3c5a
commit 236425f4ac8488c7db1f37fc3e2b80626b2a2517
Showing
5 changed files
with
1,015 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| /* | ||
| * vdrm_api.h -- Virtual DRM API | ||
| * | ||
| * Copyright (C) 2021 Renesas Electronics Corporation | ||
| */ | ||
|
|
||
| #ifndef __VDRM_API__ | ||
| #define __VDRM_API__ | ||
|
|
||
| #include <linux/of_device.h> | ||
| #include <drm/drm_crtc.h> | ||
|
|
||
| /** | ||
| * struct vdrm_property_info - Information about the properties passed from | ||
| * the DRM driver to vDRM | ||
| * @prop: Parent property to pass to vDRM | ||
| * @default_val: Default value for the property passed to vDRM | ||
| */ | ||
| struct vdrm_property_info { | ||
| struct drm_property *prop; | ||
| uint64_t default_val; | ||
| }; | ||
|
|
||
| /** | ||
| * struct vdrm_funcs - Callbacks to parent DRM driver | ||
| */ | ||
| struct vdrm_funcs { | ||
| /** | ||
| * @dumb_create: | ||
| * | ||
| * Called by &drm_driver.dumb_create. Please read the documentation | ||
| * for the &drm_driver.dumb_create hook for more details. | ||
| */ | ||
| int (*dumb_create)(struct drm_file *file, struct drm_device *dev, | ||
| struct drm_mode_create_dumb *args); | ||
|
|
||
| /** | ||
| * @crtc_flush: | ||
| * | ||
| * Called by &drm_crtc_helper_funcs.atomic_flush. Please read the | ||
| * documentation for the &drm_crtc_helper_funcs.atomic_flush hook for | ||
| * more details. | ||
| */ | ||
| void (*crtc_flush)(struct drm_crtc *crtc); | ||
| }; | ||
|
|
||
| struct vdrm_device; | ||
| struct vdrm_display; | ||
|
|
||
| void vdrm_drv_handle_vblank(struct vdrm_display *vdisplay); | ||
| void vdrm_drv_finish_page_flip(struct vdrm_display *vdisplay); | ||
| struct vdrm_device *vdrm_drv_init(struct drm_device *dev, | ||
| struct device_node *np, int num_props, | ||
| struct vdrm_property_info *props, | ||
| const struct vdrm_funcs *funcs); | ||
| int vdrm_drv_plane_init(struct vdrm_device *vdrm, struct drm_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); | ||
| struct vdrm_display *vdrm_drv_display_init(struct vdrm_device *vdrm, | ||
| struct drm_crtc *crtc, | ||
| struct drm_plane *plane); | ||
| int vdrm_drv_register(struct vdrm_device *vdrm); | ||
| void vdrm_drv_fini(struct vdrm_device *vdrm); | ||
|
|
||
| #endif /* __VDRM_API__ */ |
Oops, something went wrong.