backend-drm: Make boolean fields actually bool
Continues what dd8219b3fb
started, also in
the DRM backend.
This commit is contained in:
parent
b2f54d9f17
commit
1b3ad0993b
|
@ -171,7 +171,7 @@ drm_output_init_cursor_egl(struct drm_output *output, struct drm_backend *b)
|
|||
|
||||
err:
|
||||
weston_log("cursor buffers unavailable, using gl cursors\n");
|
||||
b->cursors_are_broken = 1;
|
||||
b->cursors_are_broken = true;
|
||||
drm_output_fini_cursor_egl(output);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -261,7 +261,6 @@ struct drm_backend {
|
|||
int min_height, max_height;
|
||||
|
||||
struct wl_list plane_list;
|
||||
int sprites_are_broken;
|
||||
|
||||
void *repaint_data;
|
||||
|
||||
|
@ -270,7 +269,8 @@ struct drm_backend {
|
|||
/* CRTC IDs not used by any enabled output. */
|
||||
struct wl_array unused_crtcs;
|
||||
|
||||
int cursors_are_broken;
|
||||
bool sprites_are_broken;
|
||||
bool cursors_are_broken;
|
||||
|
||||
bool universal_planes;
|
||||
bool atomic_modeset;
|
||||
|
@ -484,11 +484,11 @@ struct drm_output {
|
|||
/* Holds the properties for the CRTC */
|
||||
struct drm_property_info props_crtc[WDRM_CRTC__COUNT];
|
||||
|
||||
int page_flip_pending;
|
||||
int atomic_complete_pending;
|
||||
int destroy_pending;
|
||||
int disable_pending;
|
||||
int dpms_off_pending;
|
||||
bool page_flip_pending;
|
||||
bool atomic_complete_pending;
|
||||
bool destroy_pending;
|
||||
bool disable_pending;
|
||||
bool dpms_off_pending;
|
||||
|
||||
uint32_t gbm_cursor_handle[2];
|
||||
struct drm_fb *gbm_cursor_fb[2];
|
||||
|
|
|
@ -291,19 +291,19 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
|
|||
output->state_last = NULL;
|
||||
|
||||
if (output->destroy_pending) {
|
||||
output->destroy_pending = 0;
|
||||
output->disable_pending = 0;
|
||||
output->dpms_off_pending = 0;
|
||||
output->destroy_pending = false;
|
||||
output->disable_pending = false;
|
||||
output->dpms_off_pending = false;
|
||||
drm_output_destroy(&output->base);
|
||||
return;
|
||||
} else if (output->disable_pending) {
|
||||
output->disable_pending = 0;
|
||||
output->dpms_off_pending = 0;
|
||||
output->disable_pending = false;
|
||||
output->dpms_off_pending = false;
|
||||
weston_output_disable(&output->base);
|
||||
return;
|
||||
} else if (output->dpms_off_pending) {
|
||||
struct drm_pending_state *pending = drm_pending_state_alloc(b);
|
||||
output->dpms_off_pending = 0;
|
||||
output->dpms_off_pending = false;
|
||||
drm_output_get_disable_state(pending, output);
|
||||
drm_pending_state_apply_sync(pending);
|
||||
} else if (output->state_cur->dpms == WESTON_DPMS_OFF &&
|
||||
|
@ -1101,7 +1101,7 @@ drm_set_dpms(struct weston_output *output_base, enum dpms_enum level)
|
|||
* a repaint cycle. */
|
||||
if (level == WESTON_DPMS_ON) {
|
||||
if (output->dpms_off_pending)
|
||||
output->dpms_off_pending = 0;
|
||||
output->dpms_off_pending = false;
|
||||
weston_output_schedule_repaint(output_base);
|
||||
return;
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ drm_set_dpms(struct weston_output *output_base, enum dpms_enum level)
|
|||
/* If we've already got a request in the pipeline, then we need to
|
||||
* park our DPMS request until that request has quiesced. */
|
||||
if (output->state_last) {
|
||||
output->dpms_off_pending = 1;
|
||||
output->dpms_off_pending = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ drm_output_enable(struct weston_output *base)
|
|||
&output->cursor_plane->base,
|
||||
NULL);
|
||||
else
|
||||
b->cursors_are_broken = 1;
|
||||
b->cursors_are_broken = true;
|
||||
|
||||
weston_compositor_stack_plane(b->compositor,
|
||||
&output->scanout_plane->base,
|
||||
|
@ -1798,7 +1798,7 @@ drm_output_destroy(struct weston_output *base)
|
|||
assert(!output->virtual);
|
||||
|
||||
if (output->page_flip_pending || output->atomic_complete_pending) {
|
||||
output->destroy_pending = 1;
|
||||
output->destroy_pending = true;
|
||||
weston_log("destroy output while page flip pending\n");
|
||||
return;
|
||||
}
|
||||
|
@ -1827,7 +1827,7 @@ drm_output_disable(struct weston_output *base)
|
|||
assert(!output->virtual);
|
||||
|
||||
if (output->page_flip_pending || output->atomic_complete_pending) {
|
||||
output->disable_pending = 1;
|
||||
output->disable_pending = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1836,7 +1836,7 @@ drm_output_disable(struct weston_output *base)
|
|||
if (output->base.enabled)
|
||||
drm_output_deinit(&output->base);
|
||||
|
||||
output->disable_pending = 0;
|
||||
output->disable_pending = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2156,8 +2156,8 @@ drm_output_create(struct weston_compositor *compositor, const char *name)
|
|||
output->base.attach_head = drm_output_attach_head;
|
||||
output->base.detach_head = drm_output_detach_head;
|
||||
|
||||
output->destroy_pending = 0;
|
||||
output->disable_pending = 0;
|
||||
output->destroy_pending = false;
|
||||
output->disable_pending = false;
|
||||
|
||||
output->state_cur = drm_output_state_alloc(output, NULL);
|
||||
|
||||
|
@ -2662,12 +2662,12 @@ planes_binding(struct weston_keyboard *keyboard, const struct timespec *time,
|
|||
|
||||
switch (key) {
|
||||
case KEY_C:
|
||||
b->cursors_are_broken ^= 1;
|
||||
b->cursors_are_broken ^= true;
|
||||
break;
|
||||
case KEY_V:
|
||||
/* We don't support overlay-plane usage with legacy KMS. */
|
||||
if (b->atomic_modeset)
|
||||
b->sprites_are_broken ^= 1;
|
||||
b->sprites_are_broken ^= true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -553,7 +553,7 @@ drm_output_assign_state(struct drm_output_state *state,
|
|||
|
||||
if (b->atomic_modeset && mode == DRM_STATE_APPLY_ASYNC) {
|
||||
drm_debug(b, "\t[CRTC:%u] setting pending flip\n", output->crtc_id);
|
||||
output->atomic_complete_pending = 1;
|
||||
output->atomic_complete_pending = true;
|
||||
}
|
||||
|
||||
if (b->atomic_modeset &&
|
||||
|
@ -583,7 +583,7 @@ drm_output_assign_state(struct drm_output_state *state,
|
|||
|
||||
assert(plane->type != WDRM_PLANE_TYPE_OVERLAY);
|
||||
if (plane->type == WDRM_PLANE_TYPE_PRIMARY)
|
||||
output->page_flip_pending = 1;
|
||||
output->page_flip_pending = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -635,7 +635,7 @@ drm_output_set_cursor(struct drm_output_state *output_state)
|
|||
return;
|
||||
|
||||
err:
|
||||
b->cursors_are_broken = 1;
|
||||
b->cursors_are_broken = true;
|
||||
drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -1400,7 +1400,7 @@ page_flip_handler(int fd, unsigned int frame,
|
|||
|
||||
assert(!b->atomic_modeset);
|
||||
assert(output->page_flip_pending);
|
||||
output->page_flip_pending = 0;
|
||||
output->page_flip_pending = false;
|
||||
|
||||
drm_output_update_complete(output, flags, sec, usec);
|
||||
}
|
||||
|
@ -1426,7 +1426,7 @@ atomic_flip_handler(int fd, unsigned int frame, unsigned int sec,
|
|||
drm_debug(b, "[atomic][CRTC:%u] flip processing started\n", crtc_id);
|
||||
assert(b->atomic_modeset);
|
||||
assert(output->atomic_complete_pending);
|
||||
output->atomic_complete_pending = 0;
|
||||
output->atomic_complete_pending = false;
|
||||
|
||||
drm_output_update_complete(output, flags, sec, usec);
|
||||
drm_debug(b, "[atomic][CRTC:%u] flip processing completed\n", crtc_id);
|
||||
|
@ -1514,7 +1514,7 @@ init_kms_caps(struct drm_backend *b)
|
|||
* enabled.
|
||||
*/
|
||||
if (!b->atomic_modeset || getenv("WESTON_FORCE_RENDERER"))
|
||||
b->sprites_are_broken = 1;
|
||||
b->sprites_are_broken = true;
|
||||
|
||||
ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1);
|
||||
b->aspect_ratio_supported = (ret == 0);
|
||||
|
|
Loading…
Reference in New Issue