#define GBM_BO_USE_LINEAR (1 << 4)
#endif
+#ifndef DRM_PLANE_ZPOS_INVALID_PLANE
+#define DRM_PLANE_ZPOS_INVALID_PLANE 0xffffffffffffffffULL
+#endif
+
/**
* A small wrapper to print information into the 'drm-backend' debug scope.
*
WDRM_PLANE_IN_FORMATS,
WDRM_PLANE_IN_FENCE_FD,
WDRM_PLANE_FB_DAMAGE_CLIPS,
+ WDRM_PLANE_ZPOS,
WDRM_PLANE__COUNT
};
int32_t dest_x, dest_y;
uint32_t dest_w, dest_h;
+ uint64_t zpos;
+
bool complete;
/* We don't own the fd, so we shouldn't close it */
/* The last state submitted to the kernel for this plane. */
struct drm_plane_state *state_cur;
+ uint64_t zpos_min;
+ uint64_t zpos_max;
+
struct wl_list link;
struct {
{
struct drm_plane *plane;
drmModeObjectProperties *props;
+ uint64_t *zpos_range_values;
uint32_t num_formats = (kplane) ? kplane->count_formats : 1;
plane = zalloc(sizeof(*plane) +
props,
WDRM_PLANE_TYPE__COUNT);
+ zpos_range_values =
+ drm_property_get_range_values(&plane->props[WDRM_PLANE_ZPOS],
+ props);
+
+ if (zpos_range_values) {
+ plane->zpos_min = zpos_range_values[0];
+ plane->zpos_max = zpos_range_values[1];
+ } else {
+ plane->zpos_min = DRM_PLANE_ZPOS_INVALID_PLANE;
+ plane->zpos_max = DRM_PLANE_ZPOS_INVALID_PLANE;
+ }
+
if (drm_plane_populate_formats(plane, kplane, props) < 0) {
drmModeFreeObjectProperties(props);
goto err;
plane->count_formats = 1;
plane->formats[0].format = format;
plane->type = type;
+ plane->zpos_max = DRM_PLANE_ZPOS_INVALID_PLANE;
+ plane->zpos_min = DRM_PLANE_ZPOS_INVALID_PLANE;
}
if (plane->type == WDRM_PLANE_TYPE__COUNT)
[WDRM_PLANE_IN_FORMATS] = { .name = "IN_FORMATS" },
[WDRM_PLANE_IN_FENCE_FD] = { .name = "IN_FENCE_FD" },
[WDRM_PLANE_FB_DAMAGE_CLIPS] = { .name = "FB_DAMAGE_CLIPS" },
+ [WDRM_PLANE_ZPOS] = { .name = "zpos" },
};
struct drm_property_enum_info dpms_state_enums[] = {
plane_state->in_fence_fd);
}
+ /* do note, that 'invented' zpos values are set as immutable */
+ if (plane_state->zpos != DRM_PLANE_ZPOS_INVALID_PLANE &&
+ plane_state->plane->zpos_min != plane_state->plane->zpos_max)
+ ret |= plane_add_prop(req, plane,
+ WDRM_PLANE_ZPOS,
+ plane_state->zpos);
+
if (ret != 0) {
weston_log("couldn't set plane state\n");
return ret;
state->output_state = state_output;
state->plane = plane;
state->in_fence_fd = -1;
+ state->zpos = DRM_PLANE_ZPOS_INVALID_PLANE;
pixman_region32_init(&state->damage);
/* Here we only add the plane state to the desired link, and not
wl_list_init(&state->link);
state->output_state = NULL;
state->in_fence_fd = -1;
+ state->zpos = DRM_PLANE_ZPOS_INVALID_PLANE;
pixman_region32_fini(&state->damage);
if (force || state != state->plane->state_cur) {