mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-08 16:36:14 +00:00
Make a register access library with sample to do register reads Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
24 lines
422 B
C
24 lines
422 B
C
#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);
|
|
}
|
|
|
|
/* 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;
|
|
}
|