Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to recent devPrivates ABI (as used in X.org's Xserver) #560

Open
wants to merge 44 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ddd5284
Move EXTENSION_BASE and EXTENSION_EVENT_BASE to misc.h.
Nov 6, 2017
f8925ad
Add a common ARRAY_SIZE macro to dix.h
fooishbar Nov 6, 2017
bb64abb
X.org cherry-pick reverting X.org bug #6924.
sunweaver Jul 29, 2018
660fa50
mi{Create,Destroy}GCOps are unused, nuke 'em.
nwnk Nov 7, 2017
0a0e5d1
nxagent: Fake backing store support via Composite extension.
sunweaver Nov 20, 2017
1dd2f20
randr: Backport latest devPrivates ABI from X.org
sunweaver Nov 6, 2017
84f0b08
composite: Backport latest devPrivates ABI from X.org.
sunweaver Nov 6, 2017
b6eb64c
Xext: Backport latest devPrivates ABI from X.org.
sunweaver Nov 6, 2017
01ccaa8
include: Backport latest devPrivates ABI from X.org.
sunweaver Nov 7, 2017
66d68df
dix: Backport latest devPrivates ABI from X.org.
sunweaver Nov 7, 2017
a30c9ba
mi: Backport latest devPrivates ABI from X.org.
sunweaver Nov 7, 2017
a83f29c
xkb: Backport latest devPrivates ABI from X.org.
sunweaver Nov 7, 2017
71710e9
dbe: Backport latest devPrivates ABI from X.org.
sunweaver Nov 7, 2017
d3ae956
render: Backport latest devPrivates ABI from X.org.
sunweaver Nov 10, 2017
c0a1a89
damageext: Backport latest devPrivates ABI from X.org.
sunweaver Nov 10, 2017
d112afa
miext/cw: Backport latest devPrivates ABI from X.org.
sunweaver Nov 10, 2017
25c563c
xfixes: Backport latest devPrivates ABI from X.org.
sunweaver Nov 10, 2017
83d7159
record: Backport latest devPrivates ABI from X.org.
sunweaver Nov 10, 2017
4d4d45e
fb: Backport latest devPrivate ABI from X.org.
sunweaver Nov 10, 2017
5b3f2b7
miext/damage: Backport latest devPrivate ABI from X.org.
sunweaver Nov 13, 2017
310c2f3
rebase miext/damage/ devPrivates backport
sunweaver Nov 13, 2017
8910e8f
hw/nxagent: Backport latest devPrivates ABI from X.org.
sunweaver Nov 15, 2017
6cff6ac
rebase devPrivates xkb
sunweaver Nov 21, 2017
103dc70
rebase devPrivates dix
sunweaver Nov 21, 2017
f80ab1f
rebase devPrivates xkb
sunweaver Nov 21, 2017
e44213b
rebase devPrivates dix
sunweaver Nov 21, 2017
6df3122
rebase devPrivates include
sunweaver Nov 21, 2017
9235790
rebase devPrivates nxagent
sunweaver Nov 21, 2017
f7ee2e4
Eviscerate save-under support.
nwnk Nov 21, 2017
a19e251
Start devices after windows are initialized.
Nov 22, 2017
85129d1
mi: Don't save midispcur rendering resources for each cursor
keith-packard Nov 22, 2017
6109e99
dix/render: consolidate window format matching code.
airlied Nov 22, 2017
041b36e
mi: Delete unused flicker-free MoveCursor code.
jameysharp Nov 22, 2017
a7a3326
rebase devPrivates render
sunweaver Nov 22, 2017
fe360d8
rebase devPrivates nxagent
sunweaver Nov 22, 2017
51bfb20
rebase devPrivates include
sunweaver Nov 22, 2017
d1cedfb
rebase devPrivates dix
sunweaver Nov 22, 2017
0f6a6c1
rebase devPrivates Xext
sunweaver Jul 30, 2018
5351dcc
rebase devPrivates dix
sunweaver Jul 30, 2018
db6fca8
rebase devPrivates mi
sunweaver Jul 30, 2018
871386a
rebase devPrivates mi
sunweaver Jul 30, 2018
bfbc191
rebase devPrivates xfixes
sunweaver Jul 30, 2018
c4e0696
rebase devPrivates include/
sunweaver Jul 30, 2018
353e683
rebase devPrivates dix
sunweaver Jul 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rebase devPrivates render
  • Loading branch information
sunweaver committed Jul 30, 2018
commit a7a3326f8ac2901422a4d80910a98121094888ce
11 changes: 6 additions & 5 deletions nx-X11/programs/Xserver/render/animcur.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ DevPrivateKeyRec AnimCurScreenPrivateKeyRec;

#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)

#define IsAnimCur(c) ((c)->bits == &animCursorBits)
#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
#define IsAnimCur(c) ((c) && (c)->bits == &animCursorBits)
#define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)

Expand Down Expand Up @@ -355,11 +355,12 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
if (IsAnimCur (cursors[i]))
return BadMatch;

pCursor = (CursorPtr) malloc (sizeof (CursorRec) +
sizeof (AnimCurRec) +
ncursor * sizeof (AnimCurElt));
pCursor = (CursorPtr) calloc(CURSOR_REC_SIZE +
sizeof(AnimCurRec) +
ncursor * sizeof(AnimCurElt), 1);
if (!pCursor)
return BadAlloc;
dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR);
pCursor->bits = &animCursorBits;
animCursorBits.refcnt++;
pCursor->refcnt = 1;
Expand Down
66 changes: 9 additions & 57 deletions nx-X11/programs/Xserver/render/glyph.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,50 +94,6 @@ FindGlyphHashSet (CARD32 filled)
return 0;
}

