* and map to user space
*/
if (vma->vm_flags & (VM_IO | VM_PFNMAP)) {
+ down_read(¤t->mm->mmap_sem);
page_nr = get_pfnmap_pages(current, current->mm,
(unsigned long)userptr,
(int)(ttm->num_pages), 1, 0,
ttm->pages, NULL);
+ up_read(¤t->mm->mmap_sem);
} else {
/*Handle frame buffer allocated in user space*/
down_read(¤t->mm->mmap_sem);
if (unlikely(ret != 0))
return ret;
- down_read(&mm->mmap_sem);
-
/**
* get_user_pages can only handle the buffer allocated from user space,
* but we need handle the buffer allocated from other kernel driver
*/
#if 0
+ down_read(&mm->mmap_sem);
+
ret = get_user_pages(tsk, mm, start, num_pages,
write, 0, ttm->pages, NULL);
+ up_read(&mm->mmap_sem);
#else
ret = alloc_user_pages_ttm(ttm, start);
#endif
- up_read(&mm->mmap_sem);
+
if (ret != num_pages && write) {
ttm_tt_free_user_pages(ttm);
DRM_AUTH),*/
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_CREATE, psb_pl_create_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_REFERENCE, psb_pl_reference_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_UNREF, psb_pl_unref_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_SYNCCPU, psb_pl_synccpu_ioctl,
DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_WAITIDLE, psb_pl_waitidle_ioctl,
DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_SETSTATUS, psb_pl_setstatus_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_CREATE_UB, psb_pl_ub_create_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_FENCE_SIGNALED,
- psb_fence_signaled_ioctl, DRM_AUTH),
+ psb_fence_signaled_ioctl, DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_FENCE_FINISH, psb_fence_finish_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_FENCE_UNREF, psb_fence_unref_ioctl,
- DRM_AUTH),
+ DRM_AUTH | DRM_UNLOCKED),
/*to be removed later */
/*PSB_IOCTL_DEF(DRM_IOCTL_PSB_FLIP, psb_page_flip, DRM_AUTH),*/
PSB_IOCTL_DEF(DRM_IOCTL_LNC_VIDEO_GETPARAM,
- lnc_video_getparam, DRM_AUTH),
+ lnc_video_getparam, DRM_AUTH | DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_BUFFER_CLASS_VIDEO,
BC_Video_Bridge, DRM_AUTH),
#endif