dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] drm/client: Stop using legacy crtc->mode and a bunch of cleanups
@ 2025-02-28 21:14 Ville Syrjala
  2025-02-28 21:14 ` [PATCH v2 1/8] drm/client: Constify modes Ville Syrjala
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Ville Syrjala @ 2025-02-28 21:14 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The most interesting part is the change to modes[] to solve
the lifetime issue so that we can stop using the legacy
crtc->mode for atomic drivers.

Additionally I included a bunch of cleanups, some of which were
inherited from https://patchwork.freedesktop.org/series/132051/

v2: Changed modes[] back to storing pointers rather
    than the actual mode structures, wasn't as ugly
    as I recalled last time

Ville Syrjälä (8):
  drm/client: Constify modes
  drm/client: Use array notation for function arguments
  drm/client: Streamline mode selection debugs
  drm/client: Make copies of modes
  drm/client: Stop using the legacy crtc->mode
  drm/client: s/new_crtc/crtc/
  drm/client: Move variables to tighter scope
  drm/client: s/unsigned int i/int i/

 drivers/gpu/drm/drm_client_modeset.c | 257 +++++++++++++++------------
 1 file changed, 140 insertions(+), 117 deletions(-)

-- 
2.45.3


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 6/8] drm/client: s/new_crtc/crtc/
@ 2024-10-03 11:33 Ville Syrjala
  2024-10-03 18:17 ` [PATCH v2 " Ville Syrjala
  0 siblings, 1 reply; 18+ messages in thread
From: Ville Syrjala @ 2024-10-03 11:33 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Rename the 'new_crtc' variable to just 'crtc' in
drm_client_firmware_config(). We don't call any of the other
stuff in here new or old so this feels out of place.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_client_modeset.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index 3e49448370c4..b82bb3119cb2 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -638,7 +638,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
 	for (i = 0; i < count; i++) {
 		struct drm_connector *connector;
 		struct drm_encoder *encoder;
-		struct drm_crtc *new_crtc;
+		struct drm_crtc *crtc;
 		const char *mode_type;
 
 		connector = connectors[i];
@@ -680,7 +680,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
 
 		num_connectors_enabled++;
 
-		new_crtc = connector->state->crtc;
+		crtc = connector->state->crtc;
 
 		/*
 		 * Make sure we're not trying to drive multiple connectors
@@ -688,7 +688,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
 		 * match the BIOS.
 		 */
 		for (j = 0; j < count; j++) {
-			if (crtcs[j] == new_crtc) {
+			if (crtcs[j] == crtc) {
 				drm_dbg_kms(dev, "[CONNECTOR:%d:%s] fallback: cloned configuration\n",
 					    connector->base.id, connector->name);
 				goto bail;
@@ -711,7 +711,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
 		/* last resort: use current mode */
 		if (!mode_valid(&modes[i])) {
 			mode_type = "current";
-			drm_mode_copy(&modes[i], &new_crtc->state->mode);
+			drm_mode_copy(&modes[i], &crtc->state->mode);
 		}
 
 		/*
@@ -723,11 +723,11 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
 			mode_type = "non tiled";
 			drm_mode_copy(&modes[i], drm_connector_fallback_non_tiled_mode(connector));
 		}
-		crtcs[i] = new_crtc;
+		crtcs[i] = crtc;
 
 		drm_dbg_kms(dev, "[CONNECTOR::%d:%s] on [CRTC:%d:%s] using %s mode: %s\n",
 			    connector->base.id, connector->name,
-			    new_crtc->base.id, new_crtc->name,
+			    crtc->base.id, crtc->name,
 			    mode_type, modes[i].name);
 
 		fallback = false;
-- 
2.45.2


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

end of thread, other threads:[~2025-03-12 14:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 21:14 [PATCH v2 0/8] drm/client: Stop using legacy crtc->mode and a bunch of cleanups Ville Syrjala
2025-02-28 21:14 ` [PATCH v2 1/8] drm/client: Constify modes Ville Syrjala
2025-03-01  3:28   ` kernel test robot
2025-03-01  4:41   ` kernel test robot
2025-03-03  9:38   ` [PATCH v3 " Ville Syrjala
2025-02-28 21:14 ` [PATCH v2 2/8] drm/client: Use array notation for function arguments Ville Syrjala
2025-02-28 21:14 ` [PATCH v2 3/8] drm/client: Streamline mode selection debugs Ville Syrjala
2025-02-28 21:14 ` [PATCH v2 4/8] drm/client: Make copies of modes Ville Syrjala
2025-03-12 14:38   ` Jani Nikula
2025-02-28 21:14 ` [PATCH v2 5/8] drm/client: Stop using the legacy crtc->mode Ville Syrjala
2025-03-12 14:44   ` Jani Nikula
2025-02-28 21:14 ` [PATCH v2 6/8] drm/client: s/new_crtc/crtc/ Ville Syrjala
2025-03-12 14:45   ` Jani Nikula
2025-02-28 21:14 ` [PATCH v2 7/8] drm/client: Move variables to tighter scope Ville Syrjala
2025-03-12 14:45   ` Jani Nikula
2025-02-28 21:14 ` [PATCH v2 8/8] drm/client: s/unsigned int i/int i/ Ville Syrjala
2025-03-12 14:45   ` Jani Nikula
  -- strict thread matches above, loose matches on Subject: below --
2024-10-03 11:33 [PATCH 6/8] drm/client: s/new_crtc/crtc/ Ville Syrjala
2024-10-03 18:17 ` [PATCH v2 " Ville Syrjala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).