diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-09-21 17:43:57 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-09-21 18:20:19 +0900 |
commit | 792a30dbe5f7d7815ea14032dbab55b5de8eabca (patch) | |
tree | c2cea373a7c20ed13c1c948d63176d5f142fdba6 /src | |
parent | 80d794f11a5f047663897e4349da75d89ceff7c7 (diff) |
Remove w/h parameters from radeon_scanout_extents_intersect
We can use the dimensions of the CRTC's mode instead.
(Ported from amdgpu commit ede7f2bcae63be65e05e3029bfe7c742e5978932)
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_kms.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 9d968117..384e02f5 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -383,8 +383,7 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) } static Bool -radeon_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents, int w, - int h) +radeon_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents) { extents->x1 -= xf86_crtc->filter_width >> 1; extents->x2 += xf86_crtc->filter_width >> 1; @@ -394,8 +393,8 @@ radeon_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents, int w, extents->x1 = max(extents->x1, 0); extents->y1 = max(extents->y1, 0); - extents->x2 = min(extents->x2, w); - extents->y2 = min(extents->y2, h); + 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); } @@ -468,8 +467,7 @@ radeon_sync_scanout_pixmaps(xf86CrtcPtr xf86_crtc, RegionPtr new_region, goto uninit; extents = *RegionExtents(&remaining); - if (!radeon_scanout_extents_intersect(xf86_crtc, &extents, dst->width, - dst->height)) + if (!radeon_scanout_extents_intersect(xf86_crtc, &extents)) goto uninit; #if XF86_CRTC_VERSION >= 4 @@ -875,8 +873,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable; extents = *RegionExtents(pRegion); - if (!radeon_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width, - pDraw->height)) + if (!radeon_scanout_extents_intersect(xf86_crtc, &extents)) return FALSE; if (info->tear_free) { @@ -985,7 +982,6 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc) drmVBlank vbl; DamagePtr pDamage; RegionPtr pRegion; - DrawablePtr pDraw; BoxRec extents; if (!xf86_crtc->enabled || @@ -1002,10 +998,8 @@ radeon_scanout_update(xf86CrtcPtr xf86_crtc) if (!RegionNotEmpty(pRegion)) return; - pDraw = &drmmode_crtc->scanout[0].pixmap->drawable; extents = *RegionExtents(pRegion); - if (!radeon_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width, - pDraw->height)) + if (!radeon_scanout_extents_intersect(xf86_crtc, &extents)) return; scrn = xf86_crtc->scrn; |