"implicit_placement", 0, 1);
}
- int vmw_kms_set_config(struct drm_mode_set *set)
+
+
+/**
+ * vmw_kms_set_config - Wrapper around drm_atomic_helper_set_config
+ *
+ * @set: The configuration to set.
+ *
+ * The vmwgfx Xorg driver doesn't assign the mode::type member, which
+ * when drm_mode_set_crtcinfo is called as part of the configuration setting
+ * causes it to return incorrect crtc dimensions causing severe problems in
+ * the vmwgfx modesetting. So explicitly clear that member before calling
+ * into drm_atomic_helper_set_config.
+ */
- return drm_atomic_helper_set_config(set);
++int vmw_kms_set_config(struct drm_mode_set *set,
++ struct drm_modeset_acquire_ctx *ctx)
+{
+ if (set && set->mode)
+ set->mode->type = 0;
+
++ return drm_atomic_helper_set_config(set, ctx);
+}
bool to_surface,
bool interruptible);
- int vmw_kms_set_config(struct drm_mode_set *set);
++int vmw_kms_set_config(struct drm_mode_set *set,
++ struct drm_modeset_acquire_ctx *ctx);
#endif
}
static int vmw_sou_crtc_page_flip(struct drm_crtc *crtc,
- struct drm_framebuffer *fb,
+ struct drm_framebuffer *new_fb,
struct drm_pending_vblank_event *event,
- uint32_t flags)
+ uint32_t flags,
+ struct drm_modeset_acquire_ctx *ctx)
{
struct vmw_private *dev_priv = vmw_priv(crtc->dev);
struct drm_framebuffer *old_fb = crtc->primary->fb;
if (!vmw_kms_crtc_flippable(dev_priv, crtc))
return -EINVAL;
- crtc->primary->fb = fb;
+ flags &= ~DRM_MODE_PAGE_FLIP_ASYNC;
- ret = drm_atomic_helper_page_flip(crtc, new_fb, NULL, flags);
++ ret = drm_atomic_helper_page_flip(crtc, new_fb, NULL, flags, ctx);
+ if (ret) {
+ DRM_ERROR("Page flip error %d.\n", ret);
+ return ret;
+ }
/* do a full screen dirty update */
vclips.x = crtc->x;
if (!stdu->defined || !vmw_kms_crtc_flippable(dev_priv, crtc))
return -EINVAL;
- ret = vmw_stdu_bind_fb(dev_priv, crtc, &crtc->mode, new_fb);
- if (ret)
+ /*
+ * We're always async, but the helper doesn't know how to set async
+ * so lie to the helper. Also, the helper expects someone
+ * to pick the event up from the crtc state, and if nobody does,
+ * it will free it. Since we handle the event in this function,
+ * don't hand it to the helper.
+ */
+ flags &= ~DRM_MODE_PAGE_FLIP_ASYNC;
- ret = drm_atomic_helper_page_flip(crtc, new_fb, NULL, flags);
++ ret = drm_atomic_helper_page_flip(crtc, new_fb, NULL, flags, ctx);
+ if (ret) {
+ DRM_ERROR("Page flip error %d.\n", ret);
return ret;
+ }
if (stdu->base.is_implicit)
vmw_kms_update_implicit_fb(dev_priv, crtc);