summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-24 16:19:15 +0900
committerMichel Dänzer <michel@daenzer.net>2016-06-28 15:37:48 +0900
commitede7f2bcae63be65e05e3029bfe7c742e5978932 (patch)
tree6407c6f0e194adf69bfeec84527e0890663980c6
parentbf000ea7ef91f5ecb59fc3c1ab8ed9eddcc0841d (diff)
Remove w/h parameters from amdgpu_scanout_extents_intersect
We can use the dimensions of the CRTC's mode instead. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_kms.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 33dd903..23eb7dc 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -253,8 +253,7 @@ static void amdgpu_dirty_update(ScreenPtr screen)
#endif
static Bool
-amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents, int w,
- int h)
+amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents)
{
extents->x1 -= xf86_crtc->filter_width >> 1;
extents->x2 += xf86_crtc->filter_width >> 1;
@@ -264,8 +263,8 @@ amdgpu_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);
}
@@ -297,8 +296,7 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
pScreen = pDraw->pScreen;
extents = *RegionExtents(pRegion);
RegionEmpty(pRegion);
- if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width,
- pDraw->height))
+ if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents))
return FALSE;
#if XF86_CRTC_VERSION >= 4
@@ -396,7 +394,6 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc)
drmVBlank vbl;
DamagePtr pDamage;
RegionPtr pRegion;
- DrawablePtr pDraw;
BoxRec extents;
if (!xf86_crtc->enabled ||
@@ -413,10 +410,8 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc)
if (!RegionNotEmpty(pRegion))
return;
- pDraw = &drmmode_crtc->scanout[0].pixmap->drawable;
extents = *RegionExtents(pRegion);
- if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width,
- pDraw->height))
+ if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents))
return;
scrn = xf86_crtc->scrn;