lib: remove uncessary #includes from headers
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 22 Mar 2014 19:07:35 +0000 (20:07 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 22 Mar 2014 19:08:13 +0000 (20:08 +0100)
Only include what the header itself needs. The big fish here is
intel-gpu-tools.h. More will follow.

One ugly thing removed here is the duplicated GEN6_TD_CTL #define, one
of which was broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
47 files changed:
debugger/debug_rdata.c
lib/drmtest.c
lib/gen6_render.h
lib/gen7_media.h
lib/gen8_media.h
lib/igt_core.h
lib/igt_debugfs.h
lib/igt_kms.h
lib/intel_batchbuffer.h
lib/intel_chipset.h
lib/intel_gpu_tools.h
lib/intel_iosf.c
lib/intel_mmio.c
lib/intel_os.c
lib/intel_reg_map.c
lib/media_fill_gen7.c
lib/media_fill_gen8.c
lib/rendercopy_gen6.c
lib/rendercopy_gen7.c
lib/rendercopy_gen8.c
tests/ddi_compute_wrpll.c
tools/intel_audio_dump.c
tools/intel_backlight.c
tools/intel_bios_reader.c
tools/intel_dpio_read.c
tools/intel_dpio_write.c
tools/intel_error_decode.c
tools/intel_forcewaked.c
tools/intel_gpu_time.c
tools/intel_gpu_top.c
tools/intel_gtt.c
tools/intel_infoframes.c
tools/intel_lid.c
tools/intel_nc_read.c
tools/intel_nc_write.c
tools/intel_opregion_decode.c
tools/intel_panel_fitter.c
tools/intel_punit_read.c
tools/intel_punit_write.c
tools/intel_reg_checker.c
tools/intel_reg_dumper.c
tools/intel_reg_read.c
tools/intel_reg_snapshot.c
tools/intel_reg_write.c
tools/intel_stepping.c
tools/intel_vga_read.c
tools/intel_vga_write.c

index f7dc424..fc7682b 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 struct eu_rdata {
        union {
index c2751e7..112f049 100644 (file)
@@ -55,6 +55,7 @@
 #include "igt_debugfs.h"
 #include "../version.h"
 #include "config.h"
+#include "intel_reg.h"
 
 /* This file contains a bunch of wrapper functions to directly use gem ioctls.
  * Mostly useful to write kernel tests. */
index 9020514..60dc93e 100644 (file)
 #define GEN6_TS_STRG_VAL                      0x7e04
 #define GEN6_TS_RDATA                 0x7e08
 
-/* TD_CTL on gen6 is 0x7000, to not break stuff which depends on this... */
-#ifndef GEN6_TD_CTL
-#define GEN6_TD_CTL                   0x8000
-#endif
 #define GEN6_TD_CTL_MUX_SHIFT         8
 #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH          (1 << 7)
 #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT                   (1 << 6)
 #define GEN6_TS_STRG_VAL                      0x7e04
 #define GEN6_TS_RDATA                 0x7e08
 
-/* TD_CTL on gen6 is 0x7000, to not break stuff which depends on this... */
-#ifndef GEN6_TD_CTL
-#define GEN6_TD_CTL                   0x8000
-#endif
 #define GEN6_TD_CTL_MUX_SHIFT         8
 #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH          (1 << 7)
 #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT                   (1 << 6)
index d75ee1b..d5f9921 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef GEN7_MEDIA_H
 #define GEN7_MEDIA_H
 
+#include <stdint.h>
+
 #define GEN7_SURFACEFORMAT_R32G32B32A32_FLOAT             0x000
 #define GEN7_SURFACEFORMAT_R32G32B32A32_SINT              0x001
 #define GEN7_SURFACEFORMAT_R32G32B32A32_UINT              0x002
index b890df4..1214cd1 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef GEN8_MEDIA_H
 #define GEN8_MEDIA_H
 
+#include <stdint.h>
+
 #define GEN8_SURFACEFORMAT_R32G32B32A32_FLOAT             0x000
 #define GEN8_SURFACEFORMAT_R32G32B32A32_SINT              0x001
 #define GEN8_SURFACEFORMAT_R32G32B32A32_UINT              0x002
index a8bb28e..c21448e 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef IGT_CORE_H
 #define IGT_CORE_H
 
+#include <stdbool.h>
+
 bool __igt_fixture(void);
 void __igt_fixture_complete(void);
 void __igt_fixture_end(void) __attribute__((noreturn));
index d3d2389..3312a8b 100644 (file)
@@ -27,9 +27,8 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <stdio.h>
 
-#include "igt_display.h"
+enum pipe;
 
 int igt_debugfs_open(const char *filename, int mode);
 FILE *igt_debugfs_fopen(const char *filename,
index df658b0..6590fd5 100644 (file)
 #define __IGT_KMS_H__
 
 #include <stdbool.h>
-
+#include <stdint.h>
 #include <drm_fourcc.h>
 #include <cairo.h>
 
-#include <igt_display.h>
+#include "igt_display.h"
 
 struct kmstest_connector_config {
        drmModeCrtc *crtc;
index 7764064..244bdbd 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdint.h>
 #include "intel_bufmgr.h"
 #include "igt_core.h"
+#include "intel_reg.h"
 
 #define BATCH_SZ 4096
 #define BATCH_RESERVED 16
index 2f30778..f6757d4 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef _INTEL_CHIPSET_H
 #define _INTEL_CHIPSET_H
 
-#include <sys/types.h>
 #include <pciaccess.h>
 
 struct pci_device *intel_get_pci_device(void);
@@ -36,6 +35,7 @@ uint32_t intel_get_drm_devid(int fd);
 int intel_gen(uint32_t devid);
 
 extern enum pch_type intel_pch;
+
 enum pch_type {
        PCH_NONE,
        PCH_IBX,
index aab0729..591fd3f 100644 (file)
 #define INTEL_GPU_TOOLS_H
 
 #include <stdint.h>
-#include <sys/types.h>
 #include <pciaccess.h>
 
-#include "intel_chipset.h"
-#include "intel_reg.h"
-#include "drmtest.h"
-
 /* register access helpers from intel_mmio.c */
 extern void *mmio;
 void intel_get_mmio(struct pci_device *pci_dev);
index f57212f..b7b4ce2 100644 (file)
@@ -4,6 +4,7 @@
 #include <err.h>
 #include <errno.h>
 #include "intel_gpu_tools.h"
+#include "intel_reg.h"
 
 #define TIMEOUT_US 500000
 
index 2248009..3e1aac7 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "intel_gpu_tools.h"
 #include "igt_debugfs.h"
+#include "intel_chipset.h"
 
 #define FAKEKEY 0x2468ace0
 
index ce4dcbc..4b72f51 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "intel_gpu_tools.h"
 #include "i915_drm.h"
+#include "drmtest.h"
 
 uint64_t
 intel_get_total_ram_mb(void)
index 26ddd06..ec63d79 100644 (file)
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static struct intel_register_range gen_bwcl_register_map[] = {
        {0x00000000, 0x00000fff, INTEL_RANGE_RW},
index 520c4a2..7494d44 100644 (file)
@@ -1,5 +1,6 @@
 #include "media_fill.h"
 #include "gen7_media.h"
+#include "intel_reg.h"
 
 #include <assert.h>
 
index 7e0a567..d65d260 100644 (file)
@@ -1,5 +1,6 @@
 #include "media_fill.h"
 #include "gen8_media.h"
+#include "intel_reg.h"
 
 #include <assert.h>
 
index 4f5b579..a908ae6 100644 (file)
@@ -18,6 +18,7 @@
 #include "intel_gpu_tools.h"
 #include "rendercopy.h"
 #include "gen6_render.h"
+#include "intel_reg.h"
 
 #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1))
 #define VERTEX_SIZE (3*4)
index ddd6b97..05e6829 100644 (file)
@@ -18,6 +18,7 @@
 #include "intel_gpu_tools.h"
 #include "rendercopy.h"
 #include "gen7_render.h"
+#include "intel_reg.h"
 
 #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1))
 
index f6dd2b5..ef19ebf 100644 (file)
@@ -18,6 +18,7 @@
 #include "intel_gpu_tools.h"
 #include "rendercopy.h"
 #include "gen8_render.h"
+#include "intel_reg.h"
 
 #include <intel_aub.h>
 
index 9d31ebc..c1db6c0 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 
 #include "intel_gpu_tools.h"
+#include "drmtest.h"
 
 #define LC_FREQ 2700
 #define LC_FREQ_2K (LC_FREQ * 2000)
index 3ed2918..9762b4f 100644 (file)
@@ -34,6 +34,9 @@
 #include <err.h>
 #include <arpa/inet.h>
 #include "intel_gpu_tools.h"
+#include "intel_reg.h"
+#include "intel_chipset.h"
+#include "drmtest.h"
 
 static uint32_t devid;
 
index bd7c813..e259184 100644 (file)
@@ -31,6 +31,8 @@
 #include <string.h>
 
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "intel_reg.h"
 
 /* XXX PCH only today */
 
index 19b0fd9..8eb46f3 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "intel_bios.h"
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "drmtest.h"
 
 static uint32_t devid = -1;
 
index 85f8a18..2196041 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index e09f994..c3c682a 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index fff2aed..b1d51b7 100644 (file)
@@ -55,6 +55,7 @@
 #include "intel_chipset.h"
 #include "intel_gpu_tools.h"
 #include "instdone.h"
+#include "intel_reg.h"
 
 static uint32_t
 print_head(unsigned int reg)
index a90e73e..b4e7b5c 100644 (file)
@@ -35,6 +35,7 @@
 #include <syslog.h>
 #include <unistd.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 bool daemonized;
 
index c30b84d..0b8ca9e 100644 (file)
@@ -35,6 +35,8 @@
 #include <sys/wait.h>
 
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "intel_reg.h"
 
 #define SAMPLES_PER_SEC             10000
 
index 31e080a..ccbe973 100644 (file)
@@ -44,6 +44,8 @@
 #endif
 #include "intel_gpu_tools.h"
 #include "instdone.h"
+#include "intel_reg.h"
+#include "intel_chipset.h"
 
 #define  FORCEWAKE         0xA18C
 #define  FORCEWAKE_ACK     0x130090
index a21c26a..f3d1c30 100644 (file)
@@ -35,6 +35,7 @@
 #include <unistd.h>
 
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 #define KB(x) ((x) * 1024)
 #define MB(x) ((x) * 1024 * 1024)
index 81e0343..76dd627 100644 (file)
@@ -31,6 +31,8 @@
 #include <string.h>
 #include <getopt.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "drmtest.h"
 
 typedef enum {
        TRANSC_A = 0,
index 51a95fe..3496046 100644 (file)
@@ -40,6 +40,7 @@
 #include "intel_gpu_tools.h"
 #include "intel_reg.h"
 #include "intel_bios.h"
+#include "intel_chipset.h"
 
 enum lid_status {
        LID_UNKNOWN = -1,
index a2c2e9f..0ec3e75 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index 58be79a..5700f67 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index 8a9ef20..0beece6 100644 (file)
@@ -38,6 +38,7 @@
 #include <sys/types.h>
 
 #include "intel_gpu_tools.h"
+#include "drmtest.h"
 
 #define OPREGION_HEADER_OFFSET         0
 #define OPREGION_ACPI_OFFSET           0x100
index f6723d1..2e3f688 100644 (file)
@@ -31,6 +31,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "intel_reg.h"
 
 int gen;
 
index 3fa2ca8..187bd77 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index eb036ba..c0aa085 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void usage(char *cmdname)
 {
index daa8d0f..a2c7641 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static uint32_t devid;
 static int gen;
index 65fe41e..432892a 100644 (file)
@@ -34,6 +34,9 @@
 #include <err.h>
 #include <unistd.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
+#include "intel_reg.h"
+#include "drmtest.h"
 
 static uint32_t devid = 0;
 
index ae631be..961248a 100644 (file)
@@ -31,6 +31,7 @@
 #include <err.h>
 #include <string.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void bit_decode(uint32_t reg)
 {
index 9c5fa83..09a95b3 100644 (file)
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <assert.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 int main(int argc, char** argv)
 {
index dd636f6..0f73a77 100644 (file)
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <err.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 int main(int argc, char** argv)
 {
index f6f15d1..626c5bb 100644 (file)
@@ -33,6 +33,7 @@
 #include <err.h>
 #include "intel_chipset.h"
 #include "intel_gpu_tools.h"
+#include "intel_reg.h"
 
 static void
 print_clock(const char *name, int clock) {
index 7d86819..40a9cdc 100644 (file)
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <sys/io.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static uint8_t read_reg(uint32_t reg, bool use_mmio)
 {
index effca46..91af0fe 100644 (file)
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <sys/io.h>
 #include "intel_gpu_tools.h"
+#include "intel_chipset.h"
 
 static void write_reg(uint32_t reg, uint8_t val, bool use_mmio)
 {