Merge branch 'server-1.5-branch' of git+ssh://herrb@git.freedesktop.org/git/xorg/xserver into server-1.5-branch

This commit is contained in:
Matthieu Herrb 2008-06-18 09:20:05 +02:00 committed by Matthieu Herrb
commit 7e3ec36e0e
8 changed files with 46 additions and 489 deletions

View file

@ -490,9 +490,11 @@ nooverride:
data = xalloc(pitch * pixmap->drawable.height);
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, 0 /*pixmap->drawable.x*/,
0 /*pixmap->drawable.y*/, pixmap->drawable.width,
pixmap->drawable.height, ZPixmap, ~0, data);
__glXleaveServer(GL_FALSE);
if (pixmap->drawable.depth == 24)
glxFillAlphaChannel(data,
@ -534,9 +536,11 @@ nooverride:
pixmap->drawable.depth);
void *data = xalloc(pitch * (p[i].y2 - p[i].y1));
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, /*pixmap->drawable.x +*/ p[i].x1,
/*pixmap->drawable.y*/ + p[i].y1, p[i].x2 - p[i].x1,
p[i].y2 - p[i].y1, ZPixmap, ~0, data);
__glXleaveServer(GL_FALSE);
if (pixmap->drawable.depth == 24)
glxFillAlphaChannel(data,

View file

@ -2031,6 +2031,8 @@ SELinuxExtensionInit(INITARGS)
ProcSELinuxDispatch, SProcSELinuxDispatch,
SELinuxResetProc, StandardMinorOpcode);
AddExtensionAlias("Flask", extEntry);
/* Label objects that were created before we could register ourself */
SELinuxLabelInitial();
}

View file

@ -1355,8 +1355,6 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
;;
alpha*)
linux_alpha=yes
XORG_OS_PCI="axp"
xorg_bus_linuxpci="no"
;;
i*86|amd64*|x86_64*)
linux_acpi="yes"

View file

@ -359,16 +359,28 @@ V000 SECURITY:AuthorizationRevoked
E000 SECURITY:BadAuthorization
E001 SECURITY:BadAuthorizationProtocol
R000 SELinux:SELinuxQueryVersion
R001 SELinux:SELinuxSetSelectionManager
R002 SELinux:SELinuxGetSelectionManager
R001 SELinux:SELinuxSetDeviceCreateContext
R002 SELinux:SELinuxGetDeviceCreateContext
R003 SELinux:SELinuxSetDeviceContext
R004 SELinux:SELinuxGetDeviceContext
R005 SELinux:SELinuxSetPropertyCreateContext
R006 SELinux:SELinuxGetPropertyCreateContext
R007 SELinux:SELinuxGetPropertyContext
R008 SELinux:SELinuxSetWindowCreateContext
R009 SELinux:SELinuxGetWindowCreateContext
R010 SELinux:SELinuxGetWindowContext
R005 SELinux:SELinuxSetWindowCreateContext
R006 SELinux:SELinuxGetWindowCreateContext
R007 SELinux:SELinuxGetWindowContext
R008 SELinux:SELinuxSetPropertyCreateContext
R009 SELinux:SELinuxGetPropertyCreateContext
R010 SELinux:SELinuxSetPropertyUseContext
R011 SELinux:SELinuxGetPropertyUseContext
R012 SELinux:SELinuxGetPropertyContext
R013 SELinux:SELinuxGetPropertyDataContext
R014 SELinux:SELinuxListProperties
R015 SELinux:SELinuxSetSelectionCreateContext
R016 SELinux:SELinuxGetSelectionCreateContext
R017 SELinux:SELinuxSetSelectionUseContext
R018 SELinux:SELinuxGetSelectionUseContext
R019 SELinux:SELinuxGetSelectionContext
R020 SELinux:SELinuxGetSelectionDataContext
R021 SELinux:SELinuxListSelections
R022 SELinux:SELinuxGetClientContext
R000 SHAPE:QueryVersion
R001 SHAPE:Rectangles
R002 SHAPE:Mask

