summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2019-08-19 16:53:40 +0100
committerSimon Ser <contact@emersion.fr>2019-08-23 20:51:43 +0000
commitd32dfcf8334d994803f9545c2418b2d5ff34e2fc (patch)
treead08b1620378c99a8e9e31da92b00d2fe124b382
parent5f592c7855c4a1221facb282adb73156e949ecc0 (diff)
downloadweston-d32dfcf8334d994803f9545c2418b2d5ff34e2fc.tar.gz
backend-drm: Enforce content protection for hardware planes
62626cbfec08 ensures that the GL render will not render a view's content to the screen when the surface has requested a higher content-protection level than the output currently offers. When the HDCP MR was split into the core content-protection support in !83 and specific DRM support for HDCP in !48 (not yet landed), this opened a hole where the DRM backend could promote a view to a hardware plane, even if the output offered a lower protection level than the surface wanted to enforce. In the DRM backend, check the desired protection level, and refuse to promote the view to a hardware plane if the output does not offer sufficient protection. This will lead to presentation falling back to the renderer, which may censor the content, reduce quality, etc. Signed-off-by: Daniel Stone <daniels@collabora.com> Fixes: 4b6e73d61767 ("libweston: Add support to set content-protection for a weston_surface")
-rw-r--r--libweston/backend-drm/fb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libweston/backend-drm/fb.c b/libweston/backend-drm/fb.c
index fe5a666a..58d26ea1 100644
--- a/libweston/backend-drm/fb.c
+++ b/libweston/backend-drm/fb.c
@@ -497,6 +497,10 @@ drm_fb_get_from_view(struct drm_output_state *state, struct weston_view *ev)
if (!drm_view_transform_supported(ev, &output->base))
return NULL;
+ if (ev->surface->protection_mode == WESTON_SURFACE_PROTECTION_MODE_ENFORCED &&
+ ev->surface->desired_protection > output->base.current_protection)
+ return NULL;
+
if (!buffer)
return NULL;