summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-11-30 16:25:52 +0900
committerMichel Dänzer <michel@daenzer.net>2016-12-01 17:03:33 +0900
commit0f79c30619168c6845b143c6ed94ade307383068 (patch)
tree6fd55ed61e76f053bac21ce9e8b82294a433f466 /src
parent082b6b8ca1878f4b7ab0b25d16b85ba40748ac57 (diff)
Fix amdgpu_scanout_extents_intersect for GPU screens
Fixes incorrect screen updates with TearFree enabled on PRIME slave outputs which are not located at (0, 0). (Ported from radeon commit a995f5830916a0fee5126263d1bfe48632be3a15) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_kms.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 48e65a1..8a2fd30 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -300,11 +300,21 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
static Bool
amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents)
{
- 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);
+#ifdef AMDGPU_PIXMAP_SHARING
+ if (xf86_crtc->scrn->is_gpu) {
+ extents->x1 -= xf86_crtc->x;
+ extents->y1 -= xf86_crtc->y;
+ extents->x2 -= xf86_crtc->x;
+ extents->y2 -= xf86_crtc->y;
+ } else
+#endif
+ {
+ 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);