diff options
author | Dave Airlie <airlied@redhat.com> | 2022-06-24 10:29:53 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2022-06-24 12:07:07 +1000 |
commit | 0936de1e96d6cbcd3d0ede8f31b1c3e6570dad2e (patch) | |
tree | 18a118445b0b63ea94556897f9b6c3696458e794 /drivers/gpu/drm/drm_connector.c | |
parent | 0a2af0bd6e48775646dea5f3524a52a74afae7e0 (diff) | |
parent | 009a3a52791f31c57d755a73f6bc66fbdd8bd76c (diff) |
Merge tag 'drm-misc-next-2022-06-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for v5.20:
UAPI Changes:
* media: Add various RGB666 and RGB888 format constants
Cross-subsystem Changes:
* media: Documentation
Core Changes:
* aperture: Fix segfault during hot-unplug
* dp: Support waiting for HDP signal, plus driver updates;
Port-validation fixes
* fbcon: Improve scrolling performance; Sanitize input
* Clean up <drm/drm_crtc.h>
Driver Changes:
* amdgpu: Cleanups
* bridge: Add support for i.MX8qxp and i.MX8qm; anx7625: DPI fixes;
tc358775: Fix clock settings; ti-sn65dsi83: Allow GPIO to sleep
* panel: Set orientation from panel, plus driver updates
* Several small cleanups
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YrQeAAVvQ6jxu2dl@linux-uq9g
Diffstat (limited to 'drivers/gpu/drm/drm_connector.c')
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 1c48d162c77e..28ea0f8196b9 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -24,6 +24,7 @@ #include <drm/drm_connector.h> #include <drm/drm_edid.h> #include <drm/drm_encoder.h> +#include <drm/drm_panel.h> #include <drm/drm_utils.h> #include <drm/drm_print.h> #include <drm/drm_drv.h> @@ -2320,6 +2321,9 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); * It is allowed to call this function with a panel_orientation of * DRM_MODE_PANEL_ORIENTATION_UNKNOWN, in which case it is a no-op. * + * The function shouldn't be called in panel after drm is registered (i.e. + * drm_dev_register() is called in drm). + * * Returns: * Zero on success, negative errno on failure. */ @@ -2389,6 +2393,33 @@ int drm_connector_set_panel_orientation_with_quirk( } EXPORT_SYMBOL(drm_connector_set_panel_orientation_with_quirk); +/** + * drm_connector_set_orientation_from_panel - + * set the connector's panel_orientation from panel's callback. + * @connector: connector for which to init the panel-orientation property. + * @panel: panel that can provide orientation information. + * + * Drm drivers should call this function before drm_dev_register(). + * Orientation is obtained from panel's .get_orientation() callback. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_set_orientation_from_panel( + struct drm_connector *connector, + struct drm_panel *panel) +{ + enum drm_panel_orientation orientation; + + if (panel && panel->funcs && panel->funcs->get_orientation) + orientation = panel->funcs->get_orientation(panel); + else + orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + + return drm_connector_set_panel_orientation(connector, orientation); +} +EXPORT_SYMBOL(drm_connector_set_orientation_from_panel); + static const struct drm_prop_enum_list privacy_screen_enum[] = { { PRIVACY_SCREEN_DISABLED, "Disabled" }, { PRIVACY_SCREEN_ENABLED, "Enabled" }, |