/* * Timeout in ms to wait for frame done event from the backend: * must be a bit more than IO time-out
*/ #define FRAME_DONE_TO_MS (XEN_DRM_FRONT_WAIT_BACK_MS + 100)
if (ret) {
DRM_ERROR("Failed to enable display: %d\n", ret);
pipeline->conn_connected = false;
}
drm_dev_exit(idx);
}
staticvoid display_disable(struct drm_simple_display_pipe *pipe)
{ struct xen_drm_front_drm_pipeline *pipeline =
to_xen_drm_pipeline(pipe); int ret = 0, idx;
if (drm_dev_enter(pipe->crtc.dev, &idx)) {
ret = xen_drm_front_mode_set(pipeline, 0, 0, 0, 0, 0,
xen_drm_front_fb_to_cookie(NULL));
drm_dev_exit(idx);
} if (ret)
DRM_ERROR("Failed to disable display: %d\n", ret);
/* Make sure we can restart with enabled connector next time */
pipeline->conn_connected = true;
/* release stalled event if any */
send_pending_event(pipeline);
}
void xen_drm_front_kms_on_frame_done(struct xen_drm_front_drm_pipeline *pipeline,
u64 fb_cookie)
{ /* * This runs in interrupt context, e.g. under * drm_info->front_info->io_lock, so we cannot call _sync version * to cancel the work
*/
cancel_delayed_work(&pipeline->pflip_to_worker);
/* * If old_plane_state->fb is NULL and plane_state->fb is not, * then this is an atomic commit which will enable display. * If old_plane_state->fb is not NULL and plane_state->fb is, * then this is an atomic commit which will disable display. * Ignore these and do not send page flip as this framebuffer will be * sent to the backend as a part of display_set_config call.
*/ if (old_plane_state->fb && plane_state->fb) { struct xen_drm_front_drm_pipeline *pipeline =
to_xen_drm_pipeline(pipe); struct xen_drm_front_drm_info *drm_info = pipeline->drm_info; int ret;
ret = xen_drm_front_page_flip(drm_info->front_info,
pipeline->index,
xen_drm_front_fb_to_cookie(plane_state->fb)); if (ret) {
DRM_ERROR("Failed to send page flip request to backend: %d\n", ret);
pipeline->conn_connected = false; /* * Report the flip not handled, so pending event is * sent, unblocking user-space.
*/ returnfalse;
} /* * Signal that page flip was handled, pending event will be sent * on frame done event from the backend.
*/ returntrue;
}
returnfalse;
}
staticint display_check(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state, struct drm_crtc_state *crtc_state)
{ /* * Xen doesn't initialize vblanking via drm_vblank_init(), so * DRM helpers assume that it doesn't handle vblanking and start * sending out fake VBLANK events automatically. * * As xen contains it's own logic for sending out VBLANK events * in send_pending_event(), disable no_vblank (i.e., the xen * driver has vblanking support).
*/
crtc_state->no_vblank = false;
if (!drm_dev_enter(pipe->crtc.dev, &idx)) {
send_pending_event(pipeline); return;
}
/* * Send page flip request to the backend *after* we have event cached * above, so on page flip done event from the backend we can * deliver it and there is no race condition between this code and * event from the backend. * If this is not a page flip, e.g. no flip done event from the backend * is expected, then send now.
*/ if (!display_send_page_flip(pipe, old_plane_state))
send_pending_event(pipeline);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.