backend-drm: Move plane-type-specific checks to switch statement
This makes it a bit more clear and easy to follow, rather than diving through if nesting. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -682,15 +682,24 @@ drm_output_prepare_plane_view(struct drm_output_state *state,
|
|||||||
|
|
||||||
possible_plane_mask &= ~(1 << plane->plane_idx);
|
possible_plane_mask &= ~(1 << plane->plane_idx);
|
||||||
|
|
||||||
if (plane->type == WDRM_PLANE_TYPE_CURSOR &&
|
switch (plane->type) {
|
||||||
(plane != output->cursor_plane || !shmbuf)) {
|
case WDRM_PLANE_TYPE_CURSOR:
|
||||||
continue;
|
assert(shmbuf);
|
||||||
}
|
assert(plane == output->cursor_plane);
|
||||||
|
break;
|
||||||
if (plane->type == WDRM_PLANE_TYPE_PRIMARY &&
|
case WDRM_PLANE_TYPE_PRIMARY:
|
||||||
(plane != output->scanout_plane ||
|
assert(fb);
|
||||||
mode != DRM_OUTPUT_PROPOSE_STATE_PLANES_ONLY)) {
|
if (plane != output->scanout_plane)
|
||||||
continue;
|
continue;
|
||||||
|
if (mode != DRM_OUTPUT_PROPOSE_STATE_PLANES_ONLY)
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
|
case WDRM_PLANE_TYPE_OVERLAY:
|
||||||
|
assert(fb);
|
||||||
|
assert(mode != DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(false && "unknown plane type");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!drm_plane_is_available(plane, output))
|
if (!drm_plane_is_available(plane, output))
|
||||||
|
|||||||
Reference in New Issue
Block a user