Skip to contentSkip to conversation

drm/vkms: Add support for multiple pipes

PATCH Superseded Marius Vlad 3 participants 9 messages Apr 25, 2023 – May 8, 2023

Subsystems (4)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover drm/vkms: Add support for multiple pipes

With multiple pipe available we can perform management of outputs at a more granular level, such that we're able to turn off or on several outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI, and we have now uses cases which would need to ability to set-up the outputs DPMS/state individually, rather than globally -- which would affect all outputs. This an attempt on fixing that by giving the possibility to create more than one pipe, and thus allowing to run tests that could exercise code paths in the compositor related to management of outputs.

v3:
- Apply the series against drm-misc-next (Maíra Canal)
- Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
- Replace 'outputs' with 'pipes' as to use the proper terminology (Thomas Zimmermann, Maíra Canal)
- Fixed passing wrong possible_crtc bitmask when initializing the write back connector which address kms_writeback failure (Maíra Canal)
- Add a feat. note about moving overlay planes between CRTCs (Melissa Wen)

Marius Vlad (3):
vkms: Pass the correct bitmask for possible crtcs
vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

 Documentation/gpu/vkms.rst            |  5 +++--
 drivers/gpu/drm/vkms/vkms_crtc.c      |  3 +--
 drivers/gpu/drm/vkms/vkms_drv.c       | 31 +++++++++++++++++++++------
 drivers/gpu/drm/vkms/vkms_drv.h       | 12 ++++++++---
 drivers/gpu/drm/vkms/vkms_output.c    |  7 +++---
 drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++-----------
 6 files changed, 53 insertions(+), 29 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH v3 1/3 vkms: Pass the correct bitmask for possible crtcs

In preparation of having multiple pipelines we need to able to choose the correct encoder/connectors/crtc combination so pass also the index as a bitmask as possible CRTCs for the encoder.

---
 drivers/gpu/drm/vkms/vkms_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_output.c +1 -1
index 5ce70dd946aa..1b8aa3a34e46 100644
@@ -95,7 +95,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 		DRM_ERROR("Failed to init encoder\n");
 		goto err_encoder;
 	}
-	encoder->possible_crtcs = 1;
+	encoder->possible_crtcs = (1 << index);
 
 	ret = drm_connector_attach_encoder(connector, encoder);
 	if (ret) {
Signature · 1 line
2.39.2
#2 lore raw

PATCH v3 2/3 vkms: Add support for multiple pipes

In reply to Marius Vlad

This adds support for creating multiple virtual pipes, in case one would need to display multiple independent things on different outputs.

We use a module parameter to specify how many to create, defaulting to just one with the possibility of specifying a maximum of 4 possible pipes.

This is of particular importance when testing out the DRM back-end in compositors, but also to be able to independently set different DPMS states.

---
 drivers/gpu/drm/vkms/vkms_crtc.c      |  3 +--
 drivers/gpu/drm/vkms/vkms_drv.c       | 31 +++++++++++++++++++++------
 drivers/gpu/drm/vkms/vkms_drv.h       | 12 ++++++++---
 drivers/gpu/drm/vkms/vkms_output.c    |  5 ++---
 drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++-----------
 5 files changed, 49 insertions(+), 26 deletions(-)
drivers/gpu/drm/vkms/vkms_crtc.c +1 -2
index 515f6772b866..051e7b647db9 100644
@@ -89,8 +89,7 @@ static bool vkms_get_vblank_timestamp(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	unsigned int pipe = crtc->index;
-	struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev);
-	struct vkms_output *output = &vkmsdev->output;
+	struct vkms_output *output = drm_crtc_to_vkms_output(crtc);
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
 	if (!READ_ONCE(vblank->enabled)) {
drivers/gpu/drm/vkms/vkms_drv.c +25 -6
index e3c9c9571c8d..eeeb63e5396e 100644
@@ -51,14 +51,19 @@ static bool enable_overlay;
 module_param_named(enable_overlay, enable_overlay, bool, 0444);
 MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
 
+static unsigned int max_pipes = 1;
+module_param_named(max_pipes, max_pipes, int, 0444);
+MODULE_PARM_DESC(max_pipes, "Specify how many pipes to create");
+
 DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
 
 static void vkms_release(struct drm_device *dev)
 {
-	struct vkms_device *vkms = drm_device_to_vkms_device(dev);
+	int i;
+	struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev);
 
-	if (vkms->output.composer_workq)
-		destroy_workqueue(vkms->output.composer_workq);
+	for (i = 0; i < vkmsdev->config->max_pipes; i++)
+		destroy_workqueue(vkmsdev->output[i].composer_workq);
 }
 
 static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state)
