xserver/output: rename some badly named variables/APIs.

This is an API and ABI break

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Dave Airlie 2020-07-06 07:00:50 +10:00
parent 15b7738389
commit ea47af87f6
23 changed files with 363 additions and 363 deletions

View File

@ -3860,7 +3860,7 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu)
pScreen->CreateScreenResources = 0; pScreen->CreateScreenResources = 0;
xorg_list_init(&pScreen->pixmap_dirty_list); xorg_list_init(&pScreen->pixmap_dirty_list);
xorg_list_init(&pScreen->slave_list); xorg_list_init(&pScreen->secondary_list);
/* /*
* This loop gets run once for every Screen that gets added, * This loop gets run once for every Screen that gets added,
@ -4028,54 +4028,54 @@ void
AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new) AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new)
{ {
assert(new->isGPU); assert(new->isGPU);
assert(!new->current_master); assert(!new->current_primary);
xorg_list_add(&new->slave_head, &pScreen->slave_list); xorg_list_add(&new->secondary_head, &pScreen->secondary_list);
new->current_master = pScreen; new->current_primary = pScreen;
} }
void void
DetachUnboundGPU(ScreenPtr slave) DetachUnboundGPU(ScreenPtr secondary)
{ {
assert(slave->isGPU); assert(secondary->isGPU);
assert(!slave->is_output_slave); assert(!secondary->is_output_secondary);
assert(!slave->is_offload_slave); assert(!secondary->is_offload_secondary);
xorg_list_del(&slave->slave_head); xorg_list_del(&secondary->secondary_head);
slave->current_master = NULL; secondary->current_primary = NULL;
} }
void void
AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new) AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new)
{ {
assert(new->isGPU); assert(new->isGPU);
assert(!new->is_output_slave); assert(!new->is_output_secondary);
assert(new->current_master == pScreen); assert(new->current_primary == pScreen);
new->is_output_slave = TRUE; new->is_output_secondary = TRUE;
new->current_master->output_slaves++; new->current_primary->output_secondarys++;
} }
void void
DetachOutputGPU(ScreenPtr slave) DetachOutputGPU(ScreenPtr secondary)
{ {
assert(slave->isGPU); assert(secondary->isGPU);
assert(slave->is_output_slave); assert(secondary->is_output_secondary);
slave->current_master->output_slaves--; secondary->current_primary->output_secondarys--;
slave->is_output_slave = FALSE; secondary->is_output_secondary = FALSE;
} }
void void
AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new) AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new)
{ {
assert(new->isGPU); assert(new->isGPU);
assert(!new->is_offload_slave); assert(!new->is_offload_secondary);
assert(new->current_master == pScreen); assert(new->current_primary == pScreen);
new->is_offload_slave = TRUE; new->is_offload_secondary = TRUE;
} }
void void
DetachOffloadGPU(ScreenPtr slave) DetachOffloadGPU(ScreenPtr secondary)
{ {
assert(slave->isGPU); assert(secondary->isGPU);
assert(slave->is_offload_slave); assert(secondary->is_offload_secondary);
slave->is_offload_slave = FALSE; secondary->is_offload_secondary = FALSE;
} }

View File

@ -132,40 +132,40 @@ FreePixmap(PixmapPtr pPixmap)
free(pPixmap); free(pPixmap);
} }
void PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap) void PixmapUnshareSecondaryPixmap(PixmapPtr secondary_pixmap)
{ {
int ihandle = -1; int ihandle = -1;
ScreenPtr pScreen = slave_pixmap->drawable.pScreen; ScreenPtr pScreen = secondary_pixmap->drawable.pScreen;
pScreen->SetSharedPixmapBacking(slave_pixmap, ((void *)(long)ihandle)); pScreen->SetSharedPixmapBacking(secondary_pixmap, ((void *)(long)ihandle));
} }
PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) PixmapPtr PixmapShareToSecondary(PixmapPtr pixmap, ScreenPtr secondary)
{ {
PixmapPtr spix; PixmapPtr spix;
int ret; int ret;
void *handle; void *handle;
ScreenPtr master = pixmap->drawable.pScreen; ScreenPtr primary = pixmap->drawable.pScreen;
int depth = pixmap->drawable.depth; int depth = pixmap->drawable.depth;
ret = master->SharePixmapBacking(pixmap, slave, &handle); ret = primary->SharePixmapBacking(pixmap, secondary, &handle);
if (ret == FALSE) if (ret == FALSE)
return NULL; return NULL;
spix = slave->CreatePixmap(slave, 0, 0, depth, spix = secondary->CreatePixmap(secondary, 0, 0, depth,
CREATE_PIXMAP_USAGE_SHARED); CREATE_PIXMAP_USAGE_SHARED);
slave->ModifyPixmapHeader(spix, pixmap->drawable.width, secondary->ModifyPixmapHeader(spix, pixmap->drawable.width,
pixmap->drawable.height, depth, 0, pixmap->drawable.height, depth, 0,
pixmap->devKind, NULL); pixmap->devKind, NULL);
/* have the slave pixmap take a reference on the master pixmap /* have the secondary pixmap take a reference on the primary pixmap
later we destroy them both at the same time */ later we destroy them both at the same time */
pixmap->refcnt++; pixmap->refcnt++;
spix->master_pixmap = pixmap; spix->primary_pixmap = pixmap;
ret = slave->SetSharedPixmapBacking(spix, handle); ret = secondary->SetSharedPixmapBacking(spix, handle);
if (ret == FALSE) { if (ret == FALSE) {
slave->DestroyPixmap(spix); secondary->DestroyPixmap(spix);
return NULL; return NULL;
} }
@ -182,7 +182,7 @@ PixmapDirtyDamageDestroy(DamagePtr damage, void *closure)
Bool Bool
PixmapStartDirtyTracking(DrawablePtr src, PixmapStartDirtyTracking(DrawablePtr src,
PixmapPtr slave_dst, PixmapPtr secondary_dst,
int x, int y, int dst_x, int dst_y, int x, int y, int dst_x, int dst_y,
Rotation rotation) Rotation rotation)
{ {
@ -197,7 +197,7 @@ PixmapStartDirtyTracking(DrawablePtr src,
return FALSE; return FALSE;
dirty_update->src = src; dirty_update->src = src;
dirty_update->slave_dst = slave_dst; dirty_update->secondary_dst = secondary_dst;
dirty_update->x = x; dirty_update->x = x;
dirty_update->y = y; dirty_update->y = y;
dirty_update->dst_x = dst_x; dirty_update->dst_x = dst_x;
@ -209,8 +209,8 @@ PixmapStartDirtyTracking(DrawablePtr src,
if (rotation != RR_Rotate_0) { if (rotation != RR_Rotate_0) {
RRTransformCompute(x, y, RRTransformCompute(x, y,
slave_dst->drawable.width, secondary_dst->drawable.width,
slave_dst->drawable.height, secondary_dst->drawable.height,
rotation, rotation,
NULL, NULL,
&dirty_update->transform, &dirty_update->transform,
@ -229,11 +229,11 @@ PixmapStartDirtyTracking(DrawablePtr src,
box.y1 = dirty_update->y; box.y1 = dirty_update->y;
if (dirty_update->rotation == RR_Rotate_90 || if (dirty_update->rotation == RR_Rotate_90 ||
dirty_update->rotation == RR_Rotate_270) { dirty_update->rotation == RR_Rotate_270) {
box.x2 = dirty_update->x + slave_dst->drawable.height; box.x2 = dirty_update->x + secondary_dst->drawable.height;
box.y2 = dirty_update->y + slave_dst->drawable.width; box.y2 = dirty_update->y + secondary_dst->drawable.width;
} else { } else {
box.x2 = dirty_update->x + slave_dst->drawable.width; box.x2 = dirty_update->x + secondary_dst->drawable.width;
box.y2 = dirty_update->y + slave_dst->drawable.height; box.y2 = dirty_update->y + secondary_dst->drawable.height;
} }
RegionInit(&dstregion, &box, 1); RegionInit(&dstregion, &box, 1);
damageregion = DamageRegion(dirty_update->damage); damageregion = DamageRegion(dirty_update->damage);
@ -246,13 +246,13 @@ PixmapStartDirtyTracking(DrawablePtr src,
} }
Bool Bool
PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr slave_dst) PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr secondary_dst)
{ {
ScreenPtr screen = src->pScreen; ScreenPtr screen = src->pScreen;
PixmapDirtyUpdatePtr ent, safe; PixmapDirtyUpdatePtr ent, safe;
xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) {
if (ent->src == src && ent->slave_dst == slave_dst) { if (ent->src == src && ent->secondary_dst == secondary_dst) {
if (ent->damage) if (ent->damage)
DamageDestroy(ent->damage); DamageDestroy(ent->damage);
xorg_list_del(&ent->ent); xorg_list_del(&ent->ent);
@ -372,9 +372,9 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty)
RegionRec pixregion; RegionRec pixregion;
BoxRec box; BoxRec box;
dst = dirty->slave_dst->master_pixmap; dst = dirty->secondary_dst->primary_pixmap;
if (!dst) if (!dst)
dst = dirty->slave_dst; dst = dirty->secondary_dst;
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;

View File

@ -68,7 +68,7 @@ fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
pPixmap->devKind = paddedWidth; pPixmap->devKind = paddedWidth;
pPixmap->refcnt = 1; pPixmap->refcnt = 1;
pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap + base + adjust); pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap + base + adjust);
pPixmap->master_pixmap = NULL; pPixmap->primary_pixmap = NULL;
#ifdef FB_DEBUG #ifdef FB_DEBUG
pPixmap->devPrivate.ptr = pPixmap->devPrivate.ptr =

View File

@ -98,7 +98,7 @@ typedef struct _DRI2Drawable {
unsigned blocked[3]; unsigned blocked[3];
Bool needInvalidate; Bool needInvalidate;
int prime_id; int prime_id;
PixmapPtr prime_slave_pixmap; PixmapPtr prime_secondary_pixmap;
PixmapPtr redirectpixmap; PixmapPtr redirectpixmap;
} DRI2DrawableRec, *DRI2DrawablePtr; } DRI2DrawableRec, *DRI2DrawablePtr;
@ -181,33 +181,33 @@ DRI2GetScreen(ScreenPtr pScreen)
} }
static ScreenPtr static ScreenPtr
GetScreenPrime(ScreenPtr master, int prime_id) GetScreenPrime(ScreenPtr primary, int prime_id)
{ {
ScreenPtr slave; ScreenPtr secondary;
if (prime_id == 0) { if (prime_id == 0) {
return master; return primary;
} }
xorg_list_for_each_entry(slave, &master->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &primary->secondary_list, secondary_head) {
DRI2ScreenPtr ds; DRI2ScreenPtr ds;
if (!slave->is_offload_slave) if (!secondary->is_offload_secondary)
continue; continue;
ds = DRI2GetScreen(slave); ds = DRI2GetScreen(secondary);
if (ds == NULL) if (ds == NULL)
continue; continue;
if (ds->prime_id == prime_id) if (ds->prime_id == prime_id)
return slave; return secondary;
} }
return master; return primary;
} }
static DRI2ScreenPtr static DRI2ScreenPtr
DRI2GetScreenPrime(ScreenPtr master, int prime_id) DRI2GetScreenPrime(ScreenPtr primary, int prime_id)
{ {
ScreenPtr slave = GetScreenPrime(master, prime_id); ScreenPtr secondary = GetScreenPrime(primary, prime_id);
return DRI2GetScreen(slave); return DRI2GetScreen(secondary);
} }
static DRI2DrawablePtr static DRI2DrawablePtr
@ -262,7 +262,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
xorg_list_init(&pPriv->reference_list); xorg_list_init(&pPriv->reference_list);
pPriv->needInvalidate = FALSE; pPriv->needInvalidate = FALSE;
pPriv->redirectpixmap = NULL; pPriv->redirectpixmap = NULL;
pPriv->prime_slave_pixmap = NULL; pPriv->prime_secondary_pixmap = NULL;
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
pWin = (WindowPtr) pDraw; pWin = (WindowPtr) pDraw;
dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv);
@ -427,9 +427,9 @@ DRI2DrawableGone(void *p, XID id)
dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL); dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL);
} }
if (pPriv->prime_slave_pixmap) { if (pPriv->prime_secondary_pixmap) {
(*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); (*pPriv->prime_secondary_pixmap->primary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap->primary_pixmap);
(*pPriv->prime_slave_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap); (*pPriv->prime_secondary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap);
} }
if (pPriv->buffers != NULL) { if (pPriv->buffers != NULL) {
@ -815,10 +815,10 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
PixmapPtr spix; PixmapPtr spix;
PixmapPtr mpix = GetDrawablePixmap(pDraw); PixmapPtr mpix = GetDrawablePixmap(pDraw);
ScreenPtr master, slave; ScreenPtr primary, secondary;
Bool ret; Bool ret;
master = mpix->drawable.pScreen; primary = mpix->drawable.pScreen;
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr)pDraw; WindowPtr pWin = (WindowPtr)pDraw;
@ -831,15 +831,15 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
pPriv->redirectpixmap->drawable.depth == pDraw->depth) { pPriv->redirectpixmap->drawable.depth == pDraw->depth) {
mpix = pPriv->redirectpixmap; mpix = pPriv->redirectpixmap;
} else { } else {
if (master->ReplaceScanoutPixmap) { if (primary->ReplaceScanoutPixmap) {
mpix = (*master->CreatePixmap)(master, pDraw->width, pDraw->height, mpix = (*primary->CreatePixmap)(primary, pDraw->width, pDraw->height,
pDraw->depth, CREATE_PIXMAP_USAGE_SHARED); pDraw->depth, CREATE_PIXMAP_USAGE_SHARED);
if (!mpix) if (!mpix)
return NULL; return NULL;
ret = (*master->ReplaceScanoutPixmap)(pDraw, mpix, TRUE); ret = (*primary->ReplaceScanoutPixmap)(pDraw, mpix, TRUE);
if (ret == FALSE) { if (ret == FALSE) {
(*master->DestroyPixmap)(mpix); (*primary->DestroyPixmap)(mpix);
return NULL; return NULL;
} }
pPriv->redirectpixmap = mpix; pPriv->redirectpixmap = mpix;
@ -847,31 +847,31 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
return NULL; return NULL;
} }
} else if (pPriv->redirectpixmap) { } else if (pPriv->redirectpixmap) {
(*master->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE); (*primary->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE);
(*master->DestroyPixmap)(pPriv->redirectpixmap); (*primary->DestroyPixmap)(pPriv->redirectpixmap);
pPriv->redirectpixmap = NULL; pPriv->redirectpixmap = NULL;
} }
} }
slave = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); secondary = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
/* check if the pixmap is still fine */ /* check if the pixmap is still fine */
if (pPriv->prime_slave_pixmap) { if (pPriv->prime_secondary_pixmap) {
if (pPriv->prime_slave_pixmap->master_pixmap == mpix) if (pPriv->prime_secondary_pixmap->primary_pixmap == mpix)
return &pPriv->prime_slave_pixmap->drawable; return &pPriv->prime_secondary_pixmap->drawable;
else { else {
PixmapUnshareSlavePixmap(pPriv->prime_slave_pixmap); PixmapUnshareSecondaryPixmap(pPriv->prime_secondary_pixmap);
(*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); (*pPriv->prime_secondary_pixmap->primary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap->primary_pixmap);
(*slave->DestroyPixmap)(pPriv->prime_slave_pixmap); (*secondary->DestroyPixmap)(pPriv->prime_secondary_pixmap);
pPriv->prime_slave_pixmap = NULL; pPriv->prime_secondary_pixmap = NULL;
} }
} }
spix = PixmapShareToSlave(mpix, slave); spix = PixmapShareToSecondary(mpix, secondary);
if (!spix) if (!spix)
return NULL; return NULL;
pPriv->prime_slave_pixmap = spix; pPriv->prime_secondary_pixmap = spix;
#ifdef COMPOSITE #ifdef COMPOSITE
spix->screen_x = mpix->screen_x; spix->screen_x = mpix->screen_x;
spix->screen_y = mpix->screen_y; spix->screen_y = mpix->screen_y;

