Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'vmwgfx-next-5.9' of git://people.freedesktop.org/~sroland/linux into drm-next

The drm_mode_config_reset patches are very important fixing a recently
introduced kernel crash, the others fix various older issues which are
a bit less serious in practice.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: "Roland Scheidegger (VMware)" <rscheidegger.oss@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200812005941.19465-1-rscheidegger.oss@gmail.com

+15 -30
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 3037 3037 res = vmw_dx_streamoutput_lookup(vmw_context_res_man(ctx_node->ctx), 3038 3038 cmd->body.soid); 3039 3039 if (IS_ERR(res)) { 3040 - DRM_ERROR("Cound not find streamoutput to bind.\n"); 3040 + DRM_ERROR("Could not find streamoutput to bind.\n"); 3041 3041 return PTR_ERR(res); 3042 3042 } 3043 3043
+5 -5
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 186 186 /* TODO handle none page aligned offsets */ 187 187 /* TODO handle more dst & src != 0 */ 188 188 /* TODO handle more then one copy */ 189 - DRM_ERROR("Cant snoop dma request for cursor!\n"); 189 + DRM_ERROR("Can't snoop dma request for cursor!\n"); 190 190 DRM_ERROR("(%u, %u, %u) (%u, %u, %u) (%ux%ux%u) %u %u\n", 191 191 box->srcx, box->srcy, box->srcz, 192 192 box->x, box->y, box->z, ··· 2575 2575 ++i; 2576 2576 } 2577 2577 2578 - if (i != unit) { 2578 + if (&con->head == &dev_priv->dev->mode_config.connector_list) { 2579 2579 DRM_ERROR("Could not find initial display unit.\n"); 2580 2580 ret = -EINVAL; 2581 2581 goto out_unlock; ··· 2599 2599 break; 2600 2600 } 2601 2601 2602 - if (mode->type & DRM_MODE_TYPE_PREFERRED) 2603 - *p_mode = mode; 2604 - else { 2602 + if (&mode->head == &con->modes) { 2605 2603 WARN_ONCE(true, "Could not find initial preferred mode.\n"); 2606 2604 *p_mode = list_first_entry(&con->modes, 2607 2605 struct drm_display_mode, 2608 2606 head); 2607 + } else { 2608 + *p_mode = mode; 2609 2609 } 2610 2610 2611 2611 out_unlock:
+4 -9
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
··· 81 81 struct vmw_legacy_display_unit *entry; 82 82 struct drm_framebuffer *fb = NULL; 83 83 struct drm_crtc *crtc = NULL; 84 - int i = 0; 84 + int i; 85 85 86 86 /* If there is no display topology the host just assumes 87 87 * that the guest will set the same layout as the host. ··· 92 92 crtc = &entry->base.crtc; 93 93 w = max(w, crtc->x + crtc->mode.hdisplay); 94 94 h = max(h, crtc->y + crtc->mode.vdisplay); 95 - i++; 96 95 } 97 96 98 97 if (crtc == NULL) 99 98 return 0; 100 - fb = entry->base.crtc.primary->state->fb; 99 + fb = crtc->primary->state->fb; 101 100 102 101 return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0], 103 102 fb->format->cpp[0] * 8, ··· 387 388 ldu->base.is_implicit = true; 388 389 389 390 /* Initialize primary plane */ 390 - vmw_du_plane_reset(primary); 391 - 392 391 ret = drm_universal_plane_init(dev, &ldu->base.primary, 393 392 0, &vmw_ldu_plane_funcs, 394 393 vmw_primary_plane_formats, ··· 400 403 drm_plane_helper_add(primary, &vmw_ldu_primary_plane_helper_funcs); 401 404 402 405 /* Initialize cursor plane */ 403 - vmw_du_plane_reset(cursor); 404 - 405 406 ret = drm_universal_plane_init(dev, &ldu->base.cursor, 406 407 0, &vmw_ldu_cursor_funcs, 407 408 vmw_cursor_plane_formats, ··· 413 418 414 419 drm_plane_helper_add(cursor, &vmw_ldu_cursor_plane_helper_funcs); 415 420 416 - vmw_du_connector_reset(connector); 417 421 ret = drm_connector_init(dev, connector, &vmw_legacy_connector_funcs, 418 422 DRM_MODE_CONNECTOR_VIRTUAL); 419 423 if (ret) { ··· 440 446 goto err_free_encoder; 441 447 } 442 448 443 - vmw_du_crtc_reset(crtc); 444 449 ret = drm_crtc_init_with_planes(dev, crtc, &ldu->base.primary, 445 450 &ldu->base.cursor, 446 451 &vmw_legacy_crtc_funcs, NULL); ··· 513 520 vmw_ldu_init(dev_priv, 0); 514 521 515 522 dev_priv->active_display_unit = vmw_du_legacy; 523 + 524 + drm_mode_config_reset(dev); 516 525 517 526 DRM_INFO("Legacy Display Unit initialized\n"); 518 527
+2 -7
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
··· 859 859 sou->base.is_implicit = false; 860 860 861 861 /* Initialize primary plane */ 862 - vmw_du_plane_reset(primary); 863 - 864 862 ret = drm_universal_plane_init(dev, &sou->base.primary, 865 863 0, &vmw_sou_plane_funcs, 866 864 vmw_primary_plane_formats, ··· 873 875 drm_plane_enable_fb_damage_clips(primary); 874 876 875 877 /* Initialize cursor plane */ 876 - vmw_du_plane_reset(cursor); 877 - 878 878 ret = drm_universal_plane_init(dev, &sou->base.cursor, 879 879 0, &vmw_sou_cursor_funcs, 880 880 vmw_cursor_plane_formats, ··· 886 890 887 891 drm_plane_helper_add(cursor, &vmw_sou_cursor_plane_helper_funcs); 888 892 889 - vmw_du_connector_reset(connector); 890 893 ret = drm_connector_init(dev, connector, &vmw_sou_connector_funcs, 891 894 DRM_MODE_CONNECTOR_VIRTUAL); 892 895 if (ret) { ··· 913 918 goto err_free_encoder; 914 919 } 915 920 916 - 917 - vmw_du_crtc_reset(crtc); 918 921 ret = drm_crtc_init_with_planes(dev, crtc, &sou->base.primary, 919 922 &sou->base.cursor, 920 923 &vmw_screen_object_crtc_funcs, NULL); ··· 965 972 vmw_sou_init(dev_priv, i); 966 973 967 974 dev_priv->active_display_unit = vmw_du_screen_object; 975 + 976 + drm_mode_config_reset(dev); 968 977 969 978 DRM_INFO("Screen Objects Display Unit initialized\n"); 970 979
+2 -7
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
··· 1738 1738 stdu->base.is_implicit = false; 1739 1739 1740 1740 /* Initialize primary plane */ 1741 - vmw_du_plane_reset(primary); 1742 - 1743 1741 ret = drm_universal_plane_init(dev, primary, 1744 1742 0, &vmw_stdu_plane_funcs, 1745 1743 vmw_primary_plane_formats, ··· 1752 1754 drm_plane_enable_fb_damage_clips(primary); 1753 1755 1754 1756 /* Initialize cursor plane */ 1755 - vmw_du_plane_reset(cursor); 1756 - 1757 1757 ret = drm_universal_plane_init(dev, cursor, 1758 1758 0, &vmw_stdu_cursor_funcs, 1759 1759 vmw_cursor_plane_formats, ··· 1764 1768 } 1765 1769 1766 1770 drm_plane_helper_add(cursor, &vmw_stdu_cursor_plane_helper_funcs); 1767 - 1768 - vmw_du_connector_reset(connector); 1769 1771 1770 1772 ret = drm_connector_init(dev, connector, &vmw_stdu_connector_funcs, 1771 1773 DRM_MODE_CONNECTOR_VIRTUAL); ··· 1792 1798 goto err_free_encoder; 1793 1799 } 1794 1800 1795 - vmw_du_crtc_reset(crtc); 1796 1801 ret = drm_crtc_init_with_planes(dev, crtc, &stdu->base.primary, 1797 1802 &stdu->base.cursor, 1798 1803 &vmw_stdu_crtc_funcs, NULL); ··· 1886 1893 return ret; 1887 1894 } 1888 1895 } 1896 + 1897 + drm_mode_config_reset(dev); 1889 1898 1890 1899 DRM_INFO("Screen Target Display device initialized\n"); 1891 1900
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
··· 1969 1969 num_mip = 1; 1970 1970 1971 1971 num_subres = num_layers * num_mip; 1972 - dirty_size = sizeof(*dirty) + num_subres * sizeof(dirty->boxes[0]); 1972 + dirty_size = struct_size(dirty, boxes, num_subres); 1973 1973 acc_size = ttm_round_pot(dirty_size); 1974 1974 ret = ttm_mem_global_alloc(vmw_mem_glob(res->dev_priv), 1975 1975 acc_size, &ctx);