backend-drm: Remove unused enum

At some point this got hobbled, such that NO_PLANES and
NO_PLANES_ACCEPTED became the same thing, so we can just check if the
returned plane_state is NULL or not.

Signed-off-by: Daniel Stone <daniels@collabora.com>
dev
Daniel Stone 3 years ago
parent 2dd3af3c22
commit e1114228f5
  1. 29
      libweston/backend-drm/state-propose.c

@ -346,11 +346,6 @@ drm_output_try_view_on_plane(struct drm_plane *plane,
struct drm_plane_state *ps = NULL; struct drm_plane_state *ps = NULL;
const char *p_name = drm_output_get_plane_type_name(plane); const char *p_name = drm_output_get_plane_type_name(plane);
struct weston_surface *surface = ev->surface; struct weston_surface *surface = ev->surface;
enum {
NO_PLANES, /* generic err-handle */
NO_PLANES_ACCEPTED,
PLACED_ON_PLANE,
} availability = NO_PLANES;
/* sanity checks in case we over/underflow zpos or pass incorrect /* sanity checks in case we over/underflow zpos or pass incorrect
* values */ * values */
@ -360,38 +355,21 @@ drm_output_try_view_on_plane(struct drm_plane *plane,
switch (plane->type) { switch (plane->type) {
case WDRM_PLANE_TYPE_CURSOR: case WDRM_PLANE_TYPE_CURSOR:
ps = drm_output_prepare_cursor_view(state, ev, zpos); ps = drm_output_prepare_cursor_view(state, ev, zpos);
if (ps)
availability = PLACED_ON_PLANE;
break; break;
case WDRM_PLANE_TYPE_OVERLAY: case WDRM_PLANE_TYPE_OVERLAY:
ps = drm_output_prepare_overlay_view(plane, state, ev, mode, ps = drm_output_prepare_overlay_view(plane, state, ev, mode,
fb, zpos); fb, zpos);
if (ps)
availability = PLACED_ON_PLANE;
break; break;
case WDRM_PLANE_TYPE_PRIMARY: case WDRM_PLANE_TYPE_PRIMARY:
ps = drm_output_prepare_scanout_view(state, ev, mode, ps = drm_output_prepare_scanout_view(state, ev, mode,
fb, zpos); fb, zpos);
if (ps)
availability = PLACED_ON_PLANE;
break; break;
default: default:
assert(0); assert(0);
break; break;
} }
switch (availability) { if (ps) {
case NO_PLANES:
/* set initial to this catch-all case, such that
* prepare_cursor/overlay/scanout() should have/contain the
* reason for failling */
break;
case NO_PLANES_ACCEPTED:
drm_debug(b, "\t\t\t\t[plane] plane %d refusing to "
"place view %p in %s\n",
plane->plane_id, ev, p_name);
break;
case PLACED_ON_PLANE:
/* Take a reference on the buffer so that we don't release it /* Take a reference on the buffer so that we don't release it
* back to the client until we're done with it; cursor buffers * back to the client until we're done with it; cursor buffers
* don't require a reference since we copy them. */ * don't require a reference since we copy them. */
@ -406,7 +384,10 @@ drm_output_try_view_on_plane(struct drm_plane *plane,
weston_buffer_release_reference(&ps->fb_ref.release, weston_buffer_release_reference(&ps->fb_ref.release,
surface->buffer_release_ref.buffer_release); surface->buffer_release_ref.buffer_release);
} }
break; } else {
drm_debug(b, "\t\t\t\t[plane] plane %d refusing to "
"place view %p in %s\n",
plane->plane_id, ev, p_name);
} }

Loading…
Cancel
Save