View File

@ -569,14 +569,14 @@ dispatch_dirty_pixmap(ScrnInfoPtr scrn, xf86CrtcPtr crtc, PixmapPtr ppix)
{ {
modesettingPtr ms = modesettingPTR(scrn); modesettingPtr ms = modesettingPTR(scrn);
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix); msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix);
DamagePtr damage = ppriv->slave_damage; DamagePtr damage = ppriv->secondary_damage;
int fb_id = ppriv->fb_id; int fb_id = ppriv->fb_id;
dispatch_dirty_region(scrn, ppix, damage, fb_id); dispatch_dirty_region(scrn, ppix, damage, fb_id);
} }
static void static void
dispatch_slave_dirty(ScreenPtr pScreen) dispatch_secondary_dirty(ScreenPtr pScreen)
{ {
ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@ -601,28 +601,28 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout)
{ {
RegionRec pixregion; RegionRec pixregion;
PixmapRegionInit(&pixregion, dirty->slave_dst); PixmapRegionInit(&pixregion, dirty->secondary_dst);
DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); DamageRegionAppend(&dirty->secondary_dst->drawable, &pixregion);
PixmapSyncDirtyHelper(dirty); PixmapSyncDirtyHelper(dirty);
if (!screen->isGPU) { if (!screen->isGPU) {
#ifdef GLAMOR_HAS_GBM #ifdef GLAMOR_HAS_GBM
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen)); modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
/* /*
* When copying from the master framebuffer to the shared pixmap, * When copying from the primary framebuffer to the shared pixmap,
* we must ensure the copy is complete before the slave starts a * we must ensure the copy is complete before the secondary starts a
* copy to its own framebuffer (some slaves scanout directly from * copy to its own framebuffer (some secondarys scanout directly from
* the shared pixmap, but not all). * the shared pixmap, but not all).
*/ */
if (ms->drmmode.glamor) if (ms->drmmode.glamor)
ms->glamor.finish(screen); ms->glamor.finish(screen);
#endif #endif
/* Ensure the slave processes the damage immediately */ /* Ensure the secondary processes the damage immediately */
if (timeout) if (timeout)
*timeout = 0; *timeout = 0;
} }
DamageRegionProcessPending(&dirty->slave_dst->drawable); DamageRegionProcessPending(&dirty->secondary_dst->drawable);
RegionUninit(&pixregion); RegionUninit(&pixregion);
} }
@ -642,13 +642,13 @@ ms_dirty_update(ScreenPtr screen, int *timeout)
if (RegionNotEmpty(region)) { if (RegionNotEmpty(region)) {
if (!screen->isGPU) { if (!screen->isGPU) {
msPixmapPrivPtr ppriv = msPixmapPrivPtr ppriv =
msGetPixmapPriv(&ms->drmmode, ent->slave_dst->master_pixmap); msGetPixmapPriv(&ms->drmmode, ent->secondary_dst->primary_pixmap);
if (ppriv->notify_on_damage) { if (ppriv->notify_on_damage) {
ppriv->notify_on_damage = FALSE; ppriv->notify_on_damage = FALSE;
ent->slave_dst->drawable.pScreen-> ent->secondary_dst->drawable.pScreen->
SharedPixmapNotifyDamage(ent->slave_dst); SharedPixmapNotifyDamage(ent->secondary_dst);
} }
/* Requested manual updating */ /* Requested manual updating */
@ -663,7 +663,7 @@ ms_dirty_update(ScreenPtr screen, int *timeout)
} }
static PixmapDirtyUpdatePtr static PixmapDirtyUpdatePtr
ms_dirty_get_ent(ScreenPtr screen, PixmapPtr slave_dst) ms_dirty_get_ent(ScreenPtr screen, PixmapPtr secondary_dst)
{ {
PixmapDirtyUpdatePtr ent; PixmapDirtyUpdatePtr ent;
@ -671,7 +671,7 @@ ms_dirty_get_ent(ScreenPtr screen, PixmapPtr slave_dst)
return NULL; return NULL;
xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
if (ent->slave_dst == slave_dst) if (ent->secondary_dst == secondary_dst)
return ent; return ent;
} }
@ -688,7 +688,7 @@ msBlockHandler(ScreenPtr pScreen, void *timeout)
ms->BlockHandler = pScreen->BlockHandler; ms->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = msBlockHandler; pScreen->BlockHandler = msBlockHandler;
if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode) if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode)
dispatch_slave_dirty(pScreen); dispatch_secondary_dirty(pScreen);
else if (ms->dirty_enabled) else if (ms->dirty_enabled)
dispatch_dirty(pScreen); dispatch_dirty(pScreen);
@ -1291,32 +1291,32 @@ msDisableSharedPixmapFlipping(RRCrtcPtr crtc)
static Bool static Bool
msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src, msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src,
PixmapPtr slave_dst1, PixmapPtr slave_dst2, PixmapPtr secondary_dst1, PixmapPtr secondary_dst2,
int x, int y, int dst_x, int dst_y, int x, int y, int dst_x, int dst_y,
Rotation rotation) Rotation rotation)
{ {
ScreenPtr pScreen = src->pScreen; ScreenPtr pScreen = src->pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap), msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, secondary_dst1->primary_pixmap),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap); ppriv2 = msGetPixmapPriv(&ms->drmmode, secondary_dst2->primary_pixmap);
if (!PixmapStartDirtyTracking(src, slave_dst1, x, y, if (!PixmapStartDirtyTracking(src, secondary_dst1, x, y,
dst_x, dst_y, rotation)) { dst_x, dst_y, rotation)) {
return FALSE; return FALSE;
} }
if (!PixmapStartDirtyTracking(src, slave_dst2, x, y, if (!PixmapStartDirtyTracking(src, secondary_dst2, x, y,
dst_x, dst_y, rotation)) { dst_x, dst_y, rotation)) {
PixmapStopDirtyTracking(src, slave_dst1); PixmapStopDirtyTracking(src, secondary_dst1);
return FALSE; return FALSE;
} }
ppriv1->slave_src = src; ppriv1->secondary_src = src;
ppriv2->slave_src = src; ppriv2->secondary_src = src;
ppriv1->dirty = ms_dirty_get_ent(pScreen, slave_dst1); ppriv1->dirty = ms_dirty_get_ent(pScreen, secondary_dst1);
ppriv2->dirty = ms_dirty_get_ent(pScreen, slave_dst2); ppriv2->dirty = ms_dirty_get_ent(pScreen, secondary_dst2);
ppriv1->defer_dirty_update = TRUE; ppriv1->defer_dirty_update = TRUE;
ppriv2->defer_dirty_update = TRUE; ppriv2->defer_dirty_update = TRUE;
@ -1325,17 +1325,17 @@ msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src,
} }
static Bool static Bool
msPresentSharedPixmap(PixmapPtr slave_dst) msPresentSharedPixmap(PixmapPtr secondary_dst)
{ {
ScreenPtr pScreen = slave_dst->master_pixmap->drawable.pScreen; ScreenPtr pScreen = secondary_dst->primary_pixmap->drawable.pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst->master_pixmap); msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, secondary_dst->primary_pixmap);
RegionPtr region = DamageRegion(ppriv->dirty->damage); RegionPtr region = DamageRegion(ppriv->dirty->damage);
if (RegionNotEmpty(region)) { if (RegionNotEmpty(region)) {
redisplay_dirty(ppriv->slave_src->pScreen, ppriv->dirty, NULL); redisplay_dirty(ppriv->secondary_src->pScreen, ppriv->dirty, NULL);
DamageEmpty(ppriv->dirty->damage); DamageEmpty(ppriv->dirty->damage);
return TRUE; return TRUE;
@ -1346,22 +1346,22 @@ msPresentSharedPixmap(PixmapPtr slave_dst)
static Bool static Bool
msStopFlippingPixmapTracking(DrawablePtr src, msStopFlippingPixmapTracking(DrawablePtr src,
PixmapPtr slave_dst1, PixmapPtr slave_dst2) PixmapPtr secondary_dst1, PixmapPtr secondary_dst2)
{ {
ScreenPtr pScreen = src->pScreen; ScreenPtr pScreen = src->pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen)); modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap), msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, secondary_dst1->primary_pixmap),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap); ppriv2 = msGetPixmapPriv(&ms->drmmode, secondary_dst2->primary_pixmap);
Bool ret = TRUE; Bool ret = TRUE;
ret &= PixmapStopDirtyTracking(src, slave_dst1); ret &= PixmapStopDirtyTracking(src, secondary_dst1);
ret &= PixmapStopDirtyTracking(src, slave_dst2); ret &= PixmapStopDirtyTracking(src, secondary_dst2);
if (ret) { if (ret) {
ppriv1->slave_src = NULL; ppriv1->secondary_src = NULL;
ppriv2->slave_src = NULL; ppriv2->secondary_src = NULL;
ppriv1->dirty = NULL; ppriv1->dirty = NULL;
ppriv2->dirty = NULL; ppriv2->dirty = NULL;
@ -1455,7 +1455,7 @@ CreateScreenResources(ScreenPtr pScreen)
} }
static Bool static Bool
msSharePixmapBacking(PixmapPtr ppix, ScreenPtr slave, void **handle) msSharePixmapBacking(PixmapPtr ppix, ScreenPtr secondary, void **handle)
{ {
#ifdef GLAMOR_HAS_GBM #ifdef GLAMOR_HAS_GBM
modesettingPtr ms = modesettingPtr ms =
@ -1515,7 +1515,7 @@ msRequestSharedPixmapNotifyDamage(PixmapPtr ppix)
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn); modesettingPtr ms = modesettingPTR(scrn);
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix->master_pixmap); msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix->primary_pixmap);
ppriv->notify_on_damage = TRUE; ppriv->notify_on_damage = TRUE;
@ -1548,7 +1548,7 @@ msSharedPixmapNotifyDamage(PixmapPtr ppix)
if (!(drmmode_crtc->prime_pixmap && drmmode_crtc->prime_pixmap_back)) if (!(drmmode_crtc->prime_pixmap && drmmode_crtc->prime_pixmap_back))
continue; continue;
// Received damage on master screen pixmap, schedule present on vblank // Received damage on primary screen pixmap, schedule present on vblank
ret |= drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, &ms->drmmode); ret |= drmmode_SharedPixmapPresentOnVBlank(ppix, crtc, &ms->drmmode);
} }

