Chipset: igt-gpu-tools Reference Manual

## Chipset Chipset — Feature macros and chipset helpers |

## Functions

#define | BIT()
struct pci_device * | intel_get_pci_device ()
uint32_t | intel_get_drm_devid ()
const struct intel_device_info * | intel_get_device_info ()
unsigned | intel_gen ()
unsigned | intel_graphics_ver ()
unsigned | intel_display_ver ()
void | intel_check_pch ()
#define | IP_VER()
#define | IS_915G()
#define | IS_915GM()
#define | IS_915()
#define | IS_945G()
#define | IS_945GM()
#define | IS_945()
#define | IS_PINEVIEW()
#define | IS_G33()
#define | IS_BROADWATER()
#define | IS_CRESTLINE()
#define | IS_GM45()
#define | IS_G45()
#define | IS_G4X()
#define | IS_IRONLAKE()
#define | IS_ARRANDALE()
#define | IS_SANDYBRIDGE()
#define | IS_IVYBRIDGE()
#define | IS_VALLEYVIEW()
#define | IS_HASWELL()
#define | IS_BROADWELL()
#define | IS_CHERRYVIEW()
#define | IS_SKYLAKE()
#define | IS_BROXTON()
#define | IS_KABYLAKE()
#define | IS_GEMINILAKE()
#define | IS_COFFEELAKE()
#define | IS_COMETLAKE()
#define | IS_CANNONLAKE()
#define | IS_ICELAKE()
#define | IS_TIGERLAKE()
#define | IS_ROCKETLAKE()
#define | IS_DG1()
#define | IS_DG2()
#define | IS_ALDERLAKE_S()
#define | IS_RAPTORLAKE_S()
#define | IS_ALDERLAKE_P()
#define | IS_ALDERLAKE_N()
#define | IS_METEORLAKE()
#define | IS_GEN()
#define | AT_LEAST_GEN()
#define | IS_GEN2()
#define | IS_GEN3()
#define | IS_GEN4()
#define | IS_GEN5()
#define | IS_GEN6()
#define | IS_GEN7()
#define | IS_GEN8()
#define | IS_GEN9()
#define | IS_GEN10()
#define | IS_GEN11()
#define | IS_GEN12()
#define | IS_MOBILE()
#define | IS_965()
#define | HAS_BSD_RING()
#define | HAS_BLT_RING()
#define | HAS_PCH_SPLIT()
#define | HAS_4TILE()
#define | HAS_FLATCCS()

## Types and Values

struct | intel_device_info
extern | intel_pch
enum | pch_type
#define | HAS_IBX
#define | HAS_CPT
#define | HAS_LPT

## Includes

    #include <igt.h>

## Description

This library mostly provides feature macros which use raw pci device ids. It also provides a few more helper functions to handle pci devices, chipset detection and related issues.

## Functions

### BIT()

    #define BIT(x) (1ul <<(x))

### intel_get_pci_device ()

    struct pci_device *
    intel_get_pci_device (void);

Looks up the main graphics pci device using libpciaccess.

#### Returns

The pci_device, exits the program on any failures.

### intel_get_drm_devid ()

    uint32_t
    intel_get_drm_devid (int fd);

Queries the kernel for the pci device id corresponding to the drm file descriptor.

#### Parameters

fd | open i915 drm file descriptor |

#### Returns

The devid, exits the program on any failures.

### intel_get_device_info ()

    const struct intel_device_info *
    intel_get_device_info (uint16_t devid);

Looks up the Intel GFX device info for the given device id.

#### Parameters

devid | pci device id |

#### Returns

The associated intel_get_device_info

### intel_gen ()

    unsigned
    intel_gen (uint16_t devid);

Computes the Intel GFX generation for the given device id.

#### Parameters

devid | pci device id |

#### Returns

The GFX generation on successful lookup, -1u on failure.

### intel_graphics_ver ()

    unsigned
    intel_graphics_ver (uint16_t devid);

### intel_display_ver ()

    unsigned
    intel_display_ver (uint16_t devid);

Computes the Intel GFX display version for the given device id.

#### Parameters

devid | pci device id |

#### Returns

The display version on successful lookup, -1u on failure.

### intel_check_pch ()

    void
    intel_check_pch (void);

Detects the PCH chipset type of the running systems and fills in the results into the global intel_pch variable.

### IP_VER()

    #define IP_VER(ver, rel)		((ver) << 8 | (rel))

### IS_915G()

    #define IS_915G(devid)		(intel_get_device_info(devid)->is_grantsdale)

### IS_915GM()

    #define IS_915GM(devid)		(intel_get_device_info(devid)->is_alviso)

### IS_915()

    #define IS_915(devid)		(IS_915G(devid) || IS_915GM(devid))

### IS_945G()

    #define IS_945G(devid)		(intel_get_device_info(devid)->is_lakeport)

### IS_945GM()

    #define IS_945GM(devid)		(intel_get_device_info(devid)->is_calistoga)

### IS_945()

    #define             IS_945(devid)

### IS_PINEVIEW()

    #define IS_PINEVIEW(devid) (intel_get_device_info(devid)->is_pineview)

### IS_G33()

    #define             IS_G33(devid)

### IS_BROADWATER()

    #define IS_BROADWATER(devid) (intel_get_device_info(devid)->is_broadwater)

### IS_CRESTLINE()

    #define IS_CRESTLINE(devid) (intel_get_device_info(devid)->is_crestline)

### IS_GM45()

    #define IS_GM45(devid)		(intel_get_device_info(devid)->is_cantiga)

### IS_G45()

    #define IS_G45(devid)		(intel_get_device_info(devid)->is_eaglelake)

### IS_G4X()

    #define IS_G4X(devid)		(IS_G45(devid) || IS_GM45(devid))

### IS_IRONLAKE()

    #define IS_IRONLAKE(devid) (intel_get_device_info(devid)->is_ironlake)

### IS_ARRANDALE()

    #define IS_ARRANDALE(devid) (intel_get_device_info(devid)->is_arrandale)

### IS_SANDYBRIDGE()

    #define IS_SANDYBRIDGE(devid) (intel_get_device_info(devid)->is_sandybridge)

### IS_IVYBRIDGE()

    #define IS_IVYBRIDGE(devid) (intel_get_device_info(devid)->is_ivybridge)

### IS_VALLEYVIEW()

    #define IS_VALLEYVIEW(devid) (intel_get_device_info(devid)->is_valleyview)

### IS_HASWELL()

    #define IS_HASWELL(devid) (intel_get_device_info(devid)->is_haswell)

### IS_BROADWELL()

    #define IS_BROADWELL(devid) (intel_get_device_info(devid)->is_broadwell)

### IS_CHERRYVIEW()

    #define IS_CHERRYVIEW(devid) (intel_get_device_info(devid)->is_cherryview)

### IS_SKYLAKE()

    #define IS_SKYLAKE(devid) (intel_get_device_info(devid)->is_skylake)

### IS_BROXTON()

    #define IS_BROXTON(devid) (intel_get_device_info(devid)->is_broxton)

### IS_KABYLAKE()

    #define IS_KABYLAKE(devid) (intel_get_device_info(devid)->is_kabylake)

### IS_GEMINILAKE()

    #define IS_GEMINILAKE(devid) (intel_get_device_info(devid)->is_geminilake)

### IS_COFFEELAKE()

    #define IS_COFFEELAKE(devid) (intel_get_device_info(devid)->is_coffeelake)

### IS_COMETLAKE()

    #define IS_COMETLAKE(devid) (intel_get_device_info(devid)->is_cometlake)

### IS_CANNONLAKE()

    #define IS_CANNONLAKE(devid) (intel_get_device_info(devid)->is_cannonlake)

### IS_ICELAKE()

    #define IS_ICELAKE(devid) (intel_get_device_info(devid)->is_icelake)

### IS_TIGERLAKE()

    #define IS_TIGERLAKE(devid) (intel_get_device_info(devid)->is_tigerlake)

### IS_ROCKETLAKE()

    #define IS_ROCKETLAKE(devid) (intel_get_device_info(devid)->is_rocketlake)

### IS_DG1()

    #define IS_DG1(devid)		(intel_get_device_info(devid)->is_dg1)

### IS_DG2()

    #define IS_DG2(devid)		(intel_get_device_info(devid)->is_dg2)

### IS_ALDERLAKE_S()

    #define IS_ALDERLAKE_S(devid) (intel_get_device_info(devid)->is_alderlake_s)

### IS_RAPTORLAKE_S()

    #define IS_RAPTORLAKE_S(devid) (intel_get_device_info(devid)->is_raptorlake_s)

### IS_ALDERLAKE_P()

    #define IS_ALDERLAKE_P(devid) (intel_get_device_info(devid)->is_alderlake_p)

### IS_ALDERLAKE_N()

    #define IS_ALDERLAKE_N(devid) (intel_get_device_info(devid)->is_alderlake_n)

### IS_METEORLAKE()

    #define IS_METEORLAKE(devid) (intel_get_device_info(devid)->is_meteorlake)

### IS_GEN()

    #define IS_GEN(devid, x) (intel_get_device_info(devid)->graphics_ver == x)

### AT_LEAST_GEN()

    #define AT_LEAST_GEN(devid, x) (intel_get_device_info(devid)->graphics_ver >= x)

### IS_GEN2()

    #define IS_GEN2(devid)		IS_GEN(devid, 2)

### IS_GEN3()

    #define IS_GEN3(devid)		IS_GEN(devid, 3)

### IS_GEN4()

    #define IS_GEN4(devid)		IS_GEN(devid, 4)

### IS_GEN5()

    #define IS_GEN5(devid)		IS_GEN(devid, 5)

### IS_GEN6()

    #define IS_GEN6(devid)		IS_GEN(devid, 6)

### IS_GEN7()

    #define IS_GEN7(devid)		IS_GEN(devid, 7)

### IS_GEN8()

    #define IS_GEN8(devid)		IS_GEN(devid, 8)

### IS_GEN9()

    #define IS_GEN9(devid)		IS_GEN(devid, 9)

### IS_GEN10()

    #define IS_GEN10(devid)		IS_GEN(devid, 10)

### IS_GEN11()

    #define IS_GEN11(devid)		IS_GEN(devid, 11)

### IS_GEN12()

    #define IS_GEN12(devid)		IS_GEN(devid, 12)

### IS_MOBILE()

    #define IS_MOBILE(devid) (intel_get_device_info(devid)->is_mobile)

### IS_965()

    #define IS_965(devid)		AT_LEAST_GEN(devid, 4)

### HAS_BSD_RING()

    #define HAS_BSD_RING(devid) AT_LEAST_GEN(devid, 5)

### HAS_BLT_RING()

    #define HAS_BLT_RING(devid) AT_LEAST_GEN(devid, 6)

### HAS_PCH_SPLIT()

    #define             HAS_PCH_SPLIT(devid)

### HAS_4TILE()

    #define HAS_4TILE(devid) (intel_get_device_info(devid)->has_4tile)

### HAS_FLATCCS()

    #define HAS_FLATCCS(devid) (intel_get_device_info(devid)->has_flatccs)

## Types and Values

### struct intel_device_info

    struct intel_device_info {
    	unsigned graphics_ver;
    	unsigned graphics_rel;
    	unsigned display_ver;
    	unsigned gt; /* 0 if unknown */
    	bool has_4tile : 1;
    	bool has_flatccs : 1;
    	bool is_mobile : 1;
    	bool is_whitney : 1;
    	bool is_almador : 1;
    	bool is_brookdale : 1;
    	bool is_montara : 1;
    	bool is_springdale : 1;
    	bool is_grantsdale : 1;
    	bool is_alviso : 1;
    	bool is_lakeport : 1;
    	bool is_calistoga : 1;
    	bool is_bearlake : 1;
    	bool is_pineview : 1;
    	bool is_broadwater : 1;
    	bool is_crestline : 1;
    	bool is_eaglelake : 1;
    	bool is_cantiga : 1;
    	bool is_ironlake : 1;
    	bool is_arrandale : 1;
    	bool is_sandybridge : 1;
    	bool is_ivybridge : 1;
    	bool is_valleyview : 1;
    	bool is_haswell : 1;
    	bool is_broadwell : 1;
    	bool is_cherryview : 1;
    	bool is_skylake : 1;
    	bool is_broxton : 1;
    	bool is_kabylake : 1;
    	bool is_geminilake : 1;
    	bool is_coffeelake : 1;
    	bool is_cometlake : 1;
    	bool is_cannonlake : 1;
    	bool is_icelake : 1;
    	bool is_elkhartlake : 1;
    	bool is_jasperlake : 1;
    	bool is_tigerlake : 1;
    	bool is_rocketlake : 1;
    	bool is_dg1 : 1;
    	bool is_dg2 : 1;
    	bool is_alderlake_s : 1;
    	bool is_raptorlake_s : 1;
    	bool is_alderlake_p : 1;
    	bool is_alderlake_n : 1;
    	bool is_meteorlake : 1;
    	const char *codename;
    };

### intel_pch

    extern enum pch_type intel_pch;

Global variable to keep track of the pch type. Can either be set manually or detected at runtime with `intel_check_pch()`.

### enum pch_type

#### Members

PCH_NONE |  |
PCH_IBX |  |
PCH_CPT |  |
PCH_LPT |  |

### HAS_IBX

    #define HAS_IBX (intel_pch == PCH_IBX)

### HAS_CPT

    #define HAS_CPT (intel_pch == PCH_CPT)

### HAS_LPT

    #define HAS_LPT (intel_pch == PCH_LPT)