@@ -99,6 +104,7 @@ static int vkms_config_show(struct seq_file *m, void *data)
 	seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback);
 	seq_printf(m, "cursor=%d\n", vkmsdev->config->cursor);
 	seq_printf(m, "overlay=%d\n", vkmsdev->config->overlay);
+	seq_printf(m, "pipes=%d\n", vkmsdev->config->max_pipes);
 
 	return 0;
 }
@@ -133,7 +139,7 @@ static const struct drm_mode_config_helper_funcs vkms_mode_config_helpers = {
 static int vkms_modeset_init(struct vkms_device *vkmsdev)
 {
 	struct drm_device *dev = &vkmsdev->drm;
-	int ret;
+	int ret, i;
 
 	ret = drmm_mode_config_init(dev);
 	if (ret)
@@ -152,7 +158,14 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev)
 	dev->mode_config.preferred_depth = 0;
 	dev->mode_config.helper_private = &vkms_mode_config_helpers;
 
-	return vkms_output_init(vkmsdev, 0);
+	for (i = 0; i < vkmsdev->config->max_pipes; i++) {
+		ret = vkms_output_init(vkmsdev, i);
+		if (ret)
+			return ret;
+	}
+
+	drm_mode_config_reset(dev);
+	return ret;
 }
 
 static int vkms_create(struct vkms_config *config)
@@ -188,7 +201,7 @@ static int vkms_create(struct vkms_config *config)
 		goto out_devres;
 	}
 