static int _GlyphSetPrivateAllocateIndex = 0;

int
AllocateGlyphSetPrivateIndex (void)
{
return _GlyphSetPrivateAllocateIndex++;
}

void
ResetGlyphSetPrivateIndex (void)
{
_GlyphSetPrivateAllocateIndex = 0;
}

Bool
_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr)
{
void **new;

if (n > glyphSet->maxPrivate) {
if (glyphSet->devPrivates &&
glyphSet->devPrivates != (void *)(&glyphSet[1])) {
new = (void **) realloc (glyphSet->devPrivates,
(n + 1) * sizeof (void *));
if (!new)
return FALSE;
} else {
new = (void **) malloc ((n + 1) * sizeof (void *));
if (!new)
return FALSE;
if (glyphSet->devPrivates)
memcpy (new,
glyphSet->devPrivates,
(glyphSet->maxPrivate + 1) * sizeof (void *));
}
glyphSet->devPrivates = new;
/* Zero out new, uninitialize privates */
while (++glyphSet->maxPrivate < n)
glyphSet->devPrivates[glyphSet->maxPrivate] = (void *)0;
}
glyphSet->devPrivates[n] = ptr;
return TRUE;
}

Bool
GlyphInit (ScreenPtr pScreen)
{
Expand Down Expand Up @@ -263,7 +219,7 @@ FreeGlyph (GlyphPtr glyph, int format)
gr->signature = 0;
globalGlyphs[format].tableEntries--;
}
free (glyph);
dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
}
}

Expand All @@ -280,7 +236,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph);
if (gr->glyph && gr->glyph != DeletedGlyph)
{
free (glyph);
dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
glyph = gr->glyph;
}
else
Expand Down Expand Up @@ -339,18 +295,21 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
{
int size;
GlyphPtr glyph;
size_t padded_width;
size_t padded_width;

padded_width = PixmapBytePad (gi->width, glyphDepths[fdepth]);
if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height)
return 0;
size = gi->height * padded_width;
glyph = (GlyphPtr) malloc (size + sizeof (GlyphRec));
size = gi->height * padded_width + dixPrivatesSize(PRIVATE_GLYPH);
glyph = (GlyphPtr) malloc (size);
if (!glyph)
return 0;
glyph->refcnt = 0;
glyph->size = size + sizeof (xGlyphInfo);
glyph->info = *gi;

dixInitPrivates(glyph, (char *) glyph + gi->height * padded_width, PRIVATE_GLYPH);

return glyph;
}

Expand Down Expand Up @@ -423,23 +382,16 @@ GlyphSetPtr
AllocateGlyphSet (int fdepth, PictFormatPtr format)
{
GlyphSetPtr glyphSet;
int size;

if (!globalGlyphs[fdepth].hashSet)
{
if (!AllocateGlyphHash (&globalGlyphs[fdepth], &glyphHashSets[0]))
return FALSE;
}

size = (sizeof (GlyphSetRec) +
(sizeof (void *) * _GlyphSetPrivateAllocateIndex));
glyphSet = malloc (size);
glyphSet = dixAllocateObjectWithPrivates(GlyphSetRec, PRIVATE_GLYPHSET);
if (!glyphSet)
return FALSE;
bzero((char *)glyphSet, size);
glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1;
if (_GlyphSetPrivateAllocateIndex)
glyphSet->devPrivates = (void *)(&glyphSet[1]);

if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0]))
{
Expand Down
18 changes: 6 additions & 12 deletions nx-X11/programs/Xserver/render/glyphstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

typedef struct _Glyph {
CARD32 refcnt;
PrivateRec *devPrivates;
CARD32 size; /* info + bitmap */
xGlyphInfo info;
/* bits follow */
Expand Down Expand Up @@ -74,19 +75,15 @@ typedef struct _GlyphSet {
int fdepth;
GlyphHashRec hash;
int maxPrivate;
void **devPrivates;
PrivateRec *devPrivates;
} GlyphSetRec, *GlyphSetPtr;
#endif /* NXAGENT_SERVER */

#define GlyphSetGetPrivate(pGlyphSet,n) \
((n) > (pGlyphSet)->maxPrivate ? \
(void *) 0 : \
(pGlyphSet)->devPrivates[n])
#define GlyphSetGetPrivate(pGlyphSet,k) \
dixLookupPrivate(&(pGlyphSet)->devPrivates, k)

#define GlyphSetSetPrivate(pGlyphSet,n,ptr) \
((n) > (pGlyphSet)->maxPrivate ? \
_GlyphSetSetNewPrivate(pGlyphSet, n, ptr) : \
((((pGlyphSet)->devPrivates[n] = (ptr)) != 0) || TRUE))
#define GlyphSetSetPrivate(pGlyphSet,k,ptr) \
dixSetPrivate(&(pGlyphSet)->devPrivates, k, ptr)

typedef struct _GlyphList {
INT16 xOff;
Expand All @@ -106,9 +103,6 @@ AllocateGlyphSetPrivateIndex (void);
void
ResetGlyphSetPrivateIndex (void);

Bool
_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr);

Bool
GlyphInit (ScreenPtr pScreen);

Expand Down