All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
@ 2024-12-11 21:18 Jessica Zhang
  2024-12-11 21:18 ` [PATCH v3 1/2] drm: allow encoder mode_set even when connectors change for crtc Jessica Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jessica Zhang @ 2024-12-11 21:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: quic_abhinavk, dri-devel, linux-kernel, dmitry.baryshkov,
	robdclark, Jessica Zhang

Call encoder mode_set() when connectors are changed. This avoids issues
for cases where the connectors are changed but CRTC mode is not.

---
Changes in v3:
- BUILD_BUG_ON() for encoders and connectors array size check (Dmitry)
- Added more descriptive, file-specific names for helper functions
  (Dmitry)
- Added comment to test documenting what the test does (Dmitry)
- Return drm_connector_helper_get_modes_fixed() directly for encoder
  get_modes() instead of returning 1 (Dmitry)
- Move local variable declarations to top of function (Dmitry)
- Link to v2: https://lore.kernel.org/r/20241209-abhinavk-modeset-fix-v2-0-4d008f6ea8d0@quicinc.com

Changes in v2:

- Added kunit test

---
Abhinav Kumar (1):
      drm: allow encoder mode_set even when connectors change for crtc

Jessica Zhang (1):
      drm/tests: Add test for drm_atomic_helper_commit_modeset_disables()

 drivers/gpu/drm/drm_atomic_helper.c           |   2 +-
 drivers/gpu/drm/tests/Makefile                |   1 +
 drivers/gpu/drm/tests/drm_atomic_state_test.c | 244 ++++++++++++++++++++++++++
 3 files changed, 246 insertions(+), 1 deletion(-)
---
base-commit: 86313a9cd152330c634b25d826a281c6a002eb77
change-id: 20241209-abhinavk-modeset-fix-74864f1de08d

Best regards,
-- 
Jessica Zhang <quic_jesszhan@quicinc.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/2] drm: allow encoder mode_set even when connectors change for crtc
  2024-12-11 21:18 [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Jessica Zhang
@ 2024-12-11 21:18 ` Jessica Zhang
  2024-12-11 21:18 ` [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables() Jessica Zhang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Jessica Zhang @ 2024-12-11 21:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: quic_abhinavk, dri-devel, linux-kernel, dmitry.baryshkov,
	robdclark, Jessica Zhang

From: Abhinav Kumar <quic_abhinavk@quicinc.com>

In certain use-cases, a CRTC could switch between two encoders
and because the mode being programmed on the CRTC remains
the same during this switch, the CRTC's mode_changed remains false.
In such cases, the encoder's mode_set also gets skipped.

Skipping mode_set on the encoder for such cases could cause an issue
because even though the same CRTC mode was being used, the encoder
type could have changed like the CRTC could have switched from a
real time encoder to a writeback encoder OR vice-versa.

Allow encoder's mode_set to happen even when connectors changed on a
CRTC and not just when the mode changed.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5186d2114a503701e228e382cc45180b0c578d0c..32902f77f00dd8b85f03811e6d6da99b6d538afe 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1376,7 +1376,7 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state)
 		mode = &new_crtc_state->mode;
 		adjusted_mode = &new_crtc_state->adjusted_mode;
 
-		if (!new_crtc_state->mode_changed)
+		if (!new_crtc_state->mode_changed && !new_crtc_state->connectors_changed)
 			continue;
 
 		drm_dbg_atomic(dev, "modeset on [ENCODER:%d:%s]\n",

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables()
  2024-12-11 21:18 [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Jessica Zhang
  2024-12-11 21:18 ` [PATCH v3 1/2] drm: allow encoder mode_set even when connectors change for crtc Jessica Zhang
@ 2024-12-11 21:18 ` Jessica Zhang
  2024-12-11 22:50   ` Dmitry Baryshkov
  2024-12-16 11:06 ` [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Maxime Ripard
  2025-01-07 23:31 ` Dmitry Baryshkov
  3 siblings, 1 reply; 11+ messages in thread
From: Jessica Zhang @ 2024-12-11 21:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: quic_abhinavk, dri-devel, linux-kernel, dmitry.baryshkov,
	robdclark, Jessica Zhang

Add a subtest to check that modeset is called when the connector is
changed

Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
Changes in v3:
- Use BUILD_BUG_ON to check connectors and encoders array sizes (Dmitry)
- Renamed functions to be more test-specific (Dmitry)
- Added comment description for test (Dmitry)
- Return get_modes_fixed() directly within the encoder get_modes
  function (Dmitry)
- Move drm_connector local variable declaration to top of function
  (Dmitry)
- Changed drm_test_modeset() to a more descriptive name
---
 drivers/gpu/drm/tests/Makefile                |   1 +
 drivers/gpu/drm/tests/drm_atomic_state_test.c | 244 ++++++++++++++++++++++++++
 2 files changed, 245 insertions(+)

diff --git a/drivers/gpu/drm/tests/Makefile b/drivers/gpu/drm/tests/Makefile
index 56dab563abd7a7ee7c147bd6b4927e2436b82e1d..0109bcf7faa54993cce337f522eae78f0fa6ffcb 100644
--- a/drivers/gpu/drm/tests/Makefile
+++ b/drivers/gpu/drm/tests/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_DRM_KUNIT_TEST_HELPERS) += \
 	drm_kunit_helpers.o
 
 obj-$(CONFIG_DRM_KUNIT_TEST) += \
+	drm_atomic_state_test.o \
 	drm_buddy_test.o \
 	drm_cmdline_parser_test.o \
 	drm_connector_test.o \
