mesa/0001-dril-use-the-super-fallback-path-for-software-fallba.patch

37 lines
1.3 KiB
Diff
Raw Normal View History

From eee51cab8165be6e46286fd68c0f7df7fd76f3eb Mon Sep 17 00:00:00 2001
From: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Date: Mon, 2 Sep 2024 10:42:50 -0400
Subject: [PATCH] dril: use the super fallback path for software fallback
just in case gbm init fails somehow, swrast should still be able to
return some kind of fbconfigs
Fixes: ef88af84676 ("dril: always take the egl init path")
---
src/gallium/targets/dril/dril_target.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gallium/targets/dril/dril_target.c b/src/gallium/targets/dril/dril_target.c
index b7a6ada5197..0caa3514dde 100644
--- a/src/gallium/targets/dril/dril_target.c
+++ b/src/gallium/targets/dril/dril_target.c
@@ -435,8 +435,13 @@ drilCreateNewScreen(int scrn, int fd,
const __DRIconfig ***driver_configs, void *data)
{
const __DRIconfig **configs = init_dri2_configs(fd);
- if (!configs)
- return NULL;
+ if (!configs && fd == -1) {
+ // otherwise set configs to point to our config list
+ configs = calloc(ARRAY_SIZE(drilConfigs) + 1, sizeof(void *));
+ for (int i = 0; i < ARRAY_SIZE(drilConfigs); i++) {
+ configs[i] = mem_dup(&drilConfigs[i], sizeof(drilConfigs[i]));
+ }
+ }
// outpointer it
*driver_configs = configs;
--
2.46.0