summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/utils.c5
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c10
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.c3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c5
4 files changed, 9 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 328f56b50d4..6d8cb4e29a6 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -409,6 +409,11 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a,
__DRIconfig **all;
int i, j, index;
+ if (a == NULL || a[0] == NULL)
+ return b;
+ else if (b == NULL || b[0] == NULL)
+ return a;
+
i = 0;
while (a[i] != NULL)
i++;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 491f12a86ab..dea7b66ec11 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -878,10 +878,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
msaa_samples_array,
ARRAY_SIZE(msaa_samples_array),
false);
- if (configs == NULL)
- configs = new_configs;
- else
- configs = driConcatConfigs(configs, new_configs);
+ configs = driConcatConfigs(configs, new_configs);
}
/* Generate the minimum possible set of configs that include an
@@ -903,10 +900,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
back_buffer_modes + 1, 1,
msaa_samples_array, 1,
true);
- if (configs == NULL)
- configs = new_configs;
- else
- configs = driConcatConfigs(configs, new_configs);
+ configs = driConcatConfigs(configs, new_configs);
}
if (configs == NULL) {
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 2a15c08c679..3f65c36f29b 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -79,8 +79,7 @@ nouveau_get_configs(void)
GL_TRUE);
assert(config);
- configs = configs ? driConcatConfigs(configs, config)
- : config;
+ configs = driConcatConfigs(configs, config);
}
return (const __DRIconfig **)configs;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 85cfe17ad76..27b57c5a3ea 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -760,10 +760,7 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
msaa_samples_array,
ARRAY_SIZE(msaa_samples_array),
GL_TRUE);
- if (configs == NULL)
- configs = new_configs;
- else
- configs = driConcatConfigs(configs, new_configs);
+ configs = driConcatConfigs(configs, new_configs);
}
if (configs == NULL) {