diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 6cfcde75..557764fb 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -92,6 +92,7 @@ struct pixel_format_info; struct weston_output_capture_info; struct weston_output_color_outcome; struct weston_tearing_control; +struct di_info; enum weston_keyboard_modifier { MODIFIER_CTRL = (1 << 0), @@ -505,6 +506,7 @@ struct weston_head { bool non_desktop; /**< non-desktop display, e.g. HMD */ uint32_t supported_eotf_mask; /**< supported weston_eotf_mode bits */ uint32_t supported_colorimetry_mask; /**< supported weston_colorimetry_mode bits */ + struct di_info *display_info; /**< libdisplay-info, from DRM */ /** Current content protection status */ enum weston_hdcp_protection current_protection; @@ -2626,6 +2628,9 @@ weston_head_get_output(struct weston_head *head); uint32_t weston_head_get_transform(struct weston_head *head); +const struct di_info * +weston_head_get_display_info(const struct weston_head *head); + void weston_head_detach(struct weston_head *head); diff --git a/libweston/compositor.c b/libweston/compositor.c index d5b4cc44..83fec7d1 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -6715,6 +6715,8 @@ weston_head_release(struct weston_head *head) free(head->name); wl_list_remove(&head->compositor_link); + + assert(head->display_info == NULL); } /** Propagate device information changes @@ -7142,6 +7144,24 @@ weston_head_get_transform(struct weston_head *head) return head->transform; } +/** Get display information (EDID, DisplayID) + * + * \param head The head to query. + * \return libdisplay-info structure, or NULL. + * + * Hardware heads (monitors, TVs, etc.) driven directly by this compositor may + * provide EDID or DisplayID information. If a backend has that information, + * it may expose it as a libdisplay-info structure. The caller needs to use + * libdisplay-info to extract information from the returned pointer. + * + * \ingroup head + */ +WL_EXPORT const struct di_info * +weston_head_get_display_info(const struct weston_head *head) +{ + return head->display_info; +} + /** Add destroy callback for a head * * \param head The head to watch for.