From patchwork Thu Jul 31 13:46:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 4656361 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 04FAC9F32F for ; Thu, 31 Jul 2014 13:46:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91C3B2017A for ; Thu, 31 Jul 2014 13:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 10A87201BB for ; Thu, 31 Jul 2014 13:46:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41FA06E5E4; Thu, 31 Jul 2014 06:46:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTP id D282A6E5E4 for ; Thu, 31 Jul 2014 06:46:11 -0700 (PDT) Received: from 5ed49945.cm-7-5c.dynamic.ziggo.nl ([94.212.153.69] helo=[192.168.1.128]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XCqgN-0003wH-9W for dri-devel@lists.freedesktop.org; Thu, 31 Jul 2014 13:46:11 +0000 Message-ID: <53DA48A3.9060009@canonical.com> Date: Thu, 31 Jul 2014 15:46:11 +0200 From: Maarten Lankhorst User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "dri-devel@lists.freedesktop.org" Subject: [libdrm PATCH 3/3] radeon: Use symbol visibility. References: <53DA4836.2000108@canonical.com> In-Reply-To: <53DA4836.2000108@canonical.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 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 All the bof_* symbols are now no longer exported. Signed-off-by: Maarten Lankhorst Reviewed-by: Alex Deucher --- radeon/Makefile.am | 1 + radeon/radeon_bo.c | 46 ++++++++++++++++++++++++-------------------- radeon/radeon_bo_gem.c | 24 +++++++++++++---------- radeon/radeon_cs.c | 50 +++++++++++++++++++++++++----------------------- radeon/radeon_cs_gem.c | 8 ++++++-- radeon/radeon_cs_space.c | 18 +++++++++++------ radeon/radeon_surface.c | 20 +++++++++++++------ 7 files changed, 98 insertions(+), 69 deletions(-) diff --git a/radeon/Makefile.am b/radeon/Makefile.am index a8cd100..c969573 100644 --- a/radeon/Makefile.am +++ b/radeon/Makefile.am @@ -24,6 +24,7 @@ AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/radeon \ $(PTHREADSTUBS_CFLAGS) \ diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c index 6a0f8e7..865e3f7 100644 --- a/radeon/radeon_bo.c +++ b/radeon/radeon_bo.c @@ -29,10 +29,14 @@ * Dave Airlie * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include +#endif +#include #include #include -void radeon_bo_debug(struct radeon_bo *bo, const char *op) +drm_public void radeon_bo_debug(struct radeon_bo *bo, const char *op) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -40,26 +44,23 @@ void radeon_bo_debug(struct radeon_bo *bo, const char *op) op, bo, bo->handle, boi->size, boi->cref); } -struct radeon_bo *radeon_bo_open(struct radeon_bo_manager *bom, - uint32_t handle, - uint32_t size, - uint32_t alignment, - uint32_t domains, - uint32_t flags) +drm_public struct radeon_bo * +radeon_bo_open(struct radeon_bo_manager *bom, uint32_t handle, uint32_t size, + uint32_t alignment, uint32_t domains, uint32_t flags) { struct radeon_bo *bo; bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags); return bo; } -void radeon_bo_ref(struct radeon_bo *bo) +drm_public void radeon_bo_ref(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; boi->cref++; boi->bom->funcs->bo_ref(boi); } -struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) +drm_public struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (bo == NULL) @@ -69,19 +70,19 @@ struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) return boi->bom->funcs->bo_unref(boi); } -int radeon_bo_map(struct radeon_bo *bo, int write) +drm_public int radeon_bo_map(struct radeon_bo *bo, int write) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_map(boi, write); } -int radeon_bo_unmap(struct radeon_bo *bo) +drm_public int radeon_bo_unmap(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_unmap(boi); } -int radeon_bo_wait(struct radeon_bo *bo) +drm_public int radeon_bo_wait(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (!boi->bom->funcs->bo_wait) @@ -89,27 +90,29 @@ int radeon_bo_wait(struct radeon_bo *bo) return boi->bom->funcs->bo_wait(boi); } -int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) +drm_public int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_is_busy(boi, domain); } -int radeon_bo_set_tiling(struct radeon_bo *bo, - uint32_t tiling_flags, uint32_t pitch) +drm_public int +radeon_bo_set_tiling(struct radeon_bo *bo, + uint32_t tiling_flags, uint32_t pitch) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_set_tiling(boi, tiling_flags, pitch); } -int radeon_bo_get_tiling(struct radeon_bo *bo, - uint32_t *tiling_flags, uint32_t *pitch) +drm_public int +radeon_bo_get_tiling(struct radeon_bo *bo, + uint32_t *tiling_flags, uint32_t *pitch) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->bom->funcs->bo_get_tiling(boi, tiling_flags, pitch); } -int radeon_bo_is_static(struct radeon_bo *bo) +drm_public int radeon_bo_is_static(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; if (boi->bom->funcs->bo_is_static) @@ -117,18 +120,19 @@ int radeon_bo_is_static(struct radeon_bo *bo) return 0; } -int radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) +drm_public int +radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; return boi->cref > 1; } -uint32_t radeon_bo_get_handle(struct radeon_bo *bo) +drm_public uint32_t radeon_bo_get_handle(struct radeon_bo *bo) { return bo->handle; } -uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) +drm_public uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; uint32_t src_domain; diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c index 4ea405f..251ec1b 100644 --- a/radeon/radeon_bo_gem.c +++ b/radeon/radeon_bo_gem.c @@ -38,6 +38,7 @@ #include #include #include +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" #include "drm.h" @@ -283,7 +284,7 @@ static struct radeon_bo_funcs bo_gem_funcs = { bo_is_busy, }; -struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) +drm_public struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) { struct bo_manager_gem *bomg; @@ -296,7 +297,7 @@ struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) return (struct radeon_bo_manager*)bomg; } -void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) +drm_public void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) { struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom; @@ -306,19 +307,22 @@ void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) free(bomg); } -uint32_t radeon_gem_name_bo(struct radeon_bo *bo) +drm_public uint32_t +radeon_gem_name_bo(struct radeon_bo *bo) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; return bo_gem->name; } -void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) +drm_public void * +radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; return &bo_gem->reloc_in_cs; } -int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) +drm_public int +radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -339,7 +343,8 @@ int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) return 0; } -int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) +drm_public int +radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) { struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; struct drm_radeon_gem_set_domain args; @@ -356,7 +361,7 @@ int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t return r; } -int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) +drm_public int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) { struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; int ret; @@ -365,9 +370,8 @@ int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) return ret; } -struct radeon_bo *radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, - int fd_handle, - uint32_t size) +drm_public struct radeon_bo * +radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, int fd_handle, uint32_t size) { struct radeon_bo_gem *bo; int r; diff --git a/radeon/radeon_cs.c b/radeon/radeon_cs.c index d0e922b..fe5bbce 100644 --- a/radeon/radeon_cs.c +++ b/radeon/radeon_cs.c @@ -1,19 +1,22 @@ - +#ifdef HAVE_CONFIG_H +#include +#endif +#include "libdrm.h" #include #include "radeon_cs.h" #include "radeon_cs_int.h" -struct radeon_cs *radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) +drm_public struct radeon_cs * +radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) { struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw); return (struct radeon_cs *)csi; } -int radeon_cs_write_reloc(struct radeon_cs *cs, - struct radeon_bo *bo, - uint32_t read_domain, - uint32_t write_domain, - uint32_t flags) +drm_public int +radeon_cs_write_reloc(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domain, uint32_t write_domain, + uint32_t flags) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; @@ -24,56 +27,54 @@ int radeon_cs_write_reloc(struct radeon_cs *cs, flags); } -int radeon_cs_begin(struct radeon_cs *cs, - uint32_t ndw, - const char *file, - const char *func, - int line) +drm_public int +radeon_cs_begin(struct radeon_cs *cs, uint32_t ndw, + const char *file, const char *func, int line) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_begin(csi, ndw, file, func, line); } -int radeon_cs_end(struct radeon_cs *cs, - const char *file, - const char *func, - int line) +drm_public int +radeon_cs_end(struct radeon_cs *cs, + const char *file, const char *func, int line) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_end(csi, file, func, line); } -int radeon_cs_emit(struct radeon_cs *cs) +drm_public int radeon_cs_emit(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_emit(csi); } -int radeon_cs_destroy(struct radeon_cs *cs) +drm_public int radeon_cs_destroy(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_destroy(csi); } -int radeon_cs_erase(struct radeon_cs *cs) +drm_public int radeon_cs_erase(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_erase(csi); } -int radeon_cs_need_flush(struct radeon_cs *cs) +drm_public int radeon_cs_need_flush(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->csm->funcs->cs_need_flush(csi); } -void radeon_cs_print(struct radeon_cs *cs, FILE *file) +drm_public void radeon_cs_print(struct radeon_cs *cs, FILE *file) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; csi->csm->funcs->cs_print(csi, file); } -void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) +drm_public void +radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; if (domain == RADEON_GEM_DOMAIN_VRAM) @@ -82,14 +83,15 @@ void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) csi->csm->gart_limit = limit; } -void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data) +drm_public void radeon_cs_space_set_flush(struct radeon_cs *cs, + void (*fn)(void *), void *data) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; csi->space_flush_fn = fn; csi->space_flush_data = data; } -uint32_t radeon_cs_get_id(struct radeon_cs *cs) +drm_public uint32_t radeon_cs_get_id(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return csi->id; diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index b87c6b1..2020e1a 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -29,6 +29,9 @@ * Nicolai Haehnle * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include @@ -42,6 +45,7 @@ #include "radeon_cs_gem.h" #include "radeon_bo_gem.h" #include "drm.h" +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" #include "radeon_drm.h" @@ -533,7 +537,7 @@ static int radeon_get_device_id(int fd, uint32_t *device_id) return r; } -struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) +drm_public struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) { struct radeon_cs_manager_gem *csm; @@ -547,7 +551,7 @@ struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) return &csm->base; } -void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) +drm_public void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) { free(csm); } diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c index be047a7..cca650b 100644 --- a/radeon/radeon_cs_space.c +++ b/radeon/radeon_cs_space.c @@ -25,9 +25,13 @@ */ /* */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include #include +#include "libdrm.h" #include "radeon_cs.h" #include "radeon_bo_int.h" #include "radeon_cs_int.h" @@ -161,7 +165,9 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s return RADEON_CS_SPACE_OK; } -void radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) +drm_public void +radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domains, uint32_t write_domain) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -203,9 +209,9 @@ again: return 0; } -int radeon_cs_space_check_with_bo(struct radeon_cs *cs, - struct radeon_bo *bo, - uint32_t read_domains, uint32_t write_domain) +drm_public int +radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct radeon_bo *bo, + uint32_t read_domains, uint32_t write_domain) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; @@ -224,13 +230,13 @@ int radeon_cs_space_check_with_bo(struct radeon_cs *cs, return ret; } -int radeon_cs_space_check(struct radeon_cs *cs) +drm_public int radeon_cs_space_check(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; return radeon_cs_check_space_internal(csi, NULL); } -void radeon_cs_space_reset_bos(struct radeon_cs *cs) +drm_public void radeon_cs_space_reset_bos(struct radeon_cs *cs) { struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; int i; diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c index 8a1fe7d..e056ed4 100644 --- a/radeon/radeon_surface.c +++ b/radeon/radeon_surface.c @@ -26,6 +26,9 @@ * Authors: * Jérôme Glisse */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include #include @@ -35,6 +38,7 @@ #include #include #include "drm.h" +#include "libdrm.h" #include "xf86drm.h" #include "radeon_drm.h" #include "radeon_surface.h" @@ -2395,7 +2399,8 @@ static int cik_surface_best(struct radeon_surface_manager *surf_man, /* =========================================================================== * public API */ -struct radeon_surface_manager *radeon_surface_manager_new(int fd) +drm_public struct radeon_surface_manager * +radeon_surface_manager_new(int fd) { struct radeon_surface_manager *surf_man; @@ -2443,7 +2448,8 @@ out_err: return NULL; } -void radeon_surface_manager_free(struct radeon_surface_manager *surf_man) +drm_public void +radeon_surface_manager_free(struct radeon_surface_manager *surf_man) { free(surf_man); } @@ -2515,8 +2521,9 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man, return 0; } -int radeon_surface_init(struct radeon_surface_manager *surf_man, - struct radeon_surface *surf) +drm_public int +radeon_surface_init(struct radeon_surface_manager *surf_man, + struct radeon_surface *surf) { unsigned mode, type; int r; @@ -2531,8 +2538,9 @@ int radeon_surface_init(struct radeon_surface_manager *surf_man, return surf_man->surface_init(surf_man, surf); } -int radeon_surface_best(struct radeon_surface_manager *surf_man, - struct radeon_surface *surf) +drm_public int +radeon_surface_best(struct radeon_surface_manager *surf_man, + struct radeon_surface *surf) { unsigned mode, type; int r;