[libdrm] intel: use drm namespace for exported functions
diff mbox series

Message ID 20180906135218.4700-1-eric.engestrom@intel.com
State New
Headers show
Series
  • [libdrm] intel: use drm namespace for exported functions
Related show

Commit Message

Eric Engestrom Sept. 6, 2018, 1:52 p.m. UTC
And add them to the list of exported function to fix the tests.

Fixes: 4e81d4f9c9b7fd6510cf "intel: add generic functions to check PCI ID"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
---
Lucas, I'm assuming you meant to export those functions (and macros,
like `IS_GEN11()`), right?
If so, you need to namespace them, and add them to the list of allowed
exports.
---
 intel/intel-symbol-check |  2 ++
 intel/intel_bufmgr_gem.c |  2 +-
 intel/intel_chipset.c    |  4 ++--
 intel/intel_chipset.h    | 12 ++++++------
 intel/intel_decode.c     |  2 +-
 5 files changed, 12 insertions(+), 10 deletions(-)

Comments

Emil Velikov Sept. 6, 2018, 2:44 p.m. UTC | #1
On 6 September 2018 at 14:52, Eric Engestrom <eric.engestrom@intel.com> wrote:
> And add them to the list of exported function to fix the tests.
>
> Fixes: 4e81d4f9c9b7fd6510cf "intel: add generic functions to check PCI ID"
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
> ---
> Lucas, I'm assuming you meant to export those functions (and macros,
> like `IS_GEN11()`), right?
> If so, you need to namespace them, and add them to the list of allowed
> exports.

The function isn't one part of the public API.
So I'd keep the name and add the drm_private notation (adds visibility=hidden)

-Emil

Patch
diff mbox series

diff --git a/intel/intel-symbol-check b/intel/intel-symbol-check
index 4d30a4b15feb94e9523d..339240a1bce7f9673cd3 100755
--- a/intel/intel-symbol-check
+++ b/intel/intel-symbol-check
@@ -87,11 +87,13 @@  drm_intel_gem_context_destroy
 drm_intel_gem_context_get_id
 drm_intel_get_aperture_sizes
 drm_intel_get_eu_total
+drm_intel_get_genx
 drm_intel_get_min_eu_in_pool
 drm_intel_get_pipe_from_crtc_id
 drm_intel_get_pooled_eu
 drm_intel_get_reset_stats
 drm_intel_get_subslice_total
+drm_intel_is_genx
 drm_intel_reg_read
 EOF
 done)
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index d6587b76ac004aa4a5a5..3190cb249acda0ae19ab 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3656,7 +3656,7 @@  drm_intel_bufmgr_gem_init(int fd, int batch_size)
 		bufmgr_gem->gen = 7;
 	else if (IS_GEN8(bufmgr_gem->pci_device))
 		bufmgr_gem->gen = 8;
-	else if (!intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
+	else if (!drm_intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
 		free(bufmgr_gem);
 		bufmgr_gem = NULL;
 		goto exit;
diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
index d5c33cc59002e1f150e8..89f69ed9e6ed67d8c3fc 100644
--- a/intel/intel_chipset.c
+++ b/intel/intel_chipset.c
@@ -44,7 +44,7 @@  static const struct pci_device {
 	INTEL_SKL_IDS(9),
 };
 
-bool intel_is_genx(unsigned int devid, int gen)
+bool drm_intel_is_genx(unsigned int devid, int gen)
 {
 	const struct pci_device *p,
 		  *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
@@ -66,7 +66,7 @@  bool intel_is_genx(unsigned int devid, int gen)
 	return false;
 }
 
-bool intel_get_genx(unsigned int devid, int *gen)
+bool drm_intel_get_genx(unsigned int devid, int *gen)
 {
 	const struct pci_device *p,
 		  *pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
index 9b1e64f1f4bd19b3cf38..01488be2fb34fd08a876 100644
--- a/intel/intel_chipset.h
+++ b/intel/intel_chipset.h
@@ -330,12 +330,12 @@ 
 /* New platforms use kernel pci ids */
 #include <stdbool.h>
 
-bool intel_is_genx(unsigned int devid, int gen);
-bool intel_get_genx(unsigned int devid, int *gen);
+bool drm_intel_is_genx(unsigned int devid, int gen);
+bool drm_intel_get_genx(unsigned int devid, int *gen);
 
-#define IS_GEN9(devid) intel_is_genx(devid, 9)
-#define IS_GEN10(devid) intel_is_genx(devid, 10)
-#define IS_GEN11(devid) intel_is_genx(devid, 11)
+#define IS_GEN9(devid) drm_intel_is_genx(devid, 9)
+#define IS_GEN10(devid) drm_intel_is_genx(devid, 10)
+#define IS_GEN11(devid) drm_intel_is_genx(devid, 11)
 
 #define IS_9XX(dev)		(IS_GEN3(dev) || \
 				 IS_GEN4(dev) || \
@@ -343,6 +343,6 @@  bool intel_get_genx(unsigned int devid, int *gen);
 				 IS_GEN6(dev) || \
 				 IS_GEN7(dev) || \
 				 IS_GEN8(dev) || \
-				 intel_get_genx(dev, NULL))
+				 drm_intel_get_genx(dev, NULL))
 
 #endif /* _INTEL_CHIPSET_H */
diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index 0ff095bc6285d03f4fed..4a493cbfa8f84591b994 100644
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
@@ -3823,7 +3823,7 @@  drm_intel_decode_context_alloc(uint32_t devid)
 	ctx->devid = devid;
 	ctx->out = stdout;
 
-	if (intel_get_genx(devid, &ctx->gen))
+	if (drm_intel_get_genx(devid, &ctx->gen))
 		;
 	else if (IS_GEN8(devid))
 		ctx->gen = 8;