aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/atomic.c16
-rw-r--r--backend/drm/backend.c14
-rw-r--r--backend/drm/drm.c102
-rw-r--r--backend/drm/legacy.c6
-rw-r--r--backend/drm/properties.c4
-rw-r--r--backend/drm/renderer.c8
-rw-r--r--backend/drm/util.c2
7 files changed, 76 insertions, 76 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index 41b6424c..61d2f6e1 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -17,7 +17,7 @@ static void atomic_begin(struct wlr_drm_crtc *crtc, struct atomic *atom) {
if (!crtc->atomic) {
crtc->atomic = drmModeAtomicAlloc();
if (!crtc->atomic) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
atom->failed = true;
return;
}
@@ -35,7 +35,7 @@ static bool atomic_end(int drm_fd, struct atomic *atom) {
uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_NONBLOCK;
if (drmModeAtomicCommit(drm_fd, atom->req, flags, NULL)) {
- wlr_log_errno(L_ERROR, "Atomic test failed");
+ wlr_log_errno(WLR_ERROR, "Atomic test failed");
drmModeAtomicSetCursor(atom->req, atom->cursor);
return false;
}
@@ -51,13 +51,13 @@ static bool atomic_commit(int drm_fd, struct atomic *atom,
int ret = drmModeAtomicCommit(drm_fd, atom->req, flags, conn);
if (ret) {
- wlr_log_errno(L_ERROR, "%s: Atomic commit failed (%s)",
+ wlr_log_errno(WLR_ERROR, "%s: Atomic commit failed (%s)",
conn->output.name, modeset ? "modeset" : "pageflip");
// Try to commit without new changes
drmModeAtomicSetCursor(atom->req, atom->cursor);
if (drmModeAtomicCommit(drm_fd, atom->req, flags, conn)) {
- wlr_log_errno(L_ERROR,
+ wlr_log_errno(WLR_ERROR,
"%s: Atomic commit without new changes failed (%s)",
conn->output.name, modeset ? "modeset" : "pageflip");
}
@@ -70,7 +70,7 @@ static bool atomic_commit(int drm_fd, struct atomic *atom,
static inline void atomic_add(struct atomic *atom, uint32_t id, uint32_t prop, uint64_t val) {
if (!atom->failed && drmModeAtomicAddProperty(atom->req, id, prop, val) < 0) {
- wlr_log_errno(L_ERROR, "Failed to add atomic DRM property");
+ wlr_log_errno(WLR_ERROR, "Failed to add atomic DRM property");
atom->failed = true;
}
}
@@ -105,7 +105,7 @@ static bool atomic_crtc_pageflip(struct wlr_drm_backend *drm,
}
if (drmModeCreatePropertyBlob(drm->fd, mode, sizeof(*mode), &crtc->mode_id)) {
- wlr_log_errno(L_ERROR, "Unable to create property blob");
+ wlr_log_errno(WLR_ERROR, "Unable to create property blob");
return false;
}
}
@@ -219,7 +219,7 @@ static bool atomic_crtc_set_gamma(struct wlr_drm_backend *drm,
if (drmModeCreatePropertyBlob(drm->fd, gamma,
sizeof(struct drm_color_lut) * size, &crtc->gamma_lut)) {
- wlr_log_errno(L_ERROR, "Unable to create property blob");
+ wlr_log_errno(WLR_ERROR, "Unable to create property blob");
return false;
}
@@ -239,7 +239,7 @@ static uint32_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm,
if (!get_drm_prop(drm->fd, crtc->id, crtc->props.gamma_lut_size,
&gamma_lut_size)) {
- wlr_log(L_ERROR, "Unable to get gamma lut size");
+ wlr_log(WLR_ERROR, "Unable to get gamma lut size");
return 0;
}
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 7bb4dc32..5833d46e 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -70,7 +70,7 @@ static void session_signal(struct wl_listener *listener, void *data) {
struct wlr_session *session = data;
if (session->active) {
- wlr_log(L_INFO, "DRM fd resumed");
+ wlr_log(WLR_INFO, "DRM fd resumed");
scan_drm_connectors(drm);
struct wlr_drm_connector *conn;
@@ -92,7 +92,7 @@ static void session_signal(struct wl_listener *listener, void *data) {
conn->cursor_y);
}
} else {
- wlr_log(L_INFO, "DRM fd paused");
+ wlr_log(WLR_INFO, "DRM fd paused");
}
}
@@ -101,7 +101,7 @@ static void drm_invalidated(struct wl_listener *listener, void *data) {
wl_container_of(listener, drm, drm_invalidated);
char *name = drmGetDeviceNameFromFd2(drm->fd);
- wlr_log(L_DEBUG, "%s invalidated", name);
+ wlr_log(WLR_DEBUG, "%s invalidated", name);
free(name);
scan_drm_connectors(drm);
@@ -121,13 +121,13 @@ 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, "Initializing DRM backend for %s (%s)", name, version->name);
+ wlr_log(WLR_INFO, "Initializing DRM backend for %s (%s)", name, version->name);
free(name);
drmFreeVersion(version);
struct wlr_drm_backend *drm = calloc(1, sizeof(struct wlr_drm_backend));
if (!drm) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
return NULL;
}
wlr_backend_init(&drm->backend, &backend_impl);
@@ -147,7 +147,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
drm->drm_event = wl_event_loop_add_fd(event_loop, drm->fd,
WL_EVENT_READABLE, handle_drm_event, NULL);
if (!drm->drm_event) {
- wlr_log(L_ERROR, "Failed to create DRM event source");
+ wlr_log(WLR_ERROR, "Failed to create DRM event source");
goto error_fd;
}
@@ -163,7 +163,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
}
if (!init_drm_renderer(drm, &drm->renderer, create_renderer_func)) {
- wlr_log(L_ERROR, "Failed to initialize renderer");
+ wlr_log(WLR_ERROR, "Failed to initialize renderer");
goto error_event;
}
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 05d3d1bd..c4674235 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -28,19 +28,19 @@
bool check_drm_features(struct wlr_drm_backend *drm) {
if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
- wlr_log(L_ERROR, "DRM universal planes unsupported");
+ wlr_log(WLR_ERROR, "DRM universal planes unsupported");
return false;
}
const char *no_atomic = getenv("WLR_DRM_NO_ATOMIC");
if (no_atomic && strcmp(no_atomic, "1") == 0) {
- wlr_log(L_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface");
+ wlr_log(WLR_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface");
drm->iface = &legacy_iface;
} else if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
- wlr_log(L_DEBUG, "Atomic modesetting unsupported, using legacy DRM interface");
+ wlr_log(WLR_DEBUG, "Atomic modesetting unsupported, using legacy DRM interface");
drm->iface = &legacy_iface;
} else {
- wlr_log(L_DEBUG, "Using atomic DRM interface");
+ wlr_log(WLR_DEBUG, "Using atomic DRM interface");
drm->iface = &atomic_iface;
}
@@ -57,11 +57,11 @@ static int cmp_plane(const void *arg1, const void *arg2) {
static bool init_planes(struct wlr_drm_backend *drm) {
drmModePlaneRes *plane_res = drmModeGetPlaneResources(drm->fd);
if (!plane_res) {
- wlr_log_errno(L_ERROR, "Failed to get DRM plane resources");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM plane resources");
return false;
}
- wlr_log(L_INFO, "Found %"PRIu32" DRM planes", plane_res->count_planes);
+ wlr_log(WLR_INFO, "Found %"PRIu32" DRM planes", plane_res->count_planes);
if (plane_res->count_planes == 0) {
drmModeFreePlaneResources(plane_res);
@@ -71,7 +71,7 @@ static bool init_planes(struct wlr_drm_backend *drm) {
drm->num_planes = plane_res->count_planes;
drm->planes = calloc(drm->num_planes, sizeof(*drm->planes));
if (!drm->planes) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
goto error_res;
}
@@ -80,7 +80,7 @@ static bool init_planes(struct wlr_drm_backend *drm) {
drmModePlane *plane = drmModeGetPlane(drm->fd, plane_res->planes[i]);
if (!plane) {
- wlr_log_errno(L_ERROR, "Failed to get DRM plane");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM plane");
goto error_planes;
}
@@ -100,7 +100,7 @@ static bool init_planes(struct wlr_drm_backend *drm) {
drmModeFreePlane(plane);
}
- wlr_log(L_INFO, "(%zu overlay, %zu primary, %zu cursor)",
+ wlr_log(WLR_INFO, "(%zu overlay, %zu primary, %zu cursor)",
drm->num_overlay_planes,
drm->num_primary_planes,
drm->num_cursor_planes);
@@ -126,16 +126,16 @@ error_res:
bool init_drm_resources(struct wlr_drm_backend *drm) {
drmModeRes *res = drmModeGetResources(drm->fd);
if (!res) {
- wlr_log_errno(L_ERROR, "Failed to get DRM resources");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM resources");
return false;
}
- wlr_log(L_INFO, "Found %d DRM CRTCs", res->count_crtcs);
+ wlr_log(WLR_INFO, "Found %d DRM CRTCs", res->count_crtcs);
drm->num_crtcs = res->count_crtcs;
drm->crtcs = calloc(drm->num_crtcs, sizeof(drm->crtcs[0]));
if (!drm->crtcs) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
goto error_res;
}
@@ -215,7 +215,7 @@ static bool drm_connector_swap_buffers(struct wlr_output *output,
uint32_t fb_id = get_fb_for_bo(bo);
if (conn->pageflip_pending) {
- wlr_log(L_ERROR, "Skipping pageflip on output '%s'", conn->output.name);
+ wlr_log(WLR_ERROR, "Skipping pageflip on output '%s'", conn->output.name);
return false;
}
@@ -278,7 +278,7 @@ static void drm_connector_start_renderer(struct wlr_drm_connector *conn) {
return;
}
- wlr_log(L_DEBUG, "Starting renderer on output '%s'", conn->output.name);
+ wlr_log(WLR_DEBUG, "Starting renderer on output '%s'", conn->output.name);
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend;
struct wlr_drm_crtc *crtc = conn->crtc;
@@ -322,7 +322,7 @@ void enable_drm_connector(struct wlr_output *output, bool enable) {
static void realloc_planes(struct wlr_drm_backend *drm, const uint32_t *crtc_in,
bool *changed_outputs) {
- wlr_log(L_DEBUG, "Reallocating planes");
+ wlr_log(WLR_DEBUG, "Reallocating planes");
// overlay, primary, cursor
for (size_t type = 0; type < 3; ++type) {
@@ -362,7 +362,7 @@ static void realloc_planes(struct wlr_drm_backend *drm, const uint32_t *crtc_in,
struct wlr_drm_plane *new = &drm->type_planes[type][crtc_res[i]];
if (*old != new) {
- wlr_log(L_DEBUG, "Assigning plane %d -> %d to CRTC %d",
+ wlr_log(WLR_DEBUG, "Assigning plane %d -> %d to CRTC %d",
*old ? (int)(*old)->id : -1,
new ? (int)new->id : -1,
c->id);
@@ -391,7 +391,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm,
memset(possible_crtc, 0, sizeof(possible_crtc));
- wlr_log(L_DEBUG, "Reallocating CRTCs for output '%s'", conn->output.name);
+ wlr_log(WLR_DEBUG, "Reallocating CRTCs for output '%s'", conn->output.name);
ssize_t index = -1, i = -1;
struct wlr_drm_connector *c;
@@ -401,7 +401,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm,
index = i;
}
- wlr_log(L_DEBUG, "output '%s' crtc=%p state=%d",
+ wlr_log(WLR_DEBUG, "output '%s' crtc=%p state=%d",
c->output.name, c->crtc, c->state);
if (c->crtc) {
@@ -428,14 +428,14 @@ static void realloc_crtcs(struct wlr_drm_backend *drm,
// There is no point doing anything if this monitor doesn't get activated
if (!matched[index]) {
- wlr_log(L_DEBUG, "Could not match a CRTC for this output");
+ wlr_log(WLR_DEBUG, "Could not match a CRTC for this output");
return;
}
for (size_t i = 0; i < drm->num_crtcs; ++i) {
// We don't want any of the current monitors to be deactivated.
if (crtc[i] != UNMATCHED && !matched[crtc[i]]) {
- wlr_log(L_DEBUG, "Could not match a CRTC for other output %d",
+ wlr_log(WLR_DEBUG, "Could not match a CRTC for other output %d",
crtc[i]);
return;
}
@@ -460,7 +460,7 @@ static void realloc_crtcs(struct wlr_drm_backend *drm,
}
c->crtc = &drm->crtcs[i];
- wlr_log(L_DEBUG, "Assigning CRTC %d to output '%s'",
+ wlr_log(WLR_DEBUG, "Assigning CRTC %d to output '%s'",
drm->crtcs[i].id, c->output.name);
}
}
@@ -471,12 +471,12 @@ static void realloc_crtcs(struct wlr_drm_backend *drm,
static uint32_t get_possible_crtcs(int fd, uint32_t conn_id) {
drmModeConnector *conn = drmModeGetConnector(fd, conn_id);
if (!conn) {
- wlr_log_errno(L_ERROR, "Failed to get DRM connector");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM connector");
return 0;
}
if (conn->connection != DRM_MODE_CONNECTED || conn->count_modes == 0) {
- wlr_log(L_ERROR, "Output is not connected");
+ wlr_log(WLR_ERROR, "Output is not connected");
goto error_conn;
}
@@ -486,7 +486,7 @@ static uint32_t get_possible_crtcs(int fd, uint32_t conn_id) {
}
if (!enc) {
- wlr_log(L_ERROR, "Failed to get DRM encoder");
+ wlr_log(WLR_ERROR, "Failed to get DRM encoder");
goto error_conn;
}
@@ -508,7 +508,7 @@ static bool drm_connector_set_mode(struct wlr_output *output,
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
bool changed_outputs[wl_list_length(&drm->outputs)];
- wlr_log(L_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", conn->output.name,
+ wlr_log(WLR_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", conn->output.name,
mode->width, mode->height, mode->refresh);
conn->possible_crtc = get_possible_crtcs(drm->fd, conn->id);
@@ -521,10 +521,10 @@ static bool drm_connector_set_mode(struct wlr_output *output,
struct wlr_drm_crtc *crtc = conn->crtc;
if (!crtc) {
- wlr_log(L_ERROR, "Unable to match %s with a CRTC", conn->output.name);
+ wlr_log(WLR_ERROR, "Unable to match %s with a CRTC", conn->output.name);
goto error_conn;
}
- wlr_log(L_DEBUG, "%s: crtc=%td ovr=%td pri=%td cur=%td", conn->output.name,
+ wlr_log(WLR_DEBUG, "%s: crtc=%td ovr=%td pri=%td cur=%td", conn->output.name,
crtc - drm->crtcs,
crtc->overlay ? crtc->overlay - drm->overlay_planes : -1,
crtc->primary ? crtc->primary - drm->primary_planes : -1,
@@ -552,7 +552,7 @@ static bool drm_connector_set_mode(struct wlr_output *output,
if (!init_drm_plane_surfaces(crtc->primary, drm,
mode->width, mode->height, GBM_FORMAT_XRGB8888)) {
- wlr_log(L_ERROR, "Failed to initialize renderer for plane");
+ wlr_log(WLR_ERROR, "Failed to initialize renderer for plane");
goto error_conn;
}
@@ -585,7 +585,7 @@ bool wlr_drm_connector_add_mode(struct wlr_output *output,
mode->wlr_mode.height = mode->drm_mode.vdisplay;
mode->wlr_mode.refresh = mode->drm_mode.vrefresh;
- wlr_log(L_INFO, "Registered custom mode "
+ wlr_log(WLR_INFO, "Registered custom mode "
"%"PRId32"x%"PRId32"@%"PRId32,
mode->wlr_mode.width, mode->wlr_mode.height,
mode->wlr_mode.refresh);
@@ -616,7 +616,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
// We don't have a real cursor plane, so we make a fake one
plane = calloc(1, sizeof(*plane));
if (!plane) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
return false;
}
crtc->cursor = plane;
@@ -632,14 +632,14 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
if (!init_drm_surface(&plane->surf, renderer, w, h,
GBM_FORMAT_ARGB8888, 0)) {
- wlr_log(L_ERROR, "Cannot allocate cursor resources");
+ wlr_log(WLR_ERROR, "Cannot allocate cursor resources");
return false;
}
plane->cursor_bo = gbm_bo_create(renderer->gbm, w, h,
GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE);
if (!plane->cursor_bo) {
- wlr_log_errno(L_ERROR, "Failed to create cursor bo");
+ wlr_log_errno(WLR_ERROR, "Failed to create cursor bo");
return false;
}
}
@@ -680,7 +680,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
height = height * output->scale / scale;
if (width > (int)plane->surf.width || height > (int)plane->surf.height) {
- wlr_log(L_ERROR, "Cursor too large (max %dx%d)",
+ wlr_log(WLR_ERROR, "Cursor too large (max %dx%d)",
(int)plane->surf.width, (int)plane->surf.height);
return false;
}
@@ -692,7 +692,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
void *bo_data;
if (!gbm_bo_map(plane->cursor_bo, 0, 0, bo_width, bo_height,
GBM_BO_TRANSFER_WRITE, &bo_stride, &bo_data)) {
- wlr_log_errno(L_ERROR, "Unable to map buffer");
+ wlr_log_errno(WLR_ERROR, "Unable to map buffer");
return false;
}
@@ -797,7 +797,7 @@ bool wlr_output_is_drm(struct wlr_output *output) {
static int retry_pageflip(void *data) {
struct wlr_drm_connector *conn = data;
- wlr_log(L_INFO, "%s: Retrying pageflip", conn->output.name);
+ wlr_log(WLR_INFO, "%s: Retrying pageflip", conn->output.name);
drm_connector_start_renderer(conn);
return 0;
}
@@ -812,11 +812,11 @@ static const int32_t subpixel_map[] = {
};
void scan_drm_connectors(struct wlr_drm_backend *drm) {
- wlr_log(L_INFO, "Scanning DRM connectors");
+ wlr_log(WLR_INFO, "Scanning DRM connectors");
drmModeRes *res = drmModeGetResources(drm->fd);
if (!res) {
- wlr_log_errno(L_ERROR, "Failed to get DRM resources");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM resources");
return;
}
@@ -830,7 +830,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
drmModeConnector *drm_conn = drmModeGetConnector(drm->fd,
res->connectors[i]);
if (!drm_conn) {
- wlr_log_errno(L_ERROR, "Failed to get DRM connector");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM connector");
continue;
}
drmModeEncoder *curr_enc = drmModeGetEncoder(drm->fd,
@@ -849,7 +849,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
if (!wlr_conn) {
wlr_conn = calloc(1, sizeof(*wlr_conn));
if (!wlr_conn) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
drmModeFreeEncoder(curr_enc);
drmModeFreeConnector(drm_conn);
continue;
@@ -874,7 +874,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
drm_conn->connector_type_id);
wl_list_insert(&drm->outputs, &wlr_conn->link);
- wlr_log(L_INFO, "Found display '%s'", wlr_conn->output.name);
+ wlr_log(WLR_INFO, "Found display '%s'", wlr_conn->output.name);
} else {
seen[index] = true;
}
@@ -892,13 +892,13 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
if (wlr_conn->state == WLR_DRM_CONN_DISCONNECTED &&
drm_conn->connection == DRM_MODE_CONNECTED) {
- wlr_log(L_INFO, "'%s' connected", wlr_conn->output.name);
- wlr_log(L_DEBUG, "Current CRTC: %d",
+ wlr_log(WLR_INFO, "'%s' connected", wlr_conn->output.name);
+ wlr_log(WLR_DEBUG, "Current CRTC: %d",
wlr_conn->crtc ? (int)wlr_conn->crtc->id : -1);
wlr_conn->output.phys_width = drm_conn->mmWidth;
wlr_conn->output.phys_height = drm_conn->mmHeight;
- wlr_log(L_INFO, "Physical size: %"PRId32"x%"PRId32,
+ wlr_log(WLR_INFO, "Physical size: %"PRId32"x%"PRId32,
wlr_conn->output.phys_width, wlr_conn->output.phys_height);
wlr_conn->output.subpixel = subpixel_map[drm_conn->subpixel];
@@ -910,12 +910,12 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
parse_edid(&wlr_conn->output, edid_len, edid);
free(edid);
- wlr_log(L_INFO, "Detected modes:");
+ wlr_log(WLR_INFO, "Detected modes:");
for (int i = 0; i < drm_conn->count_modes; ++i) {
struct wlr_drm_mode *mode = calloc(1, sizeof(*mode));
if (!mode) {
- wlr_log_errno(L_ERROR, "Allocation failed");
+ wlr_log_errno(WLR_ERROR, "Allocation failed");
continue;
}
mode->drm_mode = drm_conn->modes[i];
@@ -923,7 +923,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
mode->wlr_mode.height = mode->drm_mode.vdisplay;
mode->wlr_mode.refresh = calculate_refresh_rate(&mode->drm_mode);
- wlr_log(L_INFO, " %"PRId32"x%"PRId32"@%"PRId32,
+ wlr_log(WLR_INFO, " %"PRId32"x%"PRId32"@%"PRId32,
mode->wlr_mode.width, mode->wlr_mode.height,
mode->wlr_mode.refresh);
@@ -933,13 +933,13 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
wlr_output_update_enabled(&wlr_conn->output, true);
wlr_conn->state = WLR_DRM_CONN_NEEDS_MODESET;
- wlr_log(L_INFO, "Sending modesetting signal for '%s'",
+ wlr_log(WLR_INFO, "Sending modesetting signal for '%s'",
wlr_conn->output.name);
wlr_signal_emit_safe(&drm->backend.events.new_output,
&wlr_conn->output);
} else if (wlr_conn->state == WLR_DRM_CONN_CONNECTED &&
drm_conn->connection != DRM_MODE_CONNECTED) {
- wlr_log(L_INFO, "'%s' disconnected", wlr_conn->output.name);
+ wlr_log(WLR_INFO, "'%s' disconnected", wlr_conn->output.name);
wlr_output_update_enabled(&wlr_conn->output, false);
drm_connector_cleanup(wlr_conn);
@@ -959,7 +959,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
continue;
}
- wlr_log(L_INFO, "'%s' disappeared", conn->output.name);
+ wlr_log(WLR_INFO, "'%s' disappeared", conn->output.name);
drm_connector_cleanup(conn);
drmModeFreeCrtc(conn->old_crtc);
@@ -1024,7 +1024,7 @@ void restore_drm_outputs(struct wlr_drm_backend *drm) {
}
if (to_close) {
- wlr_log(L_ERROR, "Timed out stopping output renderers");
+ wlr_log(WLR_ERROR, "Timed out stopping output renderers");
}
wl_list_for_each(conn, &drm->outputs, link) {
@@ -1077,7 +1077,7 @@ static void drm_connector_cleanup(struct wlr_drm_connector *conn) {
conn->pageflip_pending = false;
/* Fallthrough */
case WLR_DRM_CONN_NEEDS_MODESET:
- wlr_log(L_INFO, "Emitting destruction signal for '%s'",
+ wlr_log(WLR_INFO, "Emitting destruction signal for '%s'",
conn->output.name);
wlr_signal_emit_safe(&conn->output.events.destroy, &conn->output);
break;
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c
index 7c45ae21..d27cf137 100644
--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
@@ -12,13 +12,13 @@ static bool legacy_crtc_pageflip(struct wlr_drm_backend *drm,
if (mode) {
if (drmModeSetCrtc(drm->fd, crtc->id, fb_id, 0, 0,
&conn->id, 1, mode)) {
- wlr_log_errno(L_ERROR, "%s: Failed to set CRTC", conn->output.name);
+ wlr_log_errno(WLR_ERROR, "%s: Failed to set CRTC", conn->output.name);
return false;
}
}
if (drmModePageFlip(drm->fd, crtc->id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, conn)) {
- wlr_log_errno(L_ERROR, "%s: Failed to page flip", conn->output.name);
+ wlr_log_errno(WLR_ERROR, "%s: Failed to page flip", conn->output.name);
return false;
}
@@ -47,7 +47,7 @@ bool legacy_crtc_set_cursor(struct wlr_drm_backend *drm,
if (drmModeSetCursor(drm->fd, crtc->id, gbm_bo_get_handle(bo).u32,
plane->surf.width, plane->surf.height)) {
- wlr_log_errno(L_DEBUG, "Failed to set hardware cursor");
+ wlr_log_errno(WLR_DEBUG, "Failed to set hardware cursor");
return false;
}
diff --git a/backend/drm/properties.c b/backend/drm/properties.c
index c16d4b3a..372de232 100644
--- a/backend/drm/properties.c
+++ b/backend/drm/properties.c
@@ -63,14 +63,14 @@ static bool scan_properties(int fd, uint32_t id, uint32_t type, uint32_t *result
const struct prop_info *info, size_t info_len) {
drmModeObjectProperties *props = drmModeObjectGetProperties(fd, id, type);
if (!props) {
- wlr_log_errno(L_ERROR, "Failed to get DRM object properties");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM object properties");
return false;
}
for (uint32_t i = 0; i < props->count_props; ++i) {
drmModePropertyRes *prop = drmModeGetProperty(fd, props->props[i]);
if (!prop) {
- wlr_log_errno(L_ERROR, "Failed to get DRM object property");
+ wlr_log_errno(WLR_ERROR, "Failed to get DRM object property");
continue;
}
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 0ab63c86..38e6315d 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -22,7 +22,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
struct wlr_drm_renderer *renderer, wlr_renderer_create_func_t create_renderer_func) {
renderer->gbm = gbm_create_device(drm->fd);
if (!renderer->gbm) {
- wlr_log(L_ERROR, "Failed to create GBM device");
+ wlr_log(WLR_ERROR, "Failed to create GBM device");
return false;
}
@@ -34,7 +34,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
EGL_PLATFORM_GBM_MESA, renderer->gbm, NULL, GBM_FORMAT_ARGB8888);
if (!renderer->wlr_rend) {
- wlr_log(L_ERROR, "Failed to create EGL/WLR renderer");
+ wlr_log(WLR_ERROR, "Failed to create EGL/WLR renderer");
goto error_gbm;
}
@@ -83,13 +83,13 @@ bool init_drm_surface(struct wlr_drm_surface *surf,
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
format, GBM_BO_USE_RENDERING | flags);
if (!surf->gbm) {
- wlr_log_errno(L_ERROR, "Failed to create GBM surface");
+ wlr_log_errno(WLR_ERROR, "Failed to create GBM surface");
goto error_zero;
}
surf->egl = wlr_egl_create_surface(&renderer->egl, surf->gbm);
if (surf->egl == EGL_NO_SURFACE) {
- wlr_log(L_ERROR, "Failed to create EGL surface");
+ wlr_log(WLR_ERROR, "Failed to create EGL surface");
goto error_gbm;
}
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 73669205..baacbfa8 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -174,7 +174,7 @@ uint32_t get_fb_for_bo(struct gbm_bo *bo) {
uint32_t format = gbm_bo_get_format(bo);
if (drmModeAddFB2(fd, width, height, format, handles, pitches, offsets, &id, 0)) {
- wlr_log_errno(L_ERROR, "Unable to add DRM framebuffer");
+ wlr_log_errno(WLR_ERROR, "Unable to add DRM framebuffer");
}
gbm_bo_set_user_data(bo, (void *)(uintptr_t)id, free_fb);