View file

@ -23,10 +23,6 @@ if XORG_BUS_SPARCPCI
PCI_SOURCES += sparcPci.c
endif
if LINUX_ALPHA
PCI_SOURCES += axpPci.c
endif
if XORG_BUS_SPARC
PLATFORM_SOURCES = Sbus.c
sdk_HEADERS += xf86Sbus.h

View file

@ -189,69 +189,26 @@
#define ARCH_PCI_INIT bsdPciInit
#endif
#if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# if defined(__m32r__)
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif
#endif /* defined(linux) */
#if !defined(ARCH_PCI_INIT)
/*
* Select architecture specific PCI init function
*/
#if defined(__alpha__)
# if defined(linux)
# define ARCH_PCI_INIT axpPciInit
# endif
#elif defined(__arm__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__hppa__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__ia64__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__i386__) || defined(__i386)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# else
# define ARCH_PCI_INIT ix86PciInit
# endif
#elif defined(__mc68000__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__mips__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#if defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__)
# define ARCH_PCI_INIT ix86PciInit
#elif defined(__powerpc__) || defined(__powerpc64__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# else
# define ARCH_PCI_INIT ppcPciInit
# endif
#elif defined(__s390__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
#elif defined(__sh__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# endif
# define ARCH_PCI_INIT ppcPciInit
#elif defined(__sparc__) || defined(sparc)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# elif defined(sun)
# define ARCH_PCI_INIT sparcPciInit
# endif
# if !defined(__FreeBSD__) && !defined(linux)
# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
# endif
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# else
# define ARCH_PCI_INIT ix86PciInit
# endif
# define ARCH_PCI_INIT sparcPciInit
# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
#endif
#endif /* !defined(ARCH_PCI_INIT) */

View file

