summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_drv.c
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2016-05-02 11:05:53 +0530
committerRob Clark <robdclark@gmail.com>2016-05-08 10:22:19 -0400
commit8208ed931eea9b00a3b29c9ef36da382b5480881 (patch)
tree99039a74397ca004dc2b8cf196735ca389cb7f8d /drivers/gpu/drm/msm/msm_drv.c
parentc899f9358485869a6e18902233eb77b31f0428ee (diff)
downloadop-kernel-dev-8208ed931eea9b00a3b29c9ef36da382b5480881.zip
op-kernel-dev-8208ed931eea9b00a3b29c9ef36da382b5480881.tar.gz
drm/msm: Centralize connector registration/unregistration
Move the drm_connector registration from the encoder(HDMI/DSI etc) drivers to the msm platform driver. This will simplify the task of ensuring that the connectors are registered only after the drm_device itself is registered. The connectors' destroy ops are made to use kzalloc instead of devm_kzalloc to ensure that that the connectors can be successfully unregistered when the msm driver module is removed. The memory for the connectors is unallocated when drm_mode_config_cleanup() is called during either during an error or during driver remove. Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index c257cdd..336070d 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -199,6 +199,8 @@ static int msm_unload(struct drm_device *dev)
drm_kms_helper_poll_fini(dev);
+ drm_connector_unregister_all(dev);
+
#ifdef CONFIG_DRM_FBDEV_EMULATION
if (fbdev && priv->fbdev)
msm_fbdev_free(dev);
@@ -414,6 +416,12 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
goto fail;
}
+ ret = drm_connector_register_all(dev);
+ if (ret) {
+ dev_err(dev->dev, "failed to register connectors\n");
+ goto fail;
+ }
+
drm_mode_config_reset(dev);
#ifdef CONFIG_DRM_FBDEV_EMULATION
OpenPOWER on IntegriCloud