Re: [PATCH V3 1/5] drm/imx-ldb: Add support to drm-bridge
From: Philipp Zabel <hidden>
Date: 2016-08-01 10:22:18
Also in:
dri-devel, linux-arm-kernel, lkml
Am Sonntag, den 31.07.2016, 21:55 +0200 schrieb Peter Senna Tschudin:
Add support to attach a drm_bridge to imx-ldb in addition to existing support to attach a LVDS panel. This patch does a simple code refactoring by moving code from for_each_child_of_node iterator to a new function named imx_ldb_panel_ddc(). This was necessary to allow the panel ddc code to run only when the imx_ldb is not attached to a bridge. Cc: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> Cc: Philipp Zabel <redacted> Cc: Rob Herring <redacted> Cc: Fabio Estevam <redacted> Cc: David Airlie <redacted> Cc: Thierry Reding <redacted> Cc: Thierry Reding <redacted> Signed-off-by: Peter Senna Tschudin <peter.senna-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> --- Changes from V2: - Updated to be aplied on top of Liu Ying changes that made imx-ldb atomic. - Tested on next-20160729.
[...]
quoted hunk ↗ jump to hunk
@@ -469,19 +473,28 @@ static int imx_ldb_register(struct drm_device *drm, drm_encoder_init(drm, encoder, &imx_ldb_encoder_funcs, DRM_MODE_ENCODER_LVDS, NULL); - drm_connector_helper_add(&imx_ldb_ch->connector, - &imx_ldb_connector_helper_funcs); - drm_connector_init(drm, &imx_ldb_ch->connector, - &imx_ldb_connector_funcs, DRM_MODE_CONNECTOR_LVDS); - if (imx_ldb_ch->panel) { + drm_connector_helper_add(&imx_ldb_ch->connector, + &imx_ldb_connector_helper_funcs); + drm_connector_init(drm, &imx_ldb_ch->connector, + &imx_ldb_connector_funcs, + DRM_MODE_CONNECTOR_LVDS);
This is still not right. We want to add the connector whenever there is no bridge that brings its own, not only when there is a panel. For historical reasons, the ldb driver can also work without a panel.
ret = drm_panel_attach(imx_ldb_ch->panel, - &imx_ldb_ch->connector); + &imx_ldb_ch->connector);
What is the purpose of this change?
if (ret) return ret; } - drm_mode_connector_attach_encoder(&imx_ldb_ch->connector, encoder);
Where is this gone?
+ if (imx_ldb_ch->bridge) {
+ imx_ldb_ch->bridge->encoder = encoder;
+
+ imx_ldb_ch->encoder.bridge = imx_ldb_ch->bridge;
+ ret = drm_bridge_attach(drm, imx_ldb_ch->bridge);
+ if (ret) {
+ DRM_ERROR("Failed to initialize bridge with drm\n");
+ return ret;
+ }
+ }
return 0;
}regards Philipp -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html