summaryrefslogtreecommitdiff
path: root/lib/intel_drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/intel_drm.c')
-rw-r--r--lib/intel_drm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/intel_drm.c b/lib/intel_drm.c
index ca5e4738..55a534d5 100644
--- a/lib/intel_drm.c
+++ b/lib/intel_drm.c
@@ -55,3 +55,21 @@ intel_get_drm_devid(int fd)
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;
+}