diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-03 15:58:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-03 16:15:22 +0100 |
commit | a47f8683fefc9caa4df914de59929ae99823ca37 (patch) | |
tree | 0e095a3502337e846241fee99244c27fe58be5fd /src/intel_module.c | |
parent | 6c157a925f258fd4c82cf0c3004e7d0056c1cd70 (diff) |
intel: Handle fallback probing without match_data
One extreme fallback path through the xf86PlatformProbe results in a
call without any match data. As we have a device by this point, we can
simply do a reverse match.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_module.c')
-rw-r--r-- | src/intel_module.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel_module.c b/src/intel_module.c index e3367dce..d8cf9de6 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -454,6 +454,22 @@ intel_scrn_create(DriverPtr driver, { ScrnInfoPtr scrn; + if (match_data == 0) { + int devid = intel_entity_get_devid(entity_num), i; + if (devid == 0) + return FALSE; + + for (i = 0; intel_device_match[i].device_id != 0; i++) { + if (devid == intel_device_match[i].device_id) { + match_data = (intptr_t)&intel_device_match[i]; + break; + } + } + + if (match_data == 0) + return FALSE; + } + scrn = xf86AllocateScreen(driver, flags); if (scrn == NULL) return FALSE; |