Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit140bcaa

Browse files
committed
drm/vmwgfx: Fix black screen and device errors when running without fbdev
When we are running without fbdev, transitioning from the login screen toX or gnome-shell/wayland will cause a vt switch and the driver will disablesvga mode, losing all modesetting resources. However, the kms atomic statedoes not reflect that and may think that a crtc is still turned on, whichwill cause device errors when we try to bind an fb to the crtc, and thescreen will remain black.Fix this by turning off all kms resources before disabling svga mode.Cc: <stable@vger.kernel.org>Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>Reviewed-by: Sinclair Yeh <syeh@vmware.com>
1 parent93dfdf9 commit140bcaa

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

‎drivers/gpu/drm/vmwgfx/vmwgfx_drv.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,19 @@ static void __vmw_svga_disable(struct vmw_private *dev_priv)
13371337
*/
13381338
voidvmw_svga_disable(structvmw_private*dev_priv)
13391339
{
1340+
/*
1341+
* Disabling SVGA will turn off device modesetting capabilities, so
1342+
* notify KMS about that so that it doesn't cache atomic state that
1343+
* isn't valid anymore, for example crtcs turned on.
1344+
* Strictly we'd want to do this under the SVGA lock (or an SVGA mutex),
1345+
* but vmw_kms_lost_device() takes the reservation sem and thus we'll
1346+
* end up with lock order reversal. Thus, a master may actually perform
1347+
* a new modeset just after we call vmw_kms_lost_device() and race with
1348+
* vmw_svga_disable(), but that should at worst cause atomic KMS state
1349+
* to be inconsistent with the device, causing modesetting problems.
1350+
*
1351+
*/
1352+
vmw_kms_lost_device(dev_priv->dev);
13401353
ttm_write_lock(&dev_priv->reservation_sem, false);
13411354
spin_lock(&dev_priv->svga_lock);
13421355
if (dev_priv->bdev.man[TTM_PL_VRAM].use_type) {

‎drivers/gpu/drm/vmwgfx/vmwgfx_drv.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ int vmw_kms_present(struct vmw_private *dev_priv,
938938
intvmw_kms_update_layout_ioctl(structdrm_device*dev,void*data,
939939
structdrm_file*file_priv);
940940
voidvmw_kms_legacy_hotspot_clear(structvmw_private*dev_priv);
941+
voidvmw_kms_lost_device(structdrm_device*dev);
941942

942943
intvmw_dumb_create(structdrm_file*file_priv,
943944
structdrm_device*dev,

‎drivers/gpu/drm/vmwgfx/vmwgfx_kms.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,3 +2851,14 @@ int vmw_kms_set_config(struct drm_mode_set *set,
28512851

28522852
returndrm_atomic_helper_set_config(set,ctx);
28532853
}
2854+
2855+
2856+
/**
2857+
* vmw_kms_lost_device - Notify kms that modesetting capabilities will be lost
2858+
*
2859+
* @dev: Pointer to the drm device
2860+
*/
2861+
voidvmw_kms_lost_device(structdrm_device*dev)
2862+
{
2863+
drm_atomic_helper_shutdown(dev);
2864+
}

‎drivers/gpu/drm/vmwgfx/vmwgfx_kms.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,5 +439,4 @@ int vmw_kms_stdu_dma(struct vmw_private *dev_priv,
439439

440440
intvmw_kms_set_config(structdrm_mode_set*set,
441441
structdrm_modeset_acquire_ctx*ctx);
442-
443442
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp