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
This commit is contained in:
commit
312d100c01
|
@ -3037,7 +3037,7 @@ static int vmw_cmd_dx_bind_streamoutput(struct vmw_private *dev_priv,
|
|||
res = vmw_dx_streamoutput_lookup(vmw_context_res_man(ctx_node->ctx),
|
||||
cmd->body.soid);
|
||||
if (IS_ERR(res)) {
|
||||
DRM_ERROR("Cound not find streamoutput to bind.\n");
|
||||
DRM_ERROR("Could not find streamoutput to bind.\n");
|
||||
return PTR_ERR(res);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,
|
|||
/* TODO handle none page aligned offsets */
|
||||
/* TODO handle more dst & src != 0 */
|
||||
/* TODO handle more then one copy */
|
||||
DRM_ERROR("Cant snoop dma request for cursor!\n");
|
||||
DRM_ERROR("Can't snoop dma request for cursor!\n");
|
||||
DRM_ERROR("(%u, %u, %u) (%u, %u, %u) (%ux%ux%u) %u %u\n",
|
||||
box->srcx, box->srcy, box->srcz,
|
||||
box->x, box->y, box->z,
|
||||
|
@ -2575,7 +2575,7 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv,
|
|||
++i;
|
||||
}
|
||||
|
||||
if (i != unit) {
|
||||
if (&con->head == &dev_priv->dev->mode_config.connector_list) {
|
||||
DRM_ERROR("Could not find initial display unit.\n");
|
||||
ret = -EINVAL;
|
||||
goto out_unlock;
|
||||
|
@ -2599,13 +2599,13 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv,
|
|||
break;
|
||||
}
|
||||
|
||||
if (mode->type & DRM_MODE_TYPE_PREFERRED)
|
||||
*p_mode = mode;
|
||||
else {
|
||||
if (&mode->head == &con->modes) {
|
||||
WARN_ONCE(true, "Could not find initial preferred mode.\n");
|
||||
*p_mode = list_first_entry(&con->modes,
|
||||
struct drm_display_mode,
|
||||
head);
|
||||
} else {
|
||||
*p_mode = mode;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
|
|
|
@ -81,7 +81,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
|
|||
struct vmw_legacy_display_unit *entry;
|
||||
struct drm_framebuffer *fb = NULL;
|
||||
struct drm_crtc *crtc = NULL;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
/* If there is no display topology the host just assumes
|
||||
* that the guest will set the same layout as the host.
|
||||
|
@ -92,12 +92,11 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
|
|||
crtc = &entry->base.crtc;
|
||||
w = max(w, crtc->x + crtc->mode.hdisplay);
|
||||
h = max(h, crtc->y + crtc->mode.vdisplay);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (crtc == NULL)
|
||||
return 0;
|
||||
fb = entry->base.crtc.primary->state->fb;
|
||||
fb = crtc->primary->state->fb;
|
||||
|
||||
return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
|
||||
fb->format->cpp[0] * 8,
|
||||
|
@ -388,8 +387,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
ldu->base.is_implicit = true;
|
||||
|
||||
/* Initialize primary plane */
|
||||
vmw_du_plane_reset(primary);
|
||||
|
||||
ret = drm_universal_plane_init(dev, &ldu->base.primary,
|
||||
0, &vmw_ldu_plane_funcs,
|
||||
vmw_primary_plane_formats,
|
||||
|
@ -403,8 +400,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
drm_plane_helper_add(primary, &vmw_ldu_primary_plane_helper_funcs);
|
||||
|
||||
/* Initialize cursor plane */
|
||||
vmw_du_plane_reset(cursor);
|
||||
|
||||
ret = drm_universal_plane_init(dev, &ldu->base.cursor,
|
||||
0, &vmw_ldu_cursor_funcs,
|
||||
vmw_cursor_plane_formats,
|
||||
|
@ -418,7 +413,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
|
||||
drm_plane_helper_add(cursor, &vmw_ldu_cursor_plane_helper_funcs);
|
||||
|
||||
vmw_du_connector_reset(connector);
|
||||
ret = drm_connector_init(dev, connector, &vmw_legacy_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
if (ret) {
|
||||
|
@ -446,7 +440,6 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
goto err_free_encoder;
|
||||
}
|
||||
|
||||
vmw_du_crtc_reset(crtc);
|
||||
ret = drm_crtc_init_with_planes(dev, crtc, &ldu->base.primary,
|
||||
&ldu->base.cursor,
|
||||
&vmw_legacy_crtc_funcs, NULL);
|
||||
|
@ -521,6 +514,8 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv)
|
|||
|
||||
dev_priv->active_display_unit = vmw_du_legacy;
|
||||
|
||||
drm_mode_config_reset(dev);
|
||||
|
||||
DRM_INFO("Legacy Display Unit initialized\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -859,8 +859,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
sou->base.is_implicit = false;
|
||||
|
||||
/* Initialize primary plane */
|
||||
vmw_du_plane_reset(primary);
|
||||
|
||||
ret = drm_universal_plane_init(dev, &sou->base.primary,
|
||||
0, &vmw_sou_plane_funcs,
|
||||
vmw_primary_plane_formats,
|
||||
|
@ -875,8 +873,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
drm_plane_enable_fb_damage_clips(primary);
|
||||
|
||||
/* Initialize cursor plane */
|
||||
vmw_du_plane_reset(cursor);
|
||||
|
||||
ret = drm_universal_plane_init(dev, &sou->base.cursor,
|
||||
0, &vmw_sou_cursor_funcs,
|
||||
vmw_cursor_plane_formats,
|
||||
|
@ -890,7 +886,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
|
||||
drm_plane_helper_add(cursor, &vmw_sou_cursor_plane_helper_funcs);
|
||||
|
||||
vmw_du_connector_reset(connector);
|
||||
ret = drm_connector_init(dev, connector, &vmw_sou_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
if (ret) {
|
||||
|
@ -918,8 +913,6 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
goto err_free_encoder;
|
||||
}
|
||||
|
||||
|
||||
vmw_du_crtc_reset(crtc);
|
||||
ret = drm_crtc_init_with_planes(dev, crtc, &sou->base.primary,
|
||||
&sou->base.cursor,
|
||||
&vmw_screen_object_crtc_funcs, NULL);
|
||||
|
@ -973,6 +966,8 @@ int vmw_kms_sou_init_display(struct vmw_private *dev_priv)
|
|||
|
||||
dev_priv->active_display_unit = vmw_du_screen_object;
|
||||
|
||||
drm_mode_config_reset(dev);
|
||||
|
||||
DRM_INFO("Screen Objects Display Unit initialized\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1738,8 +1738,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
stdu->base.is_implicit = false;
|
||||
|
||||
/* Initialize primary plane */
|
||||
vmw_du_plane_reset(primary);
|
||||
|
||||
ret = drm_universal_plane_init(dev, primary,
|
||||
0, &vmw_stdu_plane_funcs,
|
||||
vmw_primary_plane_formats,
|
||||
|
@ -1754,8 +1752,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
drm_plane_enable_fb_damage_clips(primary);
|
||||
|
||||
/* Initialize cursor plane */
|
||||
vmw_du_plane_reset(cursor);
|
||||
|
||||
ret = drm_universal_plane_init(dev, cursor,
|
||||
0, &vmw_stdu_cursor_funcs,
|
||||
vmw_cursor_plane_formats,
|
||||
|
@ -1769,8 +1765,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
|
||||
drm_plane_helper_add(cursor, &vmw_stdu_cursor_plane_helper_funcs);
|
||||
|
||||
vmw_du_connector_reset(connector);
|
||||
|
||||
ret = drm_connector_init(dev, connector, &vmw_stdu_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
if (ret) {
|
||||
|
@ -1798,7 +1792,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
|
|||
goto err_free_encoder;
|
||||
}
|
||||
|
||||
vmw_du_crtc_reset(crtc);
|
||||
ret = drm_crtc_init_with_planes(dev, crtc, &stdu->base.primary,
|
||||
&stdu->base.cursor,
|
||||
&vmw_stdu_crtc_funcs, NULL);
|
||||
|
@ -1894,6 +1887,8 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)
|
|||
}
|
||||
}
|
||||
|
||||
drm_mode_config_reset(dev);
|
||||
|
||||
DRM_INFO("Screen Target Display device initialized\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1969,7 +1969,7 @@ static int vmw_surface_dirty_alloc(struct vmw_resource *res)
|
|||
num_mip = 1;
|
||||
|
||||
num_subres = num_layers * num_mip;
|
||||
dirty_size = sizeof(*dirty) + num_subres * sizeof(dirty->boxes[0]);
|
||||
dirty_size = struct_size(dirty, boxes, num_subres);
|
||||
acc_size = ttm_round_pot(dirty_size);
|
||||
ret = ttm_mem_global_alloc(vmw_mem_glob(res->dev_priv),
|
||||
acc_size, &ctx);
|
||||
|
|
Loading…
Reference in a new issue