mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-25 17:50:39 +02:00
surfaceless: Fix swrast-path segfault when loader doesn't know driver name.
If we're hitting the swrast fallback path here, it's probably because we stumbled across a KMS-only device (such as the ASpeed that some of our CI runners have) that will then return a NULL driver_name. Don't crash in that case. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
parent
6a8d39dccd
commit
86ae3c2186
1 changed files with 3 additions and 2 deletions
|
|
@ -294,8 +294,9 @@ surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
|
|||
* are unavailable since 6c5ab, and kms_swrast is more
|
||||
* feature complete than swrast.
|
||||
*/
|
||||
if (strcmp(driver_name, "vgem") == 0 ||
|
||||
strcmp(driver_name, "virtio_gpu") == 0)
|
||||
if (driver_name &&
|
||||
(strcmp(driver_name, "vgem") == 0 ||
|
||||
strcmp(driver_name, "virtio_gpu") == 0))
|
||||
dri2_dpy->driver_name = strdup("kms_swrast");
|
||||
free(driver_name);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue