mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 18:58:06 +02:00
libweston: Add error return code to repaint_output
Supports returning an error code during the repaint process of renderer Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
This commit is contained in:
parent
64713ca283
commit
fcde9fc220
5 changed files with 23 additions and 9 deletions
|
|
@ -82,10 +82,15 @@ enum weston_renderer_border_side {
|
|||
WESTON_RENDERER_BORDER_BOTTOM = 3,
|
||||
};
|
||||
|
||||
enum weston_renderer_error {
|
||||
WESTON_RENDERER_ERROR_NONE = 0,
|
||||
WESTON_RENDERER_ERROR_LOST = 1,
|
||||
};
|
||||
|
||||
struct weston_renderer {
|
||||
void (*repaint_output)(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer);
|
||||
enum weston_renderer_error (*repaint_output)(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer);
|
||||
|
||||
/** See weston_renderer_resize_output()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -36,11 +36,12 @@ struct noop_renderer {
|
|||
unsigned char seed; /* see comment in attach() */
|
||||
};
|
||||
|
||||
static void
|
||||
static enum weston_renderer_error
|
||||
noop_renderer_repaint_output(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer)
|
||||
{
|
||||
return WESTON_RENDERER_ERROR_NONE;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ static void
|
|||
pixman_renderer_output_set_buffer(struct weston_output *output,
|
||||
pixman_image_t *buffer);
|
||||
|
||||
static void
|
||||
static enum weston_renderer_error
|
||||
pixman_renderer_repaint_output(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer)
|
||||
|
|
@ -622,7 +622,7 @@ pixman_renderer_repaint_output(struct weston_output *output,
|
|||
output->color_outcome->from_blend_to_output == NULL);
|
||||
|
||||
if (!po->hw_buffer)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
if (po->shadow_image) {
|
||||
repaint_surfaces(output, output_damage);
|
||||
|
|
@ -641,6 +641,9 @@ pixman_renderer_repaint_output(struct weston_output *output,
|
|||
wl_signal_emit(&output->frame_signal, output_damage);
|
||||
|
||||
/* Actual flip should be done by caller */
|
||||
|
||||
out:
|
||||
return WESTON_RENDERER_ERROR_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -3088,7 +3088,7 @@ blit_shadow_to_output(struct weston_output *output,
|
|||
* Depending on the underlying hardware, violating that assumption could
|
||||
* result in seeing through to another display plane.
|
||||
*/
|
||||
static void
|
||||
static enum weston_renderer_error
|
||||
gl_renderer_repaint_output(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer)
|
||||
|
|
@ -3114,7 +3114,7 @@ gl_renderer_repaint_output(struct weston_output *output,
|
|||
go->fb_size.height - go->area.height - go->area.y : go->area.y;
|
||||
|
||||
if (use_output(output) < 0)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
rb = gl_renderer_update_renderbuffers(output, output_damage,
|
||||
renderbuffer);
|
||||
|
|
@ -3315,6 +3315,9 @@ gl_renderer_repaint_output(struct weston_output *output,
|
|||
gr->wireframe_dirty = false;
|
||||
|
||||
gl_renderer_garbage_collect_programs(gr);
|
||||
|
||||
out:
|
||||
return WESTON_RENDERER_ERROR_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -2400,7 +2400,7 @@ vulkan_renderer_recreate_swapchain(struct weston_output *output,
|
|||
vulkan_renderer_create_swapchain(output, fb_size);
|
||||
}
|
||||
|
||||
static void
|
||||
static enum weston_renderer_error
|
||||
vulkan_renderer_repaint_output(struct weston_output *output,
|
||||
pixman_region32_t *output_damage,
|
||||
weston_renderbuffer_t renderbuffer)
|
||||
|
|
@ -2670,6 +2670,8 @@ vulkan_renderer_repaint_output(struct weston_output *output,
|
|||
pixman_region32_clear(&rb->damage);
|
||||
|
||||
vo->frame_index = (vo->frame_index + 1) % vo->num_frames;
|
||||
|
||||
return WESTON_RENDERER_ERROR_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue