diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-09-02 17:23:16 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-09-06 17:12:43 +0900 |
commit | 2f6e5fb15f1a9ce523c85550e493f8bda9d0c00f (patch) | |
tree | b3c33f76d9e7ffc1011fcea66964e6b0325c8ad4 | |
parent | 5a57005178fc13b6f7e513458ca6dae72a3e5783 (diff) |
Move up radeon_scanout_extents_intersect
Will be needed higher up by the following changes. No functional change.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_kms.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 7173b772..568c49e3 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -381,6 +381,27 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) return TRUE; } +static Bool +radeon_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); + } + + return (extents->x1 < extents->x2 && extents->y1 < extents->y2); +} + #ifdef RADEON_PIXMAP_SHARING static RegionPtr @@ -636,27 +657,6 @@ radeon_dirty_update(ScrnInfoPtr scrn) #endif static Bool -radeon_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); - } - - return (extents->x1 < extents->x2 && extents->y1 < extents->y2); -} - -static Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) { drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; |