+ /* We implement mixed mode by progressively creating and testing
+ * incremental states, of scanout + overlay + cursor. Since we
+ * walk our views top to bottom, the scanout plane is last, however
+ * we always need it in our scene for the test modeset to be
+ * meaningful. To do this, we steal a reference to the last
+ * renderer framebuffer we have, if we think it's basically
+ * compatible. If we don't have that, then we conservatively fall
+ * back to only using the renderer for this repaint. */
+ if (mode == DRM_OUTPUT_PROPOSE_STATE_MIXED) {
+ struct drm_plane *plane = output->scanout_plane;
+ struct drm_fb *scanout_fb = plane->state_cur->fb;
+
+ if (!scanout_fb ||
+ (scanout_fb->type != BUFFER_GBM_SURFACE &&
+ scanout_fb->type != BUFFER_PIXMAN_DUMB)) {
+ drm_output_state_free(state);
+ return NULL;
+ }
+
+ if (scanout_fb->width != output_base->current_mode->width ||
+ scanout_fb->height != output_base->current_mode->height) {
+ drm_output_state_free(state);
+ return NULL;
+ }
+
+ scanout_state = drm_plane_state_duplicate(state,
+ plane->state_cur);
+ }
+