aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@chromium.org>2015-01-30 04:14:17 -0500
committerMark Yao <mark.yao@rock-chips.com>2015-04-03 02:23:12 -0400
commitd3007dabeff493d82416a7ed69e0ff055a579fa1 (patch)
treebd9564020fdf7aba914ed6a27abc810ac3a69318
parent7f53fbba3cf8db8f584b26e89802413bc2e8d902 (diff)
drm/rockchip: register all connectors after bind
Register connectors with userspace after all components are bound. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Dominik Behr <dbehr@chromium.org> drm_connector_get_name -> connector->name This patch is necessary to make X11 see screens it seems. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_drv.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 21a481b224eb..30da7813d53e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -129,6 +129,7 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
129 struct rockchip_drm_private *private; 129 struct rockchip_drm_private *private;
130 struct dma_iommu_mapping *mapping; 130 struct dma_iommu_mapping *mapping;
131 struct device *dev = drm_dev->dev; 131 struct device *dev = drm_dev->dev;
132 struct drm_connector *connector;
132 int ret; 133 int ret;
133 134
134 private = devm_kzalloc(drm_dev->dev, sizeof(*private), GFP_KERNEL); 135 private = devm_kzalloc(drm_dev->dev, sizeof(*private), GFP_KERNEL);
@@ -171,6 +172,23 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
171 if (ret) 172 if (ret)
172 goto err_detach_device; 173 goto err_detach_device;
173 174
175 /*
176 * All components are now added, we can publish the connector sysfs
177 * entries to userspace. This will generate hotplug events and so
178 * userspace will expect to be able to access DRM at this point.
179 */
180 list_for_each_entry(connector, &drm_dev->mode_config.connector_list,
181 head) {
182 ret = drm_connector_register(connector);
183 if (ret) {
184 dev_err(drm_dev->dev,
185 "[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
186 connector->base.id,
187 connector->name, ret);
188 goto err_unbind;
189 }
190 }
191
174 /* init kms poll for handling hpd */ 192 /* init kms poll for handling hpd */
175 drm_kms_helper_poll_init(drm_dev); 193 drm_kms_helper_poll_init(drm_dev);
176 194
@@ -200,6 +218,7 @@ err_vblank_cleanup:
200 drm_vblank_cleanup(drm_dev); 218 drm_vblank_cleanup(drm_dev);
201err_kms_helper_poll_fini: 219err_kms_helper_poll_fini:
202 drm_kms_helper_poll_fini(drm_dev); 220 drm_kms_helper_poll_fini(drm_dev);
221err_unbind:
203 component_unbind_all(dev, drm_dev); 222 component_unbind_all(dev, drm_dev);
204err_detach_device: 223err_detach_device:
205 arm_iommu_detach_device(dev); 224 arm_iommu_detach_device(dev);