Module: Mesa Branch: master Commit: 5871f4177ce64c43d56098fd1e18301329843109 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5871f4177ce64c43d56098fd1e18301329843109
Author: Rob Clark <[email protected]> Date: Wed Mar 17 13:28:21 2021 -0700 freedreno: Make headers C++ happy We'll need a few of these for the C++ based gfx-pps performance counter collector datasource. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9758> --- src/freedreno/common/freedreno_dev_info.h | 8 ++++++++ src/freedreno/drm/freedreno_drmif.h | 8 ++++++++ src/freedreno/drm/freedreno_ringbuffer.h | 14 ++++++++++++-- src/freedreno/drm/msm_ringbuffer.c | 2 +- src/freedreno/perfcntrs/freedreno_perfcntr.h | 8 ++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h index 8392b4a5874..4f84015abb0 100644 --- a/src/freedreno/common/freedreno_dev_info.h +++ b/src/freedreno/common/freedreno_dev_info.h @@ -28,6 +28,10 @@ #include <stdint.h> #include <stdbool.h> +#ifdef __cplusplus +extern "C" { +#endif + /** * Freedreno hardware description and quirks */ @@ -67,5 +71,9 @@ struct freedreno_dev_info { void freedreno_dev_info_init(struct freedreno_dev_info *info, uint32_t gpu_id); +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + #endif /* FREEDRENO_DEVICE_INFO_H */ diff --git a/src/freedreno/drm/freedreno_drmif.h b/src/freedreno/drm/freedreno_drmif.h index 3f7b8294e3c..f9f8b3e6f67 100644 --- a/src/freedreno/drm/freedreno_drmif.h +++ b/src/freedreno/drm/freedreno_drmif.h @@ -31,6 +31,10 @@ #include "util/u_debug.h" +#ifdef __cplusplus +extern "C" { +#endif + struct fd_bo; struct fd_pipe; struct fd_device; @@ -172,4 +176,8 @@ void * fd_bo_map(struct fd_bo *bo); int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op); void fd_bo_cpu_fini(struct fd_bo *bo); +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + #endif /* FREEDRENO_DRMIF_H_ */ diff --git a/src/freedreno/drm/freedreno_ringbuffer.h b/src/freedreno/drm/freedreno_ringbuffer.h index be6aa9e63ec..920620d9763 100644 --- a/src/freedreno/drm/freedreno_ringbuffer.h +++ b/src/freedreno/drm/freedreno_ringbuffer.h @@ -36,6 +36,10 @@ #include "adreno_common.xml.h" #include "adreno_pm4.xml.h" +#ifdef __cplusplus +extern "C" { +#endif + struct fd_submit; struct fd_ringbuffer; @@ -168,7 +172,7 @@ struct fd_reloc { #define FD_RELOC_WRITE 0x0002 #define FD_RELOC_DUMP 0x0004 uint32_t offset; - uint32_t or; + uint32_t orlo; int32_t shift; uint32_t orhi; /* used for a5xx+ */ }; @@ -239,6 +243,7 @@ OUT_RING(struct fd_ringbuffer *ring, uint32_t data) /* * NOTE: OUT_RELOC() is 2 dwords (64b) on a5xx+ */ +#ifndef __cplusplus static inline void OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset, uint64_t or, int32_t shift) @@ -262,11 +267,12 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, .bo = bo, .iova = iova, .offset = offset, - .or = or, + .orlo = or, .shift = shift, .orhi = or >> 32, }); } +#endif static inline void OUT_RB(struct fd_ringbuffer *ring, struct fd_ringbuffer *target) @@ -351,4 +357,8 @@ OUT_WFI5(struct fd_ringbuffer *ring) OUT_PKT7(ring, CP_WAIT_FOR_IDLE, 0); } +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + #endif /* FREEDRENO_RINGBUFFER_H_ */ diff --git a/src/freedreno/drm/msm_ringbuffer.c b/src/freedreno/drm/msm_ringbuffer.c index 900dc81a9c3..00748d764c9 100644 --- a/src/freedreno/drm/msm_ringbuffer.c +++ b/src/freedreno/drm/msm_ringbuffer.c @@ -515,7 +515,7 @@ msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring, APPEND(msm_ring->cmd, relocs, (struct drm_msm_gem_submit_reloc){ .reloc_idx = reloc_idx, .reloc_offset = reloc->offset, - .or = reloc->or, + .or = reloc->orlo, .shift = reloc->shift, .submit_offset = offset_bytes(ring->cur, ring->start) + msm_ring->offset, }); diff --git a/src/freedreno/perfcntrs/freedreno_perfcntr.h b/src/freedreno/perfcntrs/freedreno_perfcntr.h index 250ea92fc37..bd764e380a1 100644 --- a/src/freedreno/perfcntrs/freedreno_perfcntr.h +++ b/src/freedreno/perfcntrs/freedreno_perfcntr.h @@ -29,6 +29,10 @@ #include "util/macros.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Mapping very closely to the AMD_performance_monitor extension, adreno has * groups of performance counters where each group has N counters, which can @@ -124,4 +128,8 @@ const struct fd_perfcntr_group *fd_perfcntrs(unsigned gpu_id, unsigned *count); .countables = _countables, \ } +#ifdef __cplusplus +} /* end of extern "C" */ +#endif + #endif /* FREEDRENO_PERFCNTR_H_ */ _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
