diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index b07ca2e4d04..d9fbbe19107 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -110,6 +110,8 @@ int vmw_get_cap_3d_ioctl(struct drm_device *dev, void *data,  	memcpy_fromio(bounce, &fifo_mem[SVGA_FIFO_3D_CAPS], size);  	ret = copy_to_user(buffer, bounce, size); +	if (ret) +		ret = -EFAULT;  	vfree(bounce);  	if (unlikely(ret != 0)) @@ -131,6 +133,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,  	struct drm_vmw_rect *clips = NULL;  	struct drm_mode_object *obj;  	struct vmw_framebuffer *vfb; +	struct vmw_resource *res;  	uint32_t num_clips;  	int ret; @@ -178,11 +181,13 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,  	if (unlikely(ret != 0))  		goto out_no_ttm_lock; -	ret = vmw_user_surface_lookup_handle(dev_priv, tfile, arg->sid, -					     &surface); +	ret = vmw_user_resource_lookup_handle(dev_priv, tfile, arg->sid, +					      user_surface_converter, +					      &res);  	if (ret)  		goto out_no_surface; +	surface = vmw_res_to_srf(res);  	ret = vmw_kms_present(dev_priv, file_priv,  			      vfb, surface, arg->sid,  			      arg->dest_x, arg->dest_y,  |