-	ret = drm_vblank_init(&vkms_device->drm, 1);
+	ret = drm_vblank_init(&vkms_device->drm, config->max_pipes);
 	if (ret) {
 		DRM_ERROR("Failed to vblank\n");
 		goto out_devres;
@@ -230,7 +243,13 @@ static int __init vkms_init(void)
 	config->cursor = enable_cursor;
 	config->writeback = enable_writeback;
 	config->overlay = enable_overlay;
+	config->max_pipes = max_pipes;
+	if (config->max_pipes > NUM_MAX_PIPES)
+		config->max_pipes = NUM_MAX_PIPES;
+	if (config->max_pipes < NUM_MIN_PIPES)
+		config->max_pipes = NUM_MIN_PIPES;
 
+	DRM_INFO("Initialized with %u pipes\n", config->max_pipes);
 	ret = vkms_create(config);
 	if (ret)
 		kfree(config);
drivers/gpu/drm/vkms/vkms_drv.h +9 -3
index 4a248567efb2..4aad5fb2d6eb 100644
@@ -21,7 +21,9 @@
 #define XRES_MAX  8192
 #define YRES_MAX  8192
 
-#define NUM_OVERLAY_PLANES 8
+#define NUM_OVERLAY_PLANES	8
+#define NUM_MAX_PIPES		4
+#define NUM_MIN_PIPES		1
 
 struct vkms_frame_info {
 	struct drm_framebuffer *fb;
@@ -113,6 +115,7 @@ struct vkms_config {
 	bool writeback;
 	bool cursor;
 	bool overlay;
+	unsigned int max_pipes;
 	/* only set when instantiated */
 	struct vkms_device *dev;
 };
@@ -120,13 +123,16 @@ struct vkms_config {
 struct vkms_device {
 	struct drm_device drm;
 	struct platform_device *platform;
-	struct vkms_output output;
+	struct vkms_output output[NUM_MAX_PIPES];
 	const struct vkms_config *config;
 };
 
 #define drm_crtc_to_vkms_output(target) \
 	container_of(target, struct vkms_output, crtc)
 
+#define wb_connector_to_vkms_output(target) \
+	container_of(target, struct vkms_output, wb_connector)
+
 #define drm_device_to_vkms_device(target) \
 	container_of(target, struct vkms_device, drm)
 
@@ -157,6 +163,6 @@ void vkms_composer_worker(struct work_struct *work);
 void vkms_set_composer(struct vkms_output *out, bool enabled);
 
 /* Writeback */
-int vkms_enable_writeback_connector(struct vkms_device *vkmsdev);
+int vkms_enable_writeback_connector(struct vkms_device *vkmsdev, int index);
 
 #endif /* _VKMS_DRV_H_ */
drivers/gpu/drm/vkms/vkms_output.c +2 -3
index 1b8aa3a34e46..9c801b8c4c12 100644
@@ -48,7 +48,7 @@ static int vkms_add_overlay_plane(struct vkms_device *vkmsdev, int index,
 
 int vkms_output_init(struct vkms_device *vkmsdev, int index)
 {
-	struct vkms_output *output = &vkmsdev->output;
+	struct vkms_output *output = &vkmsdev->output[index];
 	struct drm_device *dev = &vkmsdev->drm;
 	struct drm_connector *connector = &output->connector;
 	struct drm_encoder *encoder = &output->encoder;
@@ -104,12 +104,11 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 	}
 
 	if (vkmsdev->config->writeback) {
-		writeback = vkms_enable_writeback_connector(vkmsdev);
+		writeback = vkms_enable_writeback_connector(vkmsdev, index);
 		if (writeback)
 			DRM_ERROR("Failed to init writeback connector\n");
 	}
 
-	drm_mode_config_reset(dev);
 
 	return 0;
 
drivers/gpu/drm/vkms/vkms_writeback.c +12 -12
index 84a51cd281b9..5f291689f870 100644
@@ -101,7 +101,7 @@ static void vkms_wb_cleanup_job(struct drm_writeback_connector *connector,
 				struct drm_writeback_job *job)
 {
 	struct vkms_writeback_job *vkmsjob = job->priv;
-	struct vkms_device *vkmsdev;
+	struct vkms_output *output = wb_connector_to_vkms_output(connector);
 
 	if (!job->fb)
 		return;
@@ -110,19 +110,18 @@ static void vkms_wb_cleanup_job(struct drm_writeback_connector *connector,
 
 	drm_framebuffer_put(vkmsjob->wb_frame_info.fb);
 
-	vkmsdev = drm_device_to_vkms_device(job->fb->dev);
-	vkms_set_composer(&vkmsdev->output, false);
+	vkms_set_composer(output, false);
 	kfree(vkmsjob);
 }
 
 static void vkms_wb_atomic_commit(struct drm_connector *conn,
 				  struct drm_atomic_state *state)
 {
-	struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state,
-											 conn);
-	struct vkms_device *vkmsdev = drm_device_to_vkms_device(conn->dev);
-	struct vkms_output *output = &vkmsdev->output;
-	struct drm_writeback_connector *wb_conn = &output->wb_connector;
+	struct drm_connector_state *connector_state =
+		drm_atomic_get_new_connector_state(state, conn);
+	struct drm_writeback_job *wb_job = connector_state->writeback_job;
+	struct drm_writeback_connector *wb_conn = wb_job->connector;
+	struct vkms_output *output = wb_connector_to_vkms_output(wb_conn);
 	struct drm_connector_state *conn_state = wb_conn->base.state;
 	struct vkms_crtc_state *crtc_state = output->composer_state;
 	struct drm_framebuffer *fb = connector_state->writeback_job->fb;
@@ -135,7 +134,7 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,
 	if (!conn_state)
 		return;
 
-	vkms_set_composer(&vkmsdev->output, true);
+	vkms_set_composer(output, true);
 
 	active_wb = conn_state->writeback_job->priv;
 	wb_frame_info = &active_wb->wb_frame_info;
@@ -147,6 +146,7 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,
 	wb_frame_info->cpp = fb->format->cpp[0];
 	crtc_state->wb_pending = true;
 	spin_unlock_irq(&output->composer_lock);
+
 	drm_writeback_queue_job(wb_conn, connector_state);
 	active_wb->wb_write = get_line_to_frame_function(wb_format);
 	drm_rect_init(&wb_frame_info->src, 0, 0, crtc_width, crtc_height);
@@ -160,9 +160,9 @@ static const struct drm_connector_helper_funcs vkms_wb_conn_helper_funcs = {
 	.atomic_commit = vkms_wb_atomic_commit,
 };
 
-int vkms_enable_writeback_connector(struct vkms_device *vkmsdev)
+int vkms_enable_writeback_connector(struct vkms_device *vkmsdev, int index)
 {
-	struct drm_writeback_connector *wb = &vkmsdev->output.wb_connector;
+	struct drm_writeback_connector *wb = &vkmsdev->output[index].wb_connector;
 
 	drm_connector_helper_add(&wb->base, &vkms_wb_conn_helper_funcs);
 
@@ -171,5 +171,5 @@ int vkms_enable_writeback_connector(struct vkms_device *vkmsdev)
 					    &vkms_wb_encoder_helper_funcs,
 					    vkms_wb_formats,
 					    ARRAY_SIZE(vkms_wb_formats),
-					    1);
+					    1 << index);
 }
Signature · 1 line
2.39.2
#3 lore raw

PATCH v3 3/3 Documentation/gpu/vkms.rst: Added a note about plane migration

In reply to Marius Vlad

And remove the run-time configuration comment regarding needing first more than 1 pipe.

---
 Documentation/gpu/vkms.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/gpu/vkms.rst +3 -2
index 49db221c0f52..cfb3406933c0 100644
@@ -133,6 +133,8 @@ There's lots of plane features we could add support for:
 - Async updates (currently only possible on cursor plane using the legacy
   cursor api).
 
+- Overlay plane migration between CRTCs
+
 For all of these, we also want to review the igt test coverage and make sure
 all relevant igt testcases work on vkms. They are good options for internship
 project.
@@ -146,8 +148,7 @@ module. Use/Test-cases:
 - Hotplug/hotremove connectors on the fly (to be able to test DP MST handling
   of compositors).
 
-- Configure planes/crtcs/connectors (we'd need some code to have more than 1 of
-  them first).
+- Configure planes/crtcs/connectors
 
 - Change output configuration: Plug/unplug screens, change EDID, allow changing
   the refresh rate.
Signature · 1 line
2.39.2
#4 lore raw
In reply to Marius Vlad

We're doing/planning on doing similar or related work here at chromium.

https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both

Here's the stuff we have now (we're currently rebasing and touching it up, myself and @Yi Xie <[email protected]> will be taking over this work.

Our plans are to add configFS changes and DRI VKMS changes to be able to add and remove virtual displays at runtime (among other things needed for our own testing purposes for our Exo wayland implementation).

We're still learning how this all works and comes together, but it is worth letting you know "us too"

We can chat more and see where we overlap and can learn from each other :)

Quoted 41 lines · Marius Vlad

With multiple pipe available we can perform management of outputs at a more granular level, such that we're able to turn off or on several outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI, and we have now uses cases which would need to ability to set-up the outputs DPMS/state individually, rather than globally -- which would affect all outputs. This an attempt on fixing that by giving the possibility to create more than one pipe, and thus allowing to run tests that could exercise code paths in the compositor related to management of outputs.

v3:
- Apply the series against drm-misc-next (Maíra Canal)
- Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
- Replace 'outputs' with 'pipes' as to use the proper terminology (Thomas Zimmermann, Maíra Canal)
- Fixed passing wrong possible_crtc bitmask when initializing the write back connector which address kms_writeback failure (Maíra Canal)
- Add a feat. note about moving overlay planes between CRTCs (Melissa
Wen)

Marius Vlad (3):
vkms: Pass the correct bitmask for possible crtcs
vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

 Documentation/gpu/vkms.rst            |  5 +++--
 drivers/gpu/drm/vkms/vkms_crtc.c      |  3 +--
 drivers/gpu/drm/vkms/vkms_drv.c       | 31 +++++++++++++++++++++------
 drivers/gpu/drm/vkms/vkms_drv.h       | 12 ++++++++---
 drivers/gpu/drm/vkms/vkms_output.c    |  7 +++---
 drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++-----------
 6 files changed, 53 insertions(+), 29 deletions(-)

--
2.39.2

#5 lore raw

Hi Brandon, Xie,

Thanks for reaching out, and for the heads-up. I need to take a closer look, but by glancing over it, using configFS would be really awesome. Think we could really benefit from having that in our CI and being able to customize the entire pipeline. I'm totally for that.

It looks like it requires some infra work so I guess landing that might require quite a bit of time. Not sure if there are recent updates for it.

My changes are quite trivial and much more focused on just having multiple virtual displays, so IDK, I've submitted a version that seems to work, so I guess others should or would decide if we should drop mine and focus on the configFS series, or we should go with configFS as a follow-up. Would have liked to get something in the tree so we can at least have something to work with.

Thoughts on the matter on how should we go about it?

Quoted 55 lines · Brandon Ross Pollack

We're doing/planning on doing similar or related work here at chromium.

https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both <https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both>

Here's the stuff we have now (we're currently rebasing and touching it up, myself and @Yi Xie <mailto:[email protected]> will be taking over this work.

Our plans are to add configFS changes and DRI VKMS changes to be able to add and remove virtual displays at runtime (among other things needed for our own testing purposes for our Exo wayland implementation).

We're still learning how this all works and comes together, but it is worth letting you know "us too"

We can chat more and see where we overlap and can learn from each other :)

On Tue, Apr 25, 2023 at 4:30 PM Marius Vlad <[email protected] <mailto:[email protected]>> wrote:

With multiple pipe available we can perform management of outputs at a more granular level, such that we're able to turn off or on several outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI, and we have now uses cases which would need to ability to set-up the outputs DPMS/state individually, rather than globally -- which would affect all outputs. This an attempt on fixing that by giving the possibility to create more than one pipe, and thus allowing to run tests that could exercise code paths in the compositor related to management of outputs.

v3:
  - Apply the series against drm-misc-next (Maíra Canal)
  - Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
  - Replace 'outputs' with 'pipes' as to use the proper terminology (Thomas Zimmermann, Maíra Canal)
  - Fixed passing wrong possible_crtc bitmask when initializing the write back connector which address kms_writeback failure (Maíra
Canal)
  - Add a feat. note about moving overlay planes between CRTCs
(Melissa Wen)

Marius Vlad (3):
  vkms: Pass the correct bitmask for possible crtcs
  vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

 Documentation/gpu/vkms.rst            |  5 +++-- drivers/gpu/drm/vkms/vkms_crtc.c      |  3 +-- drivers/gpu/drm/vkms/vkms_drv.c       | 31 +++++++++++++++++++++------ drivers/gpu/drm/vkms/vkms_drv.h       | 12 ++++++++--- drivers/gpu/drm/vkms/vkms_output.c    |  7 +++--- drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++----------- 6 files changed, 53 insertions(+), 29 deletions(-)

--
2.39.2

#6 lore raw

I'm adding the original offer of those changes. We talked recently and they have the intent to push forward and merge them. I'm still getting up to speed a bit, but I will probably have a stronger opinion by early next week.

Quoted 82 lines · Marius Vlad

Hi Brandon, Xie,

Thanks for reaching out, and for the heads-up. I need to take a closer look, but by glancing over it, using configFS would be really awesome. Think we could really benefit from having that in our CI and being able to customize the entire pipeline. I'm totally for that.

It looks like it requires some infra work so I guess landing that might require quite a bit of time. Not sure if there are recent updates for it.

My changes are quite trivial and much more focused on just having multiple virtual displays, so IDK, I've submitted a version that seems to work, so I guess others should or would decide if we should drop mine and focus on the configFS series, or we should go with configFS as a follow-up. Would have liked to get something in the tree so we can at least have something to work with.

Thoughts on the matter on how should we go about it?

Quoted 61 lines · Brandon Ross Pollack

We're doing/planning on doing similar or related work here at chromium.

https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both <https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both>

Here's the stuff we have now (we're currently rebasing and touching it up, myself and @Yi Xie <mailto:[email protected]> will be taking over this work.

Our plans are to add configFS changes and DRI VKMS changes to be able to add and remove virtual displays at runtime (among other things needed for our own testing purposes for our Exo wayland implementation).

We're still learning how this all works and comes together, but it is worth letting you know "us too"

We can chat more and see where we overlap and can learn from each other :)

