libweston: Add support to set content-protection for a weston_output
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 25 Mar 2019 12:27:59 +0000 (17:57 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 4 Jul 2019 08:48:50 +0000 (14:18 +0530)
For making an output secure, the content-protection should be set for
each of head attached to that output. So whenever the protection for
a weston_output is desired, it means that protection is desired for
each of the weston_head attached to that weston_output.

This patch introduces a new enum in libweston to represent the
requested/current protection statuses, equivalent to the type enum
defined by the weston-secure-output protocol. The new enum helps to
extend the content-protection status and requests to libweston and
the backends.
This patch also adds a new member desired_protection to store the
desired protection for an output in weston_output.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
include/libweston/libweston.h
libweston/compositor.c

index a020c4a9b91d97459d9fa36ac4f78811f8ad7118..d07d56f8dc622fb161ed7135cdab79c71e835e13 100644 (file)
@@ -169,6 +169,20 @@ enum dpms_enum {
        WESTON_DPMS_OFF
 };
 
+/* enum for content protection requests/status
+ *
+ * This enum represents the content protection requests and statuses in
+ * libweston and its enum values correspond to those of 'type' enum defined in
+ * weston-content-protection protocol. The values should exactly match to the
+ * values of the 'type' enum of the protocol.
+ */
+
+enum weston_hdcp_protection {
+       WESTON_HDCP_DISABLE = 0,
+       WESTON_HDCP_ENABLE_TYPE_0,
+       WESTON_HDCP_ENABLE_TYPE_1
+};
+
 /** Represents a monitor
  *
  * This object represents a monitor (hardware backends like DRM) or a window
@@ -277,6 +291,8 @@ struct weston_output {
 
        struct wl_list head_list; /**< List of driven weston_heads */
 
+       enum weston_hdcp_protection desired_protection;
+
        void (*start_repaint_loop)(struct weston_output *output);
        int (*repaint)(struct weston_output *output,
                        pixman_region32_t *damage,
index a7cd87512504245bf92d5a604d8e1c6361fdf3a2..12b9016ba7fd4d159e1f94bc6a548b40df05fe69 100644 (file)
@@ -5873,6 +5873,7 @@ weston_output_init(struct weston_output *output,
        wl_list_init(&output->link);
        wl_signal_init(&output->user_destroy_signal);
        output->enabled = false;
+       output->desired_protection = WESTON_HDCP_DISABLE;
 
        wl_list_init(&output->head_list);