Hi Heiko,
On 2025/7/10 4:11, Heiko Stübner wrote:
Am Mittwoch, 9. Juli 2025, 09:01:39 Mitteleuropäische Sommerzeit schrieb Damon Ding:
Apply drm_bridge_connector helper for Analogix DP driver.
The following changes have been made:
- Remove &analogix_dp_device.connector and change
&analogix_dp_device.bridge from a pointer to an instance.
- Apply devm_drm_bridge_alloc() to allocate &analogix_dp_device that
contains &drm_bridge.
- Apply drm_bridge_connector helper to get rid of &drm_connector_funcs
and &drm_connector_helper_funcs.
Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx>
------
Changes in v2:
- For &drm_bridge.ops, remove DRM_BRIDGE_OP_HPD and add
DRM_BRIDGE_OP_EDID.
- Add analogix_dp_bridge_edid_read().
- Move &analogix_dp_plat_data.skip_connector deletion to the previous
patches.
---
.../drm/bridge/analogix/analogix_dp_core.c | 169 ++++++++----------
.../drm/bridge/analogix/analogix_dp_core.h | 4 +-
2 files changed, 80 insertions(+), 93 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index abc64cc17e4c..fb510e55ef06 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -23,6 +23,7 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_crtc.h>
#include <drm/drm_device.h>
#include <drm/drm_edid.h>
@@ -948,23 +949,13 @@ static int analogix_dp_disable_psr(struct analogix_dp_device *dp)
return analogix_dp_send_psr_spd(dp, &psr_vsc, true);
}
-static int analogix_dp_get_modes(struct drm_connector *connector)
+static int analogix_dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector)
{
- struct analogix_dp_device *dp = to_dp(connector);
- const struct drm_edid *drm_edid;
+ struct analogix_dp_device *dp = to_dp(bridge);
int num_modes = 0;
if (dp->plat_data->panel) {
num_modes += drm_panel_get_modes(dp->plat_data->panel, connector);
here is one example where a panel_bridge would help :-)
I.e. I'd think without it the code would need some sort of
if (dp->plat_data->bridge) {
num_modes += drm_bridge_get_modes(dp->plat_data->bridge, connector);
thing?
Oh, the handling of bridge here is indeed not well thought out. I will
implement the panel-bridge in the next version.
- } else {
- drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc);
-
- drm_edid_connector_update(&dp->connector, drm_edid);
-
- if (drm_edid) {
- num_modes += drm_edid_connector_add_modes(&dp->connector);
- drm_edid_free(drm_edid);
- }
}
if (dp->plat_data->get_modes)
Best regards,
Damon