diff options
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 43 |
3 files changed, 49 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 5e1994a8ffca..e07dcf40a3ba 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
@@ -1085,7 +1085,8 @@ static struct drm_driver driver = { | |||
1085 | .release = drm_release, | 1085 | .release = drm_release, |
1086 | .unlocked_ioctl = vmw_unlocked_ioctl, | 1086 | .unlocked_ioctl = vmw_unlocked_ioctl, |
1087 | .mmap = vmw_mmap, | 1087 | .mmap = vmw_mmap, |
1088 | .poll = drm_poll, | 1088 | .poll = vmw_fops_poll, |
1089 | .read = vmw_fops_read, | ||
1089 | .fasync = drm_fasync, | 1090 | .fasync = drm_fasync, |
1090 | #if defined(CONFIG_COMPAT) | 1091 | #if defined(CONFIG_COMPAT) |
1091 | .compat_ioctl = drm_compat_ioctl, | 1092 | .compat_ioctl = drm_compat_ioctl, |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 83b2563e684a..0e9b2cefaa9d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -469,6 +469,10 @@ extern int vmw_present_ioctl(struct drm_device *dev, void *data, | |||
469 | struct drm_file *file_priv); | 469 | struct drm_file *file_priv); |
470 | extern int vmw_present_readback_ioctl(struct drm_device *dev, void *data, | 470 | extern int vmw_present_readback_ioctl(struct drm_device *dev, void *data, |
471 | struct drm_file *file_priv); | 471 | struct drm_file *file_priv); |
472 | extern unsigned int vmw_fops_poll(struct file *filp, | ||
473 | struct poll_table_struct *wait); | ||
474 | extern ssize_t vmw_fops_read(struct file *filp, char __user *buffer, | ||
475 | size_t count, loff_t *offset); | ||
472 | 476 | ||
473 | /** | 477 | /** |
474 | * Fifo utilities - vmwgfx_fifo.c | 478 | * Fifo utilities - vmwgfx_fifo.c |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index c0284a4784c9..97f23abeacda 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | |||
@@ -282,3 +282,46 @@ out_no_copy: | |||
282 | out_clips: | 282 | out_clips: |
283 | return ret; | 283 | return ret; |
284 | } | 284 | } |
285 | |||
286 | |||
287 | /** | ||
288 | * vmw_fops_poll - wrapper around the drm_poll function | ||
289 | * | ||
290 | * @filp: See the linux fops poll documentation. | ||
291 | * @wait: See the linux fops poll documentation. | ||
292 | * | ||
293 | * Wrapper around the drm_poll function that makes sure the device is | ||
294 | * processing the fifo if drm_poll decides to wait. | ||
295 | */ | ||
296 | unsigned int vmw_fops_poll(struct file *filp, struct poll_table_struct *wait) | ||
297 | { | ||
298 | struct drm_file *file_priv = filp->private_data; | ||
299 | struct vmw_private *dev_priv = | ||
300 | vmw_priv(file_priv->minor->dev); | ||
301 | |||
302 | vmw_fifo_ping_host(dev_priv, SVGA_SYNC_GENERIC); | ||
303 | return drm_poll(filp, wait); | ||
304 | } | ||
305 | |||
306 | |||
307 | /** | ||
308 | * vmw_fops_read - wrapper around the drm_read function | ||
309 | * | ||
310 | * @filp: See the linux fops read documentation. | ||
311 | * @buffer: See the linux fops read documentation. | ||
312 | * @count: See the linux fops read documentation. | ||
313 | * offset: See the linux fops read documentation. | ||
314 | * | ||
315 | * Wrapper around the drm_read function that makes sure the device is | ||
316 | * processing the fifo if drm_read decides to wait. | ||
317 | */ | ||
318 | ssize_t vmw_fops_read(struct file *filp, char __user *buffer, | ||
319 | size_t count, loff_t *offset) | ||
320 | { | ||
321 | struct drm_file *file_priv = filp->private_data; | ||
322 | struct vmw_private *dev_priv = | ||
323 | vmw_priv(file_priv->minor->dev); | ||
324 | |||
325 | vmw_fifo_ping_host(dev_priv, SVGA_SYNC_GENERIC); | ||
326 | return drm_read(filp, buffer, count, offset); | ||
327 | } | ||