diff --git a/drivers/gpu/drm/tests/drm_atomic_state_test.c b/drivers/gpu/drm/tests/drm_atomic_state_test.c
new file mode 100644
index 0000000000000000000000000000000000000000..be1f780249450ead7fbfd19ea98c96b442a94478
--- /dev/null
+++ b/drivers/gpu/drm/tests/drm_atomic_state_test.c
@@ -0,0 +1,244 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Test cases for the drm_atomic_state helpers
+ *
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_atomic_uapi.h>
+#include <drm/drm_kunit_helpers.h>
+#include <drm/drm_probe_helper.h>
+
+#define DRM_TEST_ENC_0 BIT(0)
+#define DRM_TEST_ENC_1 BIT(1)
+#define DRM_TEST_ENC_2 BIT(2)
+
+#define DRM_TEST_CONN_0 BIT(0)
+
+static const struct drm_display_mode drm_atomic_test_mode = {
+	DRM_MODE("1024x768", 0, 65000, 1024, 1048,
+		 1184, 1344, 0, 768, 771, 777, 806, 0,
+		 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
+};
+
+struct drm_atomic_test_priv {
+	struct drm_device drm;
+	struct drm_plane *plane;
+	struct drm_crtc *crtc;
+	struct drm_encoder encoders[3];
+	struct drm_connector connectors[2];
+};
+
+static int modeset_counter;
+
+static void drm_test_encoder_mode_set(struct drm_encoder *encoder,
+				      struct drm_crtc_state *crtc_state,
+				      struct drm_connector_state *conn_state)
+{
+	modeset_counter++;
+}
+
+static const struct drm_encoder_helper_funcs drm_atomic_test_encoder_funcs = {
+	.atomic_mode_set	= drm_test_encoder_mode_set,
+};
+
+static const struct drm_connector_funcs dummy_connector_funcs = {
+	.atomic_destroy_state	= drm_atomic_helper_connector_destroy_state,
+	.atomic_duplicate_state	= drm_atomic_helper_connector_duplicate_state,
+	.reset			= drm_atomic_helper_connector_reset,
+};
+
+static int drm_atomic_test_dummy_get_modes(struct drm_connector *connector)
+{
+	return drm_connector_helper_get_modes_fixed(connector,
+						    &drm_atomic_test_mode);
+}
+
+static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = {
+	.get_modes	= drm_atomic_test_dummy_get_modes,
+};
+
+static struct drm_atomic_test_priv *
+drm_atomic_test_init_drm_components(struct kunit *test, bool has_connectors)
+{
+	struct drm_atomic_test_priv *priv;
+	struct drm_encoder *enc;
+	struct drm_connector *conn;
+	struct drm_device *drm;
+	struct device *dev;
+	int ret;
+
+	dev = drm_kunit_helper_alloc_device(test);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
+
+	priv = drm_kunit_helper_alloc_drm_device(test, dev,
+						 struct drm_atomic_test_priv,
+						 drm,
+						 DRIVER_MODESET | DRIVER_ATOMIC);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv);
+	test->priv = priv;
+
+	drm = &priv->drm;
+	priv->plane = drm_kunit_helper_create_primary_plane(test, drm,
+							    NULL,
+							    NULL,
+							    NULL, 0,
+							    NULL);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->plane);
+
+	priv->crtc = drm_kunit_helper_create_crtc(test, drm,
+						  priv->plane, NULL,
+						  NULL,
+						  NULL);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->crtc);
+
+	for (int i = 0; i < ARRAY_SIZE(priv->encoders); i++) {
+		enc = &priv->encoders[i];
+
+		ret = drmm_encoder_init(drm, enc, NULL,
+					DRM_MODE_ENCODER_DSI, NULL);
+		KUNIT_ASSERT_EQ(test, ret, 0);
+
+		enc->possible_crtcs = drm_crtc_mask(priv->crtc);
+	}
+
+	priv->encoders[0].possible_clones = DRM_TEST_ENC_0 | DRM_TEST_ENC_1;
+	priv->encoders[1].possible_clones = DRM_TEST_ENC_0 | DRM_TEST_ENC_1;
+	priv->encoders[2].possible_clones = DRM_TEST_ENC_2;
+
+	if (!has_connectors)
+		goto done;
+
+	BUILD_BUG_ON(ARRAY_SIZE(priv->connectors) > ARRAY_SIZE(priv->encoders));
+
+	for (int i = 0; i < ARRAY_SIZE(priv->connectors); i++) {
+		conn = &priv->connectors[i];
+
+		ret = drmm_connector_init(drm, conn, &dummy_connector_funcs,
+					  DRM_MODE_CONNECTOR_DSI, NULL);
+		KUNIT_ASSERT_EQ(test, ret, 0);
+
+		drm_connector_helper_add(conn, &dummy_connector_helper_funcs);
+		drm_encoder_helper_add(&priv->encoders[i],
+				       &drm_atomic_test_encoder_funcs);
+
+		drm_connector_attach_encoder(conn, &priv->encoders[i]);
+	}
+
+done:
+	drm_mode_config_reset(drm);
+
+	return priv;
+}
+
+static int set_up_atomic_state(struct kunit *test,
+			       struct drm_atomic_test_priv *priv,
+			       struct drm_connector *connector,
+			       struct drm_modeset_acquire_ctx *ctx)
+{
+	struct drm_device *drm = &priv->drm;
+	struct drm_crtc *crtc = priv->crtc;
+	struct drm_atomic_state *state;
+	struct drm_connector_state *conn_state;
+	struct drm_crtc_state *crtc_state;
+	int ret;
+
+	state = drm_kunit_helper_atomic_state_alloc(test, drm, ctx);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
+
+	if (connector) {
+		conn_state = drm_atomic_get_connector_state(state, connector);
+		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state);
+
+		ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
+		KUNIT_EXPECT_EQ(test, ret, 0);
+	}
+
+	crtc_state = drm_atomic_get_crtc_state(state, crtc);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state);
+
+	ret = drm_atomic_set_mode_for_crtc(crtc_state, &drm_atomic_test_mode);
+	KUNIT_EXPECT_EQ(test, ret, 0);
+
+	crtc_state->enable = true;
+	crtc_state->active = true;
+
+	if (connector) {
+		ret = drm_atomic_commit(state);
+		KUNIT_ASSERT_EQ(test, ret, 0);
+	} else {
+		// dummy connector mask
+		crtc_state->connector_mask = DRM_TEST_CONN_0;
+	}
+
+	return 0;
+}
+
+/*
+ * Test that the DRM encoder mode_set() is called when the atomic state
+ * connectors are changed but the CRTC mode is not.
+ */
+static void drm_test_check_connector_changed_modeset(struct kunit *test)
+{
+	struct drm_atomic_test_priv *priv;
+	struct drm_modeset_acquire_ctx *ctx;
+	struct drm_connector *old_conn, *new_conn;
+	struct drm_atomic_state *state;
+	struct drm_device *drm;
+	struct drm_connector_state *new_conn_state, *old_conn_state;
+	int ret, initial_modeset_count;
+
+	priv = drm_atomic_test_init_drm_components(test, true);
+	KUNIT_ASSERT_NOT_NULL(test, priv);
+
+	drm = &priv->drm;
+	old_conn = &priv->connectors[0];
+	new_conn = &priv->connectors[1];
+
+	ctx = drm_kunit_helper_acquire_ctx_alloc(test);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
+
+	// first modeset to enable
+	ret = set_up_atomic_state(test, priv, old_conn, ctx);
+	KUNIT_ASSERT_EQ(test, ret, 0);
+
+	state = drm_kunit_helper_atomic_state_alloc(test, drm, ctx);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
+
+	new_conn_state = drm_atomic_get_connector_state(state, new_conn);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, new_conn_state);
+
+	old_conn_state = drm_atomic_get_connector_state(state, old_conn);
+	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, old_conn_state);
+
+	ret = drm_atomic_set_crtc_for_connector(old_conn_state, NULL);
+	KUNIT_EXPECT_EQ(test, ret, 0);
+
+	ret = drm_atomic_set_crtc_for_connector(new_conn_state, priv->crtc);
+	KUNIT_EXPECT_EQ(test, ret, 0);
+
+	initial_modeset_count = modeset_counter;
+
+	// modeset_disables is called as part of the atomic commit tail
+	ret = drm_atomic_commit(state);
+	KUNIT_ASSERT_EQ(test, ret, 0);
+	KUNIT_ASSERT_EQ(test, modeset_counter, initial_modeset_count + 1);
+}
+
+static struct kunit_case drm_test_check_modeset_test[] = {
+	KUNIT_CASE(drm_test_check_connector_changed_modeset),
+	{}
+};
+
+static struct kunit_suite drm_test_check_modeset_test_suite = {
+	.name = "drm_validate_modeset",
+	.test_cases = drm_test_check_modeset_test,
+};
+
+kunit_test_suite(drm_test_check_modeset_test_suite);
+
+MODULE_AUTHOR("Jessica Zhang <quic_jesszhan@quicinc.com");
+MODULE_DESCRIPTION("Test cases for the drm_atomic_helper functions");
+MODULE_LICENSE("GPL");

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables()
  2024-12-11 21:18 ` [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables() Jessica Zhang
@ 2024-12-11 22:50   ` Dmitry Baryshkov
  2025-02-04 11:23     ` Simona Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2024-12-11 22:50 UTC (permalink / raw)
  To: Jessica Zhang
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, quic_abhinavk, dri-devel, linux-kernel, robdclark

On Wed, Dec 11, 2024 at 01:18:43PM -0800, Jessica Zhang wrote:
> Add a subtest to check that modeset is called when the connector is
> changed
> 
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> ---
> Changes in v3:
> - Use BUILD_BUG_ON to check connectors and encoders array sizes (Dmitry)
> - Renamed functions to be more test-specific (Dmitry)
> - Added comment description for test (Dmitry)
> - Return get_modes_fixed() directly within the encoder get_modes
>   function (Dmitry)
> - Move drm_connector local variable declaration to top of function
>   (Dmitry)
> - Changed drm_test_modeset() to a more descriptive name
> ---
>  drivers/gpu/drm/tests/Makefile                |   1 +
>  drivers/gpu/drm/tests/drm_atomic_state_test.c | 244 ++++++++++++++++++++++++++
>  2 files changed, 245 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-11 21:18 [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Jessica Zhang
  2024-12-11 21:18 ` [PATCH v3 1/2] drm: allow encoder mode_set even when connectors change for crtc Jessica Zhang
  2024-12-11 21:18 ` [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables() Jessica Zhang
@ 2024-12-16 11:06 ` Maxime Ripard
  2024-12-16 18:27   ` Abhinav Kumar
  2025-01-07 23:31 ` Dmitry Baryshkov
  3 siblings, 1 reply; 11+ messages in thread
