summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-08-18 16:46:18 +0900
committerMichel Dänzer <michel@daenzer.net>2017-08-22 18:33:59 +0900
commitd8e8f0107bb3e83a787917f4db16a7a54ce4768b (patch)
treed77c463a894abccd974be2d4b8caf32da883a5c1 /src
parentcc1dfb88eb6714fcdcb9b576a70f400a5d0d58ca (diff)
Pass extents to amdgpu_scanout_do_update
Preparation for following change, no functional change intended yet. (Ported from radeon commit 65e0c5ea1b4adff21d673dbf54af99704c429627) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h2
-rw-r--r--src/amdgpu_kms.c41
-rw-r--r--src/drmmode_display.c3
3 files changed, 24 insertions, 22 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 515d466..1323747 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -341,7 +341,7 @@ Bool amdgpu_dri3_screen_init(ScreenPtr screen);
/* amdgpu_kms.c */
Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
- DrawablePtr src_draw);
+ DrawablePtr src_draw, BoxPtr extents);
void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
, RegionPtr pBSRegion
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 230a779..aedb3f0 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -793,32 +793,27 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
Bool
amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
- DrawablePtr src_draw)
+ DrawablePtr src_draw, BoxPtr extents)
{
drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
- RegionPtr pRegion = DamageRegion(drmmode_crtc->scanout_damage);
+ RegionRec region = { .extents = *extents, .data = NULL };
ScrnInfoPtr scrn = xf86_crtc->scrn;
ScreenPtr pScreen = scrn->pScreen;
DrawablePtr pDraw;
- BoxRec extents;
if (!xf86_crtc->enabled ||
- !drmmode_crtc->scanout[scanout_id].pixmap)
- return FALSE;
-
- if (!RegionNotEmpty(pRegion))
+ !drmmode_crtc->scanout[scanout_id].pixmap ||
+ extents->x1 >= extents->x2 || extents->y1 >= extents->y2)
return FALSE;
pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable;
- extents = *RegionExtents(pRegion);
- if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents))
+ if (!amdgpu_scanout_extents_intersect(xf86_crtc, extents))
return FALSE;
if (drmmode_crtc->tear_free) {
- amdgpu_sync_scanout_pixmaps(xf86_crtc, pRegion, scanout_id);
- RegionCopy(&drmmode_crtc->scanout_last_region, pRegion);
+ amdgpu_sync_scanout_pixmaps(xf86_crtc, &region, scanout_id);
+ RegionCopy(&drmmode_crtc->scanout_last_region, &region);
}
- RegionEmpty(pRegion);
#if XF86_CRTC_VERSION >= 4
if (xf86_crtc->driverIsPerformingTransform) {
@@ -856,9 +851,9 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
pScreen->SourceValidate = NULL;
CompositePicture(PictOpSrc,
src, NULL, dst,
- extents.x1, extents.y1, 0, 0, extents.x1,
- extents.y1, extents.x2 - extents.x1,
- extents.y2 - extents.y1);
+ extents->x1, extents->y1, 0, 0, extents->x1,
+ extents->y1, extents->x2 - extents->x1,
+ extents->y2 - extents->y1);
pScreen->SourceValidate = SourceValidate;
free_dst:
@@ -873,9 +868,9 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
ValidateGC(pDraw, gc);
(*gc->ops->CopyArea)(src_draw, pDraw, gc,
- xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1,
- extents.x2 - extents.x1, extents.y2 - extents.y1,
- extents.x1, extents.y1);
+ xf86_crtc->x + extents->x1, xf86_crtc->y + extents->y1,
+ extents->x2 - extents->x1, extents->y2 - extents->y1,
+ extents->x1, extents->y1);
FreeScratchGC(gc);
}
@@ -898,9 +893,12 @@ amdgpu_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec,
{
drmmode_crtc_private_ptr drmmode_crtc = event_data;
ScreenPtr screen = crtc->scrn->pScreen;
+ RegionPtr region = DamageRegion(drmmode_crtc->scanout_damage);
amdgpu_scanout_do_update(crtc, drmmode_crtc->scanout_id,
- &screen->GetWindowPixmap(screen->root)->drawable);
+ &screen->GetWindowPixmap(screen->root)->drawable,
+ &region->extents);
+ RegionEmpty(region);
amdgpu_scanout_update_abort(crtc, event_data);
}
@@ -977,6 +975,7 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
xf86CrtcPtr xf86_crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
+ RegionPtr region = DamageRegion(drmmode_crtc->scanout_damage);
ScrnInfoPtr scrn = xf86_crtc->scrn;
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
uintptr_t drm_queue_seq;
@@ -988,8 +987,10 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
scanout_id = drmmode_crtc->scanout_id ^ 1;
if (!amdgpu_scanout_do_update(xf86_crtc, scanout_id,
- &pScreen->GetWindowPixmap(pScreen->root)->drawable))
+ &pScreen->GetWindowPixmap(pScreen->root)->drawable,
+ &region->extents))
return;
+ RegionEmpty(region);
drm_queue_seq = amdgpu_drm_queue_alloc(xf86_crtc,
AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 972a6f2..fa19fd7 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -771,7 +771,8 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
*x = *y = 0;
amdgpu_scanout_do_update(crtc, scanout_id,
- &screen->GetWindowPixmap(screen->root)->drawable);
+ &screen->GetWindowPixmap(screen->root)->drawable,
+ box);
amdgpu_glamor_finish(scrn);
}
}