summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl/udl_modeset.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2019-12-10 09:48:57 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2019-12-11 17:02:16 +0100
commite829cf0b30b4b55c9fa212cef1e116df91e0d80b (patch)
treeb860b76b1c4fa70dd2568bc4f63c2351457b8095 /drivers/gpu/drm/udl/udl_modeset.c
parent919dfb7830568f1d5b2cf0cfb9e0a1d4a4c7bfeb (diff)
downloadlinux-e829cf0b30b4b55c9fa212cef1e116df91e0d80b.tar.bz2
drm/udl: Init connector before encoder and CRTC
To mimic simple-pipe, we initialize the connector before the rest of the display pipeline. v2: * remove unnecessary calls to drm_connector_{register,unregister}() Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-2-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/udl/udl_modeset.c')
-rw-r--r--drivers/gpu/drm/udl/udl_modeset.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index 91af25caed64..5bb1522036c7 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -421,7 +421,10 @@ static const struct drm_mode_config_funcs udl_mode_funcs = {
int udl_modeset_init(struct drm_device *dev)
{
+ struct drm_connector *connector;
struct drm_encoder *encoder;
+ int ret;
+
drm_mode_config_init(dev);
dev->mode_config.min_width = 640;
@@ -435,13 +438,22 @@ int udl_modeset_init(struct drm_device *dev)
dev->mode_config.funcs = &udl_mode_funcs;
+ connector = udl_connector_init(dev);
+ if (IS_ERR(connector)) {
+ ret = PTR_ERR(connector);
+ goto err_drm_mode_config_cleanup;
+ }
+
udl_crtc_init(dev);
encoder = udl_encoder_init(dev);
-
- udl_connector_init(dev, encoder);
+ drm_connector_attach_encoder(connector, encoder);
return 0;
+
+err_drm_mode_config_cleanup:
+ drm_mode_config_cleanup(dev);
+ return ret;
}
void udl_modeset_restore(struct drm_device *dev)