From: Maxime Ripard @ 2024-12-16 11:06 UTC (permalink / raw)
  To: Jessica Zhang
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	quic_abhinavk, dri-devel, linux-kernel, dmitry.baryshkov,
	robdclark

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

On Wed, Dec 11, 2024 at 01:18:41PM -0800, Jessica Zhang wrote:
> Call encoder mode_set() when connectors are changed. This avoids issues
> for cases where the connectors are changed but CRTC mode is not.

Looks great, thanks a lot for doing the tests :)

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-16 11:06 ` [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Maxime Ripard
@ 2024-12-16 18:27   ` Abhinav Kumar
  2024-12-17 15:02     ` Maxime Ripard
  0 siblings, 1 reply; 11+ messages in thread
From: Abhinav Kumar @ 2024-12-16 18:27 UTC (permalink / raw)
  To: Maxime Ripard, Jessica Zhang
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, dmitry.baryshkov, robdclark



On 12/16/2024 3:06 AM, Maxime Ripard wrote:
> On Wed, Dec 11, 2024 at 01:18:41PM -0800, Jessica Zhang wrote:
>> Call encoder mode_set() when connectors are changed. This avoids issues
>> for cases where the connectors are changed but CRTC mode is not.
> 
> Looks great, thanks a lot for doing the tests :)
> 
> Reviewed-by: Maxime Ripard <mripard@kernel.org>
> 
> Maxime

Thanks for your feedback.

Can we get an ack to land this through msm tree as part of the series 
which needed it?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-16 18:27   ` Abhinav Kumar
@ 2024-12-17 15:02     ` Maxime Ripard
  2024-12-20  2:05       ` Dmitry Baryshkov
  0 siblings, 1 reply; 11+ messages in thread
