libweston: Compute output protection when head is attached
A head may have its output protection set before it is attached to an output. Recompute the output protection whenever a head is attached to make sure it correctly set in output. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
This commit is contained in:
parent
b047f989a5
commit
a09f02d43a
|
@ -5803,6 +5803,33 @@ weston_output_iterate_heads(struct weston_output *output,
|
|||
return container_of(node, struct weston_head, output_link);
|
||||
}
|
||||
|
||||
static void
|
||||
weston_output_compute_protection(struct weston_output *output)
|
||||
{
|
||||
struct weston_head *head;
|
||||
enum weston_hdcp_protection op_protection;
|
||||
bool op_protection_valid = false;
|
||||
struct weston_compositor *wc = output->compositor;
|
||||
|
||||
wl_list_for_each(head, &output->head_list, output_link) {
|
||||
if (!op_protection_valid) {
|
||||
op_protection = head->current_protection;
|
||||
op_protection_valid = true;
|
||||
}
|
||||
if (head->current_protection < op_protection)
|
||||
op_protection = head->current_protection;
|
||||
}
|
||||
|
||||
if (!op_protection_valid)
|
||||
op_protection = WESTON_HDCP_DISABLE;
|
||||
|
||||
if (output->current_protection != op_protection) {
|
||||
output->current_protection = op_protection;
|
||||
weston_output_damage(output);
|
||||
weston_schedule_surface_protection_update(wc);
|
||||
}
|
||||
}
|
||||
|
||||
/** Attach a head to an output
|
||||
*
|
||||
* \param output The output to attach to.
|
||||
|
@ -5842,6 +5869,8 @@ weston_output_attach_head(struct weston_output *output,
|
|||
head->output = output;
|
||||
wl_list_insert(output->head_list.prev, &head->output_link);
|
||||
|
||||
weston_output_compute_protection(output);
|
||||
|
||||
if (output->enabled) {
|
||||
weston_head_add_global(head);
|
||||
|
||||
|
@ -6154,33 +6183,6 @@ weston_head_set_supported_eotf_mask(struct weston_head *head,
|
|||
weston_head_set_device_changed(head);
|
||||
}
|
||||
|
||||
static void
|
||||
weston_output_compute_protection(struct weston_output *output)
|
||||
{
|
||||
struct weston_head *head;
|
||||
enum weston_hdcp_protection op_protection;
|
||||
bool op_protection_valid = false;
|
||||
struct weston_compositor *wc = output->compositor;
|
||||
|
||||
wl_list_for_each(head, &output->head_list, output_link) {
|
||||
if (!op_protection_valid) {
|
||||
op_protection = head->current_protection;
|
||||
op_protection_valid = true;
|
||||
}
|
||||
if (head->current_protection < op_protection)
|
||||
op_protection = head->current_protection;
|
||||
}
|
||||
|
||||
if (!op_protection_valid)
|
||||
op_protection = WESTON_HDCP_DISABLE;
|
||||
|
||||
if (output->current_protection != op_protection) {
|
||||
output->current_protection = op_protection;
|
||||
weston_output_damage(output);
|
||||
weston_schedule_surface_protection_update(wc);
|
||||
}
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
weston_head_set_content_protection_status(struct weston_head *head,
|
||||
enum weston_hdcp_protection status)
|
||||
|
|
Loading…
Reference in New Issue