Skip to content
Commits on Source (26)
......@@ -236,6 +236,8 @@ enum try_view_on_plane_failure_reasons {
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE = (1 << 1),
FAILURE_REASONS_DMABUF_MODIFIER_INVALID = (1 << 2),
FAILURE_REASONS_ADD_FB_FAILED = (1 << 3),
FAILURE_REASONS_NO_PLANES_AVAILABLE = (1 << 4),
FAILURE_REASONS_PLANES_REJECTED = (1 << 5),
};
/**
......@@ -276,7 +278,6 @@ struct drm_backend {
int min_height, max_height;
struct wl_list plane_list;
uint32_t next_plane_idx;
void *repaint_data;
......@@ -395,16 +396,6 @@ struct drm_output_state {
struct wl_list plane_list;
};
/**
* An instance of this class is created each time we believe we have a plane
* suitable to be used by a view as a direct scan-out. The list is initialized
* and populated locally.
*/
struct drm_plane_zpos {
struct drm_plane *plane;
struct wl_list link; /**< :candidate_plane_zpos_list */
};
/**
* Plane state holds the dynamic state for a plane: where it is positioned,
* and which buffer it is currently displaying.
......
......@@ -760,7 +760,7 @@ init_pixman(struct drm_backend *b)
static struct drm_plane *
drm_plane_create(struct drm_backend *b, const drmModePlane *kplane)
{
struct drm_plane *plane;
struct drm_plane *plane, *tmp;
drmModeObjectProperties *props;
uint64_t *zpos_range_values;
......@@ -771,7 +771,6 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane)
}
plane->backend = b;
plane->plane_idx = b->next_plane_idx++;
plane->state_cur = drm_plane_state_alloc(NULL, plane);
plane->state_cur->complete = true;
plane->possible_crtcs = kplane->possible_crtcs;
......@@ -817,7 +816,15 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane)
goto err_props;
weston_plane_init(&plane->base, b->compositor, 0, 0);
wl_list_insert(&b->plane_list, &plane->link);
wl_list_for_each(tmp, &b->plane_list, link) {
if (tmp->zpos_max > plane->zpos_max) {
wl_list_insert(tmp->link.prev, &plane->link);
break;
}
}
if (plane->link.next == NULL)
wl_list_insert(b->plane_list.prev, &plane->link);
return plane;
......@@ -911,6 +918,7 @@ create_sprites(struct drm_backend *b)
drmModePlane *kplane;
struct drm_plane *drm_plane;
uint32_t i;
uint32_t next_plane_idx = 0;
kplane_res = drmModeGetPlaneResources(b->drm.fd);
if (!kplane_res) {
weston_log("failed to get plane resources: %s\n",
......@@ -934,6 +942,9 @@ create_sprites(struct drm_backend *b)
&b->compositor->primary_plane);
}
wl_list_for_each (drm_plane, &b->plane_list, link)
drm_plane->plane_idx = next_plane_idx++;
drmModeFreePlaneResources(kplane_res);
}
......
......@@ -581,6 +581,9 @@ drm_fb_get_from_view(struct drm_output_state *state, struct weston_view *ev,
/* Check if this buffer can ever go on any planes. If it can't, we have
* no reason to ever have a drm_fb, so we fail it here. */
wl_list_for_each(plane, &b->plane_list, link) {
/* only SHM buffers can go into cursor planes */
if (plane->type == WDRM_PLANE_TYPE_CURSOR)
continue;
if (drm_fb_compatible_with_plane(fb, plane))
fb->plane_mask |= (1 << plane->plane_idx);
}
......
This diff is collapsed.