xfree86: return NULL for compat output if no outputs.
With outputless GPUs showing up we crash here if there are not outputs try and recover with a bit of grace. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d7ee27e5e4
commit
d1440783a7
|
@ -1863,6 +1863,9 @@ SetCompatOutput(xf86CrtcConfigPtr config)
|
||||||
DisplayModePtr maxmode = NULL, testmode, mode;
|
DisplayModePtr maxmode = NULL, testmode, mode;
|
||||||
int o, compat = -1, count, mincount = 0;
|
int o, compat = -1, count, mincount = 0;
|
||||||
|
|
||||||
|
if (config->num_output == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Look for one that's definitely connected */
|
/* Look for one that's definitely connected */
|
||||||
for (o = 0; o < config->num_output; o++) {
|
for (o = 0; o < config->num_output; o++) {
|
||||||
test = config->output[o];
|
test = config->output[o];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user