On Tue, Apr 25, 2023 at 4:30 PM Marius Vlad <[email protected] <mailto:[email protected]>> wrote:

With multiple pipe available we can perform management of outputs at a more granular level, such that we're able to turn off or on several outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI, and we have now uses cases which would need to ability to set-up the outputs DPMS/state individually, rather than globally -- which would affect all outputs. This an attempt on fixing that by giving the possibility to create more than one pipe, and thus allowing to run tests that could exercise code paths in the compositor related to management of outputs.

v3:
- Apply the series against drm-misc-next (Maíra Canal)
- Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
- Replace 'outputs' with 'pipes' as to use the proper terminology (Thomas Zimmermann, Maíra Canal)
- Fixed passing wrong possible_crtc bitmask when initializing the write back connector which address kms_writeback failure (Maíra
Canal)
- Add a feat. note about moving overlay planes between CRTCs
(Melissa Wen)

Marius Vlad (3):
vkms: Pass the correct bitmask for possible crtcs
vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

Documentation/gpu/vkms.rst | 5 +++--
drivers/gpu/drm/vkms/vkms_crtc.c | 3 +--
drivers/gpu/drm/vkms/vkms_drv.c | 31 +++++++++++++++++++++------
drivers/gpu/drm/vkms/vkms_drv.h | 12 ++++++++---
drivers/gpu/drm/vkms/vkms_output.c | 7 +++---
drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++----------- 6 files changed, 53 insertions(+), 29 deletions(-)

