summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-25 16:28:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-08 19:24:11 +0100
commit9a2b57d229fe3e6a1c9799e8cd5397969202d223 (patch)
treefe89d3c2b42c8c93732f0dcccc3560ff4eaef9dd
parent9f823ca236058d7eb37d54a077170fff2d691b99 (diff)
intel: Bail gracefully if we encounter an unknown Intel device
Otherwise we end up with X hitting a fail-loop as the embedded libGL stacks asserts whilst initialising. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--intel/intel_bufmgr_gem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index a484b120..ec64e0a3 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3044,9 +3044,11 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
else if (IS_GEN6(bufmgr_gem->pci_device))
bufmgr_gem->gen = 6;
else if (IS_GEN7(bufmgr_gem->pci_device))
- bufmgr_gem->gen = 7;
- else
- assert(0);
+ bufmgr_gem->gen = 7;
+ else {
+ free(bufmgr_gem);
+ return NULL;
+ }
if (IS_GEN3(bufmgr_gem->pci_device) &&
bufmgr_gem->gtt_size > 256*1024*1024) {