From patchwork Wed Jun 12 13:16:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 2710071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E80789F3DD for ; Wed, 12 Jun 2013 13:17:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D255E20209 for ; Wed, 12 Jun 2013 13:17:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D5EA2201FC for ; Wed, 12 Jun 2013 13:17:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCC1AE60A4 for ; Wed, 12 Jun 2013 06:17:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A4B3E6444 for ; Wed, 12 Jun 2013 06:16:16 -0700 (PDT) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOA00E8J7IP6VD0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 12 Jun 2013 22:16:14 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.115]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id C5.31.11618.E9478B15; Wed, 12 Jun 2013 22:16:14 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-a8-51b8749e2ff4 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 53.00.21068.E9478B15; Wed, 12 Jun 2013 22:16:14 +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 <0MOA00DQL7J1H550@mmp1.samsung.com>; Wed, 12 Jun 2013 22:16:14 +0900 (KST) From: Joonyoung Shim To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm: add mmap function to prime helpers Date: Wed, 12 Jun 2013 22:16:17 +0900 Message-id: <1371042979-14633-1-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.8.1.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsWyRsSkWHdeyY5Ag/l3FSx6z51ksrjy9T2b RefEJewOzB6zO2ayemz/9oDV4373caYA5igum5TUnMyy1CJ9uwSujGvXNzIWnOCq2HDiAVsD 4wuOLkZODgkBE4k5W6azQ9hiEhfurWfrYuTiEBJYyijx8OAORpiideums0AkFjFKNPy7BuW0 Mkl82d4NVsUmoCdxZ9txJhBbREBZ4u/EVWBxZgFzif1XIGqEBWwkJjavZe1i5OBgEVCVmHfS BCTMK+Au8W/DcxaIZQoSPy+fALtCQuA6m8Tfy5/AzmMREJD4NvkQC0ivhICsxKYDzBD1khIH V9xgmcAouICRYRWjaGpBckFxUnqRqV5xYm5xaV66XnJ+7iZGYPCd/vds4g7G+wesDzEmA42b yCwlmpwPDN68knhDYzMjC1MTU2Mjc0sz0oSVxHnVW6wDhQTSE0tSs1NTC1KL4otKc1KLDzEy cXBKNTBmuZ+rnt3W46s/O1KxR67976SP3iyfq+W7WSKUnX5H3Sm4qTDdQWa+8yVGCab97/Py 1PwydoaGuKkXpr5hdA2N5pkU2N7cYbL65WGekpm/Qp/fYliQkjOlecdPh+es2jvUYuZJP6u6 5O7c/7Wo6MHq30Kr/0XprrJruhUelZpusbf1UK7YPyWW4oxEQy3mouJEAGJoRRVUAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsVy+t9jAd15JTsCDRbflLToPXeSyeLK1/ds Fp0Tl7A7MHvM7pjJ6rH92wNWj/vdx5kCmKMaGG0yUhNTUosUUvOS81My89JtlbyD453jTc0M DHUNLS3MlRTyEnNTbZVcfAJ03TJzgFYpKZQl5pQChQISi4uV9O0wTQgNcdO1gGmM0PUNCYLr MTJAAwlrGDOuXd/IWHCCq2LDiQdsDYwvOLoYOTkkBEwk1q2bzgJhi0lcuLeerYuRi0NIYBGj RMO/aywQTiuTxJft3YwgVWwCehJ3th1nArFFBJQl/k5cBRZnFjCX2H8FokZYwEZiYvNa1i5G Dg4WAVWJeSdNQMK8Au4S/zY8h1qmIPHz8gm2CYzcCxgZVjGKphYkFxQnpeca6RUn5haX5qXr JefnbmIEh/Yz6R2MqxosDjEKcDAq8fAeSNoRKMSaWFZcmXuIUYKDWUmENzEeKMSbklhZlVqU H19UmpNafIgxGWj5RGYp0eR8YNzllcQbGpuYGVkamRtaGBmbkyasJM57sNU6UEggPbEkNTs1 tSC1CGYLEwenVAPjFKnZV5VZ33sfF+qbEjS9hKk52ljh/txFbM/PJpX//+7Nv7VHIcj82fZl 4VzH5jqFqcipzN0vYj47dTJH7595PncOLDb7GXX7wtUCe6npj13kmE9VhGq6h1oYn96ieuB3 Mf+L3U/3P8m2ebQhgMFyvYgNQ8yXTdUfjm1cXWAX7HpMUOP/jhvMSizFGYmGWsxFxYkASIIg T7ECAAA= 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=-4.4 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 | 5 ++++- include/drm/drmP.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index d92853e..3a008b2 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -165,7 +165,10 @@ 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; + + 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);