[PATCH xf86-video-amdgpu 10/12] Move up amdgpu_scanout_extents_intersect

Michel Dänzer michel at daenzer.net
Thu Sep 8 10:03:08 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Will be needed higher up by the following changes. No functional change.

(Ported from radeon commit 2f6e5fb15f1a9ce523c85550e493f8bda9d0c00f)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_kms.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index c75d429..7ec86fb 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -303,6 +303,23 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 	return TRUE;
 }
 
+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);
+
+	extents->x1 = max(extents->x1, 0);
+	extents->y1 = max(extents->y1, 0);
+	extents->x2 = min(extents->x2, xf86_crtc->mode.HDisplay);
+	extents->y2 = min(extents->y2, xf86_crtc->mode.VDisplay);
+
+	return (extents->x1 < extents->x2 && extents->y1 < extents->y2);
+}
+
 #ifdef AMDGPU_PIXMAP_SHARING
 
 static RegionPtr
@@ -559,23 +576,6 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
 #endif
 
 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);
-
-	extents->x1 = max(extents->x1, 0);
-	extents->y1 = max(extents->y1, 0);
-	extents->x2 = min(extents->x2, xf86_crtc->mode.HDisplay);
-	extents->y2 = min(extents->y2, xf86_crtc->mode.VDisplay);
-
-	return (extents->x1 < extents->x2 && extents->y1 < extents->y2);
-}
-
-static Bool
 amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
 {
 	drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
-- 
2.9.3



More information about the amd-gfx mailing list