From 1be87e3c8155204852509f47f8e239b479da6feb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 17 Jan 2014 14:22:41 -0800 Subject: [PATCH] compositor-drm: Make composite bypass work on secondary outputs The opaque region is in surface coordinates, which we compare to the output region, which is in compositor coordinates. For non-primary outputs, that means that the output region is not located at 0,0 but something like 1920,0 instead. That means that the output region isn't contained in the surface opaque region and then we decide we can't scan out from it. Instead, compare the surface opaque region to the output region translated to 0,0. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=7348i5 --- src/compositor-drm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 136d517..454c393 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -431,9 +431,10 @@ drm_output_check_scanout_format(struct drm_output *output, /* We can scanout an ARGB buffer if the surface's * opaque region covers the whole output, but we have * to use XRGB as the KMS format code. */ - pixman_region32_init(&r); - pixman_region32_subtract(&r, &output->base.region, - &es->opaque); + pixman_region32_init_rect(&r, 0, 0, + output->base.width, + output->base.height); + pixman_region32_subtract(&r, &r, &es->opaque); if (!pixman_region32_not_empty(&r)) format = GBM_FORMAT_XRGB8888; -- 2.7.4