Commit 2844f8ea authored by Ankit Nautiyal's avatar Ankit Nautiyal

compositor: Enable HDCP for an output using weston.ini

This patch enables a user to opt for HDCP per output, by writing into
the output section of weston.ini configuration file. HDCP is always
enabled by default for the outputs.
Signed-off-by: Ankit Nautiyal's avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
parent f74c35b1
......@@ -1232,6 +1232,18 @@ wet_output_set_transform(struct weston_output *output,
weston_output_set_transform(output, transform);
}
static void
allow_content_protection(struct weston_output *output,
struct weston_config_section *section)
{
int allow_hdcp = 1;
if (section)
weston_config_section_get_bool(section, "allow_hdcp", &allow_hdcp, 1);
weston_output_allow_protection(output, allow_hdcp);
}
static int
wet_configure_windowed_output_from_config(struct weston_output *output,
struct wet_output_config *defaults)
......@@ -1269,6 +1281,8 @@ wet_configure_windowed_output_from_config(struct weston_output *output,
free(mode);
}
allow_content_protection(output, section);
if (parsed_options->width)
width = parsed_options->width;
......@@ -1720,6 +1734,8 @@ drm_backend_output_configure(struct weston_output *output,
api->set_seat(output, seat);
free(seat);
allow_content_protection(output, section);
return 0;
}
......
......@@ -299,6 +299,7 @@ struct weston_output {
enum weston_hdcp_protection desired_protection;
enum weston_hdcp_protection current_protection;
bool allow_protection;
void (*start_repaint_loop)(struct weston_output *output);
int (*repaint)(struct weston_output *output,
......@@ -2458,6 +2459,10 @@ weston_head_from_resource(struct wl_resource *resource);
struct weston_head *
weston_output_get_first_head(struct weston_output *output);
void
weston_output_allow_protection(struct weston_output *output,
bool allow_protection);
int
weston_compositor_enable_touch_calibrator(struct weston_compositor *compositor,
weston_touch_calibration_save_func save);
......
......@@ -6036,6 +6036,7 @@ weston_output_init(struct weston_output *output,
wl_signal_init(&output->user_destroy_signal);
output->enabled = false;
output->desired_protection = WESTON_HDCP_DISABLE;
output->allow_protection = true;
wl_list_init(&output->head_list);
......@@ -6489,6 +6490,23 @@ weston_output_get_first_head(struct weston_output *output)
struct weston_head, output_link);
}
/** Allow/Disallow content-protection support for an output
*
* This function sets the allow_protection member for an output. Setting of
* this field will allow the compositor to attempt content-protection for this
* output, for a backend that supports the content-protection protocol.
*
* \param output The weston_output for whom the content-protection is to be
* allowed.
* \param allow_protection The bool value which is to be set.
*/
WL_EXPORT void
weston_output_allow_protection(struct weston_output *output,
bool allow_protection)
{
output->allow_protection = allow_protection;
}
static void
xdg_output_unlist(struct wl_resource *resource)
{
......
......@@ -545,6 +545,15 @@ multiheaded environment with a single compositor for multiple output and input
configurations. The default seat is called "default" and will always be
present. This seat can be constrained like any other.
.RE
.TP 7
.BI "allow_hdcp=" true
Allows HDCP support for this output. If set to true, HDCP can be tried for the
content-protection, provided by the backends, on this output.
The content-protection can actually be realized, only if the hardwares (source
and sink) support HDCP, and the backend has the implementation of
content-protection protocol. By default, HDCP support is always allowed for an
output.
.RE
.SH "INPUT-METHOD SECTION"
.TP 7
.BI "path=" "@weston_libexecdir@/weston-keyboard"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment