libweston: Compute current protection for weston_output and weston_head

The actual protection status for a given weston_head depends upon the
corresponding drm_head's connector HDCP properties. On the other hand,
the actual protection for a weston_output is the minimum of the
protection status of its attached heads.
As a head's protection changes, the current protection of the output
to which the head is attached is recomputed.

This patch adds the support to keep track of the current
content-protection for heads and the outputs.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
This commit is contained in:
Ankit Nautiyal
2019-04-03 18:44:35 +05:30
parent 2690a77088
commit 4f64ff8b2f
2 changed files with 41 additions and 0 deletions
+8
View File
@@ -215,6 +215,9 @@ struct weston_head {
char *name; /**< head name, e.g. connector name */
bool connected; /**< is physically connected */
bool non_desktop; /**< non-desktop display, e.g. HMD */
/** Current content protection status */
enum weston_hdcp_protection current_protection;
};
/** Represents an output
@@ -292,6 +295,7 @@ struct weston_output {
struct wl_list head_list; /**< List of driven weston_heads */
enum weston_hdcp_protection desired_protection;
enum weston_hdcp_protection current_protection;
void (*start_repaint_loop)(struct weston_output *output);
int (*repaint)(struct weston_output *output,
@@ -2355,6 +2359,10 @@ struct wl_listener *
weston_head_get_destroy_listener(struct weston_head *head,
wl_notify_func_t notify);
void
weston_head_set_content_protection_status(struct weston_head *head,
enum weston_hdcp_protection status);
struct weston_head *
weston_compositor_iterate_heads(struct weston_compositor *compositor,
struct weston_head *iter);