backend-drm: always get pending_state from backend

The pending_state is already stored in the backend and can be directly retrieved
from there.

This avoids involving the compositor in passing state between the repaint
phases for a single backend.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
dev
Michael Tretter 3 years ago
parent c3415aed23
commit c448b938f7
  1. 7
      libweston/backend-drm/drm-virtual.c
  2. 20
      libweston/backend-drm/drm.c
  3. 2
      libweston/backend-drm/state-propose.c

@ -188,14 +188,18 @@ drm_virtual_output_repaint(struct weston_output *output_base,
pixman_region32_t *damage,
void *repaint_data)
{
struct drm_pending_state *pending_state = repaint_data;
struct drm_output_state *state = NULL;
struct drm_output *output = to_drm_output(output_base);
struct drm_plane *scanout_plane = output->scanout_plane;
struct drm_plane_state *scanout_state;
struct drm_pending_state *pending_state;
struct drm_backend *backend;
assert(output->virtual);
backend = output->backend;
pending_state = backend->repaint_data;
if (output->disable_pending || output->destroy_pending)
goto err;
@ -336,6 +340,7 @@ drm_virtual_output_create(struct weston_compositor *c, char *name)
}
output->virtual = true;
output->backend = b;
output->gbm_bo_flags = GBM_BO_USE_LINEAR | GBM_BO_USE_RENDERING;
weston_output_init(&output->base, c, name);

@ -445,13 +445,17 @@ drm_output_repaint(struct weston_output *output_base,
pixman_region32_t *damage,
void *repaint_data)
{
struct drm_pending_state *pending_state = repaint_data;
struct drm_output *output = to_drm_output(output_base);
struct drm_output_state *state = NULL;
struct drm_plane_state *scanout_state;
struct drm_pending_state *pending_state;
struct drm_backend *backend;
assert(!output->virtual);
backend = output->backend;
pending_state = backend->repaint_data;
if (output->disable_pending || output->destroy_pending)
goto err;
@ -610,20 +614,20 @@ static void *
drm_repaint_begin(struct weston_compositor *compositor)
{
struct drm_backend *b = to_drm_backend(compositor);
struct drm_pending_state *ret;
struct drm_pending_state *pending_state;
ret = drm_pending_state_alloc(b);
b->repaint_data = ret;
pending_state = drm_pending_state_alloc(b);
b->repaint_data = pending_state;
if (weston_log_scope_is_enabled(b->debug)) {
char *dbg = weston_compositor_print_scene_graph(compositor);
drm_debug(b, "[repaint] Beginning repaint; pending_state %p\n",
ret);
b->repaint_data);
drm_debug(b, "%s", dbg);
free(dbg);
}
return ret;
return NULL;
}
/**
@ -639,7 +643,7 @@ static int
drm_repaint_flush(struct weston_compositor *compositor, void *repaint_data)
{
struct drm_backend *b = to_drm_backend(compositor);
struct drm_pending_state *pending_state = repaint_data;
struct drm_pending_state *pending_state = b->repaint_data;
int ret;
ret = drm_pending_state_apply(pending_state);
@ -662,7 +666,7 @@ static void
drm_repaint_cancel(struct weston_compositor *compositor, void *repaint_data)
{
struct drm_backend *b = to_drm_backend(compositor);
struct drm_pending_state *pending_state = repaint_data;
struct drm_pending_state *pending_state = b->repaint_data;
drm_pending_state_free(pending_state);
drm_debug(b, "[repaint] cancel pending_state %p\n", pending_state);

@ -892,7 +892,7 @@ void
drm_assign_planes(struct weston_output *output_base, void *repaint_data)
{
struct drm_backend *b = to_drm_backend(output_base->compositor);
struct drm_pending_state *pending_state = repaint_data;
struct drm_pending_state *pending_state = b->repaint_data;
struct drm_output *output = to_drm_output(output_base);
struct drm_output_state *state = NULL;
struct drm_plane_state *plane_state;

Loading…
Cancel
Save