lib: remove uncessary #includes from headers

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>
This commit is contained in:
Daniel Vetter 2014-03-22 20:07:35 +01:00
parent cd6d5a61b3
commit 6cfcd71589
47 changed files with 59 additions and 18 deletions

View File

@ -29,6 +29,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
struct eu_rdata { struct eu_rdata {
union { union {

View File

@ -55,6 +55,7 @@
#include "igt_debugfs.h" #include "igt_debugfs.h"
#include "../version.h" #include "../version.h"
#include "config.h" #include "config.h"
#include "intel_reg.h"
/* This file contains a bunch of wrapper functions to directly use gem ioctls. /* This file contains a bunch of wrapper functions to directly use gem ioctls.
* Mostly useful to write kernel tests. */ * Mostly useful to write kernel tests. */

View File

@ -261,10 +261,6 @@
#define GEN6_TS_STRG_VAL 0x7e04 #define GEN6_TS_STRG_VAL 0x7e04
#define GEN6_TS_RDATA 0x7e08 #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_MUX_SHIFT 8
#define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7) #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7)
#define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6) #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6)
@ -570,10 +566,6 @@
#define GEN6_TS_STRG_VAL 0x7e04 #define GEN6_TS_STRG_VAL 0x7e04
#define GEN6_TS_RDATA 0x7e08 #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_MUX_SHIFT 8
#define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7) #define GEN6_TD_CTL_EXTERNAL_HALT_R0_DEBUG_MATCH (1 << 7)
#define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6) #define GEN6_TD_CTL_FORCE_EXTERNAL_HALT (1 << 6)

View File

@ -1,6 +1,8 @@
#ifndef GEN7_MEDIA_H #ifndef GEN7_MEDIA_H
#define GEN7_MEDIA_H #define GEN7_MEDIA_H
#include <stdint.h>
#define GEN7_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 #define GEN7_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000
#define GEN7_SURFACEFORMAT_R32G32B32A32_SINT 0x001 #define GEN7_SURFACEFORMAT_R32G32B32A32_SINT 0x001
#define GEN7_SURFACEFORMAT_R32G32B32A32_UINT 0x002 #define GEN7_SURFACEFORMAT_R32G32B32A32_UINT 0x002

View File

@ -1,6 +1,8 @@
#ifndef GEN8_MEDIA_H #ifndef GEN8_MEDIA_H
#define GEN8_MEDIA_H #define GEN8_MEDIA_H
#include <stdint.h>
#define GEN8_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000 #define GEN8_SURFACEFORMAT_R32G32B32A32_FLOAT 0x000
#define GEN8_SURFACEFORMAT_R32G32B32A32_SINT 0x001 #define GEN8_SURFACEFORMAT_R32G32B32A32_SINT 0x001
#define GEN8_SURFACEFORMAT_R32G32B32A32_UINT 0x002 #define GEN8_SURFACEFORMAT_R32G32B32A32_UINT 0x002

View File

@ -30,6 +30,8 @@
#ifndef IGT_CORE_H #ifndef IGT_CORE_H
#define IGT_CORE_H #define IGT_CORE_H
#include <stdbool.h>
bool __igt_fixture(void); bool __igt_fixture(void);
void __igt_fixture_complete(void); void __igt_fixture_complete(void);
void __igt_fixture_end(void) __attribute__((noreturn)); void __igt_fixture_end(void) __attribute__((noreturn));

View File

@ -27,9 +27,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h>
#include "igt_display.h" enum pipe;
int igt_debugfs_open(const char *filename, int mode); int igt_debugfs_open(const char *filename, int mode);
FILE *igt_debugfs_fopen(const char *filename, FILE *igt_debugfs_fopen(const char *filename,

View File

@ -26,11 +26,11 @@
#define __IGT_KMS_H__ #define __IGT_KMS_H__
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include <cairo.h> #include <cairo.h>
#include <igt_display.h> #include "igt_display.h"
struct kmstest_connector_config { struct kmstest_connector_config {
drmModeCrtc *crtc; drmModeCrtc *crtc;

View File

@ -4,6 +4,7 @@
#include <stdint.h> #include <stdint.h>
#include "intel_bufmgr.h" #include "intel_bufmgr.h"
#include "igt_core.h" #include "igt_core.h"
#include "intel_reg.h"
#define BATCH_SZ 4096 #define BATCH_SZ 4096
#define BATCH_RESERVED 16 #define BATCH_RESERVED 16

View File

@ -28,7 +28,6 @@
#ifndef _INTEL_CHIPSET_H #ifndef _INTEL_CHIPSET_H
#define _INTEL_CHIPSET_H #define _INTEL_CHIPSET_H
#include <sys/types.h>
#include <pciaccess.h> #include <pciaccess.h>
struct pci_device *intel_get_pci_device(void); 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); int intel_gen(uint32_t devid);
extern enum pch_type intel_pch; extern enum pch_type intel_pch;
enum pch_type { enum pch_type {
PCH_NONE, PCH_NONE,
PCH_IBX, PCH_IBX,

View File

@ -29,13 +29,8 @@
#define INTEL_GPU_TOOLS_H #define INTEL_GPU_TOOLS_H
#include <stdint.h> #include <stdint.h>
#include <sys/types.h>
#include <pciaccess.h> #include <pciaccess.h>
#include "intel_chipset.h"
#include "intel_reg.h"
#include "drmtest.h"
/* register access helpers from intel_mmio.c */ /* register access helpers from intel_mmio.c */
extern void *mmio; extern void *mmio;
void intel_get_mmio(struct pci_device *pci_dev); void intel_get_mmio(struct pci_device *pci_dev);

View File

@ -4,6 +4,7 @@
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_reg.h"
#define TIMEOUT_US 500000 #define TIMEOUT_US 500000

View File

@ -43,6 +43,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "igt_debugfs.h" #include "igt_debugfs.h"
#include "intel_chipset.h"
#define FAKEKEY 0x2468ace0 #define FAKEKEY 0x2468ace0

View File

@ -49,6 +49,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "i915_drm.h" #include "i915_drm.h"
#include "drmtest.h"
uint64_t uint64_t
intel_get_total_ram_mb(void) intel_get_total_ram_mb(void)

View File

@ -30,6 +30,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static struct intel_register_range gen_bwcl_register_map[] = { static struct intel_register_range gen_bwcl_register_map[] = {
{0x00000000, 0x00000fff, INTEL_RANGE_RW}, {0x00000000, 0x00000fff, INTEL_RANGE_RW},

View File

@ -1,5 +1,6 @@
#include "media_fill.h" #include "media_fill.h"
#include "gen7_media.h" #include "gen7_media.h"
#include "intel_reg.h"
#include <assert.h> #include <assert.h>

View File

@ -1,5 +1,6 @@
#include "media_fill.h" #include "media_fill.h"
#include "gen8_media.h" #include "gen8_media.h"
#include "intel_reg.h"
#include <assert.h> #include <assert.h>

View File

@ -18,6 +18,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "rendercopy.h" #include "rendercopy.h"
#include "gen6_render.h" #include "gen6_render.h"
#include "intel_reg.h"
#define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1))
#define VERTEX_SIZE (3*4) #define VERTEX_SIZE (3*4)

View File

@ -18,6 +18,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "rendercopy.h" #include "rendercopy.h"
#include "gen7_render.h" #include "gen7_render.h"
#include "intel_reg.h"
#define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1))

View File

@ -18,6 +18,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "rendercopy.h" #include "rendercopy.h"
#include "gen8_render.h" #include "gen8_render.h"
#include "intel_reg.h"
#include <intel_aub.h> #include <intel_aub.h>

View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "drmtest.h"
#define LC_FREQ 2700 #define LC_FREQ 2700
#define LC_FREQ_2K (LC_FREQ * 2000) #define LC_FREQ_2K (LC_FREQ * 2000)

View File

@ -34,6 +34,9 @@
#include <err.h> #include <err.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_reg.h"
#include "intel_chipset.h"
#include "drmtest.h"
static uint32_t devid; static uint32_t devid;

View File

@ -31,6 +31,8 @@
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "intel_reg.h"
/* XXX PCH only today */ /* XXX PCH only today */

View File

@ -37,6 +37,8 @@
#include "intel_bios.h" #include "intel_bios.h"
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "drmtest.h"
static uint32_t devid = -1; static uint32_t devid = -1;

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -55,6 +55,7 @@
#include "intel_chipset.h" #include "intel_chipset.h"
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "instdone.h" #include "instdone.h"
#include "intel_reg.h"
static uint32_t static uint32_t
print_head(unsigned int reg) print_head(unsigned int reg)

View File

@ -35,6 +35,7 @@
#include <syslog.h> #include <syslog.h>
#include <unistd.h> #include <unistd.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
bool daemonized; bool daemonized;

View File

@ -35,6 +35,8 @@
#include <sys/wait.h> #include <sys/wait.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "intel_reg.h"
#define SAMPLES_PER_SEC 10000 #define SAMPLES_PER_SEC 10000

View File

@ -44,6 +44,8 @@
#endif #endif
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "instdone.h" #include "instdone.h"
#include "intel_reg.h"
#include "intel_chipset.h"
#define FORCEWAKE 0xA18C #define FORCEWAKE 0xA18C
#define FORCEWAKE_ACK 0x130090 #define FORCEWAKE_ACK 0x130090

View File

@ -35,6 +35,7 @@
#include <unistd.h> #include <unistd.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#define KB(x) ((x) * 1024) #define KB(x) ((x) * 1024)
#define MB(x) ((x) * 1024 * 1024) #define MB(x) ((x) * 1024 * 1024)

View File

@ -31,6 +31,8 @@
#include <string.h> #include <string.h>
#include <getopt.h> #include <getopt.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "drmtest.h"
typedef enum { typedef enum {
TRANSC_A = 0, TRANSC_A = 0,

View File

@ -40,6 +40,7 @@
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_reg.h" #include "intel_reg.h"
#include "intel_bios.h" #include "intel_bios.h"
#include "intel_chipset.h"
enum lid_status { enum lid_status {
LID_UNKNOWN = -1, LID_UNKNOWN = -1,

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -38,6 +38,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "drmtest.h"
#define OPREGION_HEADER_OFFSET 0 #define OPREGION_HEADER_OFFSET 0
#define OPREGION_ACPI_OFFSET 0x100 #define OPREGION_ACPI_OFFSET 0x100

View File

@ -31,6 +31,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "intel_reg.h"
int gen; int gen;

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void usage(char *cmdname) static void usage(char *cmdname)
{ {

View File

@ -27,6 +27,7 @@
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static uint32_t devid; static uint32_t devid;
static int gen; static int gen;

View File

@ -34,6 +34,9 @@
#include <err.h> #include <err.h>
#include <unistd.h> #include <unistd.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
#include "intel_reg.h"
#include "drmtest.h"
static uint32_t devid = 0; static uint32_t devid = 0;

View File

@ -31,6 +31,7 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void bit_decode(uint32_t reg) static void bit_decode(uint32_t reg)
{ {

View File

@ -27,6 +27,7 @@
#include <unistd.h> #include <unistd.h>
#include <assert.h> #include <assert.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
int main(int argc, char** argv) int main(int argc, char** argv)
{ {

View File

@ -30,6 +30,7 @@
#include <stdio.h> #include <stdio.h>
#include <err.h> #include <err.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
int main(int argc, char** argv) int main(int argc, char** argv)
{ {

View File

@ -33,6 +33,7 @@
#include <err.h> #include <err.h>
#include "intel_chipset.h" #include "intel_chipset.h"
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_reg.h"
static void static void
print_clock(const char *name, int clock) { print_clock(const char *name, int clock) {

View File

@ -32,6 +32,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/io.h> #include <sys/io.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static uint8_t read_reg(uint32_t reg, bool use_mmio) static uint8_t read_reg(uint32_t reg, bool use_mmio)
{ {

View File

@ -32,6 +32,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/io.h> #include <sys/io.h>
#include "intel_gpu_tools.h" #include "intel_gpu_tools.h"
#include "intel_chipset.h"
static void write_reg(uint32_t reg, uint8_t val, bool use_mmio) static void write_reg(uint32_t reg, uint8_t val, bool use_mmio)
{ {