backend-drm: Assign plane_idx by plane list order

Signed-off-by: Daniel Stone <daniels@collabora.com>
dev
Daniel Stone 3 years ago
parent 6609840479
commit af42fc1e33
  1. 1
      libweston/backend-drm/drm-internal.h
  2. 5
      libweston/backend-drm/drm.c

@ -276,7 +276,6 @@ struct drm_backend {
int min_height, max_height;
struct wl_list plane_list;
uint32_t next_plane_idx;
void *repaint_data;

@ -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;
@ -919,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",
@ -942,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);
}

Loading…
Cancel
Save