summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>2019-04-03 10:14:59 +0530
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>2019-07-05 14:13:30 +0530
commit2844f8eaaf06dc298cb35f64233a566c2146d797 (patch)
treeb08a56edd44cddf5fbe4bb4608c7ac146d2db14e
parentf74c35b1f4a62543e559de3455c60c82dc468ade (diff)
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 <ankit.k.nautiyal@intel.com>
-rw-r--r--compositor/main.c16
-rw-r--r--include/libweston/libweston.h5
-rw-r--r--libweston/compositor.c18
-rw-r--r--man/weston.ini.man9
4 files changed, 48 insertions, 0 deletions
diff --git a/compositor/main.c b/compositor/main.c
index fa46292f..6ceb108e 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -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;
}
diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
index 7d3307e1..a50a0bbf 100644
--- a/include/libweston/libweston.h
+++ b/include/libweston/libweston.h
@@ -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);
diff --git a/libweston/compositor.c b/libweston/compositor.c
index d417d7ac..0baf6edb 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -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)
{
diff --git a/man/weston.ini.man b/man/weston.ini.man
index 4b088767..7573573e 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -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"