xf86: cleanup helper code to use a pointer. (v1.1)
This is in preparation for gpu screens in here, just use a pScrn pointer to point at the new screen. suggested by Keith. v1.1: fix spacing as suggested by Aaron. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
9d17981829
commit
726d467b53
@ -167,6 +167,7 @@ ScrnInfoPtr
|
|||||||
xf86AllocateScreen(DriverPtr drv, int flags)
|
xf86AllocateScreen(DriverPtr drv, int flags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
ScrnInfoPtr pScrn;
|
||||||
|
|
||||||
if (xf86Screens == NULL)
|
if (xf86Screens == NULL)
|
||||||
xf86NumScreens = 0;
|
xf86NumScreens = 0;
|
||||||
@ -174,22 +175,22 @@ xf86AllocateScreen(DriverPtr drv, int flags)
|
|||||||
i = xf86NumScreens++;
|
i = xf86NumScreens++;
|
||||||
xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
|
xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
|
||||||
xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
|
xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
|
||||||
xf86Screens[i]->scrnIndex = i; /* Changes when a screen is removed */
|
pScrn = xf86Screens[i];
|
||||||
xf86Screens[i]->origIndex = i; /* This never changes */
|
pScrn->scrnIndex = i; /* Changes when a screen is removed */
|
||||||
xf86Screens[i]->privates = xnfcalloc(sizeof(DevUnion),
|
pScrn->origIndex = i; /* This never changes */
|
||||||
xf86ScrnInfoPrivateCount);
|
pScrn->privates = xnfcalloc(sizeof(DevUnion), xf86ScrnInfoPrivateCount);
|
||||||
/*
|
/*
|
||||||
* EnableDisableFBAccess now gets initialized in InitOutput()
|
* EnableDisableFBAccess now gets initialized in InitOutput()
|
||||||
* xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
|
* pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xf86Screens[i]->drv = drv;
|
pScrn->drv = drv;
|
||||||
drv->refCount++;
|
drv->refCount++;
|
||||||
xf86Screens[i]->module = DuplicateModule(drv->module, NULL);
|
pScrn->module = DuplicateModule(drv->module, NULL);
|
||||||
|
|
||||||
xf86Screens[i]->DriverFunc = drv->driverFunc;
|
pScrn->DriverFunc = drv->driverFunc;
|
||||||
|
|
||||||
return xf86Screens[i];
|
return pScrn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user