mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-22 06:47:12 -04:00
Enable parsing of TILE info for DRM backend
This commit is contained in:
parent
3a685b10b6
commit
21fecd6015
6 changed files with 59 additions and 1 deletions
|
|
@ -1326,6 +1326,12 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
|
||||||
parse_edid(&wlr_conn->output, edid_len, edid);
|
parse_edid(&wlr_conn->output, edid_len, edid);
|
||||||
free(edid);
|
free(edid);
|
||||||
|
|
||||||
|
size_t tile_len = 0;
|
||||||
|
uint8_t *tile = get_drm_prop_blob(drm->fd,
|
||||||
|
wlr_conn->id, wlr_conn->props.tile, &tile_len);
|
||||||
|
parse_tile(&wlr_conn->output, tile_len, tile);
|
||||||
|
free(tile);
|
||||||
|
|
||||||
char *subconnector = NULL;
|
char *subconnector = NULL;
|
||||||
if (wlr_conn->props.subconnector) {
|
if (wlr_conn->props.subconnector) {
|
||||||
subconnector = get_drm_prop_enum(drm->fd,
|
subconnector = get_drm_prop_enum(drm->fd,
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ static const struct prop_info connector_info[] = {
|
||||||
{ "DPMS", INDEX(dpms) },
|
{ "DPMS", INDEX(dpms) },
|
||||||
{ "EDID", INDEX(edid) },
|
{ "EDID", INDEX(edid) },
|
||||||
{ "PATH", INDEX(path) },
|
{ "PATH", INDEX(path) },
|
||||||
|
{ "TILE", INDEX(tile) },
|
||||||
{ "link-status", INDEX(link_status) },
|
{ "link-status", INDEX(link_status) },
|
||||||
{ "non-desktop", INDEX(non_desktop) },
|
{ "non-desktop", INDEX(non_desktop) },
|
||||||
{ "panel orientation", INDEX(panel_orientation) },
|
{ "panel orientation", INDEX(panel_orientation) },
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,41 @@ void parse_edid(struct wlr_output *restrict output, size_t len, const uint8_t *d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void parse_tile(struct wlr_output *restrict output, size_t len, const uint8_t *data) {
|
||||||
|
if (len > 0) {
|
||||||
|
int ret;
|
||||||
|
ret = sscanf((char*)data, "%d:%d:%d:%d:%d:%d:%d:%d",
|
||||||
|
&output->tile_info.group_id,
|
||||||
|
&output->tile_info.tile_is_single_monitor,
|
||||||
|
&output->tile_info.num_h_tile,
|
||||||
|
&output->tile_info.num_v_tile,
|
||||||
|
&output->tile_info.tile_h_loc,
|
||||||
|
&output->tile_info.tile_v_loc,
|
||||||
|
&output->tile_info.tile_h_size,
|
||||||
|
&output->tile_info.tile_v_size);
|
||||||
|
if(ret != 8)
|
||||||
|
wlr_log(WLR_ERROR, "Unable to understand tile information for "
|
||||||
|
"output %s", output->name);
|
||||||
|
else
|
||||||
|
wlr_log(WLR_INFO, "Output %s TILE information: "
|
||||||
|
"group ID %d, single monitor %d, total %d horizontal tiles, "
|
||||||
|
"total %d vertical tiles, horizontal tile %d, vertical tile "
|
||||||
|
"%d, width %d, height %d",
|
||||||
|
output->name,
|
||||||
|
output->tile_info.group_id,
|
||||||
|
output->tile_info.tile_is_single_monitor,
|
||||||
|
output->tile_info.num_h_tile,
|
||||||
|
output->tile_info.num_v_tile,
|
||||||
|
output->tile_info.tile_h_loc,
|
||||||
|
output->tile_info.tile_v_loc,
|
||||||
|
output->tile_info.tile_h_size,
|
||||||
|
output->tile_info.tile_v_size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
wlr_log(WLR_DEBUG, "No tile information available for output %s",
|
||||||
|
output->name);
|
||||||
|
}
|
||||||
|
|
||||||
const char *conn_get_name(uint32_t type_id) {
|
const char *conn_get_name(uint32_t type_id) {
|
||||||
switch (type_id) {
|
switch (type_id) {
|
||||||
case DRM_MODE_CONNECTOR_Unknown: return "Unknown";
|
case DRM_MODE_CONNECTOR_Unknown: return "Unknown";
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,13 @@ union wlr_drm_connector_props {
|
||||||
uint32_t subconnector; // not guaranteed to exist
|
uint32_t subconnector; // not guaranteed to exist
|
||||||
uint32_t non_desktop;
|
uint32_t non_desktop;
|
||||||
uint32_t panel_orientation; // not guaranteed to exist
|
uint32_t panel_orientation; // not guaranteed to exist
|
||||||
|
uint32_t tile;
|
||||||
|
|
||||||
// atomic-modesetting only
|
// atomic-modesetting only
|
||||||
|
|
||||||
uint32_t crtc_id;
|
uint32_t crtc_id;
|
||||||
};
|
};
|
||||||
uint32_t props[4];
|
uint32_t props[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
union wlr_drm_crtc_props {
|
union wlr_drm_crtc_props {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ int32_t calculate_refresh_rate(const drmModeModeInfo *mode);
|
||||||
// Populates the make/model/phys_{width,height} of output from the edid data
|
// Populates the make/model/phys_{width,height} of output from the edid data
|
||||||
void parse_edid(struct wlr_output *restrict output, size_t len,
|
void parse_edid(struct wlr_output *restrict output, size_t len,
|
||||||
const uint8_t *data);
|
const uint8_t *data);
|
||||||
|
// Parses the TILE property
|
||||||
|
void parse_tile(struct wlr_output *restrict output, size_t len,
|
||||||
|
const uint8_t *data);
|
||||||
// Returns the string representation of a DRM output type
|
// Returns the string representation of a DRM output type
|
||||||
const char *conn_get_name(uint32_t type_id);
|
const char *conn_get_name(uint32_t type_id);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,17 @@ struct wlr_output_cursor {
|
||||||
} events;
|
} events;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
enum wlr_output_adaptive_sync_status {
|
||||||
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED,
|
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED,
|
||||||
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED,
|
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED,
|
||||||
|
|
@ -122,6 +133,7 @@ struct wlr_output {
|
||||||
char model[16];
|
char model[16];
|
||||||
char serial[16];
|
char serial[16];
|
||||||
int32_t phys_width, phys_height; // mm
|
int32_t phys_width, phys_height; // mm
|
||||||
|
struct wlr_output_tile_info tile_info;
|
||||||
|
|
||||||
// Note: some backends may have zero modes
|
// Note: some backends may have zero modes
|
||||||
struct wl_list modes; // wlr_output_mode::link
|
struct wl_list modes; // wlr_output_mode::link
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue