Merge branch 'display_tiling_clean_new' into 'master'

Draft: Display Tiling for DRM backend

See merge request wlroots/wlroots!3344
This commit is contained in:
Christian Kröner 2022-10-13 20:09:09 +00:00
commit 5e9f77f4ff
11 changed files with 333 additions and 8 deletions

View file

@ -20,6 +20,7 @@ union wlr_drm_connector_props {
uint32_t subconnector; // not guaranteed to exist
uint32_t non_desktop;
uint32_t panel_orientation; // not guaranteed to exist
uint32_t tile;
uint32_t content_type; // not guaranteed to exist
uint32_t max_bpc; // not guaranteed to exist
@ -27,7 +28,7 @@ union wlr_drm_connector_props {
uint32_t crtc_id;
};
uint32_t props[4];
uint32_t props[8];
};
union wlr_drm_crtc_props {

View file

@ -12,6 +12,8 @@ int32_t calculate_refresh_rate(const drmModeModeInfo *mode);
enum wlr_output_mode_aspect_ratio get_picture_aspect_ratio(const drmModeModeInfo *mode);
// Populates the make/model/phys_{width,height} of output from the edid data
void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data);
// Parses the TILE property
void parse_tile(struct wlr_drm_connector *conn, size_t len, const uint8_t *data);
// Part of match_obj
enum {

View file

@ -16,6 +16,7 @@
#include <wayland-util.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/util/addon.h>
#include <wlr/util/box.h>
enum wlr_output_mode_aspect_ratio {
WLR_OUTPUT_MODE_ASPECT_RATIO_NONE,
@ -51,6 +52,17 @@ struct wlr_output_cursor {
struct wl_listener surface_destroy;
};
struct wlr_output_tile_info {
uint32_t group_id;
uint32_t tile_is_single_monitor;
uint32_t num_h_tile;
uint32_t num_v_tile;
uint32_t tile_h_loc;
uint32_t tile_v_loc;
uint32_t tile_h_size;
uint32_t tile_v_size;
};
enum wlr_output_adaptive_sync_status {
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED,
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED,
@ -66,6 +78,7 @@ enum wlr_output_state_field {
WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED = 1 << 6,
WLR_OUTPUT_STATE_GAMMA_LUT = 1 << 7,
WLR_OUTPUT_STATE_RENDER_FORMAT = 1 << 8,
WLR_OUTPUT_STATE_SOURCE_BOX = 1 << 9,
WLR_OUTPUT_STATE_SUBPIXEL = 1 << 9,
};
@ -87,6 +100,9 @@ struct wlr_output_state {
float scale;
enum wl_output_transform transform;
bool adaptive_sync_enabled;
/* allow partial buffer scanout for tiling displays
* only valid if WLR_OUTPUT_STATE_SOURCE_BOX */
struct wlr_box source_box; // source box for respective output
uint32_t render_format;
enum wl_output_subpixel subpixel;
@ -131,6 +147,7 @@ struct wlr_output {
char *description; // may be NULL
char *make, *model, *serial; // may be NULL
int32_t phys_width, phys_height; // mm
struct wlr_output_tile_info tile_info;
// Note: some backends may have zero modes
struct wl_list modes; // wlr_output_mode::link
@ -416,6 +433,14 @@ uint32_t wlr_output_preferred_read_format(struct wlr_output *output);
*/
void wlr_output_set_damage(struct wlr_output *output,
pixman_region32_t *damage);
/**
* This can be used in case the output buffer is larger than the buffer that
* is supposed to be presented on the actual screen attached to the DRM
* connector. Current use case are hi-res tiling displays which use multiple
* DRM connectors to make up the full monitor.
*/
void wlr_output_set_source_box(struct wlr_output *output,
struct wlr_box source_box);
/**
* Test whether the pending output state would be accepted by the backend. If
* this function returns true, wlr_output_commit() can only fail due to a

View file

@ -0,0 +1,32 @@
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_TYPES_WLR_OUTPUT_GROUP_H
#define WLR_TYPES_WLR_OUTPUT_GROUP_H
#include <wlr/types/wlr_output.h>
struct wlr_output_group_child;
struct wlr_output_group {
struct wlr_output base;
// Private state
struct wlr_output *main_output;
struct wl_list children; // wlr_output_group_child.link
struct wl_listener main_output_destroy;
};
struct wlr_output_group *wlr_output_group_create(struct wlr_output *main_output);
struct wlr_output_group_child *wlr_output_group_add(
struct wlr_output_group *group, struct wlr_output *output);
void wlr_output_group_child_destroy(struct wlr_output_group_child *child);
#endif