From: Daniel Vetter Date: Wed, 26 Jul 2017 11:23:10 +0000 (+0200) Subject: Merge airlied/drm-next into drm-misc-next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=af055598542670c8533a58582813b1419949cae0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge airlied/drm-next into drm-misc-next I need this to be able to apply the deferred fbdev setup patches, I need the relevant prep work that landed through the drm-intel tree. Also squash in conflict fixup from Laurent Pinchart. Signed-off-by: Daniel Vetter --- af055598542670c8533a58582813b1419949cae0 diff --cc drivers/gpu/drm/bridge/panel.c index 65ab28cc2946,67fe19e5a9c6..685c1a480201 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@@ -158,9 -158,10 +158,9 @@@ struct drm_bridge *drm_panel_bridge_add u32 connector_type) { struct panel_bridge *panel_bridge; - int ret; if (!panel) - return ERR_PTR(EINVAL); + return ERR_PTR(-EINVAL); panel_bridge = devm_kzalloc(panel->dev, sizeof(*panel_bridge), GFP_KERNEL); diff --cc drivers/gpu/drm/drm_ioc32.c index ae386783e3ea,d1f202852028..f8e96e648acf --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@@ -991,14 -839,10 +839,10 @@@ static int compat_drm_wait_vblank(struc if (copy_from_user(&req32, argp, sizeof(req32))) return -EFAULT; - request = compat_alloc_user_space(sizeof(*request)); - if (!request - || __put_user(req32.request.type, &request->request.type) - || __put_user(req32.request.sequence, &request->request.sequence) - || __put_user(req32.request.signal, &request->request.signal)) - return -EFAULT; - - err = drm_ioctl(file, DRM_IOCTL_WAIT_VBLANK, (unsigned long)request); + req.request.type = req32.request.type; + req.request.sequence = req32.request.sequence; + req.request.signal = req32.request.signal; - err = drm_ioctl_kernel(file, drm_wait_vblank, &req, DRM_UNLOCKED); ++ err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, DRM_UNLOCKED); if (err) return err; diff --cc drivers/gpu/drm/drm_ioctl.c index f7f150e4a0c0,f1eb326524cf..8bfeb32f8a10 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@@ -704,11 -704,35 +704,38 @@@ static const struct drm_ioctl_desc drm_ * * And then assign this to the &drm_driver.ioctls field in your driver * structure. + * + * See the separate chapter on :ref:`file operations` for how + * the driver-specific IOCTLs are wired up. */ + long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata, + u32 flags) + { + struct drm_file *file_priv = file->private_data; + struct drm_device *dev = file_priv->minor->dev; + int retcode; + + if (drm_device_is_unplugged(dev)) + return -ENODEV; + + retcode = drm_ioctl_permit(flags, file_priv); + if (unlikely(retcode)) + return retcode; + + /* Enforce sane locking for modern driver ioctls. */ + if (!drm_core_check_feature(dev, DRIVER_LEGACY) || + (flags & DRM_UNLOCKED)) + retcode = func(dev, kdata, file_priv); + else { + mutex_lock(&drm_global_mutex); + retcode = func(dev, kdata, file_priv); + mutex_unlock(&drm_global_mutex); + } + return retcode; + } + EXPORT_SYMBOL(drm_ioctl_kernel); + /** * drm_ioctl - ioctl callback implementation for DRM drivers * @filp: file this ioctl is called on