xfree86: Reorganize the reserved ScrnInfoRec slots

First, move them to the end of the struct, for marginally better cache
locality for the struct members that actually have meaning; move the
existing slots at the end of the struct up near some others with similar
meanings. Second, only keep four slots each of integer, data pointer,
and function pointer; we've rarely used this escape hatch so this is
still plenty.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2017-02-14 15:30:56 -05:00
parent 47db92473f
commit 5d29b49366

View File

@ -410,10 +410,9 @@ typedef struct _confdrirec {
confDRIBufferRec *bufs; confDRIBufferRec *bufs;
} confDRIRec, *confDRIPtr; } confDRIRec, *confDRIPtr;
/* These values should be adjusted when new fields are added to ScrnInfoRec */ #define NUM_RESERVED_INTS 4
#define NUM_RESERVED_INTS 16 #define NUM_RESERVED_POINTERS 4
#define NUM_RESERVED_POINTERS 14 #define NUM_RESERVED_FUNCS 4
#define NUM_RESERVED_FUNCS 10
/* let clients know they can use this */ /* let clients know they can use this */
#define XF86_SCRN_HAS_PREFER_CLONE 1 #define XF86_SCRN_HAS_PREFER_CLONE 1
@ -665,18 +664,12 @@ typedef struct _ScrnInfoRec {
/* initial rightof support disable */ /* initial rightof support disable */
int preferClone; int preferClone;
/* Bool is_gpu;
* These can be used when the minor ABI version is incremented. uint32_t capabilities;
* The NUM_* parameters must be reduced appropriately to keep the
* structure size and alignment unchanged.
*/
int reservedInt[NUM_RESERVED_INTS];
int *entityInstanceList; int *entityInstanceList;
struct pci_device *vgaDev; struct pci_device *vgaDev;
void *reservedPtr[NUM_RESERVED_POINTERS];
/* /*
* Driver entry points. * Driver entry points.
* *
@ -702,15 +695,9 @@ typedef struct _ScrnInfoRec {
xorgDriverFuncProc *DriverFunc; xorgDriverFuncProc *DriverFunc;
xf86ModeSetProc *ModeSet; xf86ModeSetProc *ModeSet;
/* int reservedInt[NUM_RESERVED_INTS];
* This can be used when the minor ABI version is incremented. void *reservedPtr[NUM_RESERVED_POINTERS];
* The NUM_* parameter must be reduced appropriately to keep the
* structure size and alignment unchanged.
*/
funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
Bool is_gpu;
uint32_t capabilities;
} ScrnInfoRec; } ScrnInfoRec;
typedef struct { typedef struct {