aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-12-04 07:13:58 -0500
committerDave Airlie <airlied@redhat.com>2013-12-17 19:49:08 -0500
commit73e9efd4bddbf42d2938a150ba680b73b6126b77 (patch)
tree146a8b66778c04efcd05f7b22c4fcb13c859ff7f /drivers/gpu/drm/udl
parentee61c7303f84e2ef978aaed9b9640476c63ba586 (diff)
drm: Push dirtyfb ioctl kms locking down to drivers
Not all drivers will need take all the modeset locks for dirtyfb, so push the locking down to the drivers. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/udl')
-rw-r--r--drivers/gpu/drm/udl/udl_fb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index 97e9d614700f..dbadd49e4c4a 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -403,15 +403,17 @@ static int udl_user_framebuffer_dirty(struct drm_framebuffer *fb,
403 int i; 403 int i;
404 int ret = 0; 404 int ret = 0;
405 405
406 drm_modeset_lock_all(fb->dev);
407
406 if (!ufb->active_16) 408 if (!ufb->active_16)
407 return 0; 409 goto unlock;
408 410
409 if (ufb->obj->base.import_attach) { 411 if (ufb->obj->base.import_attach) {
410 ret = dma_buf_begin_cpu_access(ufb->obj->base.import_attach->dmabuf, 412 ret = dma_buf_begin_cpu_access(ufb->obj->base.import_attach->dmabuf,
411 0, ufb->obj->base.size, 413 0, ufb->obj->base.size,
412 DMA_FROM_DEVICE); 414 DMA_FROM_DEVICE);
413 if (ret) 415 if (ret)
414 return ret; 416 goto unlock;
415 } 417 }
416 418
417 for (i = 0; i < num_clips; i++) { 419 for (i = 0; i < num_clips; i++) {
@@ -419,7 +421,7 @@ static int udl_user_framebuffer_dirty(struct drm_framebuffer *fb,
419 clips[i].x2 - clips[i].x1, 421 clips[i].x2 - clips[i].x1,
420 clips[i].y2 - clips[i].y1); 422 clips[i].y2 - clips[i].y1);
421 if (ret) 423 if (ret)
422 break; 424 goto unlock;
423 } 425 }
424 426
425 if (ufb->obj->base.import_attach) { 427 if (ufb->obj->base.import_attach) {
@@ -427,6 +429,10 @@ static int udl_user_framebuffer_dirty(struct drm_framebuffer *fb,
427 0, ufb->obj->base.size, 429 0, ufb->obj->base.size,
428 DMA_FROM_DEVICE); 430 DMA_FROM_DEVICE);
429 } 431 }
432
433 unlock:
434 drm_modeset_unlock_all(fb->dev);
435
430 return ret; 436 return ret;
431} 437}
432 438