aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-08 09:44:42 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-07-12 13:29:03 -0400
commitaec062d0d32a3df9547dad48a2dfdfc60360b40d (patch)
treeb07703b5b59267221ad3efb416bdf997539c463a /backend/headless
parent87e8c60fafb50750e03fad118fcc7c80f70b72e2 (diff)
backend/headless: remove wlr_output_impl.export_dmabuf
This is now provided by the generic wlr_output implementation.
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/output.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 9ec6ce50..8c7e57f1 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -18,11 +18,8 @@ static struct wlr_headless_output *headless_output_from_output(
return (struct wlr_headless_output *)wlr_output;
}
-static bool output_set_custom_mode(struct wlr_output *wlr_output, int32_t width,
- int32_t height, int32_t refresh) {
- struct wlr_headless_output *output =
- headless_output_from_output(wlr_output);
-
+static bool output_set_custom_mode(struct wlr_headless_output *output,
+ int32_t width, int32_t height, int32_t refresh) {
if (refresh <= 0) {
refresh = HEADLESS_DEFAULT_REFRESH;
}
@@ -58,7 +55,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
}
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_MODE) {
- if (!output_set_custom_mode(wlr_output,
+ if (!output_set_custom_mode(output,
wlr_output->pending.custom_mode.width,
wlr_output->pending.custom_mode.height,
wlr_output->pending.custom_mode.refresh)) {
@@ -67,48 +64,23 @@ static bool output_commit(struct wlr_output *wlr_output) {
}
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
- assert(wlr_output->pending.buffer_type ==
- WLR_OUTPUT_STATE_BUFFER_SCANOUT);
-
- wlr_buffer_unlock(output->front_buffer);
- output->front_buffer = wlr_buffer_lock(wlr_output->pending.buffer);
-
wlr_output_send_present(wlr_output, NULL);
}
return true;
}
-static bool output_export_dmabuf(struct wlr_output *wlr_output,
- struct wlr_dmabuf_attributes *attribs) {
- struct wlr_headless_output *output =
- headless_output_from_output(wlr_output);
-
- if (!output->front_buffer) {
- return false;
- }
-
- struct wlr_dmabuf_attributes tmp;
- if (!wlr_buffer_get_dmabuf(output->front_buffer, &tmp)) {
- return false;
- }
-
- return wlr_dmabuf_attributes_copy(attribs, &tmp);
-}
-
static void output_destroy(struct wlr_output *wlr_output) {
struct wlr_headless_output *output =
headless_output_from_output(wlr_output);
wl_list_remove(&output->link);
wl_event_source_remove(output->frame_timer);
- wlr_buffer_unlock(output->front_buffer);
free(output);
}
static const struct wlr_output_impl output_impl = {
.destroy = output_destroy,
.commit = output_commit,
- .export_dmabuf = output_export_dmabuf,
};
bool wlr_output_is_headless(struct wlr_output *wlr_output) {
@@ -138,7 +110,7 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
backend->display);
struct wlr_output *wlr_output = &output->wlr_output;
- output_set_custom_mode(wlr_output, width, height, 0);
+ output_set_custom_mode(output, width, height, 0);
strncpy(wlr_output->make, "headless", sizeof(wlr_output->make));
strncpy(wlr_output->model, "headless", sizeof(wlr_output->model));
snprintf(wlr_output->name, sizeof(wlr_output->name), "HEADLESS-%zd",