summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-07-10 18:49:05 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-12 18:06:53 +0200
commit9f2409c4d3a9ecad8e769783e307e57a75b1255e (patch)
tree705bafbe946120abc01bf69697ce935f28d1f0cc /src
parente07c38649280b3f4361005bc4c256f2145a72537 (diff)
Simplify drmmode_crtc_scanout_update
Use our own BoxRec for the extents, and RegionEmpty for clearing the scanout damage region. (Ported from amdgpu commit 72c3e9c7308fbcdf85708b72f9be14a5f2f8e7b5) Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index fa05cda4..b3b37f56 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -765,8 +765,8 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
if (drmmode_crtc->scanout[scanout_id].pixmap &&
(!drmmode_crtc->tear_free ||
drmmode_crtc->scanout[scanout_id ^ 1].pixmap)) {
- RegionPtr region;
- BoxPtr box;
+ BoxRec extents = { .x1 = 0, .y1 = 0,
+ .x2 = scrn->virtualX, .y2 = scrn->virtualY };
if (!drmmode_crtc->scanout_damage) {
drmmode_crtc->scanout_damage =
@@ -778,21 +778,13 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
drmmode_crtc->scanout_damage);
}
- region = DamageRegion(drmmode_crtc->scanout_damage);
- RegionUninit(region);
- region->data = NULL;
- box = RegionExtents(region);
- box->x1 = 0;
- box->y1 = 0;
- box->x2 = max(box->x2, scrn->virtualX);
- box->y2 = max(box->y2, scrn->virtualY);
-
*fb = radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
*x = *y = 0;
radeon_scanout_do_update(crtc, scanout_id,
screen->GetWindowPixmap(screen->root),
- *box);
+ extents);
+ RegionEmpty(DamageRegion(drmmode_crtc->scanout_damage));
radeon_finish(scrn, drmmode_crtc->scanout[scanout_id].bo);
}
}