lib/*.h: ensure that all includes will be there
PATCH v2 1/1 lib/*.h: ensure that all includes will be there
From: Mauro Carvalho Chehab <[email protected]>
Headers should be self-contained, having all includes they need to built. Add the missing ones (alphabetically sorted).
Checking what includes were missed was done with the help of this small script:
for i in $(ls lib/*.h|grep -v igt_freebsd.h|sort); do
gcc -I . -I build/ -I include/ -I ./include/drm-uapi/ -I lib/ -I /usr/include/cairo/ -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include/ -c $i
doneWhile at this also sorted includes and added a missing logic to detect duplicated includes at igt_tread.
---
v2:
- improved patch description;
- sorted lib/intel_allocator_msgchannel.h alphabetically.
lib/debug.h | 3 +++ lib/igt_chamelium_stream.h | 3 +++ lib/igt_frame.h | 1 + lib/igt_os.h | 2 ++ lib/igt_panfrost.h | 4 ++++ lib/igt_pm.h | 5 +++++ lib/igt_sriov_device.h | 3 +++ lib/igt_sysfs.h | 3 ++- lib/igt_sysrq.h | 2 ++ lib/igt_thread.h | 7 +++++++ lib/igt_v3d.h | 3 +++ lib/igt_vc4.h | 5 +++++ lib/intel_allocator_msgchannel.h | 3 ++- lib/intel_aub.h | 2 ++ lib/intel_compute.h | 2 ++ lib/intel_io.h | 3 ++- lib/intel_mocs.h | 2 ++ lib/media_spin.h | 2 ++ lib/veboxcopy.h | 2 ++ 19 files changed, 54 insertions(+), 3 deletions(-)
lib/debug.h +3 -0
@@ -28,6 +28,9 @@#ifndef _DEBUG_H_#define _DEBUG_H_ +#include <stdint.h> +#include <stdio.h> +#define DEBUG_PROTOCOL_VERSION 1#define COMMUNICATION_OFFSET 0xc00#define COMMUNICATION_QWORD 0xc0
lib/igt_chamelium_stream.h +3 -0
@@ -27,6 +27,9 @@#define IGT_CHAMELIUM_STREAM_H #include "config.h" +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> enum chamelium_stream_realtime_mode {CHAMELIUM_STREAM_REALTIME_NONE =0 ,
lib/igt_frame.h +1 -0
@@ -29,6 +29,7 @@#include "config.h" +#include <cairo.h> #include <stdbool.h> bool igt_frame_dump_is_enabled (void );
lib/igt_os.h +2 -0
@@ -25,6 +25,8 @@#ifndef IGT_OS_H #define IGT_OS_H +#include <stddef.h> +#include <stdint.h> /* These are separate to allow easier testing when porting, see the comment at * the bottom of intel_os.c. */
lib/igt_panfrost.h +4 -0
@@ -25,6 +25,10 @@#ifndef IGT_PANFROST_H #define IGT_PANFROST_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include "panfrost_drm.h" struct panfrost_bo {
lib/igt_pm.h +5 -0
@@ -24,6 +24,11 @@#ifndef IGT_PM_H #define IGT_PM_H +#include <stdbool.h> +#include <stdint.h> + +#include "igt_kms.h" +void igt_pm_enable_audio_runtime_pm (void );void igt_pm_enable_sata_link_power_management (void );void igt_pm_restore_sata_link_power_management (void );
lib/igt_sriov_device.h +3 -0
@@ -6,6 +6,9 @@#ifndef __IGT_SRIOV_DEVICE_H__#define __IGT_SRIOV_DEVICE_H__ +#include <stdbool.h> +#include <stddef.h> +/* Library for managing SR-IOV (Single Root I/O Virtualization) * devices. *
lib/igt_sysfs.h +2 -1
@@ -25,8 +25,9 @@#ifndef __IGT_SYSFS_H__#define __IGT_SYSFS_H__ -#include <stdbool.h> #include <stdarg.h> +#include <stdbool.h> +#include <stdint.h> #define for_each_sysfs_gt_path (i915__, path__, pathlen__) \ for (int gt__ = 0; \
lib/igt_sysrq.h +2 -0
@@ -25,6 +25,8 @@#ifndef __IGT_SYSRQ_H__#define __IGT_SYSRQ_H__ +#include "igt_core.h" +__noreturn void igt_sysrq_reboot (void );#endif /* __IGT_SYSRQ_H__ */
lib/igt_thread.h +7 -0
@@ -21,8 +21,15 @@* IN THE SOFTWARE. */ +#ifndef __IGT_THREAD_H__ +#define __IGT_THREAD_H__ + +#include <stdbool.h> +void igt_thread_clear_fail_state (void );void igt_thread_fail (void );void igt_thread_assert_no_failures (void );bool igt_thread_is_main (void ); + +#endif /* __IGT_THREAD_H__ */
lib/igt_v3d.h +3 -0
@@ -24,6 +24,9 @@#ifndef IGT_V3D_H #define IGT_V3D_H +#include <stddef.h> +#include <stdint.h> +#include "v3d_drm.h" #define PAGE_SIZE 4096
lib/igt_vc4.h +5 -0
@@ -24,6 +24,11 @@#ifndef IGT_VC4_H #define IGT_VC4_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#include "igt_fb.h" #include "vc4_drm.h" #define PAGE_SIZE 4096
lib/intel_allocator_msgchannel.h +2 -1
@@ -6,9 +6,10 @@#ifndef __INTEL_ALLOCATOR_MSGCHANNEL_H__#define __INTEL_ALLOCATOR_MSGCHANNEL_H__ -#include <sys/types.h> #include <unistd.h> +#include <stdbool.h> #include <stdint.h> +#include <sys/types.h> enum reqtype { REQ_STOP,
lib/intel_aub.h +2 -0
@@ -40,6 +40,8 @@#ifndef _INTEL_AUB_H#define _INTEL_AUB_H +#include <stdint.h> +#define AUB_MI_NOOP (0)#define AUB_MI_BATCH_BUFFER_START (0x31 << 23)#define AUB_PIPE_CONTROL (0x7a000002)
lib/intel_compute.h +2 -0
@@ -9,6 +9,8 @@#ifndef INTEL_COMPUTE_H #define INTEL_COMPUTE_H +#include <stdbool.h> +#include "xe_drm.h" /*
lib/intel_io.h +2 -1
@@ -28,9 +28,10 @@#ifndef INTEL_GPU_TOOLS_H #define INTEL_GPU_TOOLS_H -#include <stdint.h> #include <pciaccess.h> #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> extern void *igt_global_mmio;
lib/intel_mocs.h +2 -0
@@ -6,6 +6,8 @@#ifndef _INTEL_MOCS_H#define _INTEL_MOCS_H +#include <stdint.h> +uint8_t intel_get_wb_mocs_index (int fd);uint8_t intel_get_uc_mocs_index (int fd);
lib/media_spin.h +2 -0
@@ -27,6 +27,8 @@#ifndef MEDIA_SPIN_H #define MEDIA_SPIN_H +#include <stdint.h> +struct intel_buf ;void gen8_media_spinfunc (int i915,struct intel_buf *buf,uint32_t spins);
lib/veboxcopy.h +2 -0
@@ -1,6 +1,8 @@#ifndef __VEBOXCOPY_H__#define __VEBOXCOPY_H__ +#include "intel_bufops.h" + void gen12_vebox_copyfunc(struct intel_bb *ibb, struct intel_buf *src, unsigned int width, unsigned int height,
Signature · 1 line
2.43.0
Hi Mauro,
Quoted 8 lines · Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <[email protected]>
Headers should be self-contained, having all includes they need to built. Add the missing ones (alphabetically sorted).
Checking what includes were missed was done with the help of this small script:
Quoted 8 lines
for i in $(ls lib/*.h|grep -v igt_freebsd.h|sort); do gcc -I . -I build/ -I include/ -I ./include/drm-uapi/ -I lib/ -I /usr/include/cairo/ -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include/ -c $i doneWhile at this also sorted includes and added a missing logic to detect duplicated includes at
igt_tread.Signed-off-by Mauro Carvalho Chehab <[email protected]>
Quoted 303 lines
---
v2:
- improved patch description;
- sortedlib/intel_allocator_msgchannel.halphabetically.lib/debug.h | 3 +++ lib/igt_chamelium_stream.h | 3 +++ lib/igt_frame.h | 1 + lib/igt_os.h | 2 ++ lib/igt_panfrost.h | 4 ++++ lib/igt_pm.h | 5 +++++ lib/igt_sriov_device.h | 3 +++ lib/igt_sysfs.h | 3 ++- lib/igt_sysrq.h | 2 ++ lib/igt_thread.h | 7 +++++++ lib/igt_v3d.h | 3 +++ lib/igt_vc4.h | 5 +++++ lib/intel_allocator_msgchannel.h | 3 ++- lib/intel_aub.h | 2 ++ lib/intel_compute.h | 2 ++ lib/intel_io.h | 3 ++- lib/intel_mocs.h | 2 ++ lib/media_spin.h | 2 ++ lib/veboxcopy.h | 2 ++ 19 files changed, 54 insertions(+), 3 deletions(-)lib/debug.h +3
-0@@ -28,6 +28,9 @@#ifndef _DEBUG_H_#define _DEBUG_H_ +#include <stdint.h> +#include <stdio.h> +#define DEBUG_PROTOCOL_VERSION 1#define COMMUNICATION_OFFSET 0xc00#define COMMUNICATION_QWORD 0xc0lib/igt_chamelium_stream.h +3
-0@@ -27,6 +27,9 @@#define IGT_CHAMELIUM_STREAM_H #include "config.h" +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> enum chamelium_stream_realtime_mode {CHAMELIUM_STREAM_REALTIME_NONE =0 ,lib/igt_frame.h +1
-0@@ -29,6 +29,7 @@#include "config.h" +#include <cairo.h> #include <stdbool.h> bool igt_frame_dump_is_enabled (void );lib/igt_os.h +2
-0@@ -25,6 +25,8 @@#ifndef IGT_OS_H #define IGT_OS_H +#include <stddef.h> +#include <stdint.h> /* These are separate to allow easier testing when porting, see the comment at * the bottom of intel_os.c. */ lib/igt_panfrost.h +4
-0@@ -25,6 +25,10 @@#ifndef IGT_PANFROST_H #define IGT_PANFROST_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include "panfrost_drm.h" struct panfrost_bo {lib/igt_pm.h +5
-0@@ -24,6 +24,11 @@#ifndef IGT_PM_H #define IGT_PM_H +#include <stdbool.h> +#include <stdint.h> + +#include "igt_kms.h" +void igt_pm_enable_audio_runtime_pm (void );void igt_pm_enable_sata_link_power_management (void );void igt_pm_restore_sata_link_power_management (void );lib/igt_sriov_device.h +3
-0@@ -6,6 +6,9 @@#ifndef __IGT_SRIOV_DEVICE_H__#define __IGT_SRIOV_DEVICE_H__ +#include <stdbool.h> +#include <stddef.h> +/* Library for managing SR-IOV (Single Root I/O Virtualization) * devices. * lib/igt_sysfs.h +2
-1@@ -25,8 +25,9 @@#ifndef __IGT_SYSFS_H__#define __IGT_SYSFS_H__ -#include <stdbool.h> #include <stdarg.h> +#include <stdbool.h> +#include <stdint.h> #define for_each_sysfs_gt_path (i915__, path__, pathlen__) \ for (int gt__ = 0; \lib/igt_sysrq.h +2
-0@@ -25,6 +25,8 @@#ifndef __IGT_SYSRQ_H__#define __IGT_SYSRQ_H__ +#include "igt_core.h" +__noreturn void igt_sysrq_reboot (void );#endif /* __IGT_SYSRQ_H__ */ lib/igt_thread.h +7
-0@@ -21,8 +21,15 @@* IN THE SOFTWARE. */ +#ifndef __IGT_THREAD_H__ +#define __IGT_THREAD_H__ + +#include <stdbool.h> +void igt_thread_clear_fail_state (void );void igt_thread_fail (void );void igt_thread_assert_no_failures (void );bool igt_thread_is_main (void ); + +#endif /* __IGT_THREAD_H__ */ lib/igt_v3d.h +3
-0@@ -24,6 +24,9 @@#ifndef IGT_V3D_H #define IGT_V3D_H +#include <stddef.h> +#include <stdint.h> +#include "v3d_drm.h" #define PAGE_SIZE 4096lib/igt_vc4.h +5
-0@@ -24,6 +24,11 @@#ifndef IGT_VC4_H #define IGT_VC4_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#include "igt_fb.h" #include "vc4_drm.h" #define PAGE_SIZE 4096lib/intel_allocator_msgchannel.h +2
-1@@ -6,9 +6,10 @@#ifndef __INTEL_ALLOCATOR_MSGCHANNEL_H__#define __INTEL_ALLOCATOR_MSGCHANNEL_H__ -#include <sys/types.h> #include <unistd.h> +#include <stdbool.h> #include <stdint.h> +#include <sys/types.h> enum reqtype { REQ_STOP,lib/intel_aub.h +2
-0@@ -40,6 +40,8 @@#ifndef _INTEL_AUB_H#define _INTEL_AUB_H +#include <stdint.h> +#define AUB_MI_NOOP (0)#define AUB_MI_BATCH_BUFFER_START (0x31 << 23)#define AUB_PIPE_CONTROL (0x7a000002)lib/intel_compute.h +2
-0@@ -9,6 +9,8 @@#ifndef INTEL_COMPUTE_H #define INTEL_COMPUTE_H +#include <stdbool.h> +#include "xe_drm.h" /* lib/intel_io.h +2
-1@@ -28,9 +28,10 @@#ifndef INTEL_GPU_TOOLS_H #define INTEL_GPU_TOOLS_H -#include <stdint.h> #include <pciaccess.h> #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> extern void *igt_global_mmio;lib/intel_mocs.h +2
-0@@ -6,6 +6,8 @@#ifndef _INTEL_MOCS_H#define _INTEL_MOCS_H +#include <stdint.h> +uint8_t intel_get_wb_mocs_index (int fd);uint8_t intel_get_uc_mocs_index (int fd);lib/media_spin.h +2
-0@@ -27,6 +27,8 @@#ifndef MEDIA_SPIN_H #define MEDIA_SPIN_H +#include <stdint.h> +struct intel_buf ;void gen8_media_spinfunc (int i915,struct intel_buf *buf,uint32_t spins);lib/veboxcopy.h +2
-0@@ -1,6 +1,8 @@#ifndef __VEBOXCOPY_H__#define __VEBOXCOPY_H__ +#include "intel_bufops.h" + void gen12_vebox_copyfunc(struct intel_bb *ibb, struct intel_buf *src, unsigned int width, unsigned int height,Signature · 1 line
2.43.0