2003-11-14 17:48:57 +01:00
|
|
|
/*
|
2003-11-25 20:29:01 +01:00
|
|
|
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of the copyright holder(s)
|
|
|
|
* and author(s) shall not be used in advertising or otherwise to promote
|
|
|
|
* the sale, use or other dealings in this Software without prior written
|
|
|
|
* authorization from the copyright holder(s) and author(s).
|
2003-11-14 17:48:57 +01:00
|
|
|
*/
|
2003-11-25 20:29:01 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
* This file contains the interfaces to the bus-specific code
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86Priv.h"
|
|
|
|
|
|
|
|
/* Bus-specific headers */
|
|
|
|
|
|
|
|
#include "xf86Bus.h"
|
|
|
|
|
|
|
|
#define XF86_OS_PRIVS
|
|
|
|
#define NEED_OS_RAC_PROTOS
|
|
|
|
#include "xf86_OSproc.h"
|
|
|
|
|
2006-06-07 23:09:02 +02:00
|
|
|
#include "Pci.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/* Entity data */
|
|
|
|
EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */
|
|
|
|
int xf86NumEntities = 0;
|
|
|
|
static int xf86EntityPrivateCount = 0;
|
|
|
|
BusAccPtr xf86BusAccInfo = NULL;
|
|
|
|
|
2009-02-04 00:07:40 +01:00
|
|
|
BusRec primaryBus = { BUS_NONE, { 0 } };
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2006-07-22 05:35:13 +02:00
|
|
|
static Bool xf86ResAccessEnter = FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
static Bool doFramebufferMode = FALSE;
|
|
|
|
|
2008-10-07 22:08:38 +02:00
|
|
|
/* state change notification callback list */
|
|
|
|
static StateChangeNotificationPtr StateChangeNotificationList;
|
|
|
|
static void notifyStateChange(xf86NotifyState state);
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
* Call the bus probes relevant to the architecture.
|
|
|
|
*
|
|
|
|
* The only one available so far is for PCI and SBUS.
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86BusProbe(void)
|
|
|
|
{
|
|
|
|
xf86PciProbe();
|
2006-12-04 22:36:30 +01:00
|
|
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SbusProbe();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Determine what bus type the busID string represents. The start of the
|
|
|
|
* bus-dependent part of the string is returned as retID.
|
|
|
|
*/
|
|
|
|
|
|
|
|
BusType
|
|
|
|
StringToBusType(const char* busID, const char **retID)
|
|
|
|
{
|
|
|
|
char *p, *s;
|
|
|
|
BusType ret = BUS_NONE;
|
|
|
|
|
|
|
|
/* If no type field, Default to PCI */
|
|
|
|
if (isdigit(busID[0])) {
|
|
|
|
if (retID)
|
|
|
|
*retID = busID;
|
|
|
|
return BUS_PCI;
|
|
|
|
}
|
|
|
|
|
|
|
|
s = xstrdup(busID);
|
|
|
|
p = strtok(s, ":");
|
|
|
|
if (p == NULL || *p == 0) {
|
|
|
|
xfree(s);
|
|
|
|
return BUS_NONE;
|
|
|
|
}
|
|
|
|
if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp"))
|
|
|
|
ret = BUS_PCI;
|
|
|
|
if (!xf86NameCmp(p, "sbus"))
|
|
|
|
ret = BUS_SBUS;
|
|
|
|
if (ret != BUS_NONE)
|
|
|
|
if (retID)
|
|
|
|
*retID = busID + strlen(p) + 1;
|
|
|
|
xfree(s);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Entity related code.
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86EntityInit(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < xf86NumEntities; i++)
|
|
|
|
if (xf86Entities[i]->entityInit) {
|
|
|
|
xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
xf86AllocateEntity(void)
|
|
|
|
{
|
|
|
|
xf86NumEntities++;
|
|
|
|
xf86Entities = xnfrealloc(xf86Entities,
|
|
|
|
sizeof(EntityPtr) * xf86NumEntities);
|
|
|
|
xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec));
|
|
|
|
xf86Entities[xf86NumEntities - 1]->entityPrivates =
|
|
|
|
xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1);
|
|
|
|
return (xf86NumEntities - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
EntityEnter(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < xf86NumEntities; i++)
|
|
|
|
if (xf86Entities[i]->entityEnter) {
|
|
|
|
xf86Entities[i]->entityEnter(i,xf86Entities[i]->private);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
EntityLeave(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < xf86NumEntities; i++)
|
|
|
|
if (xf86Entities[i]->entityLeave) {
|
|
|
|
xf86Entities[i]->entityLeave(i,xf86Entities[i]->private);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86IsEntityPrimary(int entityIndex)
|
|
|
|
{
|
|
|
|
EntityPtr pEnt = xf86Entities[entityIndex];
|
|
|
|
|
2009-01-26 12:23:09 +01:00
|
|
|
if (primaryBus.type != pEnt->bus.type) return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2009-01-26 12:23:09 +01:00
|
|
|
switch (pEnt->bus.type) {
|
2003-11-14 17:48:57 +01:00
|
|
|
case BUS_PCI:
|
2007-01-17 23:04:43 +01:00
|
|
|
return (pEnt->bus.id.pci == primaryBus.id.pci);
|
2003-11-14 17:48:57 +01:00
|
|
|
case BUS_SBUS:
|
2009-01-26 12:23:09 +01:00
|
|
|
return (pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum);
|
2003-11-14 17:48:57 +01:00
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter,
|
|
|
|
EntityProc leave, pointer private)
|
|
|
|
{
|
|
|
|
if (entityIndex >= xf86NumEntities)
|
|
|
|
return FALSE;
|
|
|
|
xf86Entities[entityIndex]->entityInit = init;
|
|
|
|
xf86Entities[entityIndex]->entityEnter = enter;
|
|
|
|
xf86Entities[entityIndex]->entityLeave = leave;
|
|
|
|
xf86Entities[entityIndex]->private = private;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86DriverHasEntities(DriverPtr drvp)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < xf86NumEntities; i++) {
|
|
|
|
if (xf86Entities[i]->driver == drvp)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
|
|
|
|
{
|
|
|
|
if (entityIndex == -1)
|
|
|
|
return;
|
|
|
|
if (xf86Entities[entityIndex]->inUse &&
|
2007-12-20 01:11:26 +01:00
|
|
|
!(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL)) {
|
|
|
|
ErrorF("Requested Entity already in use!\n");
|
|
|
|
return;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScrn->numEntities++;
|
|
|
|
pScrn->entityList = xnfrealloc(pScrn->entityList,
|
|
|
|
pScrn->numEntities * sizeof(int));
|
|
|
|
pScrn->entityList[pScrn->numEntities - 1] = entityIndex;
|
|
|
|
xf86Entities[entityIndex]->inUse = TRUE;
|
|
|
|
pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList,
|
|
|
|
pScrn->numEntities * sizeof(int));
|
|
|
|
pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
|
|
|
|
pScrn->domainIOBase = xf86Entities[entityIndex]->domainIO;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (entityIndex == -1 || entityIndex >= xf86NumEntities)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < pScrn->numEntities; i++) {
|
|
|
|
if (pScrn->entityList[i] == entityIndex) {
|
|
|
|
pScrn->entityInstanceList[i] = instance;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX This needs to be updated for the case where a single entity may have
|
|
|
|
* instances associated with more than one screen.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
ScrnInfoPtr
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86FindScreenForEntity(int entityIndex)
|
|
|
|
{
|
|
|
|
int i,j;
|
|
|
|
|
|
|
|
if (entityIndex == -1) return NULL;
|
|
|
|
|
|
|
|
if (xf86Screens) {
|
|
|
|
for (i = 0; i < xf86NumScreens; i++) {
|
|
|
|
for (j = 0; j < xf86Screens[i]->numEntities; j++) {
|
|
|
|
if ( xf86Screens[i]->entityList[j] == entityIndex )
|
|
|
|
return (xf86Screens[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < pScrn->numEntities; i++) {
|
|
|
|
if (pScrn->entityList[i] == entityIndex) {
|
|
|
|
for (i++; i < pScrn->numEntities; i++)
|
|
|
|
pScrn->entityList[i-1] = pScrn->entityList[i];
|
|
|
|
pScrn->numEntities--;
|
|
|
|
xf86Entities[entityIndex]->inUse = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86ClearEntitiesForScreen() - called when a screen is deleted
|
|
|
|
* to mark it's entities unused. Called by xf86DeleteScreen().
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86ClearEntityListForScreen(int scrnIndex)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
|
|
|
int i, entityIndex;
|
|
|
|
|
|
|
|
if (pScrn->entityList == NULL || pScrn->numEntities == 0) return;
|
|
|
|
|
|
|
|
for (i = 0; i < pScrn->numEntities; i++) {
|
|
|
|
entityIndex = pScrn->entityList[i];
|
|
|
|
xf86Entities[entityIndex]->inUse = FALSE;
|
|
|
|
/* disable resource: call the disable function */
|
|
|
|
}
|
|
|
|
xfree(pScrn->entityList);
|
|
|
|
xfree(pScrn->entityInstanceList);
|
|
|
|
pScrn->entityList = NULL;
|
|
|
|
pScrn->entityInstanceList = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Add an extra device section (GDevPtr) to an entity.
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AddDevToEntity(int entityIndex, GDevPtr dev)
|
|
|
|
{
|
|
|
|
EntityPtr pEnt;
|
|
|
|
|
|
|
|
if (entityIndex >= xf86NumEntities)
|
|
|
|
return;
|
|
|
|
|
|
|
|
pEnt = xf86Entities[entityIndex];
|
|
|
|
pEnt->numInstances++;
|
|
|
|
pEnt->devices = xnfrealloc(pEnt->devices,
|
|
|
|
pEnt->numInstances * sizeof(GDevPtr));
|
|
|
|
pEnt->devices[pEnt->numInstances - 1] = dev;
|
|
|
|
dev->claimed = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86GetEntityInfo() -- This function hands information from the
|
|
|
|
* EntityRec struct to the drivers. The EntityRec structure itself
|
|
|
|
* remains invisible to the driver.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
EntityInfoPtr
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetEntityInfo(int entityIndex)
|
|
|
|
{
|
|
|
|
EntityInfoPtr pEnt;
|
|
|
|
int i;
|
|
|
|
|
2008-03-13 07:16:46 +01:00
|
|
|
if (entityIndex == -1)
|
|
|
|
return NULL;
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
if (entityIndex >= xf86NumEntities)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
pEnt = xnfcalloc(1,sizeof(EntityInfoRec));
|
|
|
|
pEnt->index = entityIndex;
|
|
|
|
pEnt->location = xf86Entities[entityIndex]->bus;
|
|
|
|
pEnt->active = xf86Entities[entityIndex]->active;
|
|
|
|
pEnt->chipset = xf86Entities[entityIndex]->chipset;
|
|
|
|
pEnt->driver = xf86Entities[entityIndex]->driver;
|
|
|
|
if ( (xf86Entities[entityIndex]->devices) &&
|
|
|
|
(xf86Entities[entityIndex]->devices[0]) ) {
|
|
|
|
for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
|
|
|
|
if (xf86Entities[entityIndex]->devices[i]->screen == 0)
|
|
|
|
break;
|
|
|
|
pEnt->device = xf86Entities[entityIndex]->devices[i];
|
|
|
|
} else
|
|
|
|
pEnt->device = NULL;
|
|
|
|
|
|
|
|
return pEnt;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetNumEntityInstances(int entityIndex)
|
|
|
|
{
|
|
|
|
if (entityIndex >= xf86NumEntities)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return xf86Entities[entityIndex]->numInstances;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
GDevPtr
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetDevFromEntity(int entityIndex, int instance)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* We might not use AddDevtoEntity */
|
|
|
|
if ( (!xf86Entities[entityIndex]->devices) ||
|
|
|
|
(!xf86Entities[entityIndex]->devices[0]) )
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (entityIndex >= xf86NumEntities ||
|
|
|
|
instance >= xf86Entities[entityIndex]->numInstances)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
|
|
|
|
if (xf86Entities[entityIndex]->devices[i]->screen == instance)
|
|
|
|
break;
|
|
|
|
return xf86Entities[entityIndex]->devices[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86AccessInit() - set up everything needed for access control
|
|
|
|
* called only once on first server generation.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AccessInit(void)
|
|
|
|
{
|
|
|
|
xf86ResAccessEnter = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86AccessEnter() -- gets called to save the text mode VGA IO
|
|
|
|
* resources when reentering the server after a VT switch.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AccessEnter(void)
|
|
|
|
{
|
|
|
|
if (xf86ResAccessEnter)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* on enter we simply disable routing of special resources
|
|
|
|
* to any bus and let the RAC code to "open" the right bridges.
|
|
|
|
*/
|
|
|
|
EntityEnter();
|
2008-10-07 22:08:38 +02:00
|
|
|
notifyStateChange(NOTIFY_ENTER);
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86EnterServerState(SETUP);
|
|
|
|
xf86ResAccessEnter = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86AccessLeave() -- prepares access for and calls the
|
|
|
|
* entityLeave() functions.
|
|
|
|
* xf86AccessLeaveState() --- gets called to restore the
|
|
|
|
* access to the VGA IO resources when switching VT or on
|
|
|
|
* server exit.
|
|
|
|
* This was split to call xf86AccessLeaveState() from
|
|
|
|
* ddxGiveUp().
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AccessLeave(void)
|
|
|
|
{
|
|
|
|
if (!xf86ResAccessEnter)
|
|
|
|
return;
|
2008-10-07 22:08:38 +02:00
|
|
|
notifyStateChange(NOTIFY_LEAVE);
|
2003-11-14 17:48:57 +01:00
|
|
|
EntityLeave();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86EnableAccess() -- enable access to controlled resources.
|
|
|
|
* To reduce latency when switching access the ScrnInfoRec has
|
|
|
|
* a linked list of the EntityAccPtr of all screen entities.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* switching access needs to be done in te following oder:
|
|
|
|
* disable
|
|
|
|
* 1. disable old entity
|
|
|
|
* 2. reroute bus
|
|
|
|
* 3. enable new entity
|
|
|
|
* Otherwise resources needed for access control might be shadowed
|
|
|
|
* by other resources!
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86EnableAccess(ScrnInfoPtr pScrn)
|
|
|
|
{
|
2009-05-09 02:33:20 +02:00
|
|
|
DebugF("Enable access %i\n",pScrn->scrnIndex);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2009-07-28 06:47:42 +02:00
|
|
|
return;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn)
|
|
|
|
{
|
2009-07-28 06:47:42 +02:00
|
|
|
return;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86EnterServerState() -- set state the server is in.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState;
|
|
|
|
|
|
|
|
static void
|
|
|
|
SetSIGIOForState(xf86State state)
|
|
|
|
{
|
|
|
|
static int sigio_state;
|
|
|
|
static TriState sigio_blocked = TRI_UNSET;
|
|
|
|
|
|
|
|
if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) {
|
|
|
|
sigio_state = xf86BlockSIGIO();
|
|
|
|
sigio_blocked = TRI_TRUE;
|
|
|
|
} else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) {
|
|
|
|
xf86UnblockSIGIO(sigio_state);
|
|
|
|
sigio_blocked = TRI_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86EnterServerState(xf86State state)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* This is a good place to block SIGIO during SETUP state.
|
|
|
|
* SIGIO should be blocked in SETUP state otherwise (u)sleep()
|
|
|
|
* might get interrupted early.
|
|
|
|
* We take care not to call xf86BlockSIGIO() twice.
|
|
|
|
*/
|
|
|
|
SetSIGIOForState(state);
|
|
|
|
if (state == SETUP)
|
2009-05-09 02:33:20 +02:00
|
|
|
DebugF("Entering SETUP state\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
else
|
2009-05-09 02:33:20 +02:00
|
|
|
DebugF("Entering OPERATING state\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/* When servicing a dumb framebuffer we don't need to do anything */
|
|
|
|
if (doFramebufferMode) return;
|
|
|
|
|
2009-07-28 06:47:42 +02:00
|
|
|
notifyStateChange(NOTIFY_ENABLE);
|
|
|
|
return;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86PostProbe() -- Allocate all non conflicting resources
|
|
|
|
* This function gets called by xf86Init().
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86PostProbe(void)
|
|
|
|
{
|
|
|
|
if (fbSlotClaimed) {
|
2008-10-12 04:48:51 +02:00
|
|
|
if (pciSlotClaimed
|
2006-12-04 22:36:30 +01:00
|
|
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
2003-11-14 17:48:57 +01:00
|
|
|
|| sbusSlotClaimed
|
|
|
|
#endif
|
|
|
|
) {
|
|
|
|
FatalError("Cannot run in framebuffer mode. Please specify busIDs "
|
|
|
|
" for all framebuffer devices\n");
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
|
2008-10-07 22:08:38 +02:00
|
|
|
notifyStateChange(NOTIFY_ENABLE);
|
2003-11-14 17:48:57 +01:00
|
|
|
doFramebufferMode = TRUE;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2009-01-11 08:33:18 +01:00
|
|
|
xf86PostPreInit(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
if (doFramebufferMode) return;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86PostScreenInit(void)
|
|
|
|
{
|
2006-06-19 05:54:04 +02:00
|
|
|
if (doFramebufferMode) {
|
|
|
|
SetSIGIOForState(OPERATING);
|
|
|
|
return;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2009-05-09 02:33:20 +02:00
|
|
|
DebugF("PostScreenInit generation: %i\n",serverGeneration);
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86EnterServerState(OPERATING);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xf86FindPrimaryDevice() - Find the display device which
|
|
|
|
* was active when the server was started.
|
|
|
|
*/
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2009-01-11 08:33:18 +01:00
|
|
|
xf86FindPrimaryDevice(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
if (primaryBus.type != BUS_NONE) {
|
|
|
|
char *bus;
|
2007-01-17 21:59:17 +01:00
|
|
|
char loc[16];
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
switch (primaryBus.type) {
|
|
|
|
case BUS_PCI:
|
|
|
|
bus = "PCI";
|
2007-01-17 23:04:43 +01:00
|
|
|
snprintf(loc, sizeof(loc), " %2.2x@%2.2x:%2.2x:%1.1x",
|
|
|
|
primaryBus.id.pci->bus,
|
|
|
|
primaryBus.id.pci->domain,
|
|
|
|
primaryBus.id.pci->dev,
|
|
|
|
primaryBus.id.pci->func);
|
2003-11-14 17:48:57 +01:00
|
|
|
break;
|
|
|
|
case BUS_SBUS:
|
|
|
|
bus = "SBUS";
|
2007-01-17 21:59:17 +01:00
|
|
|
snprintf(loc, sizeof(loc), " %2.2x", primaryBus.id.sbus.fbNum);
|
2003-11-14 17:48:57 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
bus = "";
|
|
|
|
loc[0] = '\0';
|
|
|
|
}
|
2007-01-17 21:59:17 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86MsgVerb(X_INFO, 2, "Primary Device is: %s%s\n",bus,loc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2008-10-07 22:08:38 +02:00
|
|
|
xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
|
|
|
|
{
|
|
|
|
StateChangeNotificationPtr ptr =
|
|
|
|
(StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
|
|
|
|
|
|
|
|
ptr->func = func;
|
|
|
|
ptr->arg = arg;
|
|
|
|
ptr->next = StateChangeNotificationList;
|
|
|
|
StateChangeNotificationList = ptr;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2008-10-07 22:08:38 +02:00
|
|
|
xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func)
|
|
|
|
{
|
|
|
|
StateChangeNotificationPtr *ptr = &StateChangeNotificationList;
|
|
|
|
StateChangeNotificationPtr tmp;
|
|
|
|
|
|
|
|
while (*ptr) {
|
|
|
|
if ((*ptr)->func == func) {
|
|
|
|
tmp = (*ptr);
|
|
|
|
(*ptr) = (*ptr)->next;
|
|
|
|
xfree(tmp);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
ptr = &((*ptr)->next);
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
notifyStateChange(xf86NotifyState state)
|
|
|
|
{
|
|
|
|
StateChangeNotificationPtr ptr = StateChangeNotificationList;
|
|
|
|
while (ptr) {
|
|
|
|
ptr->func(state,ptr->arg);
|
|
|
|
ptr = ptr->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/* Multihead accel sharing accessor functions and entity Private handling */
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetLastScrnFlag(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
return(xf86Entities[entityIndex]->lastScrnFlag);
|
|
|
|
} else {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetLastScrnFlag(int entityIndex, int scrnIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
xf86Entities[entityIndex]->lastScrnFlag = scrnIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86IsEntityShared(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
if(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetEntityShared(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86IsEntitySharable(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
if(xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetEntitySharable(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86IsPrimInitDone(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
if(xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86SetPrimInitDone(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86ClearPrimInitDone(int entityIndex)
|
|
|
|
{
|
|
|
|
if(entityIndex < xf86NumEntities) {
|
|
|
|
xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Allocate a private in the entities.
|
|
|
|
*/
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86AllocateEntityPrivateIndex(void)
|
|
|
|
{
|
|
|
|
int idx, i;
|
|
|
|
EntityPtr pEnt;
|
|
|
|
DevUnion *nprivs;
|
|
|
|
|
|
|
|
idx = xf86EntityPrivateCount++;
|
|
|
|
for (i = 0; i < xf86NumEntities; i++) {
|
|
|
|
pEnt = xf86Entities[i];
|
|
|
|
nprivs = xnfrealloc(pEnt->entityPrivates,
|
|
|
|
xf86EntityPrivateCount * sizeof(DevUnion));
|
|
|
|
/* Zero the new private */
|
|
|
|
bzero(&nprivs[idx], sizeof(DevUnion));
|
|
|
|
pEnt->entityPrivates = nprivs;
|
|
|
|
}
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
DevUnion *
|
2003-11-14 17:48:57 +01:00
|
|
|
xf86GetEntityPrivate(int entityIndex, int privIndex)
|
|
|
|
{
|
|
|
|
if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return &(xf86Entities[entityIndex]->entityPrivates[privIndex]);
|
|
|
|
}
|
|
|
|
|