Skip to content

Commit 6a9d8fc

Browse files
committed
Merge branch 'vmwgfx-fixes-5.1' of git://people.freedesktop.org/~thomash/linux into drm-fixes
Two fixes CC'd stable. One fix for a long-standing a bit hard-to-trigger fbdev modesetting bug and one out-of-bo-id fix. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thellstrom@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190321112026.114328-1-thellstrom@vmware.com
2 parents 28d3ba6 + c2d3115 commit 6a9d8fc

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,9 @@ static int vmw_fb_set_par(struct fb_info *info)
564564
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
565565
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC)
566566
};
567-
struct drm_display_mode *old_mode;
568567
struct drm_display_mode *mode;
569568
int ret;
570569

571-
old_mode = par->set_mode;
572570
mode = drm_mode_duplicate(vmw_priv->dev, &new_mode);
573571
if (!mode) {
574572
DRM_ERROR("Could not create new fb mode.\n");
@@ -579,11 +577,7 @@ static int vmw_fb_set_par(struct fb_info *info)
579577
mode->vdisplay = var->yres;
580578
vmw_guess_mode_timing(mode);
581579

582-
if (old_mode && drm_mode_equal(old_mode, mode)) {
583-
drm_mode_destroy(vmw_priv->dev, mode);
584-
mode = old_mode;
585-
old_mode = NULL;
586-
} else if (!vmw_kms_validate_mode_vram(vmw_priv,
580+
if (!vmw_kms_validate_mode_vram(vmw_priv,
587581
mode->hdisplay *
588582
DIV_ROUND_UP(var->bits_per_pixel, 8),
589583
mode->vdisplay)) {
@@ -620,8 +614,8 @@ static int vmw_fb_set_par(struct fb_info *info)
620614
schedule_delayed_work(&par->local_work, 0);
621615

622616
out_unlock:
623-
if (old_mode)
624-
drm_mode_destroy(vmw_priv->dev, old_mode);
617+
if (par->set_mode)
618+
drm_mode_destroy(vmw_priv->dev, par->set_mode);
625619
par->set_mode = mode;
626620

627621
mutex_unlock(&par->bo_mutex);

drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
5757

5858
id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL);
5959
if (id < 0)
60-
return id;
60+
return (id != -ENOMEM ? 0 : id);
6161

6262
spin_lock(&gman->lock);
6363

0 commit comments

Comments
 (0)