Run indent
This commit is contained in:
parent
106bea5ad1
commit
f9f7a872bf
|
@ -194,7 +194,7 @@ crtc_init(ScrnInfoPtr pScrn)
|
||||||
|
|
||||||
res = drmModeGetResources(ms->fd);
|
res = drmModeGetResources(ms->fd);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
ErrorF("Failed drmModeGetResources %d\n",errno);
|
ErrorF("Failed drmModeGetResources %d\n", errno);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,6 +210,6 @@ crtc_init(ScrnInfoPtr pScrn)
|
||||||
crtc->driver_private = drm_crtc;
|
crtc->driver_private = drm_crtc;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,12 +65,15 @@ static Bool SaveHWState(ScrnInfoPtr pScrn);
|
||||||
static Bool RestoreHWState(ScrnInfoPtr pScrn);
|
static Bool RestoreHWState(ScrnInfoPtr pScrn);
|
||||||
static void Identify(int flags);
|
static void Identify(int flags);
|
||||||
static const OptionInfoRec *AvailableOptions(int chipid, int busid);
|
static const OptionInfoRec *AvailableOptions(int chipid, int busid);
|
||||||
static ModeStatus ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
|
static ModeStatus ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose,
|
||||||
|
int flags);
|
||||||
static void FreeScreen(int scrnIndex, int flags);
|
static void FreeScreen(int scrnIndex, int flags);
|
||||||
static void LeaveVT(int scrnIndex, int flags);
|
static void LeaveVT(int scrnIndex, int flags);
|
||||||
static Bool SwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
|
static Bool SwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
|
||||||
static Bool ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
|
static Bool ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
|
||||||
|
char **argv);
|
||||||
static Bool PreInit(ScrnInfoPtr pScrn, int flags);
|
static Bool PreInit(ScrnInfoPtr pScrn, int flags);
|
||||||
|
|
||||||
#if XSERVER_LIBPCIACCESS
|
#if XSERVER_LIBPCIACCESS
|
||||||
static Bool
|
static Bool
|
||||||
pci_probe(DriverPtr driver,
|
pci_probe(DriverPtr driver,
|
||||||
|
@ -187,8 +190,7 @@ Setup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||||
* Tell the loader about symbols from other modules that this module
|
* Tell the loader about symbols from other modules that this module
|
||||||
* might refer to.
|
* might refer to.
|
||||||
*/
|
*/
|
||||||
LoaderRefSymLists(fbSymbols,
|
LoaderRefSymLists(fbSymbols, shadowSymbols, ddcSymbols, NULL);
|
||||||
shadowSymbols, ddcSymbols, NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The return value must be non-NULL on success even though there
|
* The return value must be non-NULL on success even though there
|
||||||
|
@ -266,8 +268,7 @@ Probe(DriverPtr drv, int flags)
|
||||||
* Find the config file Device sections that match this
|
* Find the config file Device sections that match this
|
||||||
* driver, and return if there are none.
|
* driver, and return if there are none.
|
||||||
*/
|
*/
|
||||||
if ((numDevSections =
|
if ((numDevSections = xf86MatchDevice("modesetting", &devSections)) <= 0) {
|
||||||
xf86MatchDevice("modesetting", &devSections)) <= 0) {
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,14 +284,18 @@ Probe(DriverPtr drv, int flags)
|
||||||
for (ppPci = VideoInfo; ppPci != NULL && *ppPci != NULL; ppPci++) {
|
for (ppPci = VideoInfo; ppPci != NULL && *ppPci != NULL; ppPci++) {
|
||||||
for (numDevs = 0; numDevs < numDevSections; numDevs++) {
|
for (numDevs = 0; numDevs < numDevSections; numDevs++) {
|
||||||
if (devSections[numDevs]->busID && *devSections[numDevs]->busID) {
|
if (devSections[numDevs]->busID && *devSections[numDevs]->busID) {
|
||||||
if (xf86ComparePciBusString(devSections[numDevs]->busID, (*ppPci)->bus, (*ppPci)->device, (*ppPci)->func)) {
|
if (xf86ComparePciBusString
|
||||||
|
(devSections[numDevs]->busID, (*ppPci)->bus,
|
||||||
|
(*ppPci)->device, (*ppPci)->func)) {
|
||||||
/* Claim slot */
|
/* Claim slot */
|
||||||
if (xf86CheckPciSlot((*ppPci)->bus, (*ppPci)->device,
|
if (xf86CheckPciSlot((*ppPci)->bus, (*ppPci)->device,
|
||||||
(*ppPci)->func)) {
|
(*ppPci)->func)) {
|
||||||
usedChips[numUsed++] = xf86ClaimPciSlot((*ppPci)->bus, (*ppPci)->device,
|
usedChips[numUsed++] =
|
||||||
(*ppPci)->func, drv, (*ppPci)->chipType,
|
xf86ClaimPciSlot((*ppPci)->bus, (*ppPci)->device,
|
||||||
NULL, TRUE);
|
(*ppPci)->func, drv,
|
||||||
ErrorF("CLAIMED %d %d %d\n",(*ppPci)->bus,(*ppPci)->device, (*ppPci)->func);
|
(*ppPci)->chipType, NULL, TRUE);
|
||||||
|
ErrorF("CLAIMED %d %d %d\n", (*ppPci)->bus,
|
||||||
|
(*ppPci)->device, (*ppPci)->func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,7 +313,7 @@ Probe(DriverPtr drv, int flags)
|
||||||
if (numUsed > 0)
|
if (numUsed > 0)
|
||||||
foundScreen = TRUE;
|
foundScreen = TRUE;
|
||||||
} else {
|
} else {
|
||||||
ErrorF("NUMUSED %d\n",numUsed);
|
ErrorF("NUMUSED %d\n", numUsed);
|
||||||
for (i = 0; i < numUsed; i++) {
|
for (i = 0; i < numUsed; i++) {
|
||||||
ScrnInfoPtr pScrn = NULL;
|
ScrnInfoPtr pScrn = NULL;
|
||||||
|
|
||||||
|
@ -328,7 +333,8 @@ Probe(DriverPtr drv, int flags)
|
||||||
{
|
{
|
||||||
/* Allocate an entity private if necessary */
|
/* Allocate an entity private if necessary */
|
||||||
if (modesettingEntityIndex < 0)
|
if (modesettingEntityIndex < 0)
|
||||||
modesettingEntityIndex = xf86AllocateEntityPrivateIndex();
|
modesettingEntityIndex =
|
||||||
|
xf86AllocateEntityPrivateIndex();
|
||||||
|
|
||||||
pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
|
pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
|
||||||
modesettingEntityIndex);
|
modesettingEntityIndex);
|
||||||
|
@ -443,7 +449,7 @@ crtc_resize(ScrnInfoPtr pScrn, int width, int height)
|
||||||
if (width == pScrn->virtualX && height == pScrn->virtualY)
|
if (width == pScrn->virtualX && height == pScrn->virtualY)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
ErrorF("RESIZING TO %dx%d\n",width,height);
|
ErrorF("RESIZING TO %dx%d\n", width, height);
|
||||||
|
|
||||||
pScrn->virtualX = width;
|
pScrn->virtualX = width;
|
||||||
pScrn->virtualY = height;
|
pScrn->virtualY = height;
|
||||||
|
@ -469,7 +475,8 @@ crtc_resize(ScrnInfoPtr pScrn, int width, int height)
|
||||||
pScrn->bitsPerPixel / 8, 0, NULL,
|
pScrn->bitsPerPixel / 8, 0, NULL,
|
||||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_SHAREABLE
|
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_SHAREABLE
|
||||||
| DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_MAPPABLE |
|
| DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_MAPPABLE |
|
||||||
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT, DRM_BO_HINT_DONT_FENCE, &ms->bo);
|
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT,
|
||||||
|
DRM_BO_HINT_DONT_FENCE, &ms->bo);
|
||||||
|
|
||||||
MapMem(pScrn);
|
MapMem(pScrn);
|
||||||
|
|
||||||
|
@ -479,8 +486,7 @@ crtc_resize(ScrnInfoPtr pScrn, int width, int height)
|
||||||
pScrn->depth,
|
pScrn->depth,
|
||||||
pScrn->bitsPerPixel,
|
pScrn->bitsPerPixel,
|
||||||
pScrn->displayWidth * pScrn->bitsPerPixel / 8,
|
pScrn->displayWidth * pScrn->bitsPerPixel / 8,
|
||||||
ms->bo.handle,
|
ms->bo.handle, &ms->fb_id);
|
||||||
&ms->fb_id);
|
|
||||||
|
|
||||||
if (ms->shadowFB) {
|
if (ms->shadowFB) {
|
||||||
if ((ms->shadowMem =
|
if ((ms->shadowMem =
|
||||||
|
@ -792,7 +798,8 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||||
pScrn->bitsPerPixel / 8, 0, NULL,
|
pScrn->bitsPerPixel / 8, 0, NULL,
|
||||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_SHAREABLE
|
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_SHAREABLE
|
||||||
| DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_MAPPABLE |
|
| DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_MAPPABLE |
|
||||||
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT, DRM_BO_HINT_DONT_FENCE, &ms->bo);
|
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_TT,
|
||||||
|
DRM_BO_HINT_DONT_FENCE, &ms->bo);
|
||||||
|
|
||||||
MapMem(pScrn);
|
MapMem(pScrn);
|
||||||
|
|
||||||
|
@ -802,8 +809,7 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||||
pScrn->depth,
|
pScrn->depth,
|
||||||
pScrn->bitsPerPixel,
|
pScrn->bitsPerPixel,
|
||||||
pScrn->displayWidth * pScrn->bitsPerPixel / 8,
|
pScrn->displayWidth * pScrn->bitsPerPixel / 8,
|
||||||
ms->bo.handle,
|
ms->bo.handle, &ms->fb_id);
|
||||||
&ms->fb_id);
|
|
||||||
|
|
||||||
if (ms->shadowFB) {
|
if (ms->shadowFB) {
|
||||||
if ((ms->shadowMem =
|
if ((ms->shadowMem =
|
||||||
|
@ -909,7 +915,8 @@ AdjustFrame(int scrnIndex, int x, int y, int flags)
|
||||||
xf86CrtcPtr crtc = output->crtc;
|
xf86CrtcPtr crtc = output->crtc;
|
||||||
|
|
||||||
if (crtc && crtc->enabled) {
|
if (crtc && crtc->enabled) {
|
||||||
crtc->funcs->mode_set(crtc, pScrn->currentMode, pScrn->currentMode, x, y);
|
crtc->funcs->mode_set(crtc, pScrn->currentMode, pScrn->currentMode, x,
|
||||||
|
y);
|
||||||
crtc->x = output->initial_x + x;
|
crtc->x = output->initial_x + x;
|
||||||
crtc->y = output->initial_y + y;
|
crtc->y = output->initial_y + y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,14 +36,16 @@
|
||||||
|
|
||||||
#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
|
#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
int lastInstance;
|
int lastInstance;
|
||||||
int refCount;
|
int refCount;
|
||||||
ScrnInfoPtr pScrn_1;
|
ScrnInfoPtr pScrn_1;
|
||||||
ScrnInfoPtr pScrn_2;
|
ScrnInfoPtr pScrn_2;
|
||||||
} EntRec, *EntPtr;
|
} EntRec, *EntPtr;
|
||||||
|
|
||||||
typedef struct _modesettingRec {
|
typedef struct _modesettingRec
|
||||||
|
{
|
||||||
int fd;
|
int fd;
|
||||||
unsigned int fb_id;
|
unsigned int fb_id;
|
||||||
void *virtual;
|
void *virtual;
|
||||||
|
@ -51,7 +53,7 @@ typedef struct _modesettingRec {
|
||||||
|
|
||||||
EntPtr entityPrivate;
|
EntPtr entityPrivate;
|
||||||
|
|
||||||
void (*PointerMoved)(int, int, int);
|
void (*PointerMoved) (int, int, int);
|
||||||
|
|
||||||
int Chipset;
|
int Chipset;
|
||||||
EntityInfoPtr pEnt;
|
EntityInfoPtr pEnt;
|
||||||
|
|
|
@ -192,7 +192,9 @@ ExaInit(ScrnInfoPtr pScrn)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a 256KB offscreen area */
|
/* Create a 256KB offscreen area */
|
||||||
drmBOCreate(ms->fd, 256 * 1024, 0, NULL, DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_MEM_TT, DRM_BO_HINT_DONT_FENCE, &ms->exa_bo);
|
drmBOCreate(ms->fd, 256 * 1024, 0, NULL,
|
||||||
|
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_MEM_TT,
|
||||||
|
DRM_BO_HINT_DONT_FENCE, &ms->exa_bo);
|
||||||
|
|
||||||
memset(pExa, 0, sizeof(*pExa));
|
memset(pExa, 0, sizeof(*pExa));
|
||||||
pExa->exa_major = 2;
|
pExa->exa_major = 2;
|
||||||
|
|
|
@ -243,23 +243,25 @@ output_init(ScrnInfoPtr pScrn)
|
||||||
|
|
||||||
name = NULL;
|
name = NULL;
|
||||||
if (prop) {
|
if (prop) {
|
||||||
ErrorF("VALUES %d\n",prop->count_values);
|
ErrorF("VALUES %d\n", prop->count_values);
|
||||||
|
|
||||||
for (v=0;v<prop->count_values;v++)
|
for (v = 0; v < prop->count_values; v++)
|
||||||
ErrorF("%s %lld\n", prop->name, prop->values[v]);
|
ErrorF("%s %lld\n", prop->name, prop->values[v]);
|
||||||
|
|
||||||
for (v=0;v<prop->count_enums;v++) {
|
for (v = 0; v < prop->count_enums; v++) {
|
||||||
ErrorF("%s %s\n", prop->name, prop->enums[v].name);
|
ErrorF("%s %s\n", prop->name, prop->enums[v].name);
|
||||||
if (drm_output->prop_values[p] == prop->enums[v].value) {
|
if (drm_output->prop_values[p] == prop->enums[v].value) {
|
||||||
if (!strncmp("Connector Type", prop->name, 14)) {
|
if (!strncmp("Connector Type", prop->name, 14)) {
|
||||||
ErrorF("WE'VE GOT %s\n",prop->enums[v].name);
|
ErrorF("WE'VE GOT %s\n", prop->enums[v].name);
|
||||||
name = xalloc(strlen(prop->enums[v].name));
|
name = xalloc(strlen(prop->enums[v].name));
|
||||||
strncpy(name, prop->enums[v].name, strlen(name));
|
strncpy(name, prop->enums[v].name, strlen(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name) break;
|
if (name)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (name) break;
|
if (name)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,6 +282,6 @@ output_init(ScrnInfoPtr pScrn)
|
||||||
output->doubleScanAllowed = FALSE;
|
output->doubleScanAllowed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue