Skip to content

Commit a278724

Browse files
committed
drm/vmwgfx: Implement fbdev on kms v2
With screen targets the old legacy display system fbdev doesn't work satisfactory anymore. At best the resolution is severely restricted. Therefore implement fbdev on top of the kms system. With this change, fbdev will be using whatever KMS backend is chosen. There are helpers available for this, so in the future we'd probably want to implement the helper callbacks instead of calling into our KMS implementation directly. v2: Make sure we take the mode_config mutex around modesetting, Also clear the initial framebuffer using vzalloc instead of vmalloc. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
1 parent fd006a4 commit a278724

File tree

6 files changed

+436
-214
lines changed

6 files changed

+436
-214
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,23 +1120,6 @@ static long vmw_compat_ioctl(struct file *filp, unsigned int cmd,
11201120

11211121
static void vmw_lastclose(struct drm_device *dev)
11221122
{
1123-
struct drm_crtc *crtc;
1124-
struct drm_mode_set set;
1125-
int ret;
1126-
1127-
set.x = 0;
1128-
set.y = 0;
1129-
set.fb = NULL;
1130-
set.mode = NULL;
1131-
set.connectors = NULL;
1132-
set.num_connectors = 0;
1133-
1134-
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
1135-
set.crtc = crtc;
1136-
ret = drm_mode_set_config_internal(&set);
1137-
WARN_ON(ret != 0);
1138-
}
1139-
11401123
}
11411124

11421125
static void vmw_master_init(struct vmw_master *vmaster)
@@ -1321,6 +1304,8 @@ static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
13211304

13221305
switch (val) {
13231306
case PM_HIBERNATION_PREPARE:
1307+
if (dev_priv->enable_fb)
1308+
vmw_fb_off(dev_priv);
13241309
ttm_suspend_lock(&dev_priv->reservation_sem);
13251310

13261311
/*
@@ -1337,7 +1322,8 @@ static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
13371322
case PM_POST_RESTORE:
13381323
vmw_fence_fifo_up(dev_priv->fman);
13391324
ttm_suspend_unlock(&dev_priv->reservation_sem);
1340-
1325+
if (dev_priv->enable_fb)
1326+
vmw_fb_on(dev_priv);
13411327
break;
13421328
case PM_RESTORE_PREPARE:
13431329
break;

0 commit comments

Comments
 (0)