mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-08 16:36:14 +00:00
quick_dump built fine, but it could actually run, since a lot of the linking happens at run time. There is one hack where we redefine the environment stuff, since depending on igt_aux means we have to pull in libdrm, which I do not want to do. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
48 lines
780 B
C
48 lines
780 B
C
#include <stdbool.h>
|
|
#include <stdlib.h>
|
|
#include <pciaccess.h>
|
|
#include "intel_chipset.h"
|
|
|
|
int is_sandybridge(unsigned short pciid)
|
|
{
|
|
return IS_GEN6(pciid);
|
|
}
|
|
|
|
int is_ivybridge(unsigned short pciid)
|
|
{
|
|
return IS_IVYBRIDGE(pciid);
|
|
}
|
|
|
|
int is_valleyview(unsigned short pciid)
|
|
{
|
|
return IS_VALLEYVIEW(pciid);
|
|
}
|
|
|
|
int is_haswell(unsigned short pciid)
|
|
{
|
|
return IS_HASWELL(pciid);
|
|
}
|
|
|
|
int is_broadwell(unsigned short pciid)
|
|
{
|
|
return IS_BROADWELL(pciid);
|
|
}
|
|
|
|
/* Simple helper because I couldn't make this work in the script */
|
|
unsigned short pcidev_to_devid(struct pci_device *pdev)
|
|
{
|
|
return pdev->device_id;
|
|
}
|
|
|
|
bool igt_check_boolean_env_var(const char *env_var, bool default_value)
|
|
{
|
|
char *val;
|
|
|
|
val = getenv(env_var);
|
|
if (!val)
|
|
return default_value;
|
|
|
|
return atoi(val) != 0;
|
|
}
|
|
|