drm: Introduce drm_plane_reset_state() helper function

Introduce a helper function to reset the current state of a drm_plane.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
dev
Alexandros Frantzis 5 years ago committed by Daniel Stone
parent 85382d394a
commit 9975134593
  1. 5
      libweston/backend-drm/drm-gbm.c
  2. 2
      libweston/backend-drm/drm-internal.h
  3. 5
      libweston/backend-drm/drm.c
  4. 15
      libweston/backend-drm/state-helpers.c

@ -260,10 +260,7 @@ drm_output_fini_egl(struct drm_output *output)
if (!b->shutting_down &&
output->scanout_plane->state_cur->fb &&
output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) {
drm_plane_state_free(output->scanout_plane->state_cur, true);
output->scanout_plane->state_cur =
drm_plane_state_alloc(NULL, output->scanout_plane);
output->scanout_plane->state_cur->complete = true;
drm_plane_reset_state(output->scanout_plane);
}
gl_renderer->output_destroy(&output->base);

@ -748,6 +748,8 @@ drm_plane_state_put_back(struct drm_plane_state *state);
bool
drm_plane_state_coords_for_view(struct drm_plane_state *state,
struct weston_view *ev, uint64_t zpos);
void
drm_plane_reset_state(struct drm_plane *plane);
void
drm_assign_planes(struct weston_output *output_base, void *repaint_data);

@ -1272,10 +1272,7 @@ drm_output_fini_pixman(struct drm_output *output)
if (!b->shutting_down &&
output->scanout_plane->state_cur->fb &&
output->scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) {
drm_plane_state_free(output->scanout_plane->state_cur, true);
output->scanout_plane->state_cur =
drm_plane_state_alloc(NULL, output->scanout_plane);
output->scanout_plane->state_cur->complete = true;
drm_plane_reset_state(output->scanout_plane);
}
pixman_renderer_output_destroy(&output->base);

@ -261,6 +261,21 @@ drm_plane_state_coords_for_view(struct drm_plane_state *state,
return true;
}
/**
* Reset the current state of a DRM plane
*
* The current state will be freed and replaced by a pristine state.
*
* @param plane The plane to reset the current state of
*/
void
drm_plane_reset_state(struct drm_plane *plane)
{
drm_plane_state_free(plane->state_cur, true);
plane->state_cur = drm_plane_state_alloc(NULL, plane);
plane->state_cur->complete = true;
}
/**
* Return a plane state from a drm_output_state.
*/

Loading…
Cancel
Save