tools: add intel_gen

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2011-09-12 20:33:58 +02:00
parent 61b9806f4e
commit bf9f149a6d
2 changed files with 19 additions and 0 deletions

View File

@ -55,3 +55,21 @@ intel_get_drm_devid(int fd)
return devid; return devid;
} }
int intel_gen(uint32_t devid)
{
if (IS_GEN2(devid))
return 2;
if (IS_GEN3(devid))
return 3;
if (IS_GEN4(devid))
return 4;
if (IS_GEN5(devid))
return 4;
if (IS_GEN6(devid))
return 6;
if (IS_GEN7(devid))
return 7;
return -1;
}

View File

@ -79,6 +79,7 @@ OUTREG(uint32_t reg, uint32_t val)
struct pci_device *intel_get_pci_device(void); struct pci_device *intel_get_pci_device(void);
uint32_t intel_get_drm_devid(int fd); uint32_t intel_get_drm_devid(int fd);
int intel_gen(uint32_t devid);
void intel_map_file(char *); void intel_map_file(char *);