drm/client: Fix: drm_client_new: Don't require DRM to be registered
Commit894a677f4b
("drm/cma-helper: Use the generic fbdev emulation") broke almost all drivers that use the CMA helper. The reason is that drm_client_new() requires that the DRM device has been registered, but the drivers register fbdev before registering DRM. Remove the requirement that DRM should be registered when creating a new client. Fixes:c76f0f7cb5
("drm: Begin an API for in-kernel clients") Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Icenowy Zheng <icenowy@aosc.io> Cc: Chen-Yu Tsai <wens@csie.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Tested-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20180711155632.37437-1-noralf@tronnes.org
This commit is contained in:
parent
5685ca0ca2
commit
ae61f61fa8
|
@ -78,7 +78,6 @@ EXPORT_SYMBOL(drm_client_close);
|
||||||
int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
|
int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
|
||||||
const char *name, const struct drm_client_funcs *funcs)
|
const char *name, const struct drm_client_funcs *funcs)
|
||||||
{
|
{
|
||||||
bool registered;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
|
if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
|
||||||
|
@ -97,21 +96,13 @@ int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
|
||||||
goto err_put_module;
|
goto err_put_module;
|
||||||
|
|
||||||
mutex_lock(&dev->clientlist_mutex);
|
mutex_lock(&dev->clientlist_mutex);
|
||||||
registered = dev->registered;
|
|
||||||
if (registered)
|
|
||||||
list_add(&client->list, &dev->clientlist);
|
list_add(&client->list, &dev->clientlist);
|
||||||
mutex_unlock(&dev->clientlist_mutex);
|
mutex_unlock(&dev->clientlist_mutex);
|
||||||
if (!registered) {
|
|
||||||
ret = -ENODEV;
|
|
||||||
goto err_close;
|
|
||||||
}
|
|
||||||
|
|
||||||
drm_dev_get(dev);
|
drm_dev_get(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_close:
|
|
||||||
drm_client_close(client);
|
|
||||||
err_put_module:
|
err_put_module:
|
||||||
if (funcs)
|
if (funcs)
|
||||||
module_put(funcs->owner);
|
module_put(funcs->owner);
|
||||||
|
|
Loading…
Reference in New Issue