diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-03-27 11:23:54 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-03-28 18:07:36 +0300 |
commit | ae358dacd217370cc362f1674712c4e9246ace8d (patch) | |
tree | 049bc8fbf62f7ef091087ee0e5d9d017ebbfc116 /drivers/gpu/drm/udl/udl_main.c | |
parent | fcb1e57f79c0ecf4c85fecd2294a469367cbddd0 (diff) | |
download | linux-ae358dacd217370cc362f1674712c4e9246ace8d.tar.xz |
drm/udl: Get rid of dev->struct_mutex usage
It's only used to protect our page list, and only when we know we have
a full reference. This means none of these code paths can ever race
with the final unref, and hence we do not need dev->struct_mutex
serialization and can simply switch to our own locking.
For more context the only magic the locked gem_free_object provides is
that it prevents concurrent final unref (and destruction) of gem
objects while anyone is holding dev->struct_mutex. This was used by
i915 (and other drivers) to implement eviction handling with less
headaches.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327082356.24516-3-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/udl/udl_main.c')
-rw-r--r-- | drivers/gpu/drm/udl/udl_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index f1ec4528a73e..d518de8f496b 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -324,6 +324,8 @@ int udl_driver_load(struct drm_device *dev, unsigned long flags) udl->ddev = dev; dev->dev_private = udl; + mutex_init(&udl->gem_lock); + if (!udl_parse_vendor_descriptor(dev, udl->udev)) { ret = -ENODEV; DRM_ERROR("firmware not recognized. Assume incompatible device\n"); |