mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/vmwgfx: Use a per-device semaphore for reservation protection
Don't use a per-master semaphore (ttm lock) for reservation protection, but rather a per-device semaphore. This is needed since clients connecting using render nodes aren't master aware. The ttm lock used should probably be replaced with a reader-write semaphore once the function down_xx_interruptible() is available. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -226,7 +226,6 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_vmw_present_arg *arg =
|
||||
(struct drm_vmw_present_arg *)data;
|
||||
struct vmw_surface *surface;
|
||||
struct vmw_master *vmaster = vmw_master(file_priv->master);
|
||||
struct drm_vmw_rect __user *clips_ptr;
|
||||
struct drm_vmw_rect *clips = NULL;
|
||||
struct drm_framebuffer *fb;
|
||||
@@ -271,7 +270,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
|
||||
}
|
||||
vfb = vmw_framebuffer_to_vfb(fb);
|
||||
|
||||
ret = ttm_read_lock(&vmaster->lock, true);
|
||||
ret = ttm_read_lock(&dev_priv->reservation_sem, true);
|
||||
if (unlikely(ret != 0))
|
||||
goto out_no_ttm_lock;
|
||||
|
||||
@@ -291,7 +290,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
|
||||
vmw_surface_unreference(&surface);
|
||||
|
||||
out_no_surface:
|
||||
ttm_read_unlock(&vmaster->lock);
|
||||
ttm_read_unlock(&dev_priv->reservation_sem);
|
||||
out_no_ttm_lock:
|
||||
drm_framebuffer_unreference(fb);
|
||||
out_no_fb:
|
||||
@@ -311,7 +310,6 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_vmw_fence_rep __user *user_fence_rep =
|
||||
(struct drm_vmw_fence_rep __user *)
|
||||
(unsigned long)arg->fence_rep;
|
||||
struct vmw_master *vmaster = vmw_master(file_priv->master);
|
||||
struct drm_vmw_rect __user *clips_ptr;
|
||||
struct drm_vmw_rect *clips = NULL;
|
||||
struct drm_framebuffer *fb;
|
||||
@@ -361,7 +359,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
|
||||
goto out_no_ttm_lock;
|
||||
}
|
||||
|
||||
ret = ttm_read_lock(&vmaster->lock, true);
|
||||
ret = ttm_read_lock(&dev_priv->reservation_sem, true);
|
||||
if (unlikely(ret != 0))
|
||||
goto out_no_ttm_lock;
|
||||
|
||||
@@ -369,7 +367,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
|
||||
vfb, user_fence_rep,
|
||||
clips, num_clips);
|
||||
|
||||
ttm_read_unlock(&vmaster->lock);
|
||||
ttm_read_unlock(&dev_priv->reservation_sem);
|
||||
out_no_ttm_lock:
|
||||
drm_framebuffer_unreference(fb);
|
||||
out_no_fb:
|
||||
|
||||
Reference in New Issue
Block a user