i965: Don't call abort() on an unknown device.

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>
This commit is contained in:
Kenneth Graunke 2014-02-10 01:54:23 -08:00
parent b47d231526
commit eaf3358e0a
2 changed files with 4 additions and 2 deletions

View 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;
}
}

View 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;