From mboxrd@z Thu Jan 1 00:00:00 1970 From: Inki Dae Subject: [PATCH 0/2 v3] drm/exynos: added userptr feature Date: Wed, 09 May 2012 15:17:37 +0900 Message-ID: <1336544259-17222-1-git-send-email-inki.dae@samsung.com> References: <1335188594-17454-4-git-send-email-inki.dae@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C2F39E7AF for ; Tue, 8 May 2012 23:17:43 -0700 (PDT) Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M3Q007KFS54KIM0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 09 May 2012 15:17:42 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([165.213.219.103]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M3Q005VYS5HTW31@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 09 May 2012 15:17:42 +0900 (KST) In-reply-to: <1335188594-17454-4-git-send-email-inki.dae@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: airlied@linux.ie, dri-devel@lists.freedesktop.org Cc: Inki Dae , kyungmin.park@samsung.com, sw0312.kim@samsung.com List-Id: dri-devel@lists.freedesktop.org this feature could be used to use memory region allocated by malloc() in user mode and mmaped memory region allocated by other memory allocators. userptr interface can identify memory type through vm_flags value and would get pages or page frame numbers to user space appropriately. changelog v2: the memory region mmaped with VM_PFNMAP type is physically continuous and start address of the memory region should be set into buf->dma_addr but previous patch had a problem that end address is set into buf->dma_addr so v2 fixes that problem. changelog v3: mitigated the issues pointed out by Dave and Jerome. for this, added some codes to guarantee the pages to user space not to be swapped out, the VMAs within the user space would be locked and then unlocked when the pages are released. but this lock might result in significant degradation of system performance because the pages couldn't be swapped out so added one more feature that we can limit user-desired userptr size to pre-defined value using userptr limit ioctl that can be accessed by only root user. these issues had been pointed out by Dave and Jerome. Inki Dae (2): drm/exynos: added userptr limit ioctl. drm/exynos: added userptr feature. drivers/gpu/drm/exynos/exynos_drm_drv.c | 8 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 + drivers/gpu/drm/exynos/exynos_drm_gem.c | 356 +++++++++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_gem.h | 20 ++- include/drm/exynos_drm.h | 43 ++++- 5 files changed, 430 insertions(+), 3 deletions(-) -- 1.7.4.1