backend/drm: move drm_plane_finish_surface() to drm.c

This function touches queued_fb/current_fb, which the renderer has
nothing to do with.
master
Simon Ser 1 year ago committed by Simon Zeni
parent 260dbdf704
commit f935ff0ef6

@ -305,6 +305,17 @@ error_res:
return false; return false;
} }
static void drm_plane_finish_surface(struct wlr_drm_plane *plane) {
if (!plane) {
return;
}
drm_fb_clear(&plane->queued_fb);
drm_fb_clear(&plane->current_fb);
finish_drm_surface(&plane->mgpu_surf);
}
void finish_drm_resources(struct wlr_drm_backend *drm) { void finish_drm_resources(struct wlr_drm_backend *drm) {
if (!drm) { if (!drm) {
return; return;

@ -41,7 +41,7 @@ void finish_drm_renderer(struct wlr_drm_renderer *renderer) {
wlr_renderer_destroy(renderer->wlr_rend); wlr_renderer_destroy(renderer->wlr_rend);
} }
static void finish_drm_surface(struct wlr_drm_surface *surf) { void finish_drm_surface(struct wlr_drm_surface *surf) {
if (!surf || !surf->renderer) { if (!surf || !surf->renderer) {
return; return;
} }
@ -121,18 +121,6 @@ error_tex:
return NULL; return NULL;
} }
void drm_plane_finish_surface(struct wlr_drm_plane *plane) {
if (!plane) {
return;
}
drm_fb_clear(&plane->queued_fb);
drm_fb_clear(&plane->current_fb);
finish_drm_surface(&plane->mgpu_surf);
}
bool drm_plane_pick_render_format(struct wlr_drm_plane *plane, bool drm_plane_pick_render_format(struct wlr_drm_plane *plane,
struct wlr_drm_format *fmt, struct wlr_drm_renderer *renderer) { struct wlr_drm_format *fmt, struct wlr_drm_renderer *renderer) {
const struct wlr_drm_format_set *render_formats = const struct wlr_drm_format_set *render_formats =

@ -31,12 +31,12 @@ void finish_drm_renderer(struct wlr_drm_renderer *renderer);
bool init_drm_surface(struct wlr_drm_surface *surf, bool init_drm_surface(struct wlr_drm_surface *surf,
struct wlr_drm_renderer *renderer, int width, int height, struct wlr_drm_renderer *renderer, int width, int height,
const struct wlr_drm_format *drm_format); const struct wlr_drm_format *drm_format);
void finish_drm_surface(struct wlr_drm_surface *surf);
struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf, struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
struct wlr_buffer *buffer); struct wlr_buffer *buffer);
bool drm_plane_pick_render_format(struct wlr_drm_plane *plane, bool drm_plane_pick_render_format(struct wlr_drm_plane *plane,
struct wlr_drm_format *fmt, struct wlr_drm_renderer *renderer); struct wlr_drm_format *fmt, struct wlr_drm_renderer *renderer);
void drm_plane_finish_surface(struct wlr_drm_plane *plane);
#endif #endif

Loading…
Cancel
Save