mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
compositor/drm-backend: Move censor check into paint nodes
This test is critical, so only do it once, and throw some asserts around to make sure we don't mess it up. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
25a281a0a8
commit
62e76ee5fb
3 changed files with 19 additions and 3 deletions
|
|
@ -960,8 +960,7 @@ drm_output_propose_state(struct weston_output *output_base,
|
|||
/* In case of enforced mode of content-protection do not
|
||||
* assign planes for a protected surface on an unsecured output.
|
||||
*/
|
||||
if (ev->surface->protection_mode == WESTON_SURFACE_PROTECTION_MODE_ENFORCED &&
|
||||
ev->surface->desired_protection > output_base->current_protection)
|
||||
if (pnode->censored)
|
||||
pnode->try_view_on_plane_failure_reasons |=
|
||||
FAILURE_REASONS_INADEQUATE_CONTENT_PROTECTION;
|
||||
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ paint_node_update_early(struct weston_paint_node *pnode)
|
|||
buffer = pnode->surface->buffer_ref.buffer;
|
||||
pnode->draw_solid = false;
|
||||
pnode->is_fully_transparent = false;
|
||||
pnode->censored = false;
|
||||
if (buffer->type == WESTON_BUFFER_SOLID) {
|
||||
pnode->draw_solid = true;
|
||||
pnode->is_fully_opaque = (buffer->solid.a == 1.0f);
|
||||
|
|
@ -252,6 +253,7 @@ paint_node_update_early(struct weston_paint_node *pnode)
|
|||
WESTON_SURFACE_PROTECTION_MODE_ENFORCED &&
|
||||
(recording_censor || unprotected_censor)) {
|
||||
pnode->draw_solid = true;
|
||||
pnode->censored = true;
|
||||
pnode->is_fully_opaque = true;
|
||||
pnode->is_fully_blended = false;
|
||||
get_placeholder_color(pnode, &pnode->solid);
|
||||
|
|
@ -271,6 +273,16 @@ static void
|
|||
paint_node_validate_ready(struct weston_paint_node *pnode)
|
||||
{
|
||||
struct weston_compositor *comp = pnode->surface->compositor;
|
||||
struct weston_output *output = pnode->output;
|
||||
|
||||
/* A censored pnode must not have a plane assigned, and must be
|
||||
* rendered solid, or we could leak protected content.
|
||||
*/
|
||||
if (pnode->censored) {
|
||||
weston_assert_true(comp,
|
||||
pnode->plane == &output->primary_plane);
|
||||
weston_assert_true(comp, pnode->draw_solid);
|
||||
}
|
||||
|
||||
/* If the pnode is ready to paint, it must have no dirty bits */
|
||||
weston_assert_true(comp, pnode->status == PAINT_NODE_CLEAN);
|
||||
|
|
@ -336,7 +348,7 @@ paint_node_update_late(struct weston_paint_node *pnode)
|
|||
pnode->solid = (struct weston_solid_buffer_values) {
|
||||
0.0, 0.0, 0.0, 0.0
|
||||
};
|
||||
} else if (buffer->direct_display) {
|
||||
} else if (buffer->direct_display && !pnode->censored) {
|
||||
pnode->draw_solid = true;
|
||||
pnode->is_fully_opaque = true;
|
||||
pnode->is_fully_blended = false;
|
||||
|
|
|
|||
|
|
@ -730,6 +730,11 @@ struct weston_paint_node {
|
|||
* plane assignment.
|
||||
*/
|
||||
bool is_fully_transparent;
|
||||
|
||||
/* censored content must not be placed on a plane, it will be rendered
|
||||
* as a placeholder, and draw_solid must be set.
|
||||
*/
|
||||
bool censored;
|
||||
struct weston_solid_buffer_values solid;
|
||||
bool need_hole;
|
||||
uint32_t psf_flags; /* presentation-feedback flags */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue