drm_panel_get_modes() should take the connector as an argument [Was: drm/bridge: panel: Implement bridge ...]

Sam Ravnborg sam at ravnborg.org
Tue Jul 16 11:08:27 UTC 2019


Hi Laurent et all.

> +static int panel_bridge_get_modes(struct drm_bridge *bridge,
> +				  struct drm_connector *connector)
> +{
> +	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
> +
> +	/*
> +	 * FIXME: drm_panel_get_modes() should take the connector as an
> +	 * argument.
> +	 */
> +	return drm_panel_get_modes(panel_bridge->panel);
> +}

I took a look at this - it seems simple:
- Update drm_panel.get_modes() to take controller as argument, and fix
  all callers. All callers already have connector available.
- Drop drm_panel_attach(), drm_panel_detach() and update all callers.
  In reality just drop all code around attach(), detach().
  drm_panel_attach(), drm_panel_detach() will be noops when the
  connector stored in drm_panel is no longer used.

The semantic difference is that we supply the connector when we call
drm_panel_get_modes() and not at panel creation time with an drm_panel_attach().

So it should be doable without any migration from one world to the other.

If someone can say "yes it should be that simple", then I will
give it a spin.

	Sam


More information about the dri-devel mailing list