From: Maxime Ripard @ 2024-12-17 15:02 UTC (permalink / raw)
  To: Abhinav Kumar
  Cc: Jessica Zhang, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel, dmitry.baryshkov,
	robdclark

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

On Mon, Dec 16, 2024 at 10:27:44AM -0800, Abhinav Kumar wrote:
> 
> 
> On 12/16/2024 3:06 AM, Maxime Ripard wrote:
> > On Wed, Dec 11, 2024 at 01:18:41PM -0800, Jessica Zhang wrote:
> > > Call encoder mode_set() when connectors are changed. This avoids issues
> > > for cases where the connectors are changed but CRTC mode is not.
> > 
> > Looks great, thanks a lot for doing the tests :)
> > 
> > Reviewed-by: Maxime Ripard <mripard@kernel.org>
> > 
> > Maxime
> 
> Thanks for your feedback.
> 
> Can we get an ack to land this through msm tree as part of the series which
> needed it?

If possible, I'd rather merge it through drm-misc. We merge a
significant number of patches affecting the framework there, so a
conflict would be less likely there.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-17 15:02     ` Maxime Ripard
@ 2024-12-20  2:05       ` Dmitry Baryshkov
  2025-01-07 21:43         ` Abhinav Kumar
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2024-12-20  2:05 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Abhinav Kumar, Jessica Zhang, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel, robdclark

On Tue, Dec 17, 2024 at 04:02:21PM +0100, Maxime Ripard wrote:
> On Mon, Dec 16, 2024 at 10:27:44AM -0800, Abhinav Kumar wrote:
> > 
> > 
> > On 12/16/2024 3:06 AM, Maxime Ripard wrote:
> > > On Wed, Dec 11, 2024 at 01:18:41PM -0800, Jessica Zhang wrote:
> > > > Call encoder mode_set() when connectors are changed. This avoids issues
> > > > for cases where the connectors are changed but CRTC mode is not.
> > > 
> > > Looks great, thanks a lot for doing the tests :)
> > > 
> > > Reviewed-by: Maxime Ripard <mripard@kernel.org>
> > > 
> > > Maxime
> > 
> > Thanks for your feedback.
> > 
> > Can we get an ack to land this through msm tree as part of the series which
> > needed it?
> 
> If possible, I'd rather merge it through drm-misc. We merge a
> significant number of patches affecting the framework there, so a
> conflict would be less likely there.

I think it should be fine to merge this patchset + core part of the
Jessica's CWB patches ([1]) through drm-misc, then merge drm-misc-next
into msm-next. I'd ask for such a merge anyway, once Vignesh's IGT uprev
[2] lands in drm-misc as I need it to finally land the patchset
converting msm/hdmi to use the HDMI Connector framework.

[1] https://lore.kernel.org/dri-devel/20241216-concurrent-wb-v4-0-fe220297a7f0@quicinc.com/#r
[2] https://lore.kernel.org/dri-devel/20241217160655.2371138-1-vignesh.raman@collabora.com/

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-20  2:05       ` Dmitry Baryshkov
@ 2025-01-07 21:43         ` Abhinav Kumar
  0 siblings, 0 replies; 11+ messages in thread
From: Abhinav Kumar @ 2025-01-07 21:43 UTC (permalink / raw)
  To: Dmitry Baryshkov, Maxime Ripard
  Cc: Jessica Zhang, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel, robdclark



On 12/19/2024 6:05 PM, Dmitry Baryshkov wrote:
> On Tue, Dec 17, 2024 at 04:02:21PM +0100, Maxime Ripard wrote:
>> On Mon, Dec 16, 2024 at 10:27:44AM -0800, Abhinav Kumar wrote:
>>>
>>>
>>> On 12/16/2024 3:06 AM, Maxime Ripard wrote:
>>>> On Wed, Dec 11, 2024 at 01:18:41PM -0800, Jessica Zhang wrote:
>>>>> Call encoder mode_set() when connectors are changed. This avoids issues
>>>>> for cases where the connectors are changed but CRTC mode is not.
>>>>
>>>> Looks great, thanks a lot for doing the tests :)
>>>>
>>>> Reviewed-by: Maxime Ripard <mripard@kernel.org>
>>>>
>>>> Maxime
>>>
>>> Thanks for your feedback.
>>>
>>> Can we get an ack to land this through msm tree as part of the series which
>>> needed it?
>>
>> If possible, I'd rather merge it through drm-misc. We merge a
>> significant number of patches affecting the framework there, so a
>> conflict would be less likely there.
> 
> I think it should be fine to merge this patchset + core part of the
> Jessica's CWB patches ([1]) through drm-misc, then merge drm-misc-next
> into msm-next. I'd ask for such a merge anyway, once Vignesh's IGT uprev
> [2] lands in drm-misc as I need it to finally land the patchset
> converting msm/hdmi to use the HDMI Connector framework.
> 
> [1] https://lore.kernel.org/dri-devel/20241216-concurrent-wb-v4-0-fe220297a7f0@quicinc.com/#r
> [2] https://lore.kernel.org/dri-devel/20241217160655.2371138-1-vignesh.raman@collabora.com/
> 

Ok sounds good, I am fine to land this through drm-misc as well.

But we dont need to wait for CWB or the HDMI connector framework. This 
is needed not just for CWB but also other features as well including the 
bug we had fixed earlier ( mentioned here : 
https://patchwork.freedesktop.org/patch/612740/#comment_1115262 )

So, if we can land this into drm-misc first it will unblock many other 
things not just CWB.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed
  2024-12-11 21:18 [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Jessica Zhang
                   ` (2 preceding siblings ...)
  2024-12-16 11:06 ` [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Maxime Ripard
@ 2025-01-07 23:31 ` Dmitry Baryshkov
  3 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-01-07 23:31 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Jessica Zhang
  Cc: quic_abhinavk, dri-devel, linux-kernel, robdclark

