i965: Don't call abort() on an unknown device.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Feb 2014 09:54:23 +0000 (01:54 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 11 Feb 2014 10:23:22 +0000 (02:23 -0800)
If we don't recognize the PCI ID, we can't reasonably load the driver.
However, calling abort() is quite rude - it means the application that
tried to initialize us (possibly the X server) can't continue via
fallback paths.  We already have a more polite mechanism - failing to
create the context.  So, just use that.

While we're at it, improve the error message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73024
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lu Hua <huax.lu@intel.com>
src/mesa/drivers/dri/i965/brw_device_info.c
src/mesa/drivers/dri/i965/intel_screen.c

index eb1df79ce493ef12362fe20920087946e301978c..d931091ee6edf812379b1e4990c1ce103761d794 100644 (file)
@@ -229,7 +229,7 @@ brw_get_device_info(int devid)
 #define CHIPSET(id, family, name) case id: return &brw_device_info_##family;
 #include "pci_ids/i965_pci_ids.h"
    default:
-      fprintf(stderr, "Unknown Intel device.");
-      abort();
+      fprintf(stderr, "i965_dri.so does not support the 0x%x PCI ID.\n", devid);
+      return NULL;
    }
 }
index 6ab3609c4ed4e67e747f98401eeae4c50304402a..acdb5f393b9a8306b48a1f4de39dfca2d364677c 100644 (file)
@@ -1328,6 +1328,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
 
    intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr);
    intelScreen->devinfo = brw_get_device_info(intelScreen->deviceID);
+   if (!intelScreen->devinfo)
+      return false;
 
    intelScreen->hw_must_use_separate_stencil = intelScreen->devinfo->gen >= 7;