diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-10 08:36:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-10 08:37:02 +0100 |
commit | 0d1df4762ffd7babb95a5f48f77487a6c7db83fe (patch) | |
tree | 38b2c73a7f29127bffbcf5c075ce37eb8732a14b /src/sna/sna_driver.c | |
parent | f39e1d19c166a97a74974edf3fe79082d3a46d2b (diff) |
sna: Relax early failure to set KMS modes
Under the new world order, we may not have KMS rights until we are given
a VT.
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.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 66f72dc2..401737b3 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -264,26 +264,20 @@ static Bool sna_create_screen_resources(ScreenPtr screen) assert(sna->front == new_front); screen->DestroyPixmap(new_front); /* transfer ownership to screen */ - if (intel_get_master(sna->scrn)) { - xf86DrvMsg(screen->myNum, X_ERROR, - "[intel] Failed to become DRM master\n"); - screen->DestroyPixmap(sna->front); - sna->front = NULL; - return FALSE; - } - sna_mode_set_primary(sna); - /* Only preserve the fbcon, not any subsequent server regens */ - if (serverGeneration == 1 && (sna->flags & SNA_IS_HOSTED) == 0) - sna_copy_fbcon(sna); + /* Try to become master and copy the current fbcon before the + * actual VT switch. If we fail here, we will try to reset the + * mode in the eventual VT switch. This can fail if systemd has + * already revoked our KMS privileges, so just carry on regardless, + * and hope that everything is sorted after the VT switch. + */ + if (intel_get_master(sna->scrn) == 0) { + /* Only preserve the fbcon, not any subsequent server regens */ + if (serverGeneration == 1 && (sna->flags & SNA_IS_HOSTED) == 0) + sna_copy_fbcon(sna); - if (!sna_set_desired_mode(sna)) { - xf86DrvMsg(screen->myNum, X_ERROR, - "[intel] Failed to set initial mode\n"); - screen->DestroyPixmap(sna->front); - sna->front = NULL; - return FALSE; + (void)sna_set_desired_mode(sna); } return TRUE; |