diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2020-07-10 11:13:21 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2020-07-10 11:13:21 +0200 |
commit | 0d1d479ecca424120ae1b0f16f9009aec64e5164 (patch) | |
tree | b3cbcb0ce2dbad39ecaff58b3cdb55855716de1c | |
parent | 442efe73dd579dc36445a3b232937abbed9d2fbb (diff) |
Fix build against ABI_VIDEODRV_VERSION 25.2
Use primary/secondary instead of master/slave where applicable.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | man/amdgpu.man | 2 | ||||
-rw-r--r-- | src/amdgpu_drv.h | 10 | ||||
-rw-r--r-- | src/amdgpu_glamor.c | 2 | ||||
-rw-r--r-- | src/amdgpu_kms.c | 74 | ||||
-rw-r--r-- | src/compat-api.h | 6 | ||||
-rw-r--r-- | src/drmmode_display.c | 4 |
6 files changed, 52 insertions, 46 deletions
diff --git a/man/amdgpu.man b/man/amdgpu.man index 2de34a3..36193e0 100644 --- a/man/amdgpu.man +++ b/man/amdgpu.man @@ -81,7 +81,7 @@ on. If this option is set, the default value of the property is 'on' or 'off' accordingly. If this option isn't set, the default value of the property is .B auto, which means that TearFree is on for rotated outputs, outputs with RandR -transforms applied and for RandR 1.4 slave outputs, otherwise off. +transforms applied and for RandR 1.4 secondary outputs, otherwise off. .TP .BI "Option \*qVariableRefresh\*q \*q" boolean \*q Enables support for enabling variable refresh on the Screen's CRTCs diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h index aae8603..e2e162e 100644 --- a/src/amdgpu_drv.h +++ b/src/amdgpu_drv.h @@ -168,18 +168,18 @@ typedef enum { } AMDGPUOpts; static inline ScreenPtr -amdgpu_master_screen(ScreenPtr screen) +amdgpu_primary_screen(ScreenPtr screen) { - if (screen->current_master) - return screen->current_master; + if (screen->current_primary) + return screen->current_primary; return screen; } static inline ScreenPtr -amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty) +amdgpu_dirty_primary(PixmapDirtyUpdatePtr dirty) { - return amdgpu_master_screen(dirty->slave_dst->drawable.pScreen); + return amdgpu_primary_screen(dirty->secondary_dst->drawable.pScreen); } static inline DrawablePtr diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c index 174bbdf..409cb76 100644 --- a/src/amdgpu_glamor.c +++ b/src/amdgpu_glamor.c @@ -349,7 +349,7 @@ amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap) static Bool -amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave, +amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr secondary, void **handle_p) { ScreenPtr screen = pixmap->drawable.pScreen; diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 91894d8..8997759 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -604,8 +604,8 @@ dirty_region(PixmapDirtyUpdatePtr dirty) if (dirty->rotation != RR_Rotate_0) { dstregion = transform_region(damageregion, &dirty->f_inverse, - dirty->slave_dst->drawable.width, - dirty->slave_dst->drawable.height); + dirty->secondary_dst->drawable.width, + dirty->secondary_dst->drawable.height); } else #endif { @@ -613,7 +613,7 @@ dirty_region(PixmapDirtyUpdatePtr dirty) dstregion = RegionDuplicate(damageregion); RegionTranslate(dstregion, -dirty->x, -dirty->y); - PixmapRegionInit(&pixregion, dirty->slave_dst); + PixmapRegionInit(&pixregion, dirty->secondary_dst); RegionIntersect(dstregion, dstregion, &pixregion); RegionUninit(&pixregion); } @@ -630,8 +630,8 @@ redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region) if (RegionNil(region)) goto out; - if (dirty->slave_dst->master_pixmap) - DamageRegionAppend(&dirty->slave_dst->drawable, region); + if (dirty->secondary_dst->primary_pixmap) + DamageRegionAppend(&dirty->secondary_dst->drawable, region); #ifdef HAS_DIRTYTRACKING_ROTATION PixmapSyncDirtyHelper(dirty); @@ -640,8 +640,8 @@ redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region) #endif amdgpu_glamor_flush(src_scrn); - if (dirty->slave_dst->master_pixmap) - DamageRegionProcessPending(&dirty->slave_dst->drawable); + if (dirty->secondary_dst->primary_pixmap) + DamageRegionProcessPending(&dirty->secondary_dst->drawable); out: DamageEmpty(dirty->damage); @@ -658,12 +658,12 @@ amdgpu_prime_scanout_update_abort(xf86CrtcPtr crtc, void *event_data) void amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) { - ScreenPtr master_screen = amdgpu_dirty_master(dirty); + ScreenPtr primary_screen = amdgpu_dirty_primary(dirty); PixmapDirtyUpdatePtr ent; RegionPtr region; - xorg_list_for_each_entry(ent, &master_screen->pixmap_dirty_list, ent) { - if (!amdgpu_dirty_src_equals(dirty, ent->slave_dst)) + xorg_list_for_each_entry(ent, &primary_screen->pixmap_dirty_list, ent) { + if (!amdgpu_dirty_src_equals(dirty, ent->secondary_dst)) continue; region = dirty_region(ent); @@ -676,45 +676,45 @@ amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) #if HAS_SYNC_SHARED_PIXMAP static Bool -master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +primary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) { - ScreenPtr master_screen = amdgpu_dirty_master(dirty); + ScreenPtr primary_screen = amdgpu_dirty_primary(dirty); - return master_screen->SyncSharedPixmap != NULL; + return primary_screen->SyncSharedPixmap != NULL; } static Bool -slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +secondary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) { - ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen; + ScreenPtr secondary_screen = dirty->secondary_dst->drawable.pScreen; - return slave_screen->SyncSharedPixmap != NULL; + return secondary_screen->SyncSharedPixmap != NULL; } static void call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) { - ScreenPtr master_screen = amdgpu_dirty_master(dirty); + ScreenPtr primary_screen = amdgpu_dirty_primary(dirty); - master_screen->SyncSharedPixmap(dirty); + primary_screen->SyncSharedPixmap(dirty); } #else /* !HAS_SYNC_SHARED_PIXMAP */ static Bool -master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +primary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) { - ScrnInfoPtr master_scrn = xf86ScreenToScrn(amdgpu_dirty_master(dirty)); + ScrnInfoPtr primary_scrn = xf86ScreenToScrn(amdgpu_dirty_primary(dirty)); - return master_scrn->driverName == scrn->driverName; + return primary_scrn->driverName == scrn->driverName; } static Bool -slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +secondary_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) { - ScrnInfoPtr slave_scrn = xf86ScreenToScrn(dirty->slave_dst->drawable.pScreen); + ScrnInfoPtr secondary_scrn = xf86ScreenToScrn(dirty->secondary_dst->drawable.pScreen); - return slave_scrn->driverName == scrn->driverName; + return secondary_scrn->driverName == scrn->driverName; } static void @@ -729,12 +729,12 @@ call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) static xf86CrtcPtr amdgpu_prime_dirty_to_crtc(PixmapDirtyUpdatePtr dirty) { - ScreenPtr screen = dirty->slave_dst->drawable.pScreen; + ScreenPtr screen = dirty->secondary_dst->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; - /* Find the CRTC which is scanning out from this slave pixmap */ + /* Find the CRTC which is scanning out from this secondary pixmap */ for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr xf86_crtc = xf86_config->crtc[c]; drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; @@ -759,7 +759,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id) if (amdgpu_dirty_src_equals(dirty, drmmode_crtc->prime_scanout_pixmap)) { RegionPtr region; - if (master_has_sync_shared_pixmap(scrn, dirty)) + if (primary_has_sync_shared_pixmap(scrn, dirty)) call_sync_shared_pixmap(dirty); region = dirty_region(dirty); @@ -772,7 +772,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id) amdgpu_glamor_flush(scrn); RegionCopy(&drmmode_crtc->scanout_last_region, region); RegionTranslate(region, -crtc->x, -crtc->y); - dirty->slave_dst = drmmode_crtc->scanout[scanout_id]; + dirty->secondary_dst = drmmode_crtc->scanout[scanout_id]; } redisplay_dirty(dirty, region); @@ -799,7 +799,7 @@ amdgpu_prime_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t u static void amdgpu_prime_scanout_update(PixmapDirtyUpdatePtr dirty) { - ScreenPtr screen = dirty->slave_dst->drawable.pScreen; + ScreenPtr screen = dirty->secondary_dst->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); xf86CrtcPtr xf86_crtc = amdgpu_prime_dirty_to_crtc(dirty); @@ -863,7 +863,7 @@ amdgpu_prime_scanout_update(PixmapDirtyUpdatePtr dirty) static void amdgpu_prime_scanout_flip(PixmapDirtyUpdatePtr ent) { - ScreenPtr screen = ent->slave_dst->drawable.pScreen; + ScreenPtr screen = ent->secondary_dst->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); xf86CrtcPtr crtc = amdgpu_prime_dirty_to_crtc(ent); @@ -938,11 +938,11 @@ amdgpu_dirty_update(ScrnInfoPtr scrn) if (screen->isGPU) { PixmapDirtyUpdatePtr region_ent = ent; - if (master_has_sync_shared_pixmap(scrn, ent)) { - ScreenPtr master_screen = amdgpu_dirty_master(ent); + if (primary_has_sync_shared_pixmap(scrn, ent)) { + ScreenPtr primary_screen = amdgpu_dirty_primary(ent); - xorg_list_for_each_entry(region_ent, &master_screen->pixmap_dirty_list, ent) { - if (amdgpu_dirty_src_equals(ent, region_ent->slave_dst)) + xorg_list_for_each_entry(region_ent, &primary_screen->pixmap_dirty_list, ent) { + if (amdgpu_dirty_src_equals(ent, region_ent->secondary_dst)) break; } } @@ -966,7 +966,7 @@ amdgpu_dirty_update(ScrnInfoPtr scrn) RegionDestroy(region); } else { - if (slave_has_sync_shared_pixmap(scrn, ent)) + if (secondary_has_sync_shared_pixmap(scrn, ent)) continue; region = dirty_region(ent); @@ -1257,7 +1257,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = AMDGPUBlockHandler_KMS; - if (!xf86ScreenToScrn(amdgpu_master_screen(pScreen))->vtSema) + if (!xf86ScreenToScrn(amdgpu_primary_screen(pScreen))->vtSema) return; if (!pScreen->isGPU) @@ -1850,7 +1850,7 @@ CARD32 cleanup_black_fb(OsTimerPtr timer, CARD32 now, pointer data) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; - if (xf86ScreenToScrn(amdgpu_master_screen(screen))->vtSema) + if (xf86ScreenToScrn(amdgpu_primary_screen(screen))->vtSema) return 0; /* Unreference the all-black FB created by AMDGPULeaveVT_KMS. After diff --git a/src/compat-api.h b/src/compat-api.h index a703e5c..aca3b07 100644 --- a/src/compat-api.h +++ b/src/compat-api.h @@ -38,4 +38,10 @@ #define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask #endif +#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2) +#define current_primary current_master +#define primary_pixmap master_pixmap +#define secondary_dst slave_dst +#endif + #endif diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 9c1fcbb..f74106e 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -658,7 +658,7 @@ drmmode_crtc_prime_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode, xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { if (amdgpu_dirty_src_equals(dirty, drmmode_crtc->prime_scanout_pixmap)) { - dirty->slave_dst = + dirty->secondary_dst = drmmode_crtc->scanout[scanout_id]; break; } @@ -1790,7 +1790,7 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { if (amdgpu_dirty_src_equals(dirty, drmmode_crtc->prime_scanout_pixmap)) { - PixmapStopDirtyTracking(dirty->src, dirty->slave_dst); + PixmapStopDirtyTracking(dirty->src, dirty->secondary_dst); break; } } |