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>
diff --git a/libweston/compositor.c b/libweston/compositor.c
index d417d7a..0baf6ed 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -6036,6 +6036,7 @@
 	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 @@
 			    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)
 {