aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-02-03 00:15:44 +0100
committeremersion <contact@emersion.fr>2018-02-03 00:15:44 +0100
commit3d3ea321372d656fa82db48c4729e8109d6f19e2 (patch)
tree23d2a425eecb3a8b4f5760d8470cdf8288dafdf2 /backend
parentbb4aeb3b2f8d739b042ab8c2f2b9b6d1caf6e26b (diff)
parent86a404f2cd7e046e9ce9d23b4ae52c91adb47570 (diff)
Merge remote-tracking branch 'upstream/master' into output-damage
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/backend.c2
-rw-r--r--backend/drm/drm.c8
-rw-r--r--backend/drm/renderer.c15
3 files changed, 21 insertions, 4 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 2b54336f..3782817c 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -123,7 +123,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
char *name = drmGetDeviceNameFromFd2(gpu_fd);
drmVersion *version = drmGetVersion(gpu_fd);
- wlr_log(L_INFO, "Initalizing DRM backend for %s (%s)", name, version->name);
+ wlr_log(L_INFO, "Initializing DRM backend for %s (%s)", name, version->name);
free(name);
drmFreeVersion(version);
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 8d102d8a..7f51fe67 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -218,6 +218,7 @@ static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) {
}
conn->pageflip_pending = true;
+ wlr_output_update_enabled(output, true);
return true;
}
@@ -253,6 +254,7 @@ void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {
struct wlr_drm_mode *mode = (struct wlr_drm_mode *)conn->output.current_mode;
if (drm->iface->crtc_pageflip(drm, conn, crtc, fb_id, &mode->drm_mode)) {
conn->pageflip_pending = true;
+ wlr_output_update_enabled(&conn->output, true);
} else {
wl_event_source_timer_update(conn->retry_pageflip,
1000000.0f / conn->output.current_mode->refresh);
@@ -477,7 +479,7 @@ static bool wlr_drm_connector_set_mode(struct wlr_output *output,
wlr_output_update_mode(&conn->output, mode);
// Since realloc_crtcs can deallocate planes on OTHER outputs,
- // we actually need to reinitalise any than has changed
+ // we actually need to reinitialize any than has changed
ssize_t output_index = -1;
wl_list_for_each(conn, &drm->outputs, link) {
output_index += 1;
@@ -491,7 +493,7 @@ static bool wlr_drm_connector_set_mode(struct wlr_output *output,
if (!wlr_drm_plane_surfaces_init(crtc->primary, drm,
mode->width, mode->height, GBM_FORMAT_XRGB8888)) {
- wlr_log(L_ERROR, "Failed to initalise renderer for plane");
+ wlr_log(L_ERROR, "Failed to initialize renderer for plane");
goto error_conn;
}
@@ -975,7 +977,7 @@ void wlr_drm_connector_cleanup(struct wlr_drm_connector *conn) {
conn->possible_crtc = 0;
/* Fallthrough */
case WLR_DRM_CONN_NEEDS_MODESET:
- wlr_log(L_INFO, "Emmiting destruction signal for '%s'",
+ wlr_log(L_INFO, "Emitting destruction signal for '%s'",
conn->output.name);
wl_signal_emit(&drm->backend.events.output_remove, &conn->output);
break;
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index e2891057..0310a96a 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -66,6 +66,21 @@ bool wlr_drm_surface_init(struct wlr_drm_surface *surf,
surf->width = width;
surf->height = height;
+ if (surf->gbm) {
+ if (surf->front) {
+ gbm_surface_release_buffer(surf->gbm, surf->front);
+ surf->front = NULL;
+ }
+ if (surf->back) {
+ gbm_surface_release_buffer(surf->gbm, surf->back);
+ surf->back = NULL;
+ }
+ gbm_surface_destroy(surf->gbm);
+ }
+ if (surf->egl) {
+ eglDestroySurface(surf->renderer->egl.display, surf->egl);
+ }
+
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
format, GBM_BO_USE_RENDERING | flags);
if (!surf->gbm) {