View File

@ -1089,9 +1089,9 @@ static Bool
drmmode_SharedPixmapPresent(PixmapPtr ppix, xf86CrtcPtr crtc, drmmode_SharedPixmapPresent(PixmapPtr ppix, xf86CrtcPtr crtc,
drmmode_ptr drmmode) drmmode_ptr drmmode)
{ {
ScreenPtr master = crtc->randr_crtc->pScreen->current_master; ScreenPtr primary = crtc->randr_crtc->pScreen->current_primary;
if (master->PresentSharedPixmap(ppix)) { if (primary->PresentSharedPixmap(ppix)) {
/* Success, queue flip to back target */ /* Success, queue flip to back target */
if (drmmode_SharedPixmapFlip(ppix, crtc, drmmode)) if (drmmode_SharedPixmapFlip(ppix, crtc, drmmode))
return TRUE; return TRUE;
@ -1103,13 +1103,13 @@ drmmode_SharedPixmapPresent(PixmapPtr ppix, xf86CrtcPtr crtc,
} }
/* Failed to present, try again on next vblank after damage */ /* Failed to present, try again on next vblank after damage */
if (master->RequestSharedPixmapNotifyDamage) { if (primary->RequestSharedPixmapNotifyDamage) {
msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix); msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix);
/* Set flag first in case we are immediately notified */ /* Set flag first in case we are immediately notified */
ppriv->wait_for_damage = TRUE; ppriv->wait_for_damage = TRUE;
if (master->RequestSharedPixmapNotifyDamage(ppix)) if (primary->RequestSharedPixmapNotifyDamage(ppix))
return TRUE; return TRUE;
else else
ppriv->wait_for_damage = FALSE; ppriv->wait_for_damage = FALSE;
@ -1750,9 +1750,9 @@ drmmode_set_target_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix,
ppriv = msGetPixmapPriv(drmmode, *target); ppriv = msGetPixmapPriv(drmmode, *target);
drmModeRmFB(drmmode->fd, ppriv->fb_id); drmModeRmFB(drmmode->fd, ppriv->fb_id);
ppriv->fb_id = 0; ppriv->fb_id = 0;
if (ppriv->slave_damage) { if (ppriv->secondary_damage) {
DamageUnregister(ppriv->slave_damage); DamageUnregister(ppriv->secondary_damage);
ppriv->slave_damage = NULL; ppriv->secondary_damage = NULL;
} }
*target = NULL; *target = NULL;
} }
@ -1761,16 +1761,16 @@ drmmode_set_target_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix,
return TRUE; return TRUE;
ppriv = msGetPixmapPriv(drmmode, ppix); ppriv = msGetPixmapPriv(drmmode, ppix);
if (!ppriv->slave_damage) { if (!ppriv->secondary_damage) {
ppriv->slave_damage = DamageCreate(NULL, NULL, ppriv->secondary_damage = DamageCreate(NULL, NULL,
DamageReportNone, DamageReportNone,
TRUE, TRUE,
crtc->randr_crtc->pScreen, crtc->randr_crtc->pScreen,
NULL); NULL);
} }
ptr = drmmode_map_slave_bo(drmmode, ppriv); ptr = drmmode_map_secondary_bo(drmmode, ppriv);
ppix->devPrivate.ptr = ptr; ppix->devPrivate.ptr = ptr;
DamageRegister(&ppix->drawable, ppriv->slave_damage); DamageRegister(&ppix->drawable, ppriv->secondary_damage);
if (ppriv->fb_id == 0) { if (ppriv->fb_id == 0) {
drmModeAddFB(drmmode->fd, ppix->drawable.width, drmModeAddFB(drmmode->fd, ppix->drawable.width,
@ -3862,7 +3862,7 @@ drmmode_map_front_bo(drmmode_ptr drmmode)
} }
void * void *
drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv) drmmode_map_secondary_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv)
{ {
int ret; int ret;

View File

@ -227,7 +227,7 @@ typedef struct _msPixmapPriv {
uint32_t fb_id; uint32_t fb_id;
struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */ struct dumb_bo *backing_bo; /* if this pixmap is backed by a dumb bo */
DamagePtr slave_damage; DamagePtr secondary_damage;
/** Sink fields for flipping shared pixmaps */ /** Sink fields for flipping shared pixmaps */
int flip_seq; /* seq of current page flip event handler */ int flip_seq; /* seq of current page flip event handler */
@ -236,7 +236,7 @@ typedef struct _msPixmapPriv {
/** Source fields for flipping shared pixmaps */ /** Source fields for flipping shared pixmaps */
Bool defer_dirty_update; /* if we want to manually update */ Bool defer_dirty_update; /* if we want to manually update */
PixmapDirtyUpdatePtr dirty; /* cached dirty ent to avoid searching list */ PixmapDirtyUpdatePtr dirty; /* cached dirty ent to avoid searching list */
DrawablePtr slave_src; /* if we exported shared pixmap, dirty tracking src */ DrawablePtr secondary_src; /* if we exported shared pixmap, dirty tracking src */
Bool notify_on_damage; /* if sink has requested damage notification */ Bool notify_on_damage; /* if sink has requested damage notification */
} msPixmapPrivRec, *msPixmapPrivPtr; } msPixmapPrivRec, *msPixmapPrivPtr;
@ -259,7 +259,7 @@ int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo);
uint32_t drmmode_bo_get_pitch(drmmode_bo *bo); uint32_t drmmode_bo_get_pitch(drmmode_bo *bo);
uint32_t drmmode_bo_get_handle(drmmode_bo *bo); uint32_t drmmode_bo_get_handle(drmmode_bo *bo);
Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode); Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode);
void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv); void *drmmode_map_secondary_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv);
Bool drmmode_SetSlaveBO(PixmapPtr ppix, Bool drmmode_SetSlaveBO(PixmapPtr ppix,
drmmode_ptr drmmode, drmmode_ptr drmmode,
int fd_handle, int pitch, int size); int fd_handle, int pitch, int size);

