diff options
author | Hsin-Yi Wang <hsinyi@chromium.org> | 2022-06-09 15:27:23 +0800 |
---|---|---|
committer | Douglas Anderson <dianders@chromium.org> | 2022-06-21 08:52:59 -0700 |
commit | 15b9ca1641f0c3cd74885280331e9172c62a125e (patch) | |
tree | ae11deafb2794a428fe46a3b14b98a80bb02df39 /include/drm | |
parent | a64af136771a7c50818fdc23ad4ce140ed7b66c8 (diff) | |
download | linux-15b9ca1641f0c3cd74885280331e9172c62a125e.tar.gz linux-15b9ca1641f0c3cd74885280331e9172c62a125e.tar.bz2 linux-15b9ca1641f0c3cd74885280331e9172c62a125e.zip |
drm: Config orientation property if panel provides it
Panel orientation property should be set before drm_dev_register().
Some drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.
In drm_bridge_connector_init(), if a bridge is a panel bridge, use it to
set the connector's panel orientation property.
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
[dianders: fixed space vs. tab indentation]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220609072722.3488207-9-hsinyi@chromium.org
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_bridge.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 42aec8612f37..d434ab416ad4 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -918,16 +918,30 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge, enum drm_connector_status status); #ifdef CONFIG_DRM_PANEL_BRIDGE +bool drm_bridge_is_panel(const struct drm_bridge *bridge); struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel); struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, u32 connector_type); void drm_panel_bridge_remove(struct drm_bridge *bridge); +int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge); struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, struct drm_panel *panel); struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, struct drm_panel *panel, u32 connector_type); struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge); +#else +static inline bool drm_bridge_is_panel(const struct drm_bridge *bridge) +{ + return false; +} + +static inline int drm_panel_bridge_set_orientation(struct drm_connector *connector, + struct drm_bridge *bridge) +{ + return -EINVAL; +} #endif #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE) |