summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-05-30 12:09:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-05-30 13:08:10 +0100
commita9acc8dbb436e1e523e7d7c0f3c41946a2d0f245 (patch)
treed3e7eefeda1fbad8365dd80d83ea9c1431dbccae /src/sna/sna_display.c
parentf4fcb0e7d24a104afb642dd8819e67ffcaafbfb1 (diff)
sna: Cleanup up error reporting after failure to init KMS interface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r--src/sna/sna_display.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index cee0aea7..6cade448 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2793,30 +2793,32 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
int i;
mode->kmode = drmModeGetResources(sna->kgem.fd);
- if (!mode->kmode)
- return sna_mode_fake_init(sna);
+ if (mode->kmode) {
+ xf86CrtcConfigInit(scrn, &sna_mode_funcs);
- xf86CrtcConfigInit(scrn, &sna_mode_funcs);
+ for (i = 0; i < mode->kmode->count_crtcs; i++)
+ if (!sna_crtc_init(scrn, mode, i))
+ return false;
- for (i = 0; i < mode->kmode->count_crtcs; i++)
- if (!sna_crtc_init(scrn, mode, i))
- return false;
-
- for (i = 0; i < mode->kmode->count_connectors; i++)
- if (!sna_output_init(scrn, mode, i))
- return false;
+ for (i = 0; i < mode->kmode->count_connectors; i++)
+ if (!sna_output_init(scrn, mode, i))
+ return false;
- if (!xf86IsEntityShared(scrn->entityList[0]))
- sna_mode_compute_possible_clones(scrn);
-
- set_size_range(sna);
+ if (!xf86IsEntityShared(scrn->entityList[0]))
+ sna_mode_compute_possible_clones(scrn);
#if HAS_PIXMAP_SHARING
xf86ProviderSetup(scrn, NULL, "Intel");
#endif
- xf86InitialConfiguration(scrn, TRUE);
+ } else {
+ if (!sna_mode_fake_init(sna))
+ return false;
+ }
- return true;
+ set_size_range(sna);
+
+ xf86InitialConfiguration(scrn, TRUE);
+ return scrn->modes != NULL;
}
void