Move up amdgpu_scanout_extents_intersect

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

(Ported from radeon commit 2f6e5fb15f1a9ce523c85550e493f8bda9d0c00f)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Michel Dänzer
2016-09-08 17:52:25 +09:00
committed by Michel Dänzer
parent 1c725f6396
commit 4927b84ec8

View File

@@ -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
@@ -558,23 +575,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)
{