diff options
-rw-r--r-- | src/amdgpu_kms.c | 34 |
1 files 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; |