From 05cecc8ef313dddc7c71f2b0162b0b5aea44e374 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Thu, 13 Aug 2020 17:34:58 -0300 Subject: [PATCH] drm-backend: cosmetic changes to make the code easier to read There are some places where we can make some cosmetic changes to make code simpler and easier to read. Make these cosmetic changes. Note that they do not change the code behavior. Signed-off-by: Leandro Ribeiro --- libweston/backend-drm/drm.c | 8 +++----- libweston/backend-drm/state-propose.c | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index b4dd5f44..1517e1da 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -345,8 +345,7 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage) /* If we already have a client buffer promoted to scanout, then we don't * want to render. */ - scanout_state = drm_output_state_get_plane(state, - output->scanout_plane); + scanout_state = drm_output_state_get_plane(state, scanout_plane); if (scanout_state->fb) return; @@ -518,7 +517,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) if (output->disable_pending || output->destroy_pending) return 0; - if (!output->scanout_plane->state_cur->fb) { + if (!scanout_plane->state_cur->fb) { /* We can't page flip if there's no mode set */ goto finish_frame; } @@ -897,8 +896,7 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output, /* On some platforms, primary/cursor planes can roam * between different CRTCs, so make sure we don't claim the * same plane for two outputs. */ - wl_list_for_each(tmp, &b->compositor->output_list, - base.link) { + wl_list_for_each(tmp, &b->compositor->output_list, base.link) { if (tmp->cursor_plane == plane || tmp->scanout_plane == plane) { found_elsewhere = true; diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index 3c826687..7795481e 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -323,8 +323,7 @@ drm_output_prepare_cursor_view(struct drm_output_state *output_state, if (b->gbm == NULL) return NULL; - plane_state = - drm_output_state_get_plane(output_state, output->cursor_plane); + plane_state = drm_output_state_get_plane(output_state, plane); if (plane_state && plane_state->fb) return NULL;