From patchwork Mon Feb 22 21:08:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8383501 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E05BC9F372 for ; Mon, 22 Feb 2016 21:12:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE01E2042B for ; Mon, 22 Feb 2016 21:12:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 82BE620383 for ; Mon, 22 Feb 2016 21:12:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B715C6E2C8; Mon, 22 Feb 2016 21:12:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 164116E2C8 for ; Mon, 22 Feb 2016 21:12:24 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M3SWO-1ZhEdH3NdA-00r1Tg; Mon, 22 Feb 2016 22:12:19 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 4/8] drm: msm: split out GEM code into helper module Date: Mon, 22 Feb 2016 22:08:38 +0100 Message-Id: <1456175331-714117-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:ZTSqCGuScgDclmz4WGDhkudJ1A/gP/AXGTbh02Iwlc9me/NIzt/ sVZc729KPRQt4BcdMOtkrl2O25/IJ+1tkqDgISGyeuH5wj8jMgu7aFuAu2OH2owG8In9GdB NEY4BKw3NUu0PNBEfpKsoH9Y5l7jW3qd9rp+hCQDnd3vKQc/i0pqLmgsbZOsOPvwbdHDvPK GpFkkFgLJ6sL+Ypzz7b5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:cWNmP/G7850=:Dv6bRrQxSQe9CQrYCNIMq8 E5TGVhLW+P2FJkfugD9B9yz//y6YI+oCQ2ZM/4X0DimQQWwRw0F1RIkuKWyT1nNtoDIeB7YJn 6ylA2pJwdVTIzGL7cAxnMES6M5f/bLnvtmxMDDG0dO1+i/SaocO+mU9lbbP8FB6hptjEbwIYz SfuO0LCvBE02daCWKHa4/OzSSUUN+59kNmseucRqN96ZdcQamFahL4jY5l2rwGrqSK2EOdSJ1 a+5HaD6ItZRrwFkdInRuafAe9ToF2FA3/zv59q32CPU+6yeRkTdKKLD2JQATnPaCCqpdnk9ko Ewtg2jO/OzR4Nm8NBWBGeyYDux/VnwFkQakTZMxmxmH99VefAVcsm7AwL2rgS2mTLTT60Fd4f szfGa3vTsXifNvam8bciJoVDt1JZyTuVoQfqs5l4JdUb7h03DegjDEycSfJCoL18P41wBnv/q dTv+VBnmwAwjx/iEwiqPDTqU2peAsFBWoLHltDil1oqxJcDCsi9BNfL19Viar2X+LnMm75hTD I7HM0Dpb8MXUPsfnk0X9MnqSnoA6bmXJT7W7SqcFeulN2U8m2r5CoqmslSVeG5fDThtdtLCGk Och705sz0mStgiXWODe5fjq4RXbcPgPGOVcDtW4n7j4YZ7TSsmlWQuhRhZFq4VyWWvX3g8VUu xBP/cb8uFLlRKFIWgUcyDIdo8kXkkwouI87K0rAFr/SH+bh/P2paf2/XDysH0eoK2n9g= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 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 The GEM code is used by dsi, so it can't be part of the main module. This exports all functions that are called by other code, and puts it into the helper module. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/Makefile | 3 +-- drivers/gpu/drm/msm/msm_gem.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index acc02aef1b42..6817e9390153 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -25,7 +25,6 @@ drm-msm-y := \ msm_atomic.o \ msm_drv.o \ msm_fb.o \ - msm_gem.o \ msm_gem_prime.o \ msm_gem_submit.o \ msm_gpu.o \ @@ -46,4 +45,4 @@ obj-$(CONFIG_DRM_MSM_EDP) += edp/ obj-$(CONFIG_DRM_MSM) += drm-msm.o drm_msm_helper.o -drm_msm_helper-y += msm_iotrace.o msm_fence.o +drm_msm_helper-y += msm_iotrace.o msm_fence.o msm_gem.o diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 3cedb8d5c855..1d64febee274 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -143,11 +143,13 @@ struct page **msm_gem_get_pages(struct drm_gem_object *obj) mutex_unlock(&dev->struct_mutex); return p; } +EXPORT_SYMBOL_GPL(msm_gem_get_pages); void msm_gem_put_pages(struct drm_gem_object *obj) { /* when we start tracking the pin count, then do something here */ } +EXPORT_SYMBOL_GPL(msm_gem_put_pages); int msm_gem_mmap_obj(struct drm_gem_object *obj, struct vm_area_struct *vma) @@ -177,6 +179,7 @@ int msm_gem_mmap_obj(struct drm_gem_object *obj, return 0; } +EXPORT_SYMBOL_GPL(msm_gem_mmap_obj); int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma) { @@ -190,6 +193,7 @@ int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma) return msm_gem_mmap_obj(vma->vm_private_data, vma); } +EXPORT_SYMBOL_GPL(msm_gem_mmap); int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { @@ -246,6 +250,7 @@ out: return VM_FAULT_SIGBUS; } } +EXPORT_SYMBOL_GPL(msm_gem_fault); /** get mmap offset */ static uint64_t mmap_offset(struct drm_gem_object *obj) @@ -274,6 +279,7 @@ uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj) mutex_unlock(&obj->dev->struct_mutex); return offset; } +EXPORT_SYMBOL_GPL(msm_gem_mmap_offset); /* should be called under struct_mutex.. although it can be called * from atomic context without struct_mutex to acquire an extra @@ -316,6 +322,7 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id, return ret; } +EXPORT_SYMBOL_GPL(msm_gem_get_iova_locked); /* get iova, taking a reference. Should have a matching put */ int msm_gem_get_iova(struct drm_gem_object *obj, int id, uint32_t *iova) @@ -336,6 +343,7 @@ int msm_gem_get_iova(struct drm_gem_object *obj, int id, uint32_t *iova) mutex_unlock(&obj->dev->struct_mutex); return ret; } +EXPORT_SYMBOL_GPL(msm_gem_get_iova); /* get iova without taking a reference, used in places where you have * already done a 'msm_gem_get_iova()'. @@ -346,6 +354,7 @@ uint32_t msm_gem_iova(struct drm_gem_object *obj, int id) WARN_ON(!msm_obj->domain[id].iova); return msm_obj->domain[id].iova; } +EXPORT_SYMBOL_GPL(msm_gem_iova); void msm_gem_put_iova(struct drm_gem_object *obj, int id) { @@ -356,6 +365,7 @@ void msm_gem_put_iova(struct drm_gem_object *obj, int id) // if another _get_iova_locked() fails we can start unmapping // things that are no longer needed.. } +EXPORT_SYMBOL_GPL(msm_gem_put_iova); int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) @@ -365,6 +375,7 @@ int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, return msm_gem_new_handle(dev, file, args->size, MSM_BO_SCANOUT | MSM_BO_WC, &args->handle); } +EXPORT_SYMBOL_GPL(msm_gem_dumb_create); int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset) @@ -386,6 +397,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, fail: return ret; } +EXPORT_SYMBOL_GPL(msm_gem_dumb_map_offset); void *msm_gem_vaddr_locked(struct drm_gem_object *obj) { @@ -400,6 +412,7 @@ void *msm_gem_vaddr_locked(struct drm_gem_object *obj) } return msm_obj->vaddr; } +EXPORT_SYMBOL_GPL(msm_gem_vaddr_locked); void *msm_gem_vaddr(struct drm_gem_object *obj) { @@ -409,6 +422,7 @@ void *msm_gem_vaddr(struct drm_gem_object *obj) mutex_unlock(&obj->dev->struct_mutex); return ret; } +EXPORT_SYMBOL_GPL(msm_gem_vaddr); /* setup callback for when bo is no longer busy.. * TODO probably want to differentiate read vs write.. @@ -421,6 +435,7 @@ int msm_gem_queue_inactive_cb(struct drm_gem_object *obj, MSM_PREP_READ | MSM_PREP_WRITE); return msm_queue_fence_cb(obj->dev, cb, fence); } +EXPORT_SYMBOL_GPL(msm_gem_queue_inactive_cb); void msm_gem_move_to_active(struct drm_gem_object *obj, struct msm_gpu *gpu, bool write, uint32_t fence) @@ -434,6 +449,7 @@ void msm_gem_move_to_active(struct drm_gem_object *obj, list_del_init(&msm_obj->mm_list); list_add_tail(&msm_obj->mm_list, &gpu->active_list); } +EXPORT_SYMBOL_GPL(msm_gem_move_to_active); void msm_gem_move_to_inactive(struct drm_gem_object *obj) { @@ -449,6 +465,7 @@ void msm_gem_move_to_inactive(struct drm_gem_object *obj) list_del_init(&msm_obj->mm_list); list_add_tail(&msm_obj->mm_list, &priv->inactive_list); } +EXPORT_SYMBOL_GPL(msm_gem_move_to_inactive); int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) { @@ -469,12 +486,14 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) return ret; } +EXPORT_SYMBOL_GPL(msm_gem_cpu_prep); int msm_gem_cpu_fini(struct drm_gem_object *obj) { /* TODO cache maintenance */ return 0; } +EXPORT_SYMBOL_GPL(msm_gem_cpu_fini); #ifdef CONFIG_DEBUG_FS void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) @@ -490,6 +509,7 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) obj->name, obj->refcount.refcount.counter, off, msm_obj->vaddr, obj->size); } +EXPORT_SYMBOL_GPL(msm_gem_describe); void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) { @@ -507,6 +527,7 @@ void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) seq_printf(m, "Total %d objects, %zu bytes\n", count, size); } +EXPORT_SYMBOL_GPL(msm_gem_describe_objects); #endif void msm_gem_free_object(struct drm_gem_object *obj) @@ -554,6 +575,7 @@ void msm_gem_free_object(struct drm_gem_object *obj) kfree(msm_obj); } +EXPORT_SYMBOL_GPL(msm_gem_free_object); /* convenience method to construct a GEM buffer object, and userspace handle */ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, @@ -580,6 +602,7 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, return ret; } +EXPORT_SYMBOL_GPL(msm_gem_new_handle); static int msm_gem_new_impl(struct drm_device *dev, uint32_t size, uint32_t flags, @@ -663,6 +686,7 @@ fail: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(msm_gem_new); struct drm_gem_object *msm_gem_import(struct drm_device *dev, uint32_t size, struct sg_table *sgt) @@ -707,3 +731,8 @@ fail: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(msm_gem_import); + +MODULE_AUTHOR("Rob Clark