--
2.39.2

#7 lore raw

Hey, all!

I am so excited to see other folks excited about extending VKMS. I think it's a great project and has outstanding potential!

Life stuff made me AFK for the last few months, but I'm back now and I've been wrapping up the work on the patchset Brandon linked.

The current WIP patches are here:
https://gitlab.freedesktop.org/jshargo/compositor-kernel-explorations/-/merge_requests/4

They even come with matching IGT tests!
https://gitlab.freedesktop.org/jshargo/igt-gpu-tools/-/commit/8375cf128f0811d54ecb4a0b5cf044942ffc67b9

I'm hoping to send them out again soon, hopefully next week.

As a suggestion for how to move forward: the first three patches are little refactors that are separable from the core ConfigFS ones (which might have more back-and-forth design iterations). With those three, the param you're adding should be easy to put on top. I can try to get those out sooner for review.

What do you think?

Quoted 90 lines · Brandon Ross Pollack

I'm adding the original offer of those changes. We talked recently and they have the intent to push forward and merge them. I'm still getting up to speed a bit, but I will probably have a stronger opinion by early next week.

Quoted 82 lines · Marius Vlad

Hi Brandon, Xie,

Thanks for reaching out, and for the heads-up. I need to take a closer look, but by glancing over it, using configFS would be really awesome. Think we could really benefit from having that in our CI and being able to customize the entire pipeline. I'm totally for that.

