summaryrefslogtreecommitdiff
path: root/src/amdgpu_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-23 17:28:16 +0900
committerMichel Dänzer <michel@daenzer.net>2016-06-24 15:55:51 +0900
commitbf000ea7ef91f5ecb59fc3c1ab8ed9eddcc0841d (patch)
treecd727f6f281cae31e39f5142288925770ebc3923 /src/amdgpu_kms.c
parentd96dabc71b1b32dc4b422a9633cdd4e0e95da052 (diff)
Make the dedicated scanout mechanism work with arbitrary transforms v2
This makes TearFree work with arbitrary transforms, and makes transforms work better even without TearFree, with xserver >= 1.12. v2: Preserve clamping of transformed damage extents to CRTC boundaries. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_kms.c')
-rw-r--r--src/amdgpu_kms.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index b34a223..33dd903 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -256,19 +256,16 @@ static Bool
amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents, int w,
int h)
{
- extents->x1 = max(extents->x1 - xf86_crtc->x, 0);
- extents->y1 = max(extents->y1 - xf86_crtc->y, 0);
-
- switch (xf86_crtc->rotation & 0xf) {
- case RR_Rotate_90:
- case RR_Rotate_270:
- extents->x2 = min(extents->x2 - xf86_crtc->x, h);
- extents->y2 = min(extents->y2 - xf86_crtc->y, w);
- break;
- default:
- extents->x2 = min(extents->x2 - xf86_crtc->x, w);
- extents->y2 = min(extents->y2 - xf86_crtc->y, h);
- }
+ extents->x1 -= xf86_crtc->filter_width >> 1;
+ extents->x2 += xf86_crtc->filter_width >> 1;
+ extents->y1 -= xf86_crtc->filter_height >> 1;
+ extents->y2 += xf86_crtc->filter_height >> 1;
+ pixman_f_transform_bounds(&xf86_crtc->f_framebuffer_to_crtc, extents);
+
+ extents->x1 = max(extents->x1, 0);
+ extents->y1 = max(extents->y1, 0);
+ extents->x2 = min(extents->x2, w);
+ extents->y2 = min(extents->y2, h);
return (extents->x1 < extents->x2 && extents->y1 < extents->y2);
}
@@ -340,12 +337,6 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
SetPicturePictFilter(src, xf86_crtc->filter, xf86_crtc->params,
xf86_crtc->nparams);
- extents.x1 += xf86_crtc->x - (xf86_crtc->filter_width >> 1);
- extents.x2 += xf86_crtc->x + (xf86_crtc->filter_width >> 1);
- extents.y1 += xf86_crtc->y - (xf86_crtc->filter_height >> 1);
- extents.y2 += xf86_crtc->y + (xf86_crtc->filter_height >> 1);
- pixman_f_transform_bounds(&xf86_crtc->f_framebuffer_to_crtc, &extents);
-
pScreen->SourceValidate = NULL;
CompositePicture(PictOpSrc,
src, NULL, dst,