Skip to contentSkip to conversation

drm/rockchip: Rely on the default best_encoder() behavior

PATCH In review Haneen Mohammed 3 participants 5 messages Sep 27, 2017 – Oct 10, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/rockchip: Rely on the default best_encoder() behavior

Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder().

---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -9
index a57da05..275844d 100644
@@ -287,14 +287,6 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 	return ret;
 }
 
-static struct drm_encoder *
-cdn_dp_connector_best_encoder(struct drm_connector *connector)
-{
-	struct cdn_dp_device *dp = connector_to_dp(connector);
-
-	return &dp->encoder;
-}
-
 static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 				       struct drm_display_mode *mode)
 {
@@ -346,7 +338,6 @@ static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 
 static struct drm_connector_helper_funcs cdn_dp_connector_helper_funcs = {
 	.get_modes = cdn_dp_connector_get_modes,
-	.best_encoder = cdn_dp_connector_best_encoder,
 	.mode_valid = cdn_dp_connector_mode_valid,
 };
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Haneen Mohammed

Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder().

Thanks for the patch, I've applied it to drm-misc-next.

I noticed a few instances of .best_encoder = drm_atomic_helper_best_encoder hanging around. Any interest in removing those as well?

Sean

Quoted 34 lines
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -9
index a57da05..275844d 100644
@@ -287,14 +287,6 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 	return ret;
 }
 
-static struct drm_encoder *
-cdn_dp_connector_best_encoder(struct drm_connector *connector)
-{
-	struct cdn_dp_device *dp = connector_to_dp(connector);
-
-	return &dp->encoder;
-}
-
 static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 				       struct drm_display_mode *mode)
 {
@@ -346,7 +338,6 @@ static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 
 static struct drm_connector_helper_funcs cdn_dp_connector_helper_funcs = {
 	.get_modes = cdn_dp_connector_get_modes,
-	.best_encoder = cdn_dp_connector_best_encoder,
 	.mode_valid = cdn_dp_connector_mode_valid,
 };
 
Signature · 1 line
2.7.4
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
#2 lore raw
Quoted 5 lines · Sean Paul
Quoted 4 lines · Haneen Mohammed

Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder().

Quoted 10 lines
Quoted 1 line

Thanks for the patch, I've applied it to drm-misc-next.

I noticed a few instances of .best_encoder = drm_atomic_helper_best_encoder hanging around. Any interest in removing those as well?

Sean

sure, I will check them out.

Thank you,
Haneen

Quoted 37 lines
Quoted 34 lines
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -9
index a57da05..275844d 100644
@@ -287,14 +287,6 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 	return ret;
 }
 
-static struct drm_encoder *
-cdn_dp_connector_best_encoder(struct drm_connector *connector)
-{
-	struct cdn_dp_device *dp = connector_to_dp(connector);
-
-	return &dp->encoder;
-}
-
 static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 				       struct drm_display_mode *mode)
 {
@@ -346,7 +338,6 @@ static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 
 static struct drm_connector_helper_funcs cdn_dp_connector_helper_funcs = {
 	.get_modes = cdn_dp_connector_get_modes,
-	.best_encoder = cdn_dp_connector_best_encoder,
 	.mode_valid = cdn_dp_connector_mode_valid,
 };
 
Signature · 1 line
2.7.4
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
#3 lore raw
In reply to Sean Paul
Quoted 5 lines · Sean Paul
Quoted 4 lines · Haneen Mohammed

Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder().

Quoted 10 lines
Quoted 1 line

Thanks for the patch, I've applied it to drm-misc-next.

I noticed a few instances of .best_encoder = drm_atomic_helper_best_encoder hanging around. Any interest in removing those as well?

Sean

I have found three instances, the one in bridge/synopsys/sw-hdmi.c I checked and the log msg of commit c2a441fe8f7 mentioned that an explicit assginment to the best_encoder is needed because the bridge is compatible with both atomic and non-atomic devices.

I suspect this is the same case for vmwgfx/vmwgfx_/ldu/scrn/stdu.c from checking commit d947d1b71.

Lastly, there is an instance in tinydrm/core/tinydrm-pipe.c but I am not sure how to verify if the driver supports atomic and non-atomic devices as well, hence justify deleting it.

- Haneen

Quoted 31 lines
Quoted 31 lines
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -9
index a57da05..275844d 100644
@@ -287,14 +287,6 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 	return ret;
 }
 
-static struct drm_encoder *
-cdn_dp_connector_best_encoder(struct drm_connector *connector)
-{
-	struct cdn_dp_device *dp = connector_to_dp(connector);
-
-	return &dp->encoder;
-}
-
 static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 				       struct drm_display_mode *mode)
 {
@@ -346,7 +338,6 @@ static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 
 static struct drm_connector_helper_funcs cdn_dp_connector_helper_funcs = {
 	.get_modes = cdn_dp_connector_get_modes,
-	.best_encoder = cdn_dp_connector_best_encoder,
 	.mode_valid = cdn_dp_connector_mode_valid,
 };
 
Quoted 6 lines
Quoted 3 lines
Signature · 1 line
2.7.4
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 13 lines · Haneen Mohammed
Quoted 12 lines · Sean Paul
Quoted 5 lines · Haneen Mohammed

Since the output has 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers, remove the custom best_encoder() and let the core call drm_atomic_helper_best_encoder().

Thanks for the patch, I've applied it to drm-misc-next.

I noticed a few instances of .best_encoder = drm_atomic_helper_best_encoder hanging around. Any interest in removing those as well?

Quoted 8 lines
Quoted 3 lines

Sean

I have found three instances, the one in bridge/synopsys/sw-hdmi.c I checked and the log msg of commit c2a441fe8f7 mentioned that an explicit assginment to the best_encoder is needed because the bridge is compatible with both atomic and non-atomic devices.

Yes, this is blocked on armada not yet being converted to atomic.

Might be good to add a comment to assignment in the code.

Quoted 2 lines

I suspect this is the same case for vmwgfx/vmwgfx_/ldu/scrn/stdu.c from checking commit d947d1b71.

vmgfx is fully atomic.

Quoted 3 lines

Lastly, there is an instance in tinydrm/core/tinydrm-pipe.c but I am not sure how to verify if the driver supports atomic and non-atomic devices as well, hence justify deleting it.

Same for tinydrm.

You can check this by looking for drm_crtc_helper_set_config() - if a driver is using that then it's a legacy one, if not, then it's atomic. -Daniel

Quoted 40 lines

- Haneen

Quoted 37 lines
Quoted 34 lines
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -9
index a57da05..275844d 100644
@@ -287,14 +287,6 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
 	return ret;
 }
 
-static struct drm_encoder *
-cdn_dp_connector_best_encoder(struct drm_connector *connector)
-{
-	struct cdn_dp_device *dp = connector_to_dp(connector);
-
-	return &dp->encoder;
-}
-
 static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 				       struct drm_display_mode *mode)
 {
@@ -346,7 +338,6 @@ static int cdn_dp_connector_mode_valid(struct drm_connector *connector,
 
 static struct drm_connector_helper_funcs cdn_dp_connector_helper_funcs = {
 	.get_modes = cdn_dp_connector_get_modes,
-	.best_encoder = cdn_dp_connector_best_encoder,
 	.mode_valid = cdn_dp_connector_mode_valid,
 };
 
Signature · 1 line
2.7.4
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch