drm: bridge: dw-hdmi: Pass private data pointer to .mode_valid()
Platform glue drivers for dw_hdmi may need to access device-specific data from their .mode_valid() implementation. They currently have no clean way to do so, and one driver hacks around it by accessing the dev_private data of the drm_device retrieved from the connector. Add a priv_data void pointer to the dw_hdmi_plat_data structure, and pass it to the .mode_valid() function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-12-laurent.pinchart+renesas@ideasonboard.com
このコミットが含まれているのは:
@@ -2771,6 +2771,7 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
struct dw_hdmi *hdmi = bridge->driver_private;
|
||||
const struct dw_hdmi_plat_data *pdata = hdmi->plat_data;
|
||||
struct drm_connector *connector = &hdmi->connector;
|
||||
enum drm_mode_status mode_status = MODE_OK;
|
||||
|
||||
@@ -2778,8 +2779,9 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
|
||||
return MODE_BAD;
|
||||
|
||||
if (hdmi->plat_data->mode_valid)
|
||||
mode_status = hdmi->plat_data->mode_valid(connector, mode);
|
||||
if (pdata->mode_valid)
|
||||
mode_status = pdata->mode_valid(hdmi, pdata->priv_data,
|
||||
connector, mode);
|
||||
|
||||
return mode_status;
|
||||
}
|
||||
|
新しいイシューから参照
ユーザーをブロックする