backend-drm: Don't take buffer-release reference for cursor views
We just copy the SHM buffer straight into a separately-allocated GBM BO, so no need to take a reference on the buffer itself or keep it from being released. All drm_output_try_view_on_plane really does at this point is to call the prepare_*_view function for the requisite plane type, and take a ref on the weston_buffer from the client. Given that we don't need to keep the client buffer alive, we can short-circuit drm_output_try_view_on_plane, and instead just call drm_output_prepare_cursor_view directly when we have a cursor plane. This also makes it easier to just remove drm_output_try_view_on_plane in following patches when we merge the overlay/scanout plane path into one. Doing so gives us two clearly-separated paths: one for copying a SHM client buffer into a cursor, and another for directly scanning out client content. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
873e32137e
commit
81e74ff334
@ -348,9 +348,6 @@ drm_output_try_view_on_plane(struct drm_plane *plane,
|
||||
zpos != DRM_PLANE_ZPOS_INVALID_PLANE);
|
||||
|
||||
switch (plane->type) {
|
||||
case WDRM_PLANE_TYPE_CURSOR:
|
||||
ps = drm_output_prepare_cursor_view(state, ev, zpos);
|
||||
break;
|
||||
case WDRM_PLANE_TYPE_OVERLAY:
|
||||
ps = drm_output_prepare_overlay_view(plane, state, ev, mode,
|
||||
fb, zpos);
|
||||
@ -680,8 +677,12 @@ drm_output_prepare_plane_view(struct drm_output_state *state,
|
||||
"from candidate list, type: %s\n",
|
||||
plane->plane_id, p_name);
|
||||
|
||||
ps = drm_output_try_view_on_plane(plane, state, ev,
|
||||
mode, fb, zpos);
|
||||
if (plane->type == WDRM_PLANE_TYPE_CURSOR) {
|
||||
ps = drm_output_prepare_cursor_view(state, ev, zpos);
|
||||
} else {
|
||||
ps = drm_output_try_view_on_plane(plane, state, ev,
|
||||
mode, fb, zpos);
|
||||
}
|
||||
if (ps) {
|
||||
drm_debug(b, "\t\t\t\t[view] view %p has been placed to "
|
||||
"%s plane with computed zpos %"PRIu64"\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user