From patchwork Fri Jun 28 05:24:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 2797141 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9912CBF4A1 for ; Fri, 28 Jun 2013 05:28:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6D232012B for ; Fri, 28 Jun 2013 05:28:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AEA3F20125 for ; Fri, 28 Jun 2013 05:28:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EAC7E5F3E for ; Thu, 27 Jun 2013 22:28:21 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 2418FE5C99 for ; Thu, 27 Jun 2013 22:24:56 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP3009TU8CLGOM0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 28 Jun 2013 14:24:54 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D0.15.08825.62E1DC15; Fri, 28 Jun 2013 14:24:54 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-b8-51cd1e26a39d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D7.A5.28381.52E1DC15; Fri, 28 Jun 2013 14:24:54 +0900 (KST) Received: from localhost.localdomain ([10.89.53.198]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MP300FJD8DHYZD0@mmp1.samsung.com>; Fri, 28 Jun 2013 14:24:53 +0900 (KST) From: Joonyoung Shim To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/3] drm: add mmap function to prime helpers Date: Fri, 28 Jun 2013 14:24:53 +0900 Message-id: <1372397095-23934-1-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.8.1.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsWyRsSkRFdN7mygwdHDbBYnri9isrjy9T2b RefEJewOzB47Z91l95jdMZPV4373caYA5igum5TUnMyy1CJ9uwSujF1bbrAVtHNX7G87x97A OIezi5GTQ0LARKL/3H02CFtM4sK99UA2F4eQwFJGiT8r1zDDFF3q2ckKkVjEKHFj/UEWCKeV SeLd32awKjYBPYk7244zgdgiAsoSfyeuYgSxmQUsJL7NnMQCYgsL2Ets7FzPDmKzCKhKbJl3 DayGV8Bd4vbuT+wQ2xQkfl4+AXaGhMBtNolJjTeYIRoEJL5NPgQ0iAMoISux6QDUdZISB1fc YJnAKLiAkWEVo2hqQXJBcVJ6kZFecWJucWleul5yfu4mRmD4nf73rG8H480D1ocYk4HGTWSW Ek3OB4ZvXkm8obGZkYWpiamxkbmlGWnCSuK8ai3WgUIC6YklqdmpqQWpRfFFpTmpxYcYmTg4 pYBBnfzDQfPQdwWR3o0T3X/w3W/hWZK649Gc2KrDCqsM3UsnP7XZU7ZS90oqc/10bcZTq3XZ K4PXyU92i5kjuoIpQ/7q5Y418tnsJroznDTnlqo4d3j9ufuBu21HqYkiz4mb5vNvL59w/kzK m0WN/7+/PbJ1WXfhUeu/v9W+xk3Mq34T0fjwp4i/EktxRqKhFnNRcSIAVFHUw1UCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsVy+t9jAV01ubOBBv9VLE5cX8RkceXrezaL zolL2B2YPXbOusvuMbtjJqvH/e7jTAHMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaG uoaWFuZKCnmJuam2Si4+AbpumTlAm5QUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUY GaCBhDWMGbu23GAraOeu2N92jr2BcQ5nFyMnh4SAicSlnp2sELaYxIV769m6GLk4hAQWMUrc WH+QBcJpZZJ497eZGaSKTUBP4s6240wgtoiAssTfiasYQWxmAQuJbzMnsYDYwgL2Ehs717OD 2CwCqhJb5l0Dq+EVcJe4vfsTO8Q2BYmfl0+wTWDkXsDIsIpRNLUguaA4KT3XUK84Mbe4NC9d Lzk/dxMjOLSfSe1gXNlgcYhRgINRiYe3MfFMoBBrYllxZe4hRgkOZiUR3jsLgEK8KYmVValF +fFFpTmpxYcYk4G2T2SWEk3OB8ZdXkm8obGJmZGlkbmhhZGxOWnCSuK8B1qtA4UE0hNLUrNT UwtSi2C2MHFwSjUwng6+s9sli+FVTvilfwndpZN0Tx0R/lHafe1d/WmbDRffcE9hm2lfvd3+ t/JM3TznmOBeCcmFxTf2lm6ctfL6AbtMpi9b1sSvfNrHtWmT+I6046+cXRyn5/J+Xrl7wbeE Xdsm9zKsutIzoz9H10O2g2nNv63bz344fKdb+8yp/1/K+Nf7+M887K7EUpyRaKjFXFScCACX GEYUsQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: laurent.pinchart@ideasonboard.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds to call low-level mmap() from prime helpers. Signed-off-by: Joonyoung Shim --- drivers/gpu/drm/drm_prime.c | 8 +++++++- include/drm/drmP.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 52709f2..fb9b12d 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -244,7 +244,13 @@ static void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) { - return -EINVAL; + struct drm_gem_object *obj = dma_buf->priv; + struct drm_device *dev = obj->dev; + + if (!dev->driver->gem_prime_mmap) + return -ENOSYS; + + return dev->driver->gem_prime_mmap(obj, vma); } static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 82670ac..12083dc 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -937,6 +937,8 @@ struct drm_driver { struct sg_table *sgt); void *(*gem_prime_vmap)(struct drm_gem_object *obj); void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); + int (*gem_prime_mmap)(struct drm_gem_object *obj, + struct vm_area_struct *vma); /* vga arb irq handler */ void (*vgaarb_irq)(struct drm_device *dev, bool state);