On Wed, 11 Dec 2024 13:18:41 -0800, Jessica Zhang wrote:
> Call encoder mode_set() when connectors are changed. This avoids issues
> for cases where the connectors are changed but CRTC mode is not.
> 

Applied to drm-misc-next, thanks!

[1/2] drm: allow encoder mode_set even when connectors change for crtc
      commit: 7e182cb4f5567f53417b762ec0d679f0b6f0039d
[2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables()
      commit: 73d934d7b6e39a3e52586467a30ca3ff3f6f9eb4

Best regards,
-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables()
  2024-12-11 22:50   ` Dmitry Baryshkov
@ 2025-02-04 11:23     ` Simona Vetter
  0 siblings, 0 replies; 11+ messages in thread
From: Simona Vetter @ 2025-02-04 11:23 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, quic_abhinavk,
	dri-devel, linux-kernel, robdclark

On Thu, Dec 12, 2024 at 12:50:35AM +0200, Dmitry Baryshkov wrote:
> On Wed, Dec 11, 2024 at 01:18:43PM -0800, Jessica Zhang wrote:
> > Add a subtest to check that modeset is called when the connector is
> > changed
> > 
> > Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> > ---
> > Changes in v3:
> > - Use BUILD_BUG_ON to check connectors and encoders array sizes (Dmitry)
> > - Renamed functions to be more test-specific (Dmitry)
> > - Added comment description for test (Dmitry)
> > - Return get_modes_fixed() directly within the encoder get_modes
> >   function (Dmitry)
> > - Move drm_connector local variable declaration to top of function
> >   (Dmitry)
> > - Changed drm_test_modeset() to a more descriptive name
> > ---
> >  drivers/gpu/drm/tests/Makefile                |   1 +
> >  drivers/gpu/drm/tests/drm_atomic_state_test.c | 244 ++++++++++++++++++++++++++
> >  2 files changed, 245 insertions(+)
> > 
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Pretty sure this blows up with CONFIG_DEBUG_WW_MUTEX_SLOWPATH enabled.
Seems to generally be an issue with our kms kunit tests, so probably also
something we want to fix in CI.

Plus a pile of work to sort this out I fear :-/
-Sima
-- 
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-02-04 11:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 21:18 [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Jessica Zhang
2024-12-11 21:18 ` [PATCH v3 1/2] drm: allow encoder mode_set even when connectors change for crtc Jessica Zhang
2024-12-11 21:18 ` [PATCH v3 2/2] drm/tests: Add test for drm_atomic_helper_commit_modeset_disables() Jessica Zhang
2024-12-11 22:50   ` Dmitry Baryshkov
2025-02-04 11:23     ` Simona Vetter
2024-12-16 11:06 ` [PATCH v3 0/2] drm: Allow encoder modeset when connectors are changed Maxime Ripard
2024-12-16 18:27   ` Abhinav Kumar
2024-12-17 15:02     ` Maxime Ripard
2024-12-20  2:05       ` Dmitry Baryshkov
2025-01-07 21:43         ` Abhinav Kumar
2025-01-07 23:31 ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.