summaryrefslogtreecommitdiff
path: root/src/sna/sna_driver.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-12-20 08:25:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-12-20 08:28:15 +0000
commit032a581fd7037c9d2e5fdc91d325db6a7e133b7f (patch)
treebe96555c9e12fdcaa91649331fff94aa65f814b4 /src/sna/sna_driver.c
parentaf6d8e9e8f546e5cba60e3a62765c2dbd0328e83 (diff)
sna: Fixup sna->scrn == scrn assert for early initialisation
Very early on when creating the sna privates, we call to_sna(scrn) before we have even set the sna->scrn backpointer. Reorder the code such that we always set sna->scrn before the first to_sna() so that the assert(to_sna(scrn)->scrn == scrn) can always hold. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r--src/sna/sna_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 5492c59d..2643e6c8 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -554,12 +554,12 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
probe = (uintptr_t)scrn->driverPrivate & 1;
sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
scrn->driverPrivate = sna;
+ sna->scrn = scrn;
sna->cpu_features = sna_cpu_detect();
sna->acpi.fd = sna_acpi_open();
}
sna = to_sna(scrn);
- sna->scrn = scrn;
sna->pEnt = pEnt;
sna->flags = probe;