@ -1,415 +0,0 @@
/*
* Copyright 1998 by Concurrent Computer Corporation
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Concurrent Computer
* Corporation not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Concurrent Computer Corporation makes no representations
* about the suitability of this software for any purpose. It is
* provided "as is" without express or implied warranty.
*
* CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*
* Copyright 1998 by Metro Link Incorporated
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Metro Link
* Incorporated not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Metro Link Incorporated makes no representations
* about the suitability of this software for any purpose. It is
* provided "as is" without express or implied warranty.
*
* METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <stdio.h>
#include "compiler.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "Pci.h"
#include <asm/unistd.h>
#include "../linux/lnx.h" /* for _iobase */
/*
* Alpha/Linux platform specific PCI access functions
*/
static CARD32 axpPciCfgRead(PCITAG tag, int off);
static void axpPciCfgWrite(PCITAG, int off, CARD32 val);
static void axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
static pciBusFuncs_t axpFuncs0 = {
/* pciReadLong */ axpPciCfgRead,
/* pciWriteLong */ axpPciCfgWrite,
/* pciSetBitsLong */ axpPciCfgSetBits,
/* pciAddrHostToBus */ pciAddrNOOP,
/* pciAddrBusToHost */ pciAddrNOOP
};
typedef struct _axpDomainRec {
int domain, hose;
int root_bus;
unsigned long dense_io, sparse_io;
unsigned long dense_mem, sparse_mem;
IOADDRESS mapped_io;
} axpDomainRec, *axpDomainPtr;
#define MAX_DOMAINS (MAX_PCI_BUSES / 256)
static axpDomainPtr xf86DomainInfo[MAX_DOMAINS] = { NULL, };
static int pciNumDomains = 0;
/*
* For debug, domain assignment can start downward from a fixed base
* (instead of up from 0) by defining FORCE_HIGH_DOMAINS. This allows
* debug of large domain numbers and sparse domain numbering on systems
* which don't have as many hoses.
*/
#if 0
# define FORCE_HIGH_DOMAINS MAX_DOMAINS /* assign domains downward from here */
#endif
/*
* If FORCE_HIGH_DOMAINS is set, make sure it's not larger than the
* max domain
*/
#if defined(FORCE_HIGH_DOMAINS) && (FORCE_HIGH_DOMAINS > MAX_DOMAINS)
# undef FORCE_HIGH_DOMAINS
# define FORCE_HIGH_DOMAINS MAX_DOMAINS
#endif
static int
axpSetupDomains(void)
{
axpDomainRec axpDomain;
int numDomains = 0;
int hose;
#ifndef INCLUDE_XF86_NO_DOMAIN
#ifdef FORCE_HIGH_DOMAINS
xf86Msg(X_WARNING,
"DEBUG OPTION FORCE_HIGH_DOMAINS in use - DRI will *NOT* work\n");
numDomains = FORCE_HIGH_DOMAINS;
#endif
/*
* Since each hose has a different address space, hoses are a perfect
* overlay for domains, so set up one domain for each hose present
* in the system. We have to loop through all possible hoses because
* some systems allow sparse I/O controllers.
*/
for(hose = 0; hose < MAX_DOMAINS; hose++) {
axpDomain.root_bus = _iobase(IOBASE_ROOT_BUS, hose, -1, -1);
if (axpDomain.root_bus < 0) continue;
axpDomain.hose = hose;
#ifndef FORCE_HIGH_DOMAINS
axpDomain.domain = axpDomain.hose = hose;
numDomains = axpDomain.domain + 1;
#else /* FORCE_HIGH_DOMAINS */
axpDomain.domain = numDomains - hose - 1;
xf86Msg(X_WARNING,
"FORCE_HIGH_DOMAINS - assigned hose %d to domain %d\n",
axpDomain.hose, axpDomain.domain);
#endif /* FORCE_HIGH_DOMAINS */
axpDomain.dense_io = _iobase(IOBASE_DENSE_IO, hose, -1, -1);
axpDomain.sparse_io = _iobase(IOBASE_SPARSE_IO, hose, -1, -1);
axpDomain.mapped_io = 0;
axpDomain.dense_mem = _iobase(IOBASE_DENSE_MEM, hose, -1, -1);
axpDomain.sparse_mem = _iobase(IOBASE_SPARSE_MEM, hose, -1, -1);
xf86DomainInfo[axpDomain.domain] = xnfalloc(sizeof(axpDomainRec));
*(xf86DomainInfo[axpDomain.domain]) = axpDomain;
/*
* For now, only allow a single domain (hose) on sparse i/o systems.
*
* Allowing multiple domains on sparse systems would require:
* 1) either
* a) revamping the sparse video mapping code to allow
* for multiple unrelated address regions
* -- OR --
* b) implementing sparse mapping directly in
* xf86MapDomainMemory
* 2) revaming read/write sparse routines to correctly handle
* the solution to 1)
* 3) implementing a sparse I/O system (mapping, inX/outX)
* independent of glibc, since the glibc version only
* supports hose 0
*/
if (axpDomain.sparse_io) {
if (_iobase(IOBASE_ROOT_BUS, hose + 1, -1, -1) >= 0) {
/*
* It's a sparse i/o system with (at least) one more hose,
* show a message indicating that video is constrained to
* hose 0
*/
xf86Msg(X_INFO,
"Sparse I/O system - constraining video to hose 0\n");
}
break;
}
}
#else /* INCLUDE_XF86_NO_DOMAIN */
/*
* domain support is not included, so just set up a single domain (0)
* to represent the first hose so that axpPciInit will still have
* be able to set up the root bus
*/
xf86DomainInfo[0] = xnfalloc(sizeof(axpDomainRec));
*(xf86DomainInfo[0]) = axpDomain;
numDomains = 1;
#endif /* INCLUDE_XF86_NO_DOMAIN */
return numDomains;
}
void
axpPciInit()
{
axpDomainPtr pDomain;
int domain, bus;
pciNumDomains = axpSetupDomains();
for(domain = 0; domain < pciNumDomains; domain++) {
if (!(pDomain = xf86DomainInfo[domain])) continue;
/*
* Since any bridged buses will be behind a probed pci-pci bridge,
* only set up the root bus for each domain (hose) and the bridged
* buses will be set up as they are found.
*/
/* make a bus with both the domain and the root bus in it */
bus = PCI_MAKE_BUS(domain, pDomain->root_bus);
pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t));
(void)memset(pciBusInfo[bus], 0, sizeof(pciBusInfo_t));
pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER;
pciBusInfo[bus]->numDevices = 32;
pciBusInfo[bus]->funcs = &axpFuncs0;
pciBusInfo[bus]->pciBusPriv = pDomain;
pciNumBuses = bus + 1;
}
}
/*
* Alpha/Linux PCI configuration space access routines
*/
static int
axpPciBusFromTag(PCITAG tag)
{
pciBusInfo_t *pBusInfo;
axpDomainPtr pDomain;
int bus, dfn;
bus = PCI_BUS_FROM_TAG(tag);
if ((bus >= pciNumBuses)
|| !(pBusInfo = pciBusInfo[bus])
|| !(pDomain = pBusInfo->pciBusPriv)
|| (pDomain->domain != PCI_DOM_FROM_TAG(tag))) return -1;
bus = PCI_BUS_NO_DOMAIN(bus); /* should just be root_bus */
dfn = PCI_DFN_FROM_TAG(tag);
if (_iobase(IOBASE_HOSE, -1, bus, dfn) != pDomain->hose) return -1;
return bus;
}
static CARD32
axpPciCfgRead(PCITAG tag, int off)
{
int bus, dfn;
CARD32 val = 0xffffffff;
if ((bus = axpPciBusFromTag(tag)) >= 0) {
dfn = PCI_DFN_FROM_TAG(tag);
syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
}
return(val);
}
static void
axpPciCfgWrite(PCITAG tag, int off, CARD32 val)
{
int bus, dfn;
if ((bus = axpPciBusFromTag(tag)) >= 0) {
dfn = PCI_DFN_FROM_TAG(tag);
syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
}
}
static void
axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
{
int bus, dfn;
CARD32 val = 0xffffffff;
if ((bus = axpPciBusFromTag(tag)) >= 0) {
dfn = PCI_DFN_FROM_TAG(tag);
syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
val = (val & ~mask) | (bits & mask);
syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
}
}
#ifndef INCLUDE_XF86_NO_DOMAIN
/*
* Alpha/Linux addressing domain support
*/
_X_EXPORT int
xf86GetPciDomain(PCITAG Tag)
{
return PCI_DOM_FROM_TAG(Tag);
}
_X_EXPORT pointer
xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
ADDRESS Base, unsigned long Size)
{
axpDomainPtr pDomain;
int domain = PCI_DOM_FROM_TAG(Tag);
if ((domain < 0) || (domain >= pciNumDomains) ||
!(pDomain = xf86DomainInfo[domain]))
FatalError("%s called with invalid parameters\n", __FUNCTION__);
/*
* xf86MapVidMem already does what we need, but remember to subtract
* _bus_base() (the physical dense memory root of hose 0) since
* xf86MapVidMem is expecting an offset relative to _bus_base() rather
* than an actual physical address.
*/
return xf86MapVidMem(ScreenNum, Flags,
pDomain->dense_mem + Base - _bus_base(), Size);
}
IOADDRESS
xf86MapLegacyIO(struct pci_device *dev)
{
axpDomainPtr pDomain;
const int domain = dev->domain;
if ((domain < 0) || (domain >= pciNumDomains) ||
!(pDomain = xf86DomainInfo[domain]))
FatalError("%s called with invalid parameters\n", __FUNCTION__);
/*
* Use glibc inx/outx routines for sparse I/O, so just return the
* base [this is ok since we also constrain sparse I/O systems to
* a single domain in axpSetupDomains()]
*/
if (pDomain->sparse_io) return 0;
/*
* I/O addresses on Alpha are really just different physical memory
* addresses that the system corelogic turns into I/O commands on the
* bus, so just use xf86MapVidMem to map I/O as well, but remember
* to subtract _bus_base() (the physical dense memory root of hose 0)
* since xf86MapVidMem is expecting an offset relative to _bus_base()
* rather than an actual physical address.
*
* Map the entire I/O space (64kB) at once and only once.
*/
if (!pDomain->mapped_io)
pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(-1, VIDMEM_MMIO,
pDomain->dense_io - _bus_base(),
0x10000);
return pDomain->mapped_io;
}
resPtr
xf86AccResFromOS(resPtr pRes)
{
resRange range;
int domain;
for(domain = 0; domain < pciNumDomains; domain++) {
if (!xf86DomainInfo[domain]) continue;
/*
* Fallback is to claim the following areas:
*
* 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
*/
RANGE(range, 0x000c0000, 0x000effff,
RANGE_TYPE(ResExcMemBlock, domain));
pRes = xf86AddResToList(pRes, &range, -1);
/*
* Fallback would be to claim well known ports in the 0x0 - 0x3ff
* range along with their sparse I/O aliases, but that's too
* imprecise. Instead claim a bare minimum here.
*/
RANGE(range, 0x00000000, 0x000000ff,
RANGE_TYPE(ResExcIoBlock, domain)); /* For mainboard */
pRes = xf86AddResToList(pRes, &range, -1);
/*
* At minimum, the top and bottom resources must be claimed, so that
* resources that are (or appear to be) unallocated can be relocated.
*/
RANGE(range, 0x00000000, 0x00000000,
RANGE_TYPE(ResExcMemBlock, domain));
pRes = xf86AddResToList(pRes, &range, -1);
RANGE(range, 0xffffffff, 0xffffffff,
RANGE_TYPE(ResExcMemBlock, domain));
pRes = xf86AddResToList(pRes, &range, -1);
/* RANGE(range, 0x00000000, 0x00000000,
RANGE_TYPE(ResExcIoBlock, domain));
pRes = xf86AddResToList(pRes, &range, -1); */
RANGE(range, 0xffffffff, 0xffffffff,
RANGE_TYPE(ResExcIoBlock, domain));
pRes = xf86AddResToList(pRes, &range, -1);
}
return pRes;
}
#endif /* !INCLUDE_XF86_NO_DOMAIN */

View file

@ -43,7 +43,8 @@ typedef enum {
XAAOPT_WRITE_BITMAP,
XAAOPT_WRITE_PIXMAP,
XAAOPT_PIXMAP_CACHE,
XAAOPT_OFFSCREEN_PIXMAPS
XAAOPT_OFFSCREEN_PIXMAPS,
XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE
} XAAOpts;
static const OptionInfoRec XAAOptions[] = {
@ -89,6 +90,8 @@ static const OptionInfoRec XAAOptions[] = {
OPTV_BOOLEAN, {0}, FALSE },
{XAAOPT_OFFSCREEN_PIXMAPS, "XaaNoOffscreenPixmaps",
OPTV_BOOLEAN, {0}, FALSE },
{XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE, "XaaOffscreenPixmaps",
OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL,
OPTV_NONE, {0}, FALSE }
};
@ -532,8 +535,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0)
if((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy &&
!xf86ReturnOptValBool(options, XAAOPT_OFFSCREEN_PIXMAPS,
FALSE)) {
xf86IsOptionSet(options, XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE))
{
XAAMSG("\tOffscreen Pixmaps\n");
} else {
infoRec->Flags &= ~OFFSCREEN_PIXMAPS;