It looks like it requires some infra work so I guess landing that might require quite a bit of time. Not sure if there are recent updates for it.

My changes are quite trivial and much more focused on just having multiple virtual displays, so IDK, I've submitted a version that seems to work, so I guess others should or would decide if we should drop mine and focus on the configFS series, or we should go with configFS as a follow-up. Would have liked to get something in the tree so we can at least have something to work with.

Thoughts on the matter on how should we go about it?

Quoted 61 lines · Brandon Ross Pollack

We're doing/planning on doing similar or related work here at chromium.

https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both <https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both>

Here's the stuff we have now (we're currently rebasing and touching it up, myself and @Yi Xie <mailto:[email protected]> will be taking over this work.

Our plans are to add configFS changes and DRI VKMS changes to be able to add and remove virtual displays at runtime (among other things needed for our own testing purposes for our Exo wayland implementation).

We're still learning how this all works and comes together, but it is worth letting you know "us too"

We can chat more and see where we overlap and can learn from each other :)

On Tue, Apr 25, 2023 at 4:30 PM Marius Vlad <[email protected] <mailto:[email protected]>> wrote:

With multiple pipe available we can perform management of outputs at a more granular level, such that we're able to turn off or on several outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI, and we have now uses cases which would need to ability to set-up the outputs DPMS/state individually, rather than globally -- which would affect all outputs. This an attempt on fixing that by giving the possibility to create more than one pipe, and thus allowing to run tests that could exercise code paths in the compositor related to management of outputs.

