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
dev
Kristian Høgsberg 11 years ago
parent e61d2f4812
commit 1be87e3c81
  1. 7
      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 /* We can scanout an ARGB buffer if the surface's
* opaque region covers the whole output, but we have * opaque region covers the whole output, but we have
* to use XRGB as the KMS format code. */ * to use XRGB as the KMS format code. */
pixman_region32_init(&r); pixman_region32_init_rect(&r, 0, 0,
pixman_region32_subtract(&r, &output->base.region, output->base.width,
&es->opaque); output->base.height);
pixman_region32_subtract(&r, &r, &es->opaque);
if (!pixman_region32_not_empty(&r)) if (!pixman_region32_not_empty(&r))
format = GBM_FORMAT_XRGB8888; format = GBM_FORMAT_XRGB8888;

Loading…
Cancel
Save