weston: not available drm_plane to use after hotplug multiple times
After hotplug several times while playing video, the video screen disappeared. After adding log analysis, I found that there is no available drm_plane to use. When playing video we will use overlay plane.
add log in drm_plane_is_available
bool drm_plane_is_available(struct drm_plane *plane, struct drm_output *output) { assert(plane->state_cur);
if (output->virtual) {
weston_log("output is virtual\n");
return false;
}
/* The plane still has a request not yet completed by the kernel. */
if (!plane->state_cur->complete) {
weston_log("The plane still has a request not yet completed by the kernel\n");
return false;
}
/* The plane is still active on another output. */
if (plane->state_cur->output && plane->state_cur->output != output) {
weston_log("The plane is still active on another output\n"); //add debug log here
return false;
}
/* Check whether the plane can be used with this CRTC; possible_crtcs
* is a bitmask of CRTC indices (pipe), rather than CRTC object ID. */
return !!(plane->possible_crtcs & (1 << output->crtc->pipe));
}
issue log
[plane] check plane 55
[plane] not adding plane 55 to candidate list: invalid pixel format
[plane] check plane 49
[16:51:22.836] The plane is still active on another output [plane] plane 49 is not available [plane] check plane 43 [16:51:22.836] The plane is still active on another output [plane] plane 43 is not available
This issue occurs probabilistically. Is it because the plane state is not well maintained in this case?