v3:
- Apply the series against drm-misc-next (Maíra Canal)
- Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
- Replace 'outputs' with 'pipes' as to use the proper terminology (Thomas Zimmermann, Maíra Canal)
- Fixed passing wrong possible_crtc bitmask when initializing the write back connector which address kms_writeback failure (Maíra
Canal)
- Add a feat. note about moving overlay planes between CRTCs
(Melissa Wen)

Marius Vlad (3):
vkms: Pass the correct bitmask for possible crtcs
vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

Documentation/gpu/vkms.rst | 5 +++--
drivers/gpu/drm/vkms/vkms_crtc.c | 3 +--
drivers/gpu/drm/vkms/vkms_drv.c | 31 +++++++++++++++++++++------
drivers/gpu/drm/vkms/vkms_drv.h | 12 ++++++++---
drivers/gpu/drm/vkms/vkms_output.c | 7 +++---
drivers/gpu/drm/vkms/vkms_writeback.c | 24 ++++++++++----------- 6 files changed, 53 insertions(+), 29 deletions(-)

--
2.39.2

#8 lore raw

Sorry for the late reply on my end (last week was a holiday week in Japan).

I'm just getting to looking through these closer now, I spent much of my vacation reading about kernel/drivers and things make much more sense now to me so I'll have some notes (hopefully) as well shortly.

Quoted 145 lines · Jim Shargo

Hey, all!

I am so excited to see other folks excited about extending VKMS. I think it's a great project and has outstanding potential!

Life stuff made me AFK for the last few months, but I'm back now and I've been wrapping up the work on the patchset Brandon linked.

The current WIP patches are here:

https://gitlab.freedesktop.org/jshargo/compositor-kernel-explorations/-/merge_requests/4

They even come with matching IGT tests!

https://gitlab.freedesktop.org/jshargo/igt-gpu-tools/-/commit/8375cf128f0811d54ecb4a0b5cf044942ffc67b9

I'm hoping to send them out again soon, hopefully next week.

As a suggestion for how to move forward: the first three patches are little refactors that are separable from the core ConfigFS ones (which might have more back-and-forth design iterations). With those three, the param you're adding should be easy to put on top. I can try to get those out sooner for review.

What do you think?

Quoted 8 lines · Brandon Ross Pollack

I'm adding the original offer of those changes. We talked recently and they have the intent to push forward and merge them. I'm still getting up to speed a bit, but I will probably have a stronger opinion by early next week.

On Wed, Apr 26, 2023 at 9:54 PM Marius Vlad <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines

Hi Brandon, Xie,

Thanks for reaching out, and for the heads-up. I need to take a closer look, but by glancing over it, using configFS would be really awesome. Think we could really benefit from having that in our CI and being able to customize the entire pipeline. I'm totally for that.

It looks like it requires some infra work so I guess landing that might require quite a bit of time. Not sure if there are recent updates for

it.

Quoted 4 lines
Quoted 4 lines

My changes are quite trivial and much more focused on just having multiple virtual displays, so IDK, I've submitted a version that seems to work, so I guess others should or would decide if we should drop

mine

Quoted 8 lines
Quoted 8 lines

and focus on the configFS series, or we should go with configFS as a follow-up. Would have liked to get something in the tree so we can at least have something to work with.

Thoughts on the matter on how should we go about it?

Quoted 1 line · Brandon Ross Pollack

We're doing/planning on doing similar or related work here at

chromium.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both
<
https://patchwork.kernel.org/project/dri-devel/list/?series=662676&submitter=&state=&q=&delegate=&archive=both

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Here's the stuff we have now (we're currently rebasing and touching

it

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

up, myself and @Yi Xie <mailto:[email protected]> will be taking over this work.

Our plans are to add configFS changes and DRI VKMS changes to be

able to

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

add and remove virtual displays at runtime (among other things needed for our own testing purposes for our Exo wayland implementation).

We're still learning how this all works and comes together, but it is worth letting you know "us too"

We can chat more and see where we overlap and can learn from each

other :)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On Tue, Apr 25, 2023 at 4:30 PM Marius Vlad <

[email protected]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

<mailto:[email protected]>> wrote:

With multiple pipe available we can perform management of

outputs at

Quoted 1 line
Quoted 1 line
Quoted 1 line

a more granular level, such that we're able to turn off or on

several

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

outputs at a time, or combinations that arise from doing that.

The Weston project use VKMS when running its test suite in CI,

and we

Quoted 1 line
Quoted 1 line
Quoted 1 line

have now uses cases which would need to ability to set-up the

outputs

Quoted 1 line
Quoted 1 line
Quoted 1 line

DPMS/state individually, rather than globally -- which would

affect all

Quoted 1 line
Quoted 1 line
Quoted 1 line

outputs. This an attempt on fixing that by giving the

possibility to

Quoted 1 line
Quoted 1 line
Quoted 1 line

create more than one pipe, and thus allowing to run tests that

could

Quoted 1 line
Quoted 1 line
Quoted 1 line

exercise code paths in the compositor related to management of

outputs.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

v3:
- Apply the series against drm-misc-next (Maíra Canal)
- Add a lower range check to avoid passing negative values to max_pipes (Maíra Canal)

v2:
- Replace 'outputs' with 'pipes' as to use the proper

terminology

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

(Thomas Zimmermann, Maíra Canal)
- Fixed passing wrong possible_crtc bitmask when initializing

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

write back connector which address kms_writeback failure

(Maíra

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Canal)
- Add a feat. note about moving overlay planes between CRTCs
(Melissa Wen)

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Marius Vlad (3):
vkms: Pass the correct bitmask for possible crtcs
vkms: Add support for multiple pipes Documentation/gpu/vkms.rst: Added a note about plane migration

Documentation/gpu/vkms.rst | 5 +++--
drivers/gpu/drm/vkms/vkms_crtc.c | 3 +--
drivers/gpu/drm/vkms/vkms_drv.c | 31

+++++++++++++++++++++------

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
      drivers/gpu/drm/vkms/vkms_drv.h       | 12 ++++++++---
      drivers/gpu/drm/vkms/vkms_output.c    |  7 +++---
      drivers/gpu/drm/vkms/vkms_writeback.c | 24

++++++++++-----------

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
      6 files changed, 53 insertions(+), 29 deletions(-)
    --
    2.39.2