return 0;
}
+static inline struct drm_mode *
+to_drm_mode(struct weston_mode *base)
+{
+ return container_of(base, struct drm_mode, base);
+}
+
/**
* Get the current value of a KMS property
*
assert(scanout_state->dest_w == scanout_state->src_w >> 16);
assert(scanout_state->dest_h == scanout_state->src_h >> 16);
- mode = container_of(output->base.current_mode, struct drm_mode, base);
+ mode = to_drm_mode(output->base.current_mode);
if (output->state_invalid || !scanout_plane->state_cur->fb ||
scanout_plane->state_cur->fb->stride != scanout_state->fb->stride) {
ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id,
output->base.current_mode->height == target_mode->height &&
(output->base.current_mode->refresh == target_mode->refresh ||
target_mode->refresh == 0))
- return (struct drm_mode *)output->base.current_mode;
+ return to_drm_mode(output->base.current_mode);
wl_list_for_each(mode, &output->base.mode_list, base.link) {
if (mode->mode_info.hdisplay == target_mode->width &&