View File

@ -115,7 +115,7 @@ ms_crtc_on(xf86CrtcPtr crtc)
/* /*
* Return the first output which is connected to an active CRTC on this screen. * Return the first output which is connected to an active CRTC on this screen.
* *
* RRFirstOutput() will return an output from a slave screen if it is primary, * RRFirstOutput() will return an output from a secondary screen if it is primary,
* which is not the behavior that ms_covering_crtc() wants. * which is not the behavior that ms_covering_crtc() wants.
*/ */
@ -188,10 +188,10 @@ ms_covering_xf86_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
} }
} }
/* Fallback to primary crtc for drawable's on slave outputs */ /* Fallback to primary crtc for drawable's on secondary outputs */
if (best_crtc == NULL && !pScreen->isGPU) { if (best_crtc == NULL && !pScreen->isGPU) {
RROutputPtr primary_output = NULL; RROutputPtr primary_output = NULL;
ScreenPtr slave; ScreenPtr secondary;
if (dixPrivateKeyRegistered(rrPrivKey)) if (dixPrivateKeyRegistered(rrPrivKey))
primary_output = ms_first_output(scrn->pScreen); primary_output = ms_first_output(scrn->pScreen);
@ -202,12 +202,12 @@ ms_covering_xf86_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
if (!ms_crtc_on(crtc)) if (!ms_crtc_on(crtc))
return NULL; return NULL;
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
if (ms_covering_xf86_crtc(slave, box, FALSE)) { if (ms_covering_xf86_crtc(secondary, box, FALSE)) {
/* The drawable is on a slave output, return primary crtc */ /* The drawable is on a secondary output, return primary crtc */
return crtc; return crtc;
} }
} }
@ -260,10 +260,10 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
} }
} }
/* Fallback to primary crtc for drawable's on slave outputs */ /* Fallback to primary crtc for drawable's on secondary outputs */
if (best_crtc == NULL && !pScreen->isGPU) { if (best_crtc == NULL && !pScreen->isGPU) {
RROutputPtr primary_output = NULL; RROutputPtr primary_output = NULL;
ScreenPtr slave; ScreenPtr secondary;
if (dixPrivateKeyRegistered(rrPrivKey)) if (dixPrivateKeyRegistered(rrPrivKey))
primary_output = ms_first_output(scrn->pScreen); primary_output = ms_first_output(scrn->pScreen);
@ -274,12 +274,12 @@ ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
if (!ms_crtc_on((xf86CrtcPtr) crtc->devPrivate)) if (!ms_crtc_on((xf86CrtcPtr) crtc->devPrivate))
return NULL; return NULL;
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
if (ms_covering_randr_crtc(slave, box, FALSE)) { if (ms_covering_randr_crtc(secondary, box, FALSE)) {
/* The drawable is on a slave output, return primary crtc */ /* The drawable is on a secondary output, return primary crtc */
return crtc; return crtc;
} }
} }

View File

@ -3110,7 +3110,7 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
pScrn->ModeSet(pScrn); pScrn->ModeSet(pScrn);
if (pScrn->pScreen) { if (pScrn->pScreen) {
if (pScrn->pScreen->isGPU) if (pScrn->pScreen->isGPU)
xf86CursorResetCursor(pScrn->pScreen->current_master); xf86CursorResetCursor(pScrn->pScreen->current_primary);
else else
xf86CursorResetCursor(pScrn->pScreen); xf86CursorResetCursor(pScrn->pScreen);
} }

View File

@ -2183,7 +2183,7 @@ xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider)
config->randr_provider->output_source = NULL; config->randr_provider->output_source = NULL;
RRSetChanged(screen); RRSetChanged(screen);
} }
if (screen->current_master) if (screen->current_primary)
DetachUnboundGPU(screen); DetachUnboundGPU(screen);
} }
config->randr_provider = NULL; config->randr_provider = NULL;

View File

@ -315,8 +315,8 @@ xf86CrtcFitsScreen(xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb)
*/ */
if (pScrn->is_gpu) { if (pScrn->is_gpu) {
ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
if (pScreen->current_master) if (pScreen->current_primary)
pScrn = xf86ScreenToScrn(pScreen->current_master); pScrn = xf86ScreenToScrn(pScreen->current_primary);
} }
if (pScrn->virtualX == 0 || pScrn->virtualY == 0) if (pScrn->virtualX == 0 || pScrn->virtualY == 0)

View File

@ -461,8 +461,8 @@ xf86CurrentCursor(ScreenPtr pScreen)
{ {
xf86CursorScreenPtr ScreenPriv; xf86CursorScreenPtr ScreenPriv;
if (pScreen->is_output_slave) if (pScreen->is_output_secondary)
pScreen = pScreen->current_master; pScreen = pScreen->current_primary;
ScreenPriv = dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); ScreenPriv = dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey);
return ScreenPriv->CurrentCursor; return ScreenPriv->CurrentCursor;

View File

@ -150,7 +150,7 @@ xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr
} }
/* ask each driver consuming a pixmap if it can support HW cursor */ /* ask each driver consuming a pixmap if it can support HW cursor */
xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(pSlave, &pScreen->secondary_list, secondary_head) {
xf86CursorScreenPtr sPriv; xf86CursorScreenPtr sPriv;
if (!RRHasScanoutPixmap(pSlave)) if (!RRHasScanoutPixmap(pSlave))
@ -162,7 +162,7 @@ xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr
break; break;
} }
/* FALSE if HWCursor not supported by slave */ /* FALSE if HWCursor not supported by secondary */
if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) { if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) {
use_hw_cursor = FALSE; use_hw_cursor = FALSE;
break; break;
@ -252,14 +252,14 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
if (!xf86ScreenSetCursor(pScreen, pCurs, x, y)) if (!xf86ScreenSetCursor(pScreen, pCurs, x, y))
goto out; goto out;
/* ask each slave driver to set the cursor. */ /* ask each secondary driver to set the cursor. */
xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(pSlave, &pScreen->secondary_list, secondary_head) {
if (!RRHasScanoutPixmap(pSlave)) if (!RRHasScanoutPixmap(pSlave))
continue; continue;
if (!xf86ScreenSetCursor(pSlave, pCurs, x, y)) { if (!xf86ScreenSetCursor(pSlave, pCurs, x, y)) {
/* /*
* hide the master (and successfully set slave) cursors, * hide the primary (and successfully set secondary) cursors,
* otherwise both the hw and sw cursor will show. * otherwise both the hw and sw cursor will show.
*/ */
xf86SetCursor(pScreen, NullCursor, x, y); xf86SetCursor(pScreen, NullCursor, x, y);
@ -328,8 +328,8 @@ xf86MoveCursor(ScreenPtr pScreen, int x, int y)
xf86ScreenMoveCursor(pScreen, x, y); xf86ScreenMoveCursor(pScreen, x, y);
/* ask each slave driver to move the cursor */ /* ask each secondary driver to move the cursor */
xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(pSlave, &pScreen->secondary_list, secondary_head) {
if (!RRHasScanoutPixmap(pSlave)) if (!RRHasScanoutPixmap(pSlave))
continue; continue;

View File

@ -113,10 +113,10 @@ extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ ,
extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ ); extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
extern _X_EXPORT PixmapPtr extern _X_EXPORT PixmapPtr
PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave); PixmapShareToSecondary(PixmapPtr pixmap, ScreenPtr secondary);
extern _X_EXPORT void extern _X_EXPORT void
PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap); PixmapUnshareSecondaryPixmap(PixmapPtr secondary_pixmap);
#define HAS_DIRTYTRACKING_ROTATION 1 #define HAS_DIRTYTRACKING_ROTATION 1
#define HAS_DIRTYTRACKING_DRAWABLE_SRC 1 #define HAS_DIRTYTRACKING_DRAWABLE_SRC 1

View File

@ -84,12 +84,12 @@ typedef struct _Pixmap {
#endif #endif
unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */ unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */
PixmapPtr master_pixmap; /* pointer to master copy of pixmap for pixmap sharing */ PixmapPtr primary_pixmap; /* pointer to primary copy of pixmap for pixmap sharing */
} PixmapRec; } PixmapRec;
typedef struct _PixmapDirtyUpdate { typedef struct _PixmapDirtyUpdate {
DrawablePtr src; /* Root window / shared pixmap */ DrawablePtr src; /* Root window / shared pixmap */
PixmapPtr slave_dst; /* Shared / scanout pixmap */ PixmapPtr secondary_dst; /* Shared / scanout pixmap */
int x, y; int x, y;
DamagePtr damage; DamagePtr damage;
struct xorg_list ent; struct xorg_list ent;

View File

@ -362,17 +362,17 @@ typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
#define HAS_SYNC_SHARED_PIXMAP 1 #define HAS_SYNC_SHARED_PIXMAP 1
/* The SyncSharedPixmap hook has two purposes: /* The SyncSharedPixmap hook has two purposes:
* *
* 1. If the master driver has it, the slave driver can use it to * 1. If the primary driver has it, the secondary driver can use it to
* synchronize the shared pixmap contents with the screen pixmap. * synchronize the shared pixmap contents with the screen pixmap.
* 2. If the slave driver has it, the master driver can expect the slave * 2. If the secondary driver has it, the primary driver can expect the secondary
* driver to call the master screen's SyncSharedPixmap hook, so the master * driver to call the primary screen's SyncSharedPixmap hook, so the primary
* driver doesn't have to synchronize the shared pixmap contents itself, * driver doesn't have to synchronize the shared pixmap contents itself,
* e.g. from the BlockHandler. * e.g. from the BlockHandler.
* *
* A driver must only set the hook if it handles both cases correctly. * A driver must only set the hook if it handles both cases correctly.
* *
* The argument is the slave screen's pixmap_dirty_list entry, the hook is * The argument is the secondary screen's pixmap_dirty_list entry, the hook is
* responsible for finding the corresponding entry in the master screen's * responsible for finding the corresponding entry in the primary screen's
* pixmap_dirty_list. * pixmap_dirty_list.
*/ */
typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr); typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr);
@ -634,14 +634,14 @@ typedef struct _Screen {
Bool isGPU; Bool isGPU;
/* Info on this screen's slaves (if any) */ /* Info on this screen's secondarys (if any) */
struct xorg_list slave_list; struct xorg_list secondary_list;
struct xorg_list slave_head; struct xorg_list secondary_head;
int output_slaves; int output_secondarys;
/* Info for when this screen is a slave */ /* Info for when this screen is a secondary */
ScreenPtr current_master; ScreenPtr current_primary;
Bool is_output_slave; Bool is_output_secondary;
Bool is_offload_slave; Bool is_offload_secondary;
SharePixmapBackingProcPtr SharePixmapBacking; SharePixmapBackingProcPtr SharePixmapBacking;
SetSharedPixmapBackingProcPtr SetSharedPixmapBacking; SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;

View File

@ -484,7 +484,7 @@ TellChanged(WindowPtr pWin, void *value)
ClientPtr client; ClientPtr client;
ScreenPtr pScreen = pWin->drawable.pScreen; ScreenPtr pScreen = pWin->drawable.pScreen;
ScreenPtr iter; ScreenPtr iter;
rrScrPrivPtr pSlaveScrPriv; rrScrPrivPtr pSecondaryScrPriv;
rrScrPriv(pScreen); rrScrPriv(pScreen);
int i; int i;
@ -510,13 +510,13 @@ TellChanged(WindowPtr pWin, void *value)
RRDeliverCrtcEvent(client, pWin, crtc); RRDeliverCrtcEvent(client, pWin, crtc);
} }
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
if (!iter->is_output_slave) if (!iter->is_output_secondary)
continue; continue;
pSlaveScrPriv = rrGetScrPriv(iter); pSecondaryScrPriv = rrGetScrPriv(iter);
for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) { for (i = 0; i < pSecondaryScrPriv->numCrtcs; i++) {
RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i]; RRCrtcPtr crtc = pSecondaryScrPriv->crtcs[i];
if (crtc->changed) if (crtc->changed)
RRDeliverCrtcEvent(client, pWin, crtc); RRDeliverCrtcEvent(client, pWin, crtc);
@ -532,13 +532,13 @@ TellChanged(WindowPtr pWin, void *value)
RRDeliverOutputEvent(client, pWin, output); RRDeliverOutputEvent(client, pWin, output);
} }
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
if (!iter->is_output_slave) if (!iter->is_output_secondary)
continue; continue;
pSlaveScrPriv = rrGetScrPriv(iter); pSecondaryScrPriv = rrGetScrPriv(iter);
for (i = 0; i < pSlaveScrPriv->numOutputs; i++) { for (i = 0; i < pSecondaryScrPriv->numOutputs; i++) {
RROutputPtr output = pSlaveScrPriv->outputs[i]; RROutputPtr output = pSecondaryScrPriv->outputs[i];
if (output->changed) if (output->changed)
RRDeliverOutputEvent(client, pWin, output); RRDeliverOutputEvent(client, pWin, output);
@ -547,10 +547,10 @@ TellChanged(WindowPtr pWin, void *value)
} }
if (pRREvent->mask & RRProviderChangeNotifyMask) { if (pRREvent->mask & RRProviderChangeNotifyMask) {
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
pSlaveScrPriv = rrGetScrPriv(iter); pSecondaryScrPriv = rrGetScrPriv(iter);
if (pSlaveScrPriv->provider->changed) if (pSecondaryScrPriv->provider->changed)
RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); RRDeliverProviderEvent(client, pWin, pSecondaryScrPriv->provider);
} }
} }
@ -572,23 +572,23 @@ TellChanged(WindowPtr pWin, void *value)
void void
RRSetChanged(ScreenPtr pScreen) RRSetChanged(ScreenPtr pScreen)
{ {
/* set changed bits on the master screen only */ /* set changed bits on the primary screen only */
ScreenPtr master; ScreenPtr primary;
rrScrPriv(pScreen); rrScrPriv(pScreen);
rrScrPrivPtr mastersp; rrScrPrivPtr primarysp;
if (pScreen->isGPU) { if (pScreen->isGPU) {
master = pScreen->current_master; primary = pScreen->current_primary;
if (!master) if (!primary)
return; return;
mastersp = rrGetScrPriv(master); primarysp = rrGetScrPriv(primary);
} }
else { else {
master = pScreen; primary = pScreen;
mastersp = pScrPriv; primarysp = pScrPriv;
} }
mastersp->changed = TRUE; primarysp->changed = TRUE;
} }
/* /*
@ -597,69 +597,69 @@ RRSetChanged(ScreenPtr pScreen)
void void
RRTellChanged(ScreenPtr pScreen) RRTellChanged(ScreenPtr pScreen)
{ {
ScreenPtr master; ScreenPtr primary;
rrScrPriv(pScreen); rrScrPriv(pScreen);
rrScrPrivPtr mastersp; rrScrPrivPtr primarysp;
int i; int i;
ScreenPtr iter; ScreenPtr iter;
rrScrPrivPtr pSlaveScrPriv; rrScrPrivPtr pSecondaryScrPriv;
if (pScreen->isGPU) { if (pScreen->isGPU) {
master = pScreen->current_master; primary = pScreen->current_primary;
if (!master) if (!primary)
return; return;
mastersp = rrGetScrPriv(master); primarysp = rrGetScrPriv(primary);
} }
else { else {
master = pScreen; primary = pScreen;
mastersp = pScrPriv; primarysp = pScrPriv;
} }
xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { xorg_list_for_each_entry(iter, &primary->secondary_list, secondary_head) {
pSlaveScrPriv = rrGetScrPriv(iter); pSecondaryScrPriv = rrGetScrPriv(iter);
if (!iter->is_output_slave) if (!iter->is_output_secondary)
continue; continue;
if (CompareTimeStamps(mastersp->lastSetTime, if (CompareTimeStamps(primarysp->lastSetTime,
pSlaveScrPriv->lastSetTime) == EARLIER) { pSecondaryScrPriv->lastSetTime) == EARLIER) {
mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; primarysp->lastSetTime = pSecondaryScrPriv->lastSetTime;
} }
} }
if (mastersp->changed) { if (primarysp->changed) {
UpdateCurrentTimeIf(); UpdateCurrentTimeIf();
if (mastersp->configChanged) { if (primarysp->configChanged) {
mastersp->lastConfigTime = currentTime; primarysp->lastConfigTime = currentTime;
mastersp->configChanged = FALSE; primarysp->configChanged = FALSE;
} }
pScrPriv->changed = FALSE; pScrPriv->changed = FALSE;
mastersp->changed = FALSE; primarysp->changed = FALSE;
WalkTree(master, TellChanged, (void *) master); WalkTree(primary, TellChanged, (void *) primary);
mastersp->resourcesChanged = FALSE; primarysp->resourcesChanged = FALSE;
for (i = 0; i < pScrPriv->numOutputs; i++) for (i = 0; i < pScrPriv->numOutputs; i++)
pScrPriv->outputs[i]->changed = FALSE; pScrPriv->outputs[i]->changed = FALSE;
for (i = 0; i < pScrPriv->numCrtcs; i++) for (i = 0; i < pScrPriv->numCrtcs; i++)
pScrPriv->crtcs[i]->changed = FALSE; pScrPriv->crtcs[i]->changed = FALSE;
xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { xorg_list_for_each_entry(iter, &primary->secondary_list, secondary_head) {
pSlaveScrPriv = rrGetScrPriv(iter); pSecondaryScrPriv = rrGetScrPriv(iter);
pSlaveScrPriv->provider->changed = FALSE; pSecondaryScrPriv->provider->changed = FALSE;
if (iter->is_output_slave) { if (iter->is_output_secondary) {
for (i = 0; i < pSlaveScrPriv->numOutputs; i++) for (i = 0; i < pSecondaryScrPriv->numOutputs; i++)
pSlaveScrPriv->outputs[i]->changed = FALSE; pSecondaryScrPriv->outputs[i]->changed = FALSE;
for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) for (i = 0; i < pSecondaryScrPriv->numCrtcs; i++)
pSlaveScrPriv->crtcs[i]->changed = FALSE; pSecondaryScrPriv->crtcs[i]->changed = FALSE;
} }
} }
if (mastersp->layoutChanged) { if (primarysp->layoutChanged) {
pScrPriv->layoutChanged = FALSE; pScrPriv->layoutChanged = FALSE;
RRPointerScreenConfigured(master); RRPointerScreenConfigured(primary);
RRSendConfigNotify(master); RRSendConfigNotify(primary);
} }
} }
} }

View File

@ -1043,7 +1043,7 @@ extern _X_EXPORT void
RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider);
extern _X_EXPORT void extern _X_EXPORT void
RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr primaryScreen);
/* rrproviderproperty.c */ /* rrproviderproperty.c */

View File

@ -373,17 +373,17 @@ RRComputeContiguity(ScreenPtr pScreen)
static void static void
rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) { rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) {
ScreenPtr master = crtc->pScreen->current_master; ScreenPtr primary = crtc->pScreen->current_primary;
if (master && pPixmap->master_pixmap) { if (primary && pPixmap->primary_pixmap) {
/* /*
* Unref the pixmap twice: once for the original reference, and once * Unref the pixmap twice: once for the original reference, and once
* for the reference implicitly added by PixmapShareToSlave. * for the reference implicitly added by PixmapShareToSecondary.
*/ */
PixmapUnshareSlavePixmap(pPixmap); PixmapUnshareSecondaryPixmap(pPixmap);
master->DestroyPixmap(pPixmap->master_pixmap); primary->DestroyPixmap(pPixmap->primary_pixmap);
master->DestroyPixmap(pPixmap->master_pixmap); primary->DestroyPixmap(pPixmap->primary_pixmap);
} }
crtc->pScreen->DestroyPixmap(pPixmap); crtc->pScreen->DestroyPixmap(pPixmap);
@ -395,14 +395,14 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
rrScrPriv(crtc->pScreen); rrScrPriv(crtc->pScreen);
if (crtc->scanout_pixmap) { if (crtc->scanout_pixmap) {
ScreenPtr master = crtc->pScreen->current_master; ScreenPtr primary = crtc->pScreen->current_primary;
DrawablePtr mrootdraw = &master->root->drawable; DrawablePtr mrootdraw = &primary->root->drawable;
if (crtc->scanout_pixmap_back) { if (crtc->scanout_pixmap_back) {
pScrPriv->rrDisableSharedPixmapFlipping(crtc); pScrPriv->rrDisableSharedPixmapFlipping(crtc);
if (mrootdraw) { if (mrootdraw) {
master->StopFlippingPixmapTracking(mrootdraw, primary->StopFlippingPixmapTracking(mrootdraw,
crtc->scanout_pixmap, crtc->scanout_pixmap,
crtc->scanout_pixmap_back); crtc->scanout_pixmap_back);
} }
@ -414,7 +414,7 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
if (mrootdraw) { if (mrootdraw) {
master->StopPixmapTracking(mrootdraw, primary->StopPixmapTracking(mrootdraw,
crtc->scanout_pixmap); crtc->scanout_pixmap);
} }
} }
@ -427,20 +427,20 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
} }
static PixmapPtr static PixmapPtr
rrCreateSharedPixmap(RRCrtcPtr crtc, ScreenPtr master, rrCreateSharedPixmap(RRCrtcPtr crtc, ScreenPtr primary,
int width, int height, int depth, int width, int height, int depth,
int x, int y, Rotation rotation) int x, int y, Rotation rotation)
{ {
PixmapPtr mpix, spix; PixmapPtr mpix, spix;
mpix = master->CreatePixmap(master, width, height, depth, mpix = primary->CreatePixmap(primary, width, height, depth,
CREATE_PIXMAP_USAGE_SHARED); CREATE_PIXMAP_USAGE_SHARED);
if (!mpix) if (!mpix)
return NULL; return NULL;
spix = PixmapShareToSlave(mpix, crtc->pScreen); spix = PixmapShareToSecondary(mpix, crtc->pScreen);
if (spix == NULL) { if (spix == NULL) {
master->DestroyPixmap(mpix); primary->DestroyPixmap(mpix);
return NULL; return NULL;
} }
@ -502,30 +502,30 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
int x, int y, Rotation rotation, Bool sync, int x, int y, Rotation rotation, Bool sync,
int numOutputs, RROutputPtr * outputs) int numOutputs, RROutputPtr * outputs)
{ {
ScreenPtr master = crtc->pScreen->current_master; ScreenPtr primary = crtc->pScreen->current_primary;
rrScrPrivPtr pMasterScrPriv = rrGetScrPriv(master); rrScrPrivPtr pPrimaryScrPriv = rrGetScrPriv(primary);
rrScrPrivPtr pSlaveScrPriv = rrGetScrPriv(crtc->pScreen); rrScrPrivPtr pSecondaryScrPriv = rrGetScrPriv(crtc->pScreen);
DrawablePtr mrootdraw = &master->root->drawable; DrawablePtr mrootdraw = &primary->root->drawable;
int depth = mrootdraw->depth; int depth = mrootdraw->depth;
PixmapPtr spix_front; PixmapPtr spix_front;
/* Create a pixmap on the master screen, then get a shared handle for it. /* Create a pixmap on the primary screen, then get a shared handle for it.
Create a shared pixmap on the slave screen using the handle. Create a shared pixmap on the secondary screen using the handle.
If sync == FALSE -- If sync == FALSE --
Set slave screen to scanout shared linear pixmap. Set secondary screen to scanout shared linear pixmap.
Set the master screen to do dirty updates to the shared pixmap Set the primary screen to do dirty updates to the shared pixmap
from the screen pixmap on its own accord. from the screen pixmap on its own accord.
If sync == TRUE -- If sync == TRUE --
If any of the below steps fail, clean up and fall back to sync == FALSE. If any of the below steps fail, clean up and fall back to sync == FALSE.
Create another shared pixmap on the slave screen using the handle. Create another shared pixmap on the secondary screen using the handle.
Set slave screen to prepare for scanout and flipping between shared Set secondary screen to prepare for scanout and flipping between shared
linear pixmaps. linear pixmaps.
Set the master screen to do dirty updates to the shared pixmaps from the Set the primary screen to do dirty updates to the shared pixmaps from the
screen pixmap when prompted to by us or the slave. screen pixmap when prompted to by us or the secondary.
Prompt the master to do a dirty update on the first shared pixmap, then Prompt the primary to do a dirty update on the first shared pixmap, then
defer to the slave. defer to the secondary.
*/ */
if (crtc->scanout_pixmap) if (crtc->scanout_pixmap)
@ -535,7 +535,7 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
return TRUE; return TRUE;
} }
spix_front = rrCreateSharedPixmap(crtc, master, spix_front = rrCreateSharedPixmap(crtc, primary,
width, height, depth, width, height, depth,
x, y, rotation); x, y, rotation);
if (spix_front == NULL) { if (spix_front == NULL) {
@ -545,36 +545,36 @@ rrSetupPixmapSharing(RRCrtcPtr crtc, int width, int height,
/* Both source and sink must support required ABI funcs for flipping */ /* Both source and sink must support required ABI funcs for flipping */
if (sync && if (sync &&
pSlaveScrPriv->rrEnableSharedPixmapFlipping && pSecondaryScrPriv->rrEnableSharedPixmapFlipping &&
pSlaveScrPriv->rrDisableSharedPixmapFlipping && pSecondaryScrPriv->rrDisableSharedPixmapFlipping &&
pMasterScrPriv->rrStartFlippingPixmapTracking && pPrimaryScrPriv->rrStartFlippingPixmapTracking &&
master->PresentSharedPixmap && primary->PresentSharedPixmap &&
master->StopFlippingPixmapTracking) { primary->StopFlippingPixmapTracking) {
PixmapPtr spix_back = rrCreateSharedPixmap(crtc, master, PixmapPtr spix_back = rrCreateSharedPixmap(crtc, primary,
width, height, depth, width, height, depth,
x, y, rotation); x, y, rotation);
if (spix_back == NULL) if (spix_back == NULL)
goto fail; goto fail;
if (!pSlaveScrPriv->rrEnableSharedPixmapFlipping(crtc, if (!pSecondaryScrPriv->rrEnableSharedPixmapFlipping(crtc,
spix_front, spix_back)) spix_front, spix_back))
goto fail; goto fail;
crtc->scanout_pixmap = spix_front; crtc->scanout_pixmap = spix_front;
crtc->scanout_pixmap_back = spix_back; crtc->scanout_pixmap_back = spix_back;
if (!pMasterScrPriv->rrStartFlippingPixmapTracking(crtc, if (!pPrimaryScrPriv->rrStartFlippingPixmapTracking(crtc,
mrootdraw, mrootdraw,
spix_front, spix_front,
spix_back, spix_back,
x, y, 0, 0, x, y, 0, 0,
rotation)) { rotation)) {
pSlaveScrPriv->rrDisableSharedPixmapFlipping(crtc); pSecondaryScrPriv->rrDisableSharedPixmapFlipping(crtc);
goto fail; goto fail;
} }
master->PresentSharedPixmap(spix_front); primary->PresentSharedPixmap(spix_front);
return TRUE; return TRUE;
@ -593,14 +593,14 @@ fail: /* If flipping funcs fail, just fall back to unsynchronized */
rrSetPixmapSharingSyncProp(0, numOutputs, outputs); rrSetPixmapSharingSyncProp(0, numOutputs, outputs);
} }
if (!pSlaveScrPriv->rrCrtcSetScanoutPixmap(crtc, spix_front)) { if (!pSecondaryScrPriv->rrCrtcSetScanoutPixmap(crtc, spix_front)) {
rrDestroySharedPixmap(crtc, spix_front); rrDestroySharedPixmap(crtc, spix_front);
ErrorF("randr: failed to set shadow slave pixmap\n"); ErrorF("randr: failed to set shadow secondary pixmap\n");
return FALSE; return FALSE;
} }
crtc->scanout_pixmap = spix_front; crtc->scanout_pixmap = spix_front;
master->StartPixmapTracking(mrootdraw, spix_front, x, y, 0, 0, rotation); primary->StartPixmapTracking(mrootdraw, spix_front, x, y, 0, 0, rotation);
return TRUE; return TRUE;
} }
@ -633,7 +633,7 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
int c; int c;
BoxRec newbox; BoxRec newbox;
BoxPtr newsize; BoxPtr newsize;
ScreenPtr slave; ScreenPtr secondary;
int new_width, new_height; int new_width, new_height;
PixmapPtr screen_pixmap = pScreen->GetScreenPixmap(pScreen); PixmapPtr screen_pixmap = pScreen->GetScreenPixmap(pScreen);
rrScrPriv(pScreen); rrScrPriv(pScreen);
@ -641,8 +641,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
PixmapRegionInit(&root_pixmap_region, screen_pixmap); PixmapRegionInit(&root_pixmap_region, screen_pixmap);
RegionInit(&total_region, NULL, 0); RegionInit(&total_region, NULL, 0);
/* have to iterate all the crtcs of the attached gpu masters /* have to iterate all the crtcs of the attached gpu primarys
and all their output slaves */ and all their output secondarys */
for (c = 0; c < pScrPriv->numCrtcs; c++) { for (c = 0; c < pScrPriv->numCrtcs; c++) {
RRCrtcPtr crtc = pScrPriv->crtcs[c]; RRCrtcPtr crtc = pScrPriv->crtcs[c];
@ -666,16 +666,16 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
RegionUnion(&total_region, &total_region, &new_crtc_region); RegionUnion(&total_region, &total_region, &new_crtc_region);
} }
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
rrScrPrivPtr slave_priv = rrGetScrPriv(slave); rrScrPrivPtr secondary_priv = rrGetScrPriv(secondary);
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
for (c = 0; c < slave_priv->numCrtcs; c++) { for (c = 0; c < secondary_priv->numCrtcs; c++) {
RRCrtcPtr slave_crtc = slave_priv->crtcs[c]; RRCrtcPtr secondary_crtc = secondary_priv->crtcs[c];
if (slave_crtc == rr_crtc) { if (secondary_crtc == rr_crtc) {
newbox.x1 = x; newbox.x1 = x;
newbox.y1 = y; newbox.y1 = y;
if (rotation == RR_Rotate_90 || if (rotation == RR_Rotate_90 ||
@ -688,9 +688,9 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
} }
} }
else { else {
if (!slave_crtc->mode) if (!secondary_crtc->mode)
continue; continue;
crtc_to_box(&newbox, slave_crtc); crtc_to_box(&newbox, secondary_crtc);
} }
RegionInit(&new_crtc_region, &newbox, 1); RegionInit(&new_crtc_region, &newbox, 1);
RegionUnion(&total_region, &total_region, &new_crtc_region); RegionUnion(&total_region, &total_region, &new_crtc_region);
@ -756,19 +756,19 @@ RRCrtcSet(RRCrtcPtr crtc,
} }
else { else {
if (pScreen->isGPU) { if (pScreen->isGPU) {
ScreenPtr master = pScreen->current_master; ScreenPtr primary = pScreen->current_primary;
int width = 0, height = 0; int width = 0, height = 0;
if (mode) { if (mode) {
width = mode->mode.width; width = mode->mode.width;
height = mode->mode.height; height = mode->mode.height;
} }
ret = rrCheckPixmapBounding(master, crtc, ret = rrCheckPixmapBounding(primary, crtc,
rotation, x, y, width, height); rotation, x, y, width, height);
if (!ret) if (!ret)
return FALSE; return FALSE;
if (pScreen->current_master) { if (pScreen->current_primary) {
Bool sync = rrGetPixmapSharingSyncProp(numOutputs, outputs); Bool sync = rrGetPixmapSharingSyncProp(numOutputs, outputs);
ret = rrSetupPixmapSharing(crtc, width, height, ret = rrSetupPixmapSharing(crtc, width, height,
x, y, rotation, sync, x, y, rotation, sync,
@ -1384,8 +1384,8 @@ ProcRRSetCrtcConfig(ClientPtr client)
int width, height; int width, height;
if (pScreen->isGPU) { if (pScreen->isGPU) {
width = pScreen->current_master->width; width = pScreen->current_primary->width;
height = pScreen->current_master->height; height = pScreen->current_primary->height;
} }
else { else {
width = pScreen->width; width = pScreen->width;
@ -1887,7 +1887,7 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
{ {
rrScrPriv(pScreen); rrScrPriv(pScreen);
Bool ret; Bool ret;
ScreenPtr slave; ScreenPtr secondary;
/* intentional dead space -> let it float */ /* intentional dead space -> let it float */
if (pScrPriv->discontiguous) if (pScrPriv->discontiguous)
@ -1898,11 +1898,11 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
if (ret == TRUE) if (ret == TRUE)
return; return;
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
ret = check_all_screen_crtcs(slave, x, y); ret = check_all_screen_crtcs(secondary, x, y);
if (ret == TRUE) if (ret == TRUE)
return; return;
} }
@ -1912,11 +1912,11 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
if (ret == TRUE) if (ret == TRUE)
return; return;
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &pScreen->secondary_list, secondary_head) {
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
ret = constrain_all_screen_crtcs(pDev, slave, x, y); ret = constrain_all_screen_crtcs(pDev, secondary, x, y);
if (ret == TRUE) if (ret == TRUE)
return; return;
} }
@ -2015,7 +2015,7 @@ RRHasScanoutPixmap(ScreenPtr pScreen)
rrScrPriv(pScreen); rrScrPriv(pScreen);
int i; int i;
if (!pScreen->is_output_slave) if (!pScreen->is_output_secondary)
return FALSE; return FALSE;
for (i = 0; i < pScrPriv->numCrtcs; i++) { for (i = 0; i < pScrPriv->numCrtcs; i++) {

View File

@ -195,21 +195,21 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
rrScrPrivPtr pScrPriv = rrGetScrPriv(screen); rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
int m, o, c, sc; int m, o, c, sc;
int numCrtcs; int numCrtcs;
ScreenPtr slave; ScreenPtr secondary;
if (!RRGetInfo(screen, FALSE)) if (!RRGetInfo(screen, FALSE))
return FALSE; return FALSE;
/* Count the number of crtcs in this and any slave screens */ /* Count the number of crtcs in this and any secondary screens */
numCrtcs = pScrPriv->numCrtcs; numCrtcs = pScrPriv->numCrtcs;
xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &screen->secondary_list, secondary_head) {
rrScrPrivPtr pSlavePriv; rrScrPrivPtr pSecondaryPriv;
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
pSlavePriv = rrGetScrPriv(slave); pSecondaryPriv = rrGetScrPriv(secondary);
numCrtcs += pSlavePriv->numCrtcs; numCrtcs += pSecondaryPriv->numCrtcs;
} }
mon_list->num_crtcs = numCrtcs; mon_list->num_crtcs = numCrtcs;
@ -224,16 +224,16 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
mon_list->server_crtc[c] = pScrPriv->crtcs[sc]; mon_list->server_crtc[c] = pScrPriv->crtcs[sc];
} }
xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &screen->secondary_list, secondary_head) {
rrScrPrivPtr pSlavePriv; rrScrPrivPtr pSecondaryPriv;
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
pSlavePriv = rrGetScrPriv(slave); pSecondaryPriv = rrGetScrPriv(secondary);
for (sc = 0; sc < pSlavePriv->numCrtcs; sc++, c++) { for (sc = 0; sc < pSecondaryPriv->numCrtcs; sc++, c++) {
if (pSlavePriv->crtcs[sc]->mode != NULL) if (pSecondaryPriv->crtcs[sc]->mode != NULL)
mon_list->server_crtc[c] = pSlavePriv->crtcs[sc]; mon_list->server_crtc[c] = pSecondaryPriv->crtcs[sc];
} }
} }
@ -464,7 +464,7 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
{ {
rrScrPrivPtr pScrPriv = rrGetScrPriv(screen); rrScrPrivPtr pScrPriv = rrGetScrPriv(screen);
int m; int m;
ScreenPtr slave; ScreenPtr secondary;
RRMonitorPtr *monitors; RRMonitorPtr *monitors;
if (!pScrPriv) if (!pScrPriv)
@ -479,11 +479,11 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
return BadValue; return BadValue;
} }
xorg_list_for_each_entry(slave, &screen->slave_list, slave_head) { xorg_list_for_each_entry(secondary, &screen->secondary_list, secondary_head) {
if (!slave->is_output_slave) if (!secondary->is_output_secondary)
continue; continue;
if (RRMonitorMatchesOutputName(slave, monitor->name)) { if (RRMonitorMatchesOutputName(secondary, monitor->name)) {
client->errorValue = monitor->name; client->errorValue = monitor->name;
return BadValue; return BadValue;
} }

View File

@ -32,27 +32,27 @@ RESTYPE RROutputType;
void void
RROutputChanged(RROutputPtr output, Bool configChanged) RROutputChanged(RROutputPtr output, Bool configChanged)
{ {
/* set changed bits on the master screen only */ /* set changed bits on the primary screen only */
ScreenPtr pScreen = output->pScreen; ScreenPtr pScreen = output->pScreen;
rrScrPrivPtr mastersp; rrScrPrivPtr primarysp;
output->changed = TRUE; output->changed = TRUE;
if (!pScreen) if (!pScreen)
return; return;
if (pScreen->isGPU) { if (pScreen->isGPU) {
ScreenPtr master = pScreen->current_master; ScreenPtr primary = pScreen->current_primary;
if (!master) if (!primary)
return; return;
mastersp = rrGetScrPriv(master); primarysp = rrGetScrPriv(primary);
} }
else { else {
mastersp = rrGetScrPriv(pScreen); primarysp = rrGetScrPriv(pScreen);
} }
RRSetChanged(pScreen); RRSetChanged(pScreen);
if (configChanged) if (configChanged)
mastersp->configChanged = TRUE; primarysp->configChanged = TRUE;
} }
/* /*
@ -609,7 +609,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
WindowPtr pWin; WindowPtr pWin;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int ret; int ret;
ScreenPtr slave; ScreenPtr secondary;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
@ -627,7 +627,7 @@ ProcRRSetOutputPrimary(ClientPtr client)
client->errorValue = stuff->window; client->errorValue = stuff->window;
return BadMatch; return BadMatch;
} }
if (output->pScreen->isGPU && output->pScreen->current_master != pWin->drawable.pScreen) { if (output->pScreen->isGPU && output->pScreen->current_primary != pWin->drawable.pScreen) {
client->errorValue = stuff->window; client->errorValue = stuff->window;
return BadMatch; return BadMatch;
} }
@ -638,11 +638,11 @@ ProcRRSetOutputPrimary(ClientPtr client)
{ {
RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
xorg_list_for_each_entry(slave, xorg_list_for_each_entry(secondary,
&pWin->drawable.pScreen->slave_list, &pWin->drawable.pScreen->secondary_list,
slave_head) { secondary_head) {
if (slave->is_output_slave) if (secondary->is_output_secondary)
RRSetPrimaryOutput(slave, rrGetScrPriv(slave), output); RRSetPrimaryOutput(secondary, rrGetScrPriv(secondary), output);
} }
} }

View File

@ -75,7 +75,7 @@ ProcRRGetProviders (ClientPtr client)
if (pScrPriv->provider) if (pScrPriv->provider)
total_providers++; total_providers++;
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
pScrPriv = rrGetScrPriv(iter); pScrPriv = rrGetScrPriv(iter);
total_providers += pScrPriv->provider ? 1 : 0; total_providers += pScrPriv->provider ? 1 : 0;
} }
@ -111,7 +111,7 @@ ProcRRGetProviders (ClientPtr client)
providers = (RRProvider *)extra; providers = (RRProvider *)extra;
ADD_PROVIDER(pScreen); ADD_PROVIDER(pScreen);
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
ADD_PROVIDER(iter); ADD_PROVIDER(iter);
} }
} }
@ -174,8 +174,8 @@ ProcRRGetProviderInfo (ClientPtr client)
if (provider->output_source && if (provider->output_source &&
provider->output_source != provider->offload_sink) provider->output_source != provider->offload_sink)
rep.nAssociatedProviders++; rep.nAssociatedProviders++;
xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(provscreen, &pScreen->secondary_list, secondary_head) {
if (provscreen->is_output_slave || provscreen->is_offload_slave) if (provscreen->is_output_secondary || provscreen->is_offload_secondary)
rep.nAssociatedProviders++; rep.nAssociatedProviders++;
} }
@ -227,17 +227,17 @@ ProcRRGetProviderInfo (ClientPtr client)
swapl(&prov_cap[i]); swapl(&prov_cap[i]);
i++; i++;
} }
xorg_list_for_each_entry(provscreen, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(provscreen, &pScreen->secondary_list, secondary_head) {
if (!provscreen->is_output_slave && !provscreen->is_offload_slave) if (!provscreen->is_output_secondary && !provscreen->is_offload_secondary)
continue; continue;
pScrProvPriv = rrGetScrPriv(provscreen); pScrProvPriv = rrGetScrPriv(provscreen);
providers[i] = pScrProvPriv->provider->id; providers[i] = pScrProvPriv->provider->id;
if (client->swapped) if (client->swapped)
swapl(&providers[i]); swapl(&providers[i]);
prov_cap[i] = 0; prov_cap[i] = 0;
if (provscreen->is_output_slave) if (provscreen->is_output_secondary)
prov_cap[i] |= RR_Capability_SinkOutput; prov_cap[i] |= RR_Capability_SinkOutput;
if (provscreen->is_offload_slave) if (provscreen->is_offload_secondary)
prov_cap[i] |= RR_Capability_SourceOffload; prov_cap[i] |= RR_Capability_SourceOffload;
if (client->swapped) if (client->swapped)
swapl(&prov_cap[i]); swapl(&prov_cap[i]);
@ -488,26 +488,26 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider)
} }
void void
RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr primaryScreen)
{ {
rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); rrScrPrivPtr primaryPriv = rrGetScrPriv(primaryScreen);
RRProviderPtr provider = pScrPriv->provider; RRProviderPtr provider = pScrPriv->provider;
RRProviderPtr master_provider = masterPriv->provider; RRProviderPtr primary_provider = primaryPriv->provider;
if (!provider || !master_provider) if (!provider || !primary_provider)
return; return;
if ((provider->capabilities & RR_Capability_SinkOutput) && if ((provider->capabilities & RR_Capability_SinkOutput) &&
(master_provider->capabilities & RR_Capability_SourceOutput)) { (primary_provider->capabilities & RR_Capability_SourceOutput)) {
pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); pScrPriv->rrProviderSetOutputSource(pScreen, provider, primary_provider);
RRInitPrimeSyncProps(pScreen); RRInitPrimeSyncProps(pScreen);
masterPriv->configChanged = TRUE; primaryPriv->configChanged = TRUE;
RRSetChanged(masterScreen); RRSetChanged(primaryScreen);
} }
if ((provider->capabilities & RR_Capability_SourceOffload) && if ((provider->capabilities & RR_Capability_SourceOffload) &&
(master_provider->capabilities & RR_Capability_SinkOffload)) (primary_provider->capabilities & RR_Capability_SinkOffload))
pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); pScrPriv->rrProviderSetOffloadSink(pScreen, provider, primary_provider);
} }

View File

@ -380,7 +380,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
CARD8 *names; CARD8 *names;
int has_primary = 0; int has_primary = 0;
/* we need to iterate all the GPU masters and all their output slaves */ /* we need to iterate all the GPU primarys and all their output secondarys */
total_crtcs = 0; total_crtcs = 0;
total_outputs = 0; total_outputs = 0;
total_modes = 0; total_modes = 0;
@ -394,8 +394,8 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
update_totals(pScreen, pScrPriv); update_totals(pScreen, pScrPriv);
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
if (!iter->is_output_slave) if (!iter->is_output_secondary)
continue; continue;
pScrPriv = rrGetScrPriv(iter); pScrPriv = rrGetScrPriv(iter);
@ -453,8 +453,8 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
} }
update_arrays(pScreen, pScrPriv, primary_crtc, has_primary); update_arrays(pScreen, pScrPriv, primary_crtc, has_primary);
xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { xorg_list_for_each_entry(iter, &pScreen->secondary_list, secondary_head) {
if (!iter->is_output_slave) if (!iter->is_output_secondary)
continue; continue;
pScrPriv = rrGetScrPriv(iter); pScrPriv = rrGetScrPriv(iter);
@ -509,7 +509,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
if (!RRGetInfo(pScreen, query)) if (!RRGetInfo(pScreen, query))
return BadAlloc; return BadAlloc;
if (pScreen->output_slaves) if (pScreen->output_secondarys)
return rrGetMultiScreenResources(client, query, pScreen); return rrGetMultiScreenResources(client, query, pScreen);
if (!pScrPriv) { if (!pScrPriv) {