From 801c359574d08ff2d6ac75a3325ff522bc862e30 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Aug 2007 15:46:05 -0700 Subject: [PATCH 01/81] Fix fbdevhwstub for pci-rework. --- hw/xfree86/fbdevhw/fbdevhwstub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c index 56ba92901..191a6d33d 100644 --- a/hw/xfree86/fbdevhw/fbdevhwstub.c +++ b/hw/xfree86/fbdevhw/fbdevhwstub.c @@ -1,4 +1,3 @@ - #ifdef HAVE_XORG_CONFIG_H #include #endif @@ -23,13 +22,13 @@ fbdevHWFreeRec(ScrnInfoPtr pScrn) Bool -fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep) +fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) { return FALSE; } Bool -fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device) +fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device) { xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n"); return FALSE; From 9e2112b2b56af099a7f380ece9b5c1d25b20cce4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Aug 2007 18:50:34 -0700 Subject: [PATCH 02/81] Remove unused xf8GetBlock and xf86GetSparse entry points. --- hw/xfree86/common/xf86.h | 6 -- hw/xfree86/common/xf86Bus.c | 207 ------------------------------------ hw/xfree86/loader/xf86sym.c | 2 - 3 files changed, 215 deletions(-) diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 69d619e6f..064107428 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -138,12 +138,6 @@ Bool xf86IsEntityPrimary(int entityIndex); resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); resPtr xf86SetOperatingState(resList list, int entityIndex, int mask); void xf86EnterServerState(xf86State state); -resRange xf86GetBlock(unsigned long type, memType size, - memType window_start, memType window_end, - memType align_mask, resPtr avoid); -resRange xf86GetSparse(unsigned long type, memType fixed_bits, - memType decode_mask, memType address_mask, - resPtr avoid); memType xf86ChkConflict(resRange *rgp, int entityIndex); ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86NoSharedResources(int screenIndex, resType res); diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 537ddf7a4..1959f798e 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -1548,213 +1548,6 @@ RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated #endif -/* - * Resource request code - */ - -#define ALIGN(x,a) ((x) + a) &~(a) - -_X_EXPORT resRange -xf86GetBlock(unsigned long type, memType size, - memType window_start, memType window_end, - memType align_mask, resPtr avoid) -{ - memType min, max, tmp; - resRange r = {ResEnd,0,0}; - resPtr res_range = ResRange; - - if (!size) return r; - if (window_end < window_start || (window_end - window_start) < (size - 1)) { - ErrorF("Requesting insufficient memory window!:" - " start: 0x%lx end: 0x%lx size 0x%lx\n", - window_start,window_end,size); - return r; - } - type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResBlock; - - while (res_range) { - if ((type & ResTypeMask) == (res_range->res_type & ResTypeMask)) { - if (res_range->block_begin > window_start) - min = res_range->block_begin; - else - min = window_start; - if (res_range->block_end < window_end) - max = res_range->block_end; - else - max = window_end; - min = ALIGN(min,align_mask); - /* do not produce an overflow! */ - while (min < max && (max - min) >= (size - 1)) { - RANGE(r,min,min + size - 1,type); - tmp = ChkConflict(&r,Acc,SETUP); - if (!tmp) { - tmp = ChkConflict(&r,avoid,SETUP); - if (!tmp) { - return r; - } - } - min = ALIGN(tmp,align_mask); - } - } - res_range = res_range->next; - } - RANGE(r,0,0,ResEnd); - return r; -} - -#define mt_max ~(memType)0 -#define length sizeof(memType) * 8 -/* - * make_base() -- assign the lowest bits to the bits set in mask. - * example: mask 011010 val 0000110 -> 011000 - */ -static memType -make_base(memType val, memType mask) -{ - int i,j = 0; - memType ret = 0 - ; - for (i = 0;i> j) & 1) << i); - j++; - } - } - return ret; -} - -/* - * make_base() -- assign the bits set in mask to the lowest bits. - * example: mask 011010 , val 010010 -> 000011 - */ -static memType -unmake_base(memType val, memType mask) -{ - int i,j = 0; - memType ret = 0; - - for (i = 0;i> i) & 1) << j); - j++; - } - } - return ret; -} - -static memType -fix_counter(memType val, memType old_mask, memType mask) -{ - mask = old_mask & mask; - - val = make_base(val,old_mask); - return unmake_base(val,mask); -} - -_X_EXPORT resRange -xf86GetSparse(unsigned long type, memType fixed_bits, - memType decode_mask, memType address_mask, resPtr avoid) -{ - resRange r = {ResEnd,0,0}; - memType new_mask; - memType mask1; - memType base; - memType counter = 0; - memType counter1; - memType max_counter = ~(memType)0; - memType max_counter1; - memType conflict = 0; - - /* for sanity */ - type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse; - - /* - * a sparse address consists of 3 parts: - * fixed_bits: F bits which hard decoded by the hardware - * decode_bits: D bits which are used to decode address - * but which may be set by software - * address_bits: A bits which are used to address the - * sparse range. - * the decode_mask marks all decode bits while the address_mask - * masks out all address_bits: - * F D A - * decode_mask: 0 1 0 - * address_mask: 1 1 0 - */ - decode_mask &= address_mask; - new_mask = decode_mask; - - /* - * We start by setting the decode_mask bits to different values - * when a conflict is found the address_mask of the conflicting - * resource is returned. We remove those bits from decode_mask - * that are also set in the returned address_mask as they always - * conflict with resources which use them as address masks. - * The resoulting mask is stored in new_mask. - * We continue until no conflict is found or until we have - * tried all possible settings of new_mask. - */ - while (1) { - base = make_base(counter,new_mask) | fixed_bits; - RANGE(r,base,address_mask,type); - conflict = ChkConflict(&r,Acc,SETUP); - if (!conflict) { - conflict = ChkConflict(&r,avoid,SETUP); - if (!conflict) { - return r; - } - } - counter = fix_counter(counter,new_mask,conflict); - max_counter = fix_counter(max_counter,new_mask,conflict); - new_mask &= conflict; - counter ++; - if (counter > max_counter) break; - } - if (!new_mask && (new_mask == decode_mask)) { - RANGE(r,0,0,ResEnd); - return r; - } - /* - * if we haven't been successful we also try to modify those - * bits in decode_mask that are not at the same time set in - * new mask. These bits overlap with address_bits of some - * resources. If a conflict with a resource of this kind is - * found (ie. returned_mask & mask1 != mask1) with - * mask1 = decode_mask & ~new_mask we cannot - * use our choice of bits in the new_mask part. We try - * another choice. - */ - max_counter = fix_counter(mt_max,mt_max,new_mask); - mask1 = decode_mask & ~new_mask; - max_counter1 = fix_counter(mt_max,mt_max,mask1); - counter = 0; - - while (1) { - counter1 = 0; - while (1) { - base = make_base(counter1,mask1); - RANGE(r,base,address_mask,type); - conflict = ChkConflict(&r,Acc,SETUP); - if (!conflict) { - conflict = ChkConflict(&r,avoid,SETUP); - if (!conflict) { - return r; - } - } - counter1 ++; - if ((mask1 & conflict) != mask1 || counter1 > max_counter1) - break; - } - counter ++; - if (counter > max_counter) break; - } - RANGE(r,0,0,ResEnd); - return r; -} - -#undef length -#undef mt_max - /* * Resource registrarion */ diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 9b8dac82e..cb2a2b911 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -333,8 +333,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86IsEntityPrimary) SYMFUNC(xf86SetOperatingState) SYMFUNC(xf86EnterServerState) - SYMFUNC(xf86GetBlock) - SYMFUNC(xf86GetSparse) SYMFUNC(xf86ChkConflict) SYMFUNC(xf86FindScreenForEntity) SYMFUNC(xf86RegisterStateChangeNotificationCallback) From 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 27 Aug 2007 19:02:41 -0700 Subject: [PATCH 03/81] Remove the BusAccWindows resource code which is now unused. This was a bunch of poorly defined resource ranges per OS/platform combination which were supposed to represent what regions could potentially have resources allocated into them. --- hw/xfree86/common/xf86Bus.c | 8 - hw/xfree86/os-support/bsd/bsdResource.c | 99 ------------ hw/xfree86/os-support/bus/axpPci.c | 28 ---- hw/xfree86/os-support/bus/linuxPci.c | 43 ----- hw/xfree86/os-support/bus/sparcPci.c | 48 ------ hw/xfree86/os-support/linux/lnxResource.c | 178 --------------------- hw/xfree86/os-support/shared/stdResource.c | 55 ------- hw/xfree86/os-support/xf86_OSproc.h | 8 - 8 files changed, 467 deletions(-) diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 1959f798e..3dc08f8a2 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -77,9 +77,6 @@ static resPtr AccReducers = NULL; resPtr Acc = NULL; resPtr osRes = NULL; -/* allocatable ranges */ -resPtr ResRange = NULL; - /* predefined special resources */ _X_EXPORT resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END}; _X_EXPORT resRange resVgaShared[] = {_VGA_SHARED, _END}; @@ -1366,11 +1363,6 @@ xf86ResourceBrokerInit(void) osRes = NULL; - /* Get the addressable ranges */ - ResRange = xf86BusAccWindowsFromOS(); - xf86MsgVerb(X_INFO, 3, "Addressable bus resource ranges are\n"); - xf86PrintResList(3, ResRange); - /* Get the ranges used exclusively by the system */ osRes = xf86AccResFromOS(osRes); xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges:\n"); diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c index 37749c913..586863404 100644 --- a/hw/xfree86/os-support/bsd/bsdResource.c +++ b/hw/xfree86/os-support/bsd/bsdResource.c @@ -23,59 +23,6 @@ _X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - /* - * Only allow the upper half of the pci memory range to be used - * for allocation. The lower half includes magic regions for DMA. - * XXX this is not right for XP1000's and similar where we use the - * region 0x40000000-0xbfffffff for DMA but this only matters if - * the bios screws up the pci region mappings. - */ - RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { @@ -117,52 +64,6 @@ xf86AccResFromOS(resPtr ret) #elif defined(__powerpc__) -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c index e2f086c53..c59c06804 100644 --- a/hw/xfree86/os-support/bus/axpPci.c +++ b/hw/xfree86/os-support/bus/axpPci.c @@ -362,34 +362,6 @@ xf86MapLegacyIO(struct pci_device *dev) return pDomain->mapped_io; } -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr pRes = NULL; - resRange range; - int domain; - - for(domain = 0; domain < pciNumDomains; domain++) { - if (!xf86DomainInfo[domain]) continue; - - RANGE(range, 0, 0xffffffffUL, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, 0x0000ffffUL, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - -resPtr -xf86BusAccWindowsFromOS(void) -{ - return xf86PciBusAccWindowsFromOS(); -} - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index b88fae6c7..11eb4f9e8 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -548,49 +548,6 @@ xf86MapLegacyIO(struct pci_device *dev) return (IOADDRESS)DomainMmappedIO[domain]; } -resPtr -xf86BusAccWindowsFromOS(void) -{ - struct pci_device *dev; - struct pci_device_iterator *iter; - resPtr pRes = NULL; - resRange range; - - iter = pci_id_match_iterator_create(& match_host_bridge); - while ((dev = pci_device_next(iter)) != NULL) { - const int domain = dev->domain; - const struct pciSizes * const sizes = linuxGetSizesStruct(dev); - - RANGE(range, 0, (ADDRESS)(sizes->mem_size - 1), - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, (IOADDRESS)(sizes->io_size - 1), - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - /* FIXME: The old code reserved domain 0 for a special purpose. The - * FIXME: new code just uses whatever domains the kernel tells it, - * FIXME: but there is no way to get a domain < 0. What should - * FIXME: happen here? - * - if (domain <= 0) - break; - */ - } - - pci_iterator_destroy(iter); - - return pRes; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - return xf86BusAccWindowsFromOS(); -} - - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c index 82b1d89b9..6f7113f15 100644 --- a/hw/xfree86/os-support/bus/sparcPci.c +++ b/hw/xfree86/os-support/bus/sparcPci.c @@ -648,54 +648,6 @@ xf86MapLegacyIO(int ScreenNum, int Flags, PCITAG Tag, return (IOADDRESS)pDomain->io + Base; } -resPtr -xf86BusAccWindowsFromOS(void) -{ - sparcDomainPtr pDomain; - resPtr pRes = NULL; - resRange range; - int domain; - - for (domain = 1; domain < pciNumDomains; domain++) { - if (!(pDomain = xf86DomainInfo[domain])) - continue; - - RANGE(range, 0, pDomain->mem_size - 1, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, pDomain->io_size - 1, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - sparcDomainPtr pDomain; - resPtr pRes = NULL; - resRange range; - int domain; - - for (domain = 1; domain < pciNumDomains; domain++) { - if (!(pDomain = xf86DomainInfo[domain])) - continue; - - RANGE(range, 0, pDomain->mem_size - 1, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, pDomain->io_size - 1, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c index 6f89cdb07..bb42d8a97 100644 --- a/hw/xfree86/os-support/linux/lnxResource.c +++ b/hw/xfree86/os-support/linux/lnxResource.c @@ -30,121 +30,6 @@ _X_EXPORT resRange PciAvoid[] = #ifdef __alpha__ -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - /* - * On the Alpha the first 16MB of every 128 Mb segment in - * sparse address space are an image of the ISA bus range - */ - if (_bus_base_sparse()) { - RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - } else { - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - } - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { @@ -193,69 +78,6 @@ xf86AccResFromOS(resPtr ret) defined(__s390__) || \ defined(__hppa__) - /* - * XXX this isn't exactly correct but it will get the server working - * for now until we get something better. - */ - -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c index 555f80526..51d1a2adf 100644 --- a/hw/xfree86/os-support/shared/stdResource.c +++ b/hw/xfree86/os-support/shared/stdResource.c @@ -44,68 +44,13 @@ #include "bus/Pci.h" #ifdef USESTDRES -#define xf86StdBusAccWindowsFromOS xf86BusAccWindowsFromOS #define xf86StdAccResFromOS xf86AccResFromOS -#define xf86StdPciBusAccWindowsFromOS xf86PciBusAccWindowsFromOS -#define xf86StdIsaBusAccWindowsFromOS xf86IsaBusAccWindowsFromOS _X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #endif #ifdef INCLUDE_XF86_NO_DOMAIN -resPtr -xf86StdBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86StdPciBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86StdIsaBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86StdAccResFromOS(resPtr ret) { diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 6f0391dc7..1d6b842fe 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -228,17 +228,9 @@ extern PMClose xf86OSPMOpen(void); #ifdef NEED_OS_RAC_PROTOS /* RAC-related privs */ /* internal to os-support layer */ -resPtr xf86StdBusAccWindowsFromOS(void); -resPtr xf86StdPciAccWindowsFromOS(void); -resPtr xf86StdIsaAccWindowsFromOS(void); resPtr xf86StdAccResFromOS(resPtr ret); /* available to the common layer */ -resPtr xf86BusAccWindowsFromOS(void); -resPtr xf86PciBusAccWindowsFromOS(void); -#ifdef INCLUDE_UNUSED -resPtr xf86IsaBusAccWindowsFromOS(void); -#endif resPtr xf86AccResFromOS(resPtr ret); #endif /* NEED_OS_RAC_PROTOS */ From adf46b57ce6c69ab13a38b09a8104c802d54d052 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 28 Aug 2007 10:08:38 -0700 Subject: [PATCH 04/81] Replace BSD custom PCI code with a stub implementation thanks to pciaccess. Note that pciaccess doesn't yet have Net/OpenBSD support, but the relevant code should go there instead of disconnected code in the X Server. While here, remove the now-disabled INCLUDE_XF86_NO_DOMAIN from the headers, and un-disable xf8StdAccResFromOS for those OSes without domain support which will need it. --- configure.ac | 34 +---- hw/xfree86/os-support/bus/Makefile.am | 8 +- hw/xfree86/os-support/bus/Pci.c | 18 --- hw/xfree86/os-support/bus/Pci.h | 41 +----- hw/xfree86/os-support/bus/bsd_pci.c | 84 +++++++++++ hw/xfree86/os-support/bus/freebsdPci.c | 164 --------------------- hw/xfree86/os-support/bus/netbsdPci.c | 129 ---------------- hw/xfree86/os-support/shared/stdResource.c | 7 +- 8 files changed, 103 insertions(+), 382 deletions(-) create mode 100644 hw/xfree86/os-support/bus/bsd_pci.c delete mode 100644 hw/xfree86/os-support/bus/freebsdPci.c delete mode 100644 hw/xfree86/os-support/bus/netbsdPci.c diff --git a/configure.ac b/configure.ac index 6d7db2d00..1f3743fc2 100644 --- a/configure.ac +++ b/configure.ac @@ -1287,8 +1287,7 @@ XORG_CORE_LIBS="$DIX_LIB $CONFIG_LIB" AC_SUBST([XORG_CORE_LIBS]) xorg_bus_linuxpci=no -xorg_bus_freebsdpci=no -xorg_bus_netbsdpci=no +xorg_bus_bsdpci=no xorg_bus_ix86pci=no xorg_bus_ppcpci=no xorg_bus_sparcpci=no @@ -1397,35 +1396,17 @@ return 0;} freebsd* | kfreebsd*-gnu) XORG_OS="freebsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86) - ;; - *) - xorg_bus_freebsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; netbsd*) XORG_OS="netbsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86|amd64*|x86_64*|ia64*) - ;; - *) - xorg_bus_netbsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; openbsd*) XORG_OS="openbsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86|amd64*|x86_64*|ia64*) - ;; - *) - xorg_bus_freebsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; solaris*) XORG_OS="solaris" @@ -1495,6 +1476,7 @@ return 0;} i*86) case $host_os in darwin*) ;; + *bsd*) ;; *) xorg_bus_ix86pci=yes ;; esac ;; @@ -1513,8 +1495,7 @@ return 0;} ;; x86_64*|amd64*) case $host_os in - darwin*|freebsd*|kfreebsd*-gnu) - # FreeBSD uses the system pci interface + darwin*|*bsd*) ;; *) xorg_bus_ix86pci="yes" @@ -1608,8 +1589,7 @@ return 0;} fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_FREEBSDPCI], [test "x$xorg_bus_freebsdpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_NETBSDPCI], [test "x$xorg_bus_netbsdpci" = xyes]) +AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_IX86PCI], [test "x$xorg_bus_ix86pci" = xyes]) AM_CONDITIONAL([XORG_BUS_PPCPCI], [test "x$xorg_bus_ppcpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARCPCI], [test "x$xorg_bus_sparcpci" = xyes]) diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index fba6e5421..381b9923c 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -7,12 +7,8 @@ if XORG_BUS_LINUXPCI PCI_SOURCES += linuxPci.c endif -if XORG_BUS_FREEBSDPCI -PCI_SOURCES += freebsdPci.c -endif - -if XORG_BUS_NETBSDPCI -PCI_SOURCES += netbsdPci.c +if XORG_BUS_BSDPCI +PCI_SOURCES += bsd_pci.c endif if XORG_BUS_IX86PCI diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index 31e9023f0..a34ed99d0 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -286,21 +286,3 @@ xf86scanpci(void) return success; } - -#ifdef INCLUDE_XF86_NO_DOMAIN - -_X_EXPORT pointer -xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev, - ADDRESS Base, unsigned long Size) -{ - return xf86MapVidMem(ScreenNum, Flags, Base, Size); -} - -IOADDRESS -xf86MapLegacyIO(struct pci_device *dev) -{ - (void) dev; - return 0; -} - -#endif /* INCLUDE_XF86_NO_DOMAIN */ diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 632a7a048..bb93260d1 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -184,35 +184,30 @@ #define PCI_CFGMECH1_MAXDEV 32 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ + defined(__DragonFly__) +#define ARCH_PCI_INIT bsdPciInit +#endif + +#if !defined(ARCH_PCI_INIT) /* * Select architecture specific PCI init function */ #if defined(__alpha__) # if defined(linux) # define ARCH_PCI_INIT axpPciInit -# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN -# elif defined(__NetBSD__) -# define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__arm__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__hppa__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__ia64__) # if defined(linux) # define ARCH_PCI_INIT ia64linuxPciInit -# elif defined(FreeBSD) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif # define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper #elif defined(__i386__) || defined(i386) @@ -221,70 +216,50 @@ # else # define ARCH_PCI_INIT ix86PciInit # endif -# define INCLUDE_XF86_NO_DOMAIN #elif defined(__mc68000__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__mips__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__powerpc__) || defined(__powerpc64__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */ -# elif defined(__FreeBSD__) || defined(__OpenBSD__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN -# elif defined(__NetBSD__) -# define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # else # define ARCH_PCI_INIT ppcPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__s390__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sh__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sparc__) || defined(sparc) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit # elif defined(sun) # define ARCH_PCI_INIT sparcPciInit -# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif # if !defined(__FreeBSD__) && !defined(linux) # define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge # endif #elif defined(__amd64__) || defined(__amd64) -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# define ARCH_PCI_INIT freebsdPciInit -# elif defined(linux) +# if defined(linux) # define ARCH_PCI_INIT linuxPciInit # else # define ARCH_PCI_INIT ix86PciInit # endif -# define INCLUDE_XF86_NO_DOMAIN #endif +#endif /* !defined(ARCH_PCI_INIT) */ #ifndef ARCH_PCI_INIT #error No PCI support available for this architecture/OS combination #endif -#undef INCLUDE_XF86_NO_DOMAIN - extern void ARCH_PCI_INIT(void); #if defined(XF86SCANPCI_WRAPPER) diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c new file mode 100644 index 000000000..bceb1087f --- /dev/null +++ b/hw/xfree86/os-support/bus/bsd_pci.c @@ -0,0 +1,84 @@ +/* + * Copyright © 2007 Intel Corporation + * + * 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 (including the next + * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Eric Anholt + * + */ + +/** + * @file bsd_pci.c + * + * This is a trivial implementation of the remaining PCI support hooks in the + * X Server that is unaware of domains. + * + * Most of even this should go away once drivers are converted and the + * old interfaces are confirmed to all be obsolete. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include +#include "compiler.h" +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "Pci.h" + +#include "pciaccess.h" + +static pciBusFuncs_t bsd_funcs = { + .pciAddrBusToHost = pciAddrNOOP, +}; + +static pciBusInfo_t bsd_pci = { + .configMech = PCI_CFG_MECH_OTHER, + .numDevices = 32, + .secondary = FALSE, + .primary_bus = 0, + .funcs = &bsd_funcs, + .pciBusPriv = NULL, + .bridge = NULL, +}; + +_X_EXPORT pointer +xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev, + ADDRESS Base, unsigned long Size) +{ + return xf86MapVidMem(ScreenNum, Flags, Base, Size); +} + +IOADDRESS +xf86MapLegacyIO(struct pci_device *dev) +{ + (void)dev; + return 0; +} + +void +bsdPciInit(void) +{ + pciNumBuses = 1; + pciBusInfo[0] = &bsd_pci; +} diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c deleted file mode 100644 index ff11c72f4..000000000 --- a/hw/xfree86/os-support/bus/freebsdPci.c +++ /dev/null @@ -1,164 +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 -#endif - -#include -#include "compiler.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "Pci.h" - -#include - -/* - * freebsd platform specific PCI access functions -- using /dev/pci - * needs kernel version 2.2.x - */ -static CARD32 freebsdPciCfgRead(PCITAG tag, int off); -static void freebsdPciCfgWrite(PCITAG, int off, CARD32 val); -static void freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits); - -static pciBusFuncs_t freebsdFuncs0 = { -/* pciReadLong */ freebsdPciCfgRead, -/* pciWriteLong */ freebsdPciCfgWrite, -/* pciSetBitsLong */ freebsdPciCfgSetBits, -/* pciAddrHostToBus */ pciAddrNOOP, -/* pciAddrBusToHost */ pciAddrNOOP -}; - -static pciBusInfo_t freebsdPci0 = { -/* configMech */ PCI_CFG_MECH_OTHER, -/* numDevices */ 32, -/* secondary */ FALSE, -/* primary_bus */ 0, -/* funcs */ &freebsdFuncs0, -/* pciBusPriv */ NULL, -/* bridge */ NULL -}; - -#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) -#if X_BYTE_ORDER == X_BIG_ENDIAN -#ifdef __sparc__ -#ifndef ASI_PL -#define ASI_PL 0x88 -#endif -#define PCI_CPU(val) ({ \ -int __ret; \ -__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \ -__ret; \ -}) -#else -#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \ - ((val >> 8) & 0x0000ff00) | \ - ((val << 8) & 0x00ff0000) | \ - ((val << 24) & 0xff000000)) -#endif -#else -#define PCI_CPU(val) (val) -#endif -#else /* ! OpenBSD */ -/* OpenBSD has already the bytes in the right order - for all architectures */ -#define PCI_CPU(val) (val) -#endif - - -#define BUS(tag) (((tag)>>16)&0xff) -#define DFN(tag) (((tag)>>8)&0xff) - -static int pciFd = -1; - -void -freebsdPciInit() -{ - pciFd = open("/dev/pci", O_RDWR); - if (pciFd < 0) - return; - - pciNumBuses = 1; - pciBusInfo[0] = &freebsdPci0; -} - -static CARD32 -freebsdPciCfgRead(PCITAG tag, int off) -{ - struct pci_io io; - int error; - io.pi_sel.pc_bus = BUS(tag); - io.pi_sel.pc_dev = DFN(tag) >> 3; - io.pi_sel.pc_func = DFN(tag) & 7; - io.pi_reg = off; - io.pi_width = 4; - error = ioctl(pciFd, PCIOCREAD, &io); - if (error) - return ~0; - return PCI_CPU(io.pi_data); -} - -static void -freebsdPciCfgWrite(PCITAG tag, int off, CARD32 val) -{ - struct pci_io io; - io.pi_sel.pc_bus = BUS(tag); - io.pi_sel.pc_dev = DFN(tag) >> 3; - io.pi_sel.pc_func = DFN(tag) & 7; - io.pi_reg = off; - io.pi_width = 4; - io.pi_data = PCI_CPU(val); - ioctl(pciFd, PCIOCWRITE, &io); -} - -static void -freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits) -{ - CARD32 val = freebsdPciCfgRead(tag, off); - val = (val & ~mask) | (bits & mask); - freebsdPciCfgWrite(tag, off, val); -} diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c deleted file mode 100644 index 760302752..000000000 --- a/hw/xfree86/os-support/bus/netbsdPci.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. - * - * 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 XFREE86 PROJECT 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 XFree86 Project - * 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 XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86OSpriv.h" - -#include "Pci.h" - -static CARD32 netbsdPciConfRead(PCITAG, int); -static void netbsdPciConfWrite(PCITAG, int, CARD32); -static void netbsdPciSetBits(PCITAG, int, CARD32, CARD32); - -static int devpci = -1; - -static pciBusFuncs_t netbsdFuncs0 = { -/* pciReadLong */ netbsdPciConfRead, -/* pciWriteLong */ netbsdPciConfWrite, -/* pciSetBitsLong */ netbsdPciSetBits, -/* pciAddrHostToBus */ pciAddrNOOP, -/* pciAddrBusToHost */ pciAddrNOOP -}; - -static pciBusInfo_t netbsdPci0 = { -/* configMech */ PCI_CFG_MECH_OTHER, -/* numDevices */ 32, -/* secondary */ FALSE, -/* primary_bus */ 0, -/* funcs */ &netbsdFuncs0, -/* pciBusPriv */ NULL, -/* bridge */ NULL -}; - -void -netbsdPciInit() -{ - struct pciio_businfo pci_businfo; - - devpci = open("/dev/pci0", O_RDWR); - if (devpci == -1) - FatalError("netbsdPciInit: can't open /dev/pci0\n"); - - pciNumBuses = 1; - pciBusInfo[0] = &netbsdPci0; - /* use businfo to get the number of devs */ - if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0) - FatalError("netbsdPciInit: not a PCI bus device"); - netbsdPci0.numDevices = pci_businfo.maxdevs; -} - -static CARD32 -netbsdPciConfRead(PCITAG tag, int reg) -{ - struct pciio_bdf_cfgreg bdfr; - - bdfr.bus = PCI_BUS_FROM_TAG(tag); - bdfr.device = PCI_DEV_FROM_TAG(tag); - bdfr.function = PCI_FUNC_FROM_TAG(tag); - bdfr.cfgreg.reg = reg; - - if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1) - FatalError("netbsdPciConfRead: failed on %d/%d/%d\n", - bdfr.bus, bdfr.device, bdfr.function); - - return (bdfr.cfgreg.val); -} - -static void -netbsdPciConfWrite(PCITAG tag, int reg, CARD32 val) -{ - struct pciio_bdf_cfgreg bdfr; - - bdfr.bus = PCI_BUS_FROM_TAG(tag); - bdfr.device = PCI_DEV_FROM_TAG(tag); - bdfr.function = PCI_FUNC_FROM_TAG(tag); - bdfr.cfgreg.reg = reg; - bdfr.cfgreg.val = val; - - if (ioctl(devpci, PCI_IOC_BDF_CFGWRITE, &bdfr) == -1) - FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n", - bdfr.bus, bdfr.device, bdfr.function); -} - -static void -netbsdPciSetBits(PCITAG tag, int reg, CARD32 mask, CARD32 bits) -{ - CARD32 val; - - val = netbsdPciConfRead(tag, reg); - val = (val & ~mask) | (bits & mask); - netbsdPciConfWrite(tag, reg, val); -} diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c index 51d1a2adf..2e5c2cf98 100644 --- a/hw/xfree86/os-support/shared/stdResource.c +++ b/hw/xfree86/os-support/shared/stdResource.c @@ -43,14 +43,13 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -#ifdef USESTDRES +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ + defined(__DragonFly__) #define xf86StdAccResFromOS xf86AccResFromOS _X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #endif -#ifdef INCLUDE_XF86_NO_DOMAIN - resPtr xf86StdAccResFromOS(resPtr ret) { @@ -117,5 +116,3 @@ xf86StdAccResFromOS(resPtr ret) /* XXX add others */ return ret; } - -#endif /* INCLUDE_XF86_NO_DOMAIN */ From 87295b66a972a2bd194a79af6aa4f715018fcded Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Aug 2007 15:54:32 -0700 Subject: [PATCH 05/81] Bug #9629: Remove badly-licensed neomagic kdrive files. Licensing issues of these files include: - They claim to be licensed under the GPL, yet we haven't allowed that in the xserver repository in the past. - They refer the user to the top of the tree for GPL license text, yet it isn't there. - They claim to be derived from the (MIT-licensed) ati kdrive code, yet don't follow the licensing terms of those files. --- hw/kdrive/Makefile.am | 2 +- hw/kdrive/neomagic/backend.c | 86 ------------------------------------ hw/kdrive/neomagic/backend.h | 70 ----------------------------- 3 files changed, 1 insertion(+), 157 deletions(-) delete mode 100644 hw/kdrive/neomagic/backend.c delete mode 100644 hw/kdrive/neomagic/backend.h diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am index 267d772e2..5803644d5 100644 --- a/hw/kdrive/Makefile.am +++ b/hw/kdrive/Makefile.am @@ -1,5 +1,5 @@ if KDRIVEVESA -VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ +VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga nvidia pm2 r128 \ smi via endif diff --git a/hw/kdrive/neomagic/backend.c b/hw/kdrive/neomagic/backend.c deleted file mode 100644 index 12fbf030a..000000000 --- a/hw/kdrive/neomagic/backend.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Generic card driving functions. - * Essentially, cascades calls to fbdev and vesa to initialize cards that - * do not have hardware-specific routines yet. Copied from the ati driver. - * - * Copyright (c) 2004 Brent Cook - * - * This code is licensed under the GPL. See the file COPYING in the root - * directory of the sources for details. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "backend.h" - -Bool -backendInitialize(KdCardInfo *card, BackendInfo *backend) -{ - Bool success = FALSE; - -#ifdef KDRIVEVESA - if (!success && vesaInitialize(card, &backend->priv.vesa)) { - success = TRUE; - backend->type = VESA; - backend->cardfini = vesaCardFini; - backend->scrfini = vesaScreenFini; - backend->initScreen = vesaInitScreen; - backend->finishInitScreen = vesaFinishInitScreen; - backend->createRes = vesaCreateResources; - backend->preserve = vesaPreserve; - backend->restore = vesaRestore; - backend->dpms = vesaDPMS; - backend->enable = vesaEnable; - backend->disable = vesaDisable; - backend->getColors = vesaGetColors; - backend->putColors = vesaPutColors; - } -#endif -#ifdef KDRIVEFBDEV - if (!success && fbdevInitialize(card, &backend->priv.fbdev)) { - success = TRUE; - backend->type = FBDEV; - backend->cardfini = fbdevCardFini; - backend->scrfini = fbdevScreenFini; - backend->initScreen = fbdevInitScreen; - backend->finishInitScreen = fbdevFinishInitScreen; - backend->createRes = fbdevCreateResources; - backend->preserve = fbdevPreserve; - backend->restore = fbdevRestore; - backend->dpms = fbdevDPMS; - backend->enable = fbdevEnable; - backend->disable = fbdevDisable; - backend->getColors = fbdevGetColors; - backend->putColors = fbdevPutColors; - } -#endif - return success; -} - -Bool -backendScreenInitialize(KdScreenInfo *screen, BackendScreen *backendScreen, - BackendInfo *backendCard) -{ - Bool success = FALSE; - -#ifdef KDRIVEFBDEV - if (backendCard->type == FBDEV) { - screen->card->driver = &backendCard->priv.fbdev; - success = fbdevScreenInitialize(screen, &backendScreen->fbdev); - screen->memory_size = backendCard->priv.fbdev.fix.smem_len; - screen->off_screen_base = backendCard->priv.fbdev.var.yres_virtual - * screen->fb[0].byteStride; - } -#endif -#ifdef KDRIVEVESA - if (backendCard->type == VESA) { - screen->card->driver = &backendCard->priv.vesa; - if (screen->fb[0].depth == 0) { - screen->fb[0].depth = 16; - } - success = vesaScreenInitialize(screen, &backendScreen->vesa); - } -#endif - return success; -} diff --git a/hw/kdrive/neomagic/backend.h b/hw/kdrive/neomagic/backend.h deleted file mode 100644 index 33eae2680..000000000 --- a/hw/kdrive/neomagic/backend.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Generic card driving functions. - * Essentially, cascades calls to fbdev and vesa to initialize cards that - * do not have hardware-specific routines yet. Copied from the ati driver. - * - * Copyright (c) 2004 Brent Cook - * - * This code is licensed under the GPL. See the file COPYING in the root - * directory of the sources for details. - */ - -#ifndef _BACKEND_H_ -#define _BACKEND_H_ -#include "kdrive.h" - -#ifdef KDRIVEFBDEV -#include -#endif -#ifdef KDRIVEVESA -#include -#endif - -typedef enum _BackendType {VESA, FBDEV} BackendType; - -typedef struct _BackendInfo { - // backend info - BackendType type; - - // backend internal structures - union { -#ifdef KDRIVEFBDEV - FbdevPriv fbdev; -#endif -#ifdef KDRIVEVESA - VesaCardPrivRec vesa; -#endif - } priv; - - // pointers to helper functions for this backend - void (*cardfini)(KdCardInfo *); - void (*scrfini)(KdScreenInfo *); - Bool (*initScreen)(ScreenPtr); - Bool (*finishInitScreen)(ScreenPtr pScreen); - Bool (*createRes)(ScreenPtr); - void (*preserve)(KdCardInfo *); - void (*restore)(KdCardInfo *); - Bool (*dpms)(ScreenPtr, int); - Bool (*enable)(ScreenPtr); - void (*disable)(ScreenPtr); - void (*getColors)(ScreenPtr, int, int, xColorItem *); - void (*putColors)(ScreenPtr, int, int, xColorItem *); -} BackendInfo; - -typedef union _BackendScreen { -#ifdef KDRIVEFBDEV - FbdevScrPriv fbdev; -#endif -#ifdef KDRIVEVESA - VesaScreenPrivRec vesa; -#endif -} BackendScreen; - -Bool -backendInitialize(KdCardInfo *card, BackendInfo *backend); - -Bool -backendScreenInitialize(KdScreenInfo *screen, BackendScreen *backendScreen, - BackendInfo *backendCard); - -#endif From 5aaf00190157114780ab51f7268b396459ed1cad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Aug 2007 16:05:23 -0700 Subject: [PATCH 06/81] Add more generated files to .gitignore. --- .gitignore | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.gitignore b/.gitignore index e4b3d3199..27132c0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ config.log config.status config.sub configure +configure.lineno depcomp install-sh libtool @@ -91,6 +92,8 @@ cfb32/cfbzerarcG.c cfb32/cfbzerarcX.c doc/Xserver.1x doc/Xserver.man +doc/SecurityPolicy.5 +doc/SecurityPolicy.man hw/dmx/Xdmx hw/dmx/Xdmx.1x hw/dmx/config/dmxtodmx @@ -206,31 +209,58 @@ hw/xfree86/xaa/mf3-xaaBitmap.c hw/xfree86/xaa/mf3-xaaStipple.c hw/xfree86/xaa/s-xaaDashLine.c hw/xfree86/xaa/s-xaaLine.c +hw/xfree86/xf1bpp/maskbits.c +hw/xfree86/xf1bpp/mfbbitblt.c hw/xfree86/xf1bpp/mfbbltC.c hw/xfree86/xf1bpp/mfbbltCI.c hw/xfree86/xf1bpp/mfbbltG.c hw/xfree86/xf1bpp/mfbbltO.c hw/xfree86/xf1bpp/mfbbltX.c +hw/xfree86/xf1bpp/mfbbres.c +hw/xfree86/xf1bpp/mfbbresd.c +hw/xfree86/xf1bpp/mfbclip.c +hw/xfree86/xf1bpp/mfbcmap.c +hw/xfree86/xf1bpp/mfbfillarc.c +hw/xfree86/xf1bpp/mfbfillrct.c +hw/xfree86/xf1bpp/mfbfillsp.c +hw/xfree86/xf1bpp/mfbfont.c +hw/xfree86/xf1bpp/mfbgc.c +hw/xfree86/xf1bpp/mfbgetsp.c hw/xfree86/xf1bpp/mfbigbblak.c hw/xfree86/xf1bpp/mfbigbwht.c +hw/xfree86/xf1bpp/mfbhrzvert.c +hw/xfree86/xf1bpp/mfbimage.c +hw/xfree86/xf1bpp/mfbline.c +hw/xfree86/xf1bpp/mfbmisc.c hw/xfree86/xf1bpp/mfbpablack.c hw/xfree86/xf1bpp/mfbpainv.c hw/xfree86/xf1bpp/mfbpawhite.c hw/xfree86/xf1bpp/mfbpgbblak.c hw/xfree86/xf1bpp/mfbpgbinv.c hw/xfree86/xf1bpp/mfbpgbwht.c +hw/xfree86/xf1bpp/mfbpixmap.c hw/xfree86/xf1bpp/mfbplyblack.c hw/xfree86/xf1bpp/mfbplyinv.c hw/xfree86/xf1bpp/mfbplywhite.c +hw/xfree86/xf1bpp/mfbpntwin.c +hw/xfree86/xf1bpp/mfbpolypnt.c +hw/xfree86/xf1bpp/mfbpushpxl.c +hw/xfree86/xf1bpp/mfbscrclse.c +hw/xfree86/xf1bpp/mfbscrinit.c hw/xfree86/xf1bpp/mfbseg.c +hw/xfree86/xf1bpp/mfbsetsp.c hw/xfree86/xf1bpp/mfbteblack.c hw/xfree86/xf1bpp/mfbtewhite.c hw/xfree86/xf1bpp/mfbtileC.c hw/xfree86/xf1bpp/mfbtileG.c +hw/xfree86/xf1bpp/mfbwindow.c +hw/xfree86/xf1bpp/mfbzerarc.c hw/xfree86/xf4bpp/mfbseg.c hw/xfree86/xf8_32bpp/cfbgc32.c hw/xfree86/xf8_32bpp/cfbgc8.c hw/xfree86/xorg.c +hw/xfree86/xorg.conf.example +hw/xfree86/xorg.conf.example.pre hw/xnest/Xnest hw/xnest/Xnest.1x hw/xnest/Xnest.man From 45efe85003195bd45501630cef08349abb180c3a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Aug 2007 16:05:51 -0700 Subject: [PATCH 07/81] Remove stale changelogs from kdrive. --- hw/kdrive/ati/ChangeLog | 622 ----------------------------------- hw/kdrive/neomagic/ChangeLog | 98 ------ 2 files changed, 720 deletions(-) delete mode 100644 hw/kdrive/ati/ChangeLog delete mode 100644 hw/kdrive/neomagic/ChangeLog diff --git a/hw/kdrive/ati/ChangeLog b/hw/kdrive/ati/ChangeLog deleted file mode 100644 index a76712897..000000000 --- a/hw/kdrive/ati/ChangeLog +++ /dev/null @@ -1,622 +0,0 @@ -2006-02-15 Keith Packard - - * Makefile.am: - * ati.c: (ATIMapReg): - * ati.h: - * ati_cursor.c: (ATIMoveCursor), (ClassicSetCursorColors), - (ClassicLoadCursor), (RadeonLoadCursor), (ATIUnloadCursor): - Fix kdrive pointer signed/unsigned types. - -2006-02-14 Eric Anholt - - * ati_draw.c: (ATIDrawDisable): - Remove the waitSync from KdDisableScreen and push it off to drivers' - disableAccel hook, which is more correct anyway. This makes kdrive.c - not have any knowledge of kaa, opening the way for using exa from - kdrive. - -2006-02-09 Keith Packard - - reviewed by: Eric Anholt - - * ati_video.c: (RadeonDisplayVideo): - Replace TRI_FAN with RECT_LIST to eliminate tearing - -2005-08-07 Keith Packard - - * ati_video.c: (RadeonDisplayVideo): - Build with modular X libraries and headers - -2005-06-09 Eric Anholt - - * ati.h: - * ati_video.c: - Axe a few dead fields from the port priv struct and add my name to - the "Copyright" line of the license to ati_video.c that already has my - name in the text. - -2005-06-09 Eric Anholt - - * ati_dri.c: - Perform a warnings sweep on hw/kdrive. A number of these were my fault, - but some come from others. - -2005-06-09 Eric Anholt - - * ati.c: - * ati.h: - * ati_draw.c: (ATIWaitMarker), (ATIGetOffsetPitch), - (ATIUploadToScreen), (ATIUploadToScratch), (ATIDrawInit), - (ATIDrawEnable): - * ati_dri.c: (ATIDRISwapContext): - * ati_video.c: (R128DisplayVideo), (RadeonDisplayVideo): - - Replace the syncAccel hook in the kdrive structure with a pair of - hooks in the kaa structure: markSync and waitMarker. The first, if - set, returns a hardware-dependent marker number which can then be - waited for with waitMarker. If markSync is absent (which is the case - on all drivers currently), waitMarker must wait for idle on any given - marker number. The intention is to allow for more parallelism when - we get downloading from framebuffer, or more fine-grained idling. - - Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and - kaaWaitSync. These will need to be refined when KAA starts being - smart about using them. Merge kpict.c into kasync.c since kasyn.c has - all the rest of these fallback funcs. - - Restructure all drivers to initialize a KaaInfo structure by hand - rather than statically in dubious order. - - Whack the i810 driver into shape in hopes that it'll work after this - change (it certainly wouldn't have before this). Doesn't support my - i845 though. - - Make a new KXV helper to avoid duplicated code to fill the region - with the necessary color key. Use it in i810 and mach64 (tested). - -2005-02-28 Keith Packard - - * ati_reg.h: - Add macrovision register defines - -2005-01-24 19:37 anholt - - * ati_dma.c, ati_draw.c, ati_reg.h: Finish converting RB2D_DSTCACHE - to RB3D_DSTCACHE. Remove an extra pixel cache flush in the idle - function. Init an extra reg for r200, and annotate the - TCL_BYPASS better. Also, clean up some style nits from the last - commit. - -2005-01-24 18:39 keithp - - * ati.h, ati_draw.c, ati_reg.h, radeon_composite.c: Add tracing. - Hack Radeon cache registers to use 3D addresses. Works on M6 - -2005-01-24 17:38 anholt - - * ati_dri.c: Silence a warning about uninitialized variable (though - it would be). - -2005-01-20 08:22 anholt - - * ati_dma.c, ati_dma.h, ati_dri.c: Add a set of macros for dealing - with the repeated code to wait for a while reading a - register/attempting DMA. Now it'll wait for a certain number of - seconds rather than a certain number of times through the loop - before deciding that it's timed out and resetting the hardware. - Also, add more timeout handling, and reset the draw state after - resetting the engine. - -2005-01-19 23:28 anholt - - * radeon_composite.c: Use RadeonSwitchTo3D() instead of doing the - WAIT_UNTIL ourselves (RST3D() also does DC_FLUSH, which may be - important). - -2005-01-19 23:09 anholt - - * ati_video.c: Add R200 XV support, and make R100 (hopefully) use - linear filtering instead of nearest. Also, use RadeonSwitchTo3D - instead of doing the WAIT_UNTIL ourselves. - -2005-01-19 17:09 anholt - - * ati_dma.c, ati_reg.h: Make R200 PDMA work -- primary queue sizes - are now 9 bits, not 8. - -2004-12-22 10:39 anholt - - * ati_draw.c, ati_reg.h, radeon_composite.c: Back out the previous - day's broken R200 "fix" -- the same number of coords are always - emitted. Fix the real problem, which was not enough regs being - initialized in ati_draw.c. Fix a typo that was resulting in - alpha coming out as 0 * src or 0 * broken instead of src * 1 or - src * mask. Assign the blending results to R0, as appears to be - necessary. Unbreak the dst-alpha-blend-with-no-dst-alpha code. - Yow. And set the right DMA count for the r200 traps code. - -2004-12-21 01:51 anholt - - * ati_draw.c, radeon_composite.c: Fix r200 render (for real this - time?) by setting tex1_comp_cnt right for non-mask rendering. - Reenable it. Also, R200TexFormats was used instead of R100 in - one place. Harmless so far, because the formats were in the same - order. - -2004-12-21 01:49 anholt - - * ati_dri.c: Whitespace nit. - -2004-09-19 20:12 anholt - - * ati_draw.c, ati_reg.h, radeon_composite.c: Fix the R200 Render - code. Composite and Trapezoids are now supported just as well as - on R100. - -2004-09-19 03:57 anholt - - * ati_dri.c, ati_reg.h: Unbreak the AGP DRI case. That was quite a - pile of broken code. - -2004-09-13 23:26 anholt - - * ati.c, ati_reg.h: Add proper PCI/AGP detection, based on Mike - Harris's code for Radeon, but using the MMIO mirror of the bits - instead of config space. - -2004-09-12 16:22 anholt - - * ati_draw.c: - Fix a segfault on VT switch with DRI. Still dies - due to cursor allocation troubles. - Move the - RemoveBlockAndWakeupHandlers to match - RegisterBlockAndWakeupHandlers. - Enable R100 trapezoid - "acceleration" when DRI is working, so that it can be exposed - and worked on. - -2004-09-12 16:01 anholt - - * ati_dri.c: Fix a bad argument missed in the previous commit for - ATIDRIDMA* functions. - -2004-09-12 15:21 anholt - - * ati_draw.c: Move the RegisterBlockAndWakeupHandlers to before DRI - initialization. The change to use that instead of manual - wrapping made the DMA dispatch come after the lock had been - dropped, causing lots of pain. - -2004-09-12 13:31 anholt - - * ati.h, ati_dma.c, ati_dri.c: Reset the CCE/CP on engine reset, - and make the ATIDRIDMA functions take a more useful argument. - -2004-09-12 13:19 anholt - - * ati_draw.c: Add missing kaa.h include for kaaInitTrapOffsets. - -2004-09-12 13:02 anholt - - * ati_dri.c: Fix handling of is_agp. is_agp is whether the card is - actually AGP, while using_agp should say whether AGP is being - used as part of DMA/DRI. - -2004-09-12 12:52 anholt - - * ati_dma.c, ati_dma.h, ati_dri.c: Improve error handling, - especially in the DRI case. Do some FatalErrors instead of - ErrorFs for things that are really bad, and put limits on some - loops. Now, sometimes instead of hanging the entire system, we - (mostly-) cleanly drop to console when the card has hung. - -2004-09-11 02:28 anholt - - * ati.h, ati_dma.h, ati_draw.c, ati_draw.h, ati_reg.h, - r128_composite.c, radeon_composite.c: - Add disabled WIP - trapezoid code for R128 and R100. The R128 rendering is not - doing an add of 1 per triangle like I hoped, and instead seems - to be saturating all the pixels or something. The R100 - acceleration renders pretty well, with some gaps. Note that - both are slower than software due to lack of DMA to submit - vertices. - Mostly fix R128 and Radeon transform support, - including supporting bilinear filtering on R128. Subpixel - offsets are still probably an issue (reported by rendercheck), - but I want to make 100% sure about my understanding of the - protocol before changing everybody, including fb. - Add support - for dst formats without alpha to R128 Composite. - Remove the - R128 Blend code, which has long outlived its usefulness. (I - kept it around for one reason: It could be useful for the w/h - > 1024 case with no mask and a non-src op. That seems pretty - infrequent and not worth the trouble). - -2004-07-24 10:02 keithp - - * ati.c: Check for mmio before restoring crtc/crtc2 pitch registers - -2004-07-22 11:17 keithp - - * ati.c, ati.h, ati_cursor.c, ati_reg.h: 2004-07-22 Keith Packard - - - reviewed by: - - * hw/kdrive/ati/ati.c: (ATISetOffscreen), (ATISetPitch), - (ATIRandRSetConfig), (ATIPreserve), (ATIRestore), - (ATIEnable): - * hw/kdrive/ati/ati.h: - * hw/kdrive/ati/ati_cursor.c: (RadeonLoadCursor), - (ATIUnloadCursor), (ATICursorEnable): - * hw/kdrive/ati/ati_reg.h: - Correct pitch so that accelerator can run on 1400x1050 - screens. - Add a few more register sets for cursors. - -2004-07-19 05:07 anholt - - * radeon_composite.c: Add support for a8b8g8r8 and x8b8g8r8 - pictures, which showed up frequently with metacity usage. - -2004-07-19 04:42 anholt - - * ati_cursor.c: Breakage in last commit to this file: - pCurPriv->area isn't set up until Enable, these days. - -2004-07-19 04:19 anholt - - * ati_draw.c: Set the right number of texture coordinates for r200 - Render support (still disabled, needs to be tested). - -2004-07-19 04:16 anholt - - * r128_composite.c, radeon_composite.c: - Add Radeon picture - transform support. - On R128, don't refer to an old Composite's - mask transform when the current Composite doesn't have a mask. - - Staticize some global variables in r128_composite.c. - -2004-07-19 00:53 anholt - - * ati.c, ati.h, ati_cursor.c, ati_draw.c, ati_draw.h: Use the - offscreen memory manager as much as possible to do the - reservation of memory at startup. Do some drive-by cleanups - while I'm here (sorry!). - -2004-07-19 00:20 anholt - - * r128_composite.c: Add support for transforms of textures on R128. - -2004-07-03 03:23 anholt - - * r128_composite.c: Clean up Rage 128 composite code. Now it - composites more operations correctly and is simpler. - -2004-06-27 17:48 keithp - - * ati.c, ati.h, ati_cursor.c, ati_draw.c: 2004-06-27 Keith Packard - - - * hw/kdrive/ati/ati.c: (ATICardInit), (ATISetOffscreen), - (ATIScreenInit), (ATIRandRSetConfig), (ATIRandRInit), - (ATIFinishInitScreen), (ATIEnable): - * hw/kdrive/ati/ati.h: - * hw/kdrive/ati/ati_cursor.c: (ATICursorInit): - * hw/kdrive/ati/ati_draw.c: (RadeonSwitchTo2D), - (RadeonSwitchTo3D), - (ATIBlockHandler), (ATIWakeupHandler), (ATIDrawEnable), - (ATIDrawDisable), (ATIDrawFini): - Separate out off-screen allocation from Init. - Fix Enable to update off-screen addresses. - Wrap RandR to update off-screen addresses. - - * hw/kdrive/fbdev/fbdev.c: (fbdevMapFramebuffer): - Set off_screen_base and memory_size fields correctly. - -2004-06-25 21:13 keithp - - * ati.c, ati_cursor.c, ati_draw.c, ati_reg.h: 2004-06-25 Keith - Packard - - * hw/kdrive/ati/ati.c: (ATIScreenInit): - * hw/kdrive/ati/ati_cursor.c: (ATIMoveCursor), - (ClassicAllocCursorColors), (ClassicSetCursorColors), - (ClassicRecolorCursor), (ClassicLoadCursor), - (RadeonLoadCursor), - (ATIRealizeCursor), (ATISetCursor), (ATICursorEnable), - (ATIRecolorCursor): - * hw/kdrive/ati/ati_draw.c: (ATIDrawFini): - * hw/kdrive/ati/ati_reg.h: - Add ARGB cursor support for Radeon cards. - -2004-06-10 12:22 anholt - - * ati_draw.c: - Pass the right pixel mask (all ones) in to - PrepareSolid in the solid-fill-based composite acceleration. - - Use a real pixmap when doing an UploadToScratch (For - pDrawable->type == DRAWABLE_WINDOW, you need to get the backing - pixmap). - Pass back the x/y offsets from kaaGetOffscreenPixmap - unconditionally, because they'll be used in the scratch case. - - Turn on the Render acceleration for Rage 128 and Radeon - 100-series at last! - -2004-06-10 02:50 anholt - - * ati_draw.c: Align scratch area offsets to the offscreen byte - alignment. - -2004-06-10 01:37 anholt - - * ati_dma.c: Oops, testers reported that the last patch actually - didn't work (conflicts occurred), so the R300 PDMA doesn't work. - Disable. - -2004-06-09 22:57 anholt - - * ati_dma.c, ati_microcode.c: Bug #242: Fix setup of R300 cards, by - providing R300 CP code from volodya-project and initializing - PDMA. - -2004-05-17 13:18 anholt - - * Makefile.am, ati.c, ati.h, ati_cursor.c, ati_dma.c, ati_dma.h, - ati_draw.c, ati_draw.h, ati_dri.c, ati_microcode.c, ati_reg.h, - ati_video.c, r128_composite.c, radeon_composite.c: Overhaul of - the ATI driver: - Add monochrome hardware cursor support. - Try - to auto-detect AGP support for DRI on Radeons. And fail. - Detect it properly on R128. - Set up card for pseudo-DMA if - possible. Convert 2D rendering code to prepare DMA packets - only. Use generic code to decode DMA packets to MMIO if PDMA - is unavailable. Add WIP code to support "real" DMA without DRM - support. - Dispatch pending DMA commands when the server sleeps. - Otherwise some things, such as typing in an xterm, wouldn't - show up for a time. - Fix Radeon Composite acceleration in - many ways, and add Rage 128 Composite acceleration. Disable - them both due to still-not-understood issues they have. They - fail with In, Out, AtopReverse, and Xor, and text rendering is - strange. - Add textured XV support for R100 and Rage 128. No - brightness/sat controls, but it does support multiple ports, - and cooperates with Composite. - Add WIP code for hostdata - uploads. - Many cleanups and fixes. - -2004-01-24 21:31 anholt - - * ati_dri.c: Disable GLX visuals code on !GLXEXT, and remove a - useless prototype. - -2004-01-24 17:30 anholt - - * ati.c, ati.h, ati_dri.c, radeon_composite.c: - Add glx visuals - code based on XFree86's Radeon driver. - Reserve areas for - back/depth/span when USING_DRI && GLXEXT. This would be better - in a TransitionTo3d, but we'd need to work with the offscreen - memory manager for that. - Misc. fixes to ati_dri.c for DRI+GLX. - Needs more work still. - -2004-01-24 17:16 anholt - - * ati_draw.h: Oops, turn fallback output back off. - -2004-01-24 17:04 anholt - - * ati_dri.c: Whitespace cleanup. - -2004-01-10 16:10 anholt - - * ati_draw.c, r128_blendtmp.h: Support 1x1 repeat sources in R128's - Blend. - -2004-01-09 00:43 anholt - - * ati.c, ati.h, ati_draw.c, ati_draw.h, ati_dri.c: Change PCI ID - information field to be one of r128, r100, r200, r300. This is - all the information we need so far. Put that information into - atic, and use it correctly in the code (unlike before). - -2004-01-08 12:18 anholt - - * ati_draw.c, radeon_composite.c: Compile fixes for non-DRI case - and for non-C99 compiler. - -2004-01-08 00:25 anholt - - * ati.c: Forced commit: Previous commit included the removal of the - 8192 scanline limit on offscreen memory in the fbdev case. I - remember daenzer (who originally put that code in) saying he - wasn't sure of it, and there doesn't seem to be any reason for - that limit given how acceleration is done. - -2004-01-08 00:16 anholt - - * ati.c, ati.h, ati_draw.c: - Add a new UploadToScratch kaa hook - for putting the data for a single pixmap into temporary - offscreen storage. Subsequent UploadToScratch may clobber the - data of previous ones. This allows hardware acceleration of - composite operations on glyphs. - Add a new UploadToScreen kaa - hook for doing the actual moving of data to framebuffer. This - would allow us to do things like hostdata blits or memcpy to - agp and then blit. - Add an UploadToScreen on ATI which is just - memcpy, but which will be replaced with a hostdata blit soon. - - Add UploadToScratch on ATI and reserve 64k of scratch space. - This provided a 3x speedup of rgb24text on my Radeon. - -2004-01-06 18:30 anholt - - * radeon_composite.c: Speed things up slightly by removing Z values - from emitted vertices and by emitting as a tri fan rather than a - tri list. A rect list would save an additional vertex (out of 4) - per rectangle, but there's no measurable speed difference and the - tri fan may be useful when transforms come into play. - -2004-01-04 12:47 anholt - - * ati_draw.c, radeon_composite.c: - Correctly set the texture - coordinate set source for the second texture unit. - Re-enable - Radeon's Composite accel now that fonts work again. - -2004-01-03 03:46 anholt - - * ati_draw.c, radeon_composite.c: - Add more Composite operations, - including Saturate, to Radeon Composite accel. I don't 100% - trust that the math works for Saturate, but I can't tell from - existing information. - Fix texture pitch fallback checks. - - Fallback when src or mask have transforms. - Disable Radeon - Composite accel until the offset thing is fixed. - Set - offscreenPitch to 64 on Radeon thanks to new information and a - kaa fix. Fixes acceleration at width!=1024. - -2003-12-31 15:24 anholt - - * radeon_composite.c: Some strange \240 character snuck into the - original commit of this file. - -2003-12-30 00:45 anholt - - * ati_drawtmp.h: There's never a copy between different depths. - Remove the check. - -2003-12-30 00:23 anholt - - * Makefile.am, ati_draw.c, ati_draw.h, ati_drawtmp.h, ati_reg.h, - radeon_composite.c: - Add new Composite hook for kdrive drivers, - which only ensures that the pixmaps are offscreen and don't - have alpha maps. It is the last case checked before going to - software fallback - Use the new Composite hook in the ati driver - to implement acceleration of most Composites that get done in - an xcompmgr environment on r100 series cards. It is only - available when using the DRM. There are still some corruption - issues, but the DRI is still non-default and I need to get this - into version control. - -2003-12-29 01:04 anholt - - * Makefile.am: Add dependency lines so that servers are rebuilt - when server libraries are changed. - -2003-12-28 22:24 anholt - - * Makefile.am, ati.c, ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, - ati_dri.c, ati_dri.h, ati_dripriv.h, ati_reg.h, ati_sarea.h, - ati_stub.c, r128_blendtmp.h, r128_common.h, r128_sarea.h, - radeon_common.h, radeon_sarea.h: Merge dri-0-1-branch to trunk. - Notable changes: - Add libdrm and libdri. Portions of the DRI - extension are stubbed out. - Use the DRM in the ATI driver - when available. This provides a minor performance improvement - in x11perf, and opens the possibility of using the 3d hardware - for acceleration in the future. - Implement solid fill - acceleration for Composite in KAA. - Implement Blend hook for - Composite and use it on r128. - Fix a bug of mine that resulted - in overuse of offscreen memory. - Fix many miscellaneous bugs in - ATI driver and add PCI IDs. - -2003-12-28 21:10 anholt - - * ati_drawtmp.h, r128_blendtmp.h: - Disable libdrm verbosity. It - isn't important enough yet to make a run-time flag for it. - - Fix the (void)atic; tricks to quiet unused variable warnings in - ATI template files. Mixing statements and variable defines works - in newer compilers, but not pdx's. - -2003-12-28 01:16 anholt - - * ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, ati_dri.c, - r128_blendtmp.h: - Allow acceleration between same-depth pixmaps, - rather than between anything and a dst that matched the screen - depth (fixes corruption for non-screen-depth src and makes more - acceleration possible). - Add ATI_FALLBACK macro and use it to - allow verbose descriptions of why hardware acceleration fails. - - Check that src and dst alignment meet requirements of the card - before accelerating. The BIOS may set up screens that don't - meet the requirements. - Fix the R128 offset alignment (32 - bytes, not 8). - Enable Blend operation even if screen is 24bpp - (it will fail if the dest is 24bpp anyway). - -2003-12-27 02:46 anholt - - * ati_reg.h, r128_blendtmp.h: Properly initialize texture registers - in Blend. Fixes problems with blending code such as whiteness in - test-render, or no blending at all. - - Tested by: andersca - -2003-12-23 14:29 anholt - - * Makefile.am, ati_draw.c, ati_drawtmp.h, ati_reg.h, - r128_blendtmp.h: - Implement acceleration of Composite on R128 - when there is no mask, no transformation, no repeat, and only - certain ops are used. - Add debugging output for software - fallbacks for Composite. - Allow pixmaps in offscreen that don't - match root depth. - Clean up some mess in ati_reg.h. - - Many thanks to andersca for a lot of this code. - -2003-12-09 21:01 anholt - - * ati_draw.c: Add missing kaaDrawFini to ATI driver. - -2003-12-01 14:56 anholt - - * Makefile.am, ati.c, ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, - ati_dri.c, ati_dri.h, ati_dripriv.h, ati_reg.h, ati_sarea.h, - ati_stub.c, r128_common.h, r128_sarea.h, radeon_common.h, - radeon_sarea.h: - Initial add of enough of the DRI to create a 2d - driver that uses the DRM for its acceleration. - Converted the - ATI driver to use the DRM to execute rendering commands using - DMA instead of MMIO when available. - -2003-11-30 20:33 anholt - - * Makefile.am, ati.c, ati.h, ati_stub.c: - Add fbdev mode-setting - backend to Xati. It and vesa are compiled in when available, - with fbdev being used by default. - Use depth 16 by default when - vesa backend is used. - Add MMIO defines for PowerPC (should be - in a common location). - - Many thanks for Michel Daenzer for much of this code. - -2003-11-30 19:15 anholt - - * ati.c: Add more RV250 PCI IDs. - -2003-11-30 17:46 anholt - - * ati_draw.c: Remove sys/io.h inclusion from some files that didn't - need it, and change asm/io.h to sys/io.h in vga.c, which newer - Linux complains about. - -2003-11-25 14:39 anholt - - * ati.c: Add new Radeon 9200 PCI IDs. - -2003-11-23 02:12 anholt - - * ati_draw.c: - Fix Radeon offscreen pixmap pitch alignment. - - Remove usleeps from idle and waitavail code, recommended by - keithp. - Add a workaround for apparent broken acceleration with - Rage 128 and offset alignment with 8-bit acceleration (24-hack - and plain 8-bit). - Minor cleanup of setup code. - -2003-11-22 18:08 anholt - - * ati.c: Add RV250 PCI IDs. - -2003-11-19 23:49 anholt - - * ati.c, ati.h, ati_draw.c, ati_reg.h: - Fix a bug in pitch - alignment for offscren pixmaps. - Add 24-bit acceleration for - Xati using the 8-bit trick from mach64. - Add offscreen pixmap - support to Xati. - -2003-11-19 16:05 anholt - - * ati.c, ati_draw.c: - Fix confusion of depth/bitsPerPixel in - ati_draw.c - Disable acceleration with 24bpp due to apparent - broken acceleration. Accel at 24bpp was the cause of the - crashes when people tried to use any depth over 16. XFree86 - doesn't support 24 either. - Disable at < 8bpp, too. - Add the - other Rage 128 PCI IDs. - Remove unnecessary setting of scissor - registers (only default scissor gets used). - -2003-11-19 00:32 anholt - - * .cvsignore, Makefile.am, ati.c, ati.h, ati_draw.c, ati_reg.h, - ati_stub.c: - Add PCI information (device/vendor id, bus - location) to KdCardAttr to help with ati, and future DRM - drivers. - Add new "ati" kdrive driver. It has ancestry in the - r128 driver from andersca, but took a detour through being the - WIP SiS 300 driver on the way. It supports Radeons (tested on - QD VIVO and 7500) and Rage 128. Current limitations include - that it requires depth 16 and that the other Rage 128 PCI IDs - aren't included yet. - diff --git a/hw/kdrive/neomagic/ChangeLog b/hw/kdrive/neomagic/ChangeLog deleted file mode 100644 index 4e0788e5a..000000000 --- a/hw/kdrive/neomagic/ChangeLog +++ /dev/null @@ -1,98 +0,0 @@ -2006-02-15 Keith Packard - - * Makefile.am: - Add XSERVER_LIBS to build in xorg tree - -2005-08-07 Keith Packard - - * neo_draw.c: - Build with modular X libraries and headers - -2005-06-09 Eric Anholt - - * neo_draw.c: - * neomagic.c: (neoScreenInit): - Perform a warnings sweep on hw/kdrive. A number of these were my fault, - but some come from others. - -2005-06-09 Eric Anholt - - * neo_draw.c: (neoWaitMarker), (neoDrawInit): - * neomagic.c: - * neomagic.h: - - Replace the syncAccel hook in the kdrive structure with a pair of - hooks in the kaa structure: markSync and waitMarker. The first, if - set, returns a hardware-dependent marker number which can then be - waited for with waitMarker. If markSync is absent (which is the case - on all drivers currently), waitMarker must wait for idle on any given - marker number. The intention is to allow for more parallelism when - we get downloading from framebuffer, or more fine-grained idling. - - Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and - kaaWaitSync. These will need to be refined when KAA starts being - smart about using them. Merge kpict.c into kasync.c since kasyn.c has - all the rest of these fallback funcs. - - Restructure all drivers to initialize a KaaInfo structure by hand - rather than statically in dubious order. - - Whack the i810 driver into shape in hopes that it'll work after this - change (it certainly wouldn't have before this). Doesn't support my - i845 though. - - Make a new KXV helper to avoid duplicated code to fill the region - with the necessary color key. Use it in i810 and mach64 (tested). - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * neomagicstub.c: (InitInput): - -2004-07-21 Phil Blundell - - * Makefile.am (Xneomagic_LDADD): Include -lts if appropriate. - Patch from pattieja@bentham.ispvip.biz. - -2004-06-07 Franco Catrin L. - * Small fix for depth calculation - -2004-04-11 Franco Catrin L. - - * Basic bitblt implementation - * Fixed width and height calculation in solids - * Added ROP (not tested) - -2004-04-10 Franco Catrin L. - - * MMIO enabled after switching to new VT - * First acceleration function implemented (DrawSolid) - -2004-04-06 Franco Catrin L. - - * Returned to a working state. Brent will - continue working on a backend in a separate CVS branch From 1d11e4bc4ccb169fb23fc18583f0b648f0a6a4e0 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Thu, 30 Aug 2007 12:50:21 +0200 Subject: [PATCH 08/81] Fixing a misleading comment which could suggest a GPL violation. The author of the int10 code looked at the VBIOS POSTing code in DOSEMU to get some initial idea on how to POST a VBIOS. To give credit to the DOSEMU Team for this inspiration a comment was added to the code which could suggest that code from the GPLed DOSEMU was directly incorporated into this code. This patch should clearify the situation. --- hw/xfree86/int10/helper_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 3e1051dc2..e8334262e 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -3,8 +3,8 @@ * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich * - * Part of this is based on code taken from DOSEMU - * (C) Copyright 1992, ..., 1999 the "DOSEMU-Development-Team" + * Part of this code was inspired by the VBIOS POSTing code in DOSEMU + * developed by the "DOSEMU-Development-Team" */ /* From c2d80529fc7f514d80cf3cbed6f580cb999aca1b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Aug 2007 10:20:55 -0700 Subject: [PATCH 09/81] Remove the now-dead PciAvoid symbol. --- hw/xfree86/common/xf86Resources.h | 2 -- hw/xfree86/loader/xf86sym.c | 1 - hw/xfree86/os-support/bsd/bsdResource.c | 2 -- hw/xfree86/os-support/linux/lnxResource.c | 8 -------- hw/xfree86/os-support/shared/stdResource.c | 2 -- 5 files changed, 15 deletions(-) diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h index 97bf817fe..15bd32c69 100644 --- a/hw/xfree86/common/xf86Resources.h +++ b/hw/xfree86/common/xf86Resources.h @@ -133,7 +133,5 @@ extern resRange res8514Shared[]; {ResExcIoSparse | ResBus, 0x0200, 0x0200},\ {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF} -extern resRange PciAvoid[]; - #define RES_UNDEFINED NULL #endif diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index cb2a2b911..7c46e0266 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -1114,7 +1114,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMVAR(resVgaSparseShared) SYMVAR(res8514Exclusive) SYMVAR(res8514Shared) - SYMVAR(PciAvoid) #if defined(__powerpc__) && (!defined(NO_INLINE) || defined(Lynx)) SYMVAR(ioBase) diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c index 586863404..fe166c845 100644 --- a/hw/xfree86/os-support/bsd/bsdResource.c +++ b/hw/xfree86/os-support/bsd/bsdResource.c @@ -17,8 +17,6 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; - #ifdef INCLUDE_XF86_NO_DOMAIN #if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c index bb42d8a97..67af9db3d 100644 --- a/hw/xfree86/os-support/linux/lnxResource.c +++ b/hw/xfree86/os-support/linux/lnxResource.c @@ -18,14 +18,6 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -_X_EXPORT resRange PciAvoid[] = -{ -#if !defined(__sparc__) || !defined(INCLUDE_XF86_NO_DOMAIN) - _PCI_AVOID_PC_STYLE, -#endif - _END -}; - #ifdef INCLUDE_XF86_NO_DOMAIN #ifdef __alpha__ diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c index 2e5c2cf98..7229d55b5 100644 --- a/hw/xfree86/os-support/shared/stdResource.c +++ b/hw/xfree86/os-support/shared/stdResource.c @@ -46,8 +46,6 @@ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ defined(__DragonFly__) #define xf86StdAccResFromOS xf86AccResFromOS - -_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #endif resPtr From d8ab2353cbd7694b556b7b9d550104dc8c460a1b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Aug 2007 10:39:53 -0700 Subject: [PATCH 10/81] Remove dead xf86GetPciSizeFromOS and xf86GetPciOffsetFromOS. --- hw/xfree86/os-support/bsd/Makefile.am | 1 - hw/xfree86/os-support/hurd/Makefile.am | 1 - hw/xfree86/os-support/linux/lnx_pci.c | 63 ----------------------- hw/xfree86/os-support/shared/stdPci.c | 48 ----------------- hw/xfree86/os-support/solaris/Makefile.am | 2 +- hw/xfree86/os-support/xf86_OSproc.h | 2 - 6 files changed, 1 insertion(+), 116 deletions(-) delete mode 100644 hw/xfree86/os-support/shared/stdPci.c diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index 0432ba931..446b69ee2 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -57,7 +57,6 @@ libbsd_la_SOURCES = \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/stdPci.c \ $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c \ bsd_init.c \ diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am index 731ff083d..e6543e133 100644 --- a/hw/xfree86/os-support/hurd/Makefile.am +++ b/hw/xfree86/os-support/hurd/Makefile.am @@ -6,7 +6,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/stdResource.c \ - $(srcdir)/../shared/stdPci.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c index 8415aa01c..53818f2dc 100644 --- a/hw/xfree86/os-support/linux/lnx_pci.c +++ b/hw/xfree86/os-support/linux/lnx_pci.c @@ -147,69 +147,6 @@ int lnxPciInit(void) { return xf86OSLinuxNumPciDevs; } -Bool -xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) -{ - signed PCIADDR_TYPE Size; - struct pci_dev *device; - - if (index >= 7) - return FALSE; - - if (!xf86OSLinuxPCIDevs) { - xf86OSLinuxPCIDevs = xf86OSLinuxGetPciDevs(); - } - if (!xf86OSLinuxPCIDevs) - return FALSE; - - for (device = xf86OSLinuxPCIDevs; device; device = device->next) { - if (tag == PCI_MAKE_TAG(PCI_MAKE_BUS(device->domain, device->bus), - device->dev, device->fn)) { - if (device->size[index] != 0) { - Size = device->size[index] - ((PCIADDR_TYPE) 1); - while (Size & ((PCIADDR_TYPE) 0x01)) { - Size = Size >> ((PCIADDR_TYPE) 1); - (*bits)++; - } - } - return TRUE; - } - } - - return FALSE; -} - - - -#if 0 -/* Query the kvirt address (64bit) of a BAR range from TAG */ -Bool -xf86GetPciOffsetFromOS(PCITAG tag, int index, unsigned long* bases) -{ - struct pci_dev *device; - - if (index >= 7) - return FALSE; - - if (!xf86OSLinuxPCIDevs) { - xf86OSLinuxPCIDevs = xf86OSLinuxGetPciDevs(); - } - if (!xf86OSLinuxPCIDevs) - return FALSE; - - for (device = xf86OSLinuxPCIDevs; device; device = device->next) { - if (tag == PCI_MAKE_TAG(PCI_MAKE_BUS(device->domain, device->bus), - device->dev, device->fn)) { - /* return the offset for the index requested */ - *bases = device->offset[index]; - return TRUE; - } - } - - return FALSE; -} -#endif - /* Query the kvirt address (64bit) of a BAR range from size for a given TAG */ unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base) diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c deleted file mode 100644 index 6777c6a1f..000000000 --- a/hw/xfree86/os-support/shared/stdPci.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999-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). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Privstr.h" -#include "xf86Pci.h" -#define NEED_OS_RAC_PROTOS -#include "xf86_OSlib.h" - -#ifndef HAVE_PCI_SIZE_FUNC -#define xf86StdGetPciSizeFromOS xf86GetPciSizeFromOS -#endif - -Bool -xf86StdGetPciSizeFromOS(PCITAG tag, int index, int* bits) -{ - return FALSE; -} diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index c027d9a3e..5ed60bc55 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -23,7 +23,7 @@ libsolaris_la_SOURCES = sun_bios.c sun_init.c \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/sigiostubs.c \ - $(srcdir)/../shared/stdPci.c $(srcdir)/../shared/stdResource.c \ + $(srcdir)/../shared/stdResource.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 1d6b842fe..abf5a47c2 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -234,8 +234,6 @@ resPtr xf86StdAccResFromOS(resPtr ret); resPtr xf86AccResFromOS(resPtr ret); #endif /* NEED_OS_RAC_PROTOS */ -extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits); -extern Bool xf86GetPciOffsetFromOS(PCITAG tag, int indx, unsigned long* bases); extern unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base); extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer); From 87495fc7064d5e0a7575a0713b6895a4172df0fa Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 30 Aug 2007 21:57:41 +0100 Subject: [PATCH 11/81] Allow yres_virtual to be greater for some kernel fbdev drivers. (temporary fix for older fbdev drivers) --- hw/xfree86/fbdevhw/fbdevhw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 00c7752b7..837d2b12b 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -239,7 +239,7 @@ static Bool fbdev_modes_equal(struct fb_var_screeninfo *set, struct fb_var_screeninfo *req) { return (set->xres_virtual >= req->xres_virtual && - set->yres_virtual == req->yres_virtual && + set->yres_virtual >= req->yres_virtual && set->bits_per_pixel == req->bits_per_pixel && set->red.length == req->red.length && set->green.length == req->green.length && From 0fcde83d94507eadd9f99d4e6a63584b221c989c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 Aug 2007 18:20:20 +0930 Subject: [PATCH 12/81] config: return BadValue to caller if add/remove doesn't have parameters. If message iterator cannot be created, the caller didn't supply any parameters. Return BadValue, instead of dying a horrible death while being stuck in an endless loop. --- config/dbus.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/dbus.c b/config/dbus.c index c6f4af0d5..d43799448 100644 --- a/config/dbus.c +++ b/config/dbus.c @@ -74,11 +74,12 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error) int ret, err; DeviceIntPtr dev = NULL; + dbus_message_iter_init_append(reply, &reply_iter); + if (!dbus_message_iter_init(message, &iter)) { ErrorF("[config/dbus] couldn't initialise iterator\n"); - return BadAlloc; + MALFORMED_MESSAGE(); } - dbus_message_iter_init_append(reply, &reply_iter); options = xcalloc(sizeof(*options), 1); if (!options) { @@ -200,11 +201,12 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) DeviceIntPtr dev; DBusMessageIter iter, reply_iter; + dbus_message_iter_init_append(reply, &reply_iter); + if (!dbus_message_iter_init(message, &iter)) { ErrorF("[config] failed to init iterator\n"); - return BadAlloc; + MALFORMED_MESSAGE(); } - dbus_message_iter_init_append(reply, &reply_iter); if (!dbus_message_get_args(message, error, DBUS_TYPE_UINT32, &deviceid, DBUS_TYPE_INVALID)) { From 3f42af8c0ef1e5379bc836f589e0cbee43c02ac5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 Aug 2007 18:22:12 +0930 Subject: [PATCH 13/81] config: Use [config/dbus] consistently for error messages. --- config/dbus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/dbus.c b/config/dbus.c index d43799448..c8675120f 100644 --- a/config/dbus.c +++ b/config/dbus.c @@ -139,7 +139,7 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error) MALFORMED_MESSAGE(); options->value = xstrdup(tmp); if (!options->value) { - ErrorF("[config] couldn't duplicate option!\n"); + ErrorF("[config/dbus] couldn't duplicate option!\n"); ret = BadAlloc; goto unwind; } @@ -204,7 +204,7 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) dbus_message_iter_init_append(reply, &reply_iter); if (!dbus_message_iter_init(message, &iter)) { - ErrorF("[config] failed to init iterator\n"); + ErrorF("[config/dbus] failed to init iterator\n"); MALFORMED_MESSAGE(); } @@ -215,12 +215,12 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) dev = LookupDeviceIntRec(deviceid); if (!dev) { - DebugF("[config] bogus device id %d given\n", deviceid); + DebugF("[config/dbus] bogus device id %d given\n", deviceid); ret = BadMatch; goto unwind; } - DebugF("[config] removing device %s (id %d)\n", dev->name, deviceid); + DebugF("[config/dbus] removing device %s (id %d)\n", dev->name, deviceid); /* Call PIE here so we don't try to dereference a device that's * already been removed. */ From a02db0d500cac20d0f0f107d27c064a175018421 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 31 Aug 2007 12:24:07 -0700 Subject: [PATCH 14/81] Convert servers to using _DEPENDENCIES to ensure proper rebuilds. This cleans up server Makefile.ams a little bit, but also means that people messing with configure.ac need to be careful with whether they put libraries in the _LIBS or _SYS_LIBS targets. Hopefully the comment in configure.ac will clarify the issues. --- configure.ac | 184 +++++++++++++++++++++++------------------ hw/darwin/Makefile.am | 75 +++++++---------- hw/dmx/Makefile.am | 15 ++-- hw/vfb/Makefile.am | 13 +-- hw/xfree86/Makefile.am | 11 +-- hw/xgl/Makefile.am | 12 +-- hw/xgl/egl/Makefile.am | 21 +++-- hw/xnest/Makefile.am | 11 ++- hw/xwin/Makefile.am | 10 ++- 9 files changed, 184 insertions(+), 168 deletions(-) diff --git a/configure.ac b/configure.ac index 1f3743fc2..cad85a91d 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,9 @@ b = bswap16(a); fi fi +AC_CHECK_FUNC([dlopen], [], + AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) + dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ @@ -624,13 +627,9 @@ XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' -PIXMAN="[pixman-1 >= 0.9.5]" -PKG_CHECK_MODULES(PIXMAN, $PIXMAN) -AC_SUBST(PIXMAN_CFLAGS) - dnl Core modules for most extensions, et al. REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" -REQUIRED_LIBS="xfont xau fontenc $PIXMAN" +REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]" dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config @@ -674,6 +673,49 @@ if test "x$NEED_DBUS" = xyes; then fi CONFIG_LIB='$(top_builddir)/config/libconfig.a' +AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], + [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], + [have_clock_gettime=no])]) + +AC_MSG_CHECKING([for a useful monotonic clock ...]) + +if ! test "x$have_clock_gettime" = xno; then + if ! test "x$have_clock_gettime" = xyes; then + CLOCK_LIBS="$have_clock_gettime" + else + CLOCK_LIBS="" + fi + + LIBS_SAVE="$LIBS" + LIBS="$CLOCK_LIBS" + + AC_RUN_IFELSE([ +#define _POSIX_C_SOURCE 199309L +#include + +int main(int argc, char *argv[[]]) { + struct timespec tp; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + return 0; + else + return 1; +} + ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], + [MONOTONIC_CLOCK="cross compiling"]) + + LIBS="$LIBS_SAVE" +else + MONOTONIC_CLOCK=no +fi + +AC_MSG_RESULT([$MONOTONIC_CLOCK]) + +if test "x$MONOTONIC_CLOCK" = xyes; then + AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) + LIBS="$LIBS $CLOCK_LIBS" +fi + AM_CONDITIONAL(XV, [test "x$XV" = xyes]) if test "x$XV" = xyes; then AC_DEFINE(XV, 1, [Support Xv extension]) @@ -759,7 +801,7 @@ AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" - GLX_LIBS="$GLX_LIBS -lpthread" + GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi AC_SUBST([GLX_DEFINES]) @@ -1036,9 +1078,26 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) +# Autotools has some unfortunate issues with library handling. In order to +# get a server to rebuild when a dependency in the tree is changed, it must +# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be +# listed there, or some versions of autotols will break (especially if a -L +# is required to find the library). So, we keep two sets of libraries +# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which +# will go into the _DEPENDENCIES and _LDADD of the server, and +# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The +# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in +# NAMESPACE_SYS_LIBS. +# +# XSERVER_LIBS is the set of in-tree libraries which all servers require. +# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers +# require. +# XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}" -XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" -AC_SUBST([SYS_LIBS]) +XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB" +XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" +AC_SUBST([XSERVER_LIBS]) +AC_SUBST([XSERVER_SYS_LIBS]) # The Xorg binary needs to export symbols so that they can be used from modules # Some platforms require extra flags to do this. gcc should set these flags @@ -1066,50 +1125,6 @@ case $host_os in esac AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) -AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], - [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], - [have_clock_gettime=no])]) - -AC_MSG_CHECKING([for a useful monotonic clock ...]) - -if ! test "x$have_clock_gettime" = xno; then - if ! test "x$have_clock_gettime" = xyes; then - CLOCK_LIBS="$have_clock_gettime" - else - CLOCK_LIBS="" - fi - - LIBS_SAVE="$LIBS" - LIBS="$CLOCK_LIBS" - - AC_RUN_IFELSE([ -#define _POSIX_C_SOURCE 199309L -#include - -int main(int argc, char *argv[[]]) { - struct timespec tp; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return 0; - else - return 1; -} - ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], - [MONOTONIC_CLOCK="cross compiling"]) - - LIBS="$LIBS_SAVE" -else - MONOTONIC_CLOCK=no -fi - -AC_MSG_RESULT([$MONOTONIC_CLOCK]) - -if test "x$MONOTONIC_CLOCK" = xyes; then - AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) - XSERVER_LIBS="$XSERVER_LIBS $CLOCK_LIBS" - LIBS="$LIBS $CLOCK_LIBS" -fi - dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so dnl we need to replicate that here until those can all be fixed AC_MSG_CHECKING([if SVR4 needs to be defined]) @@ -1136,8 +1151,6 @@ AH_VERBATIM([X_BYTE_ORDER],[ #endif ]) -AC_SUBST([XSERVER_LIBS]) - dnl --------------------------------------------------------------------------- dnl DDX section. dnl --------------------------------------------------------------------------- @@ -1145,7 +1158,7 @@ dnl --------------------------------------------------------------------------- dnl DMX DDX AC_MSG_CHECKING([whether to build Xdmx DDX]) -PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES $PIXMAN], [have_dmx=yes], [have_dmx=no]) +PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no]) if test "x$DMX" = xauto; then DMX="$have_dmx" fi @@ -1158,8 +1171,12 @@ if test "x$DMX" = xyes; then modules not found.]) fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $OS_LIB $CWRAP_LIB" + XDMX_CFLAGS="$DMXMODULES_CFLAGS" + XDMX_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $CWRAP_LIB" + XDMX_SYS_LIBS="$DMXMODULES_LIBS" + AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) + AC_SUBST([XDMX_SYS_LIBS]) dnl USB sources in DMX require AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", @@ -1197,8 +1214,10 @@ AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" + XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB" + XVFB_SYS_LIBS="$XVFBMODULES_LIBS" AC_SUBST([XVFB_LIBS]) + AC_SUBST([XVFB_SYS_LIBS]) fi @@ -1213,8 +1232,10 @@ AC_MSG_RESULT([$XNEST]) AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) if test "x$XNEST" = xyes; then - XNEST_LIBS="$MI_LIB $CONFIG_LIB $XSERVER_LIBS $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" + XNEST_LIBS="$CONFIG_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB" + XNEST_SYS_LIBS="$XNESTMODULES_LIBS" AC_SUBST([XNEST_LIBS]) + AC_SUBST([XNEST_SYS_LIBS]) fi @@ -1235,14 +1256,15 @@ AC_MSG_CHECKING([whether to build Xgl DDX]) if test "x$XGL" != xno; then PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XGL=yes], [XGL=no]) AC_SUBST(XGLMODULES_CFLAGS) - AC_SUBST(XGLMODULES_LIBS) fi AC_MSG_RESULT([$XGL]) AM_CONDITIONAL(XGL, [test "x$XGL" = xyes]) if test "x$XGL" = xyes; then - XGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XGL_SYS_LIBS="$XGLMODULES_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" AC_SUBST([XGL_LIBS]) + AC_SUBST([XGL_SYS_LIBS]) AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules]) xglmoduledir="$moduledir/xgl" @@ -1256,14 +1278,15 @@ AC_MSG_CHECKING([whether to build Xegl DDX]) if test "x$XEGL" != xno; then PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XEGL=yes], [XEGL=no]) AC_SUBST(XEGLMODULES_CFLAGS) - AC_SUBST(XEGLMODULES_LIBS) fi AC_MSG_RESULT([$XEGL]) AM_CONDITIONAL(XEGL, [test "x$XEGL" = xyes]) if test "x$XEGL" = xyes; then - XEGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XEGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XEGL_SYS_LIBS = "$XEGL_SYS_LIBS $XEGLMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XEGL_LIBS]) + AC_SUBST([XEGL_SYS_LIBS]) fi dnl Xglx DDX @@ -1272,20 +1295,17 @@ AC_MSG_CHECKING([whether to build Xglx DDX]) if test "x$XGLX" != xno; then PKG_CHECK_MODULES([XGLXMODULES], [glitz-glx >= 0.4.3 xrender], [XGLX=yes], [XGLX=no]) AC_SUBST(XGLXMODULES_CFLAGS) - AC_SUBST(XGLXMODULES_LIBS) fi AC_MSG_RESULT([$XGLX]) AM_CONDITIONAL(XGLX, [test "x$XGLX" = xyes]) if test "x$XGLX" = xyes; then - XGLX_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XGLX_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XGLX_SYS_LIBS="$XGLX_SYS_LIBS $XGLXMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XGLX_LIBS]) + AC_SUBST([XGLX_SYS_LIBS]) fi -# XORG_CORE_LIBS is needed even if you're not building the Xorg DDX -XORG_CORE_LIBS="$DIX_LIB $CONFIG_LIB" -AC_SUBST([XORG_CORE_LIBS]) - xorg_bus_linuxpci=no xorg_bus_bsdpci=no xorg_bus_ix86pci=no @@ -1298,15 +1318,13 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $MI_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $OS_LIB" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB" dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. - AC_CHECK_FUNC([dlopen], [], - AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl")) PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) - XSERVER_LIBS="$XSERVER_LIBS $PCIACCESS_LIBS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" case $host_os in @@ -1345,7 +1363,7 @@ return 0;} # LDFLAGS=$save_LDFLAGS # ]) xorg_cv_AGL_framework=no - DARWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB" + DARWIN_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" AC_SUBST([DARWIN_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) AC_SUBST([APPLE_APPLICATIONS_DIR]) @@ -1538,10 +1556,11 @@ return 0;} if test -n "$XORG_MODULES"; then PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" - XORG_LIBS="$XORG_LIBS $XORG_MODULES_LIBS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi AC_SUBST([XORG_LIBS]) + AC_SUBST([XORG_SYS_LIBS]) AC_SUBST([XORG_INCS]) AC_SUBST([XORG_OS]) AC_SUBST([XORG_OS_SUBDIR]) @@ -1623,9 +1642,9 @@ AC_MSG_CHECKING([whether to build Xprint DDX]) AC_MSG_RESULT([$XPRINT]) if test "x$XPRINT" = xyes; then - PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau $PIXMAN]) + PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau]) XPRINT_EXTENSIONS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS" - XPRINT_LIBS="$DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS $XPRINT_LIBS" + XPRINT_LIBS="$DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MIEXT_DAMAGE_LIB $CWRAP_LIB $XPRINT_LIBS" AC_SUBST([XPRINT_CFLAGS]) AC_SUBST([XPRINT_LIBS]) @@ -1680,7 +1699,7 @@ if test "x$XWIN" = xauto; then mingw*) XWIN="yes" ;; *) XWIN="no" ;; esac - XWIN_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $OS_LIB $SHADOW_LIB" + XWIN_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $SHADOW_LIB" AC_SUBST([XWIN_LIBS]) fi AC_MSG_RESULT([$XWIN]) @@ -1699,11 +1718,12 @@ if test "x$XWIN" = xyes; then XWIN_SERVER_NAME=Xming AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYSTEM_LIBS=-lwinsock2 + XWIN_SYS_LIBS=-lwinsock2 ;; esac + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $(XWINMODULES_LIBS)" AC_SUBST(XWIN_SERVER_NAME) - AC_SUBST(XWIN_SYSTEM_LIBS) + AC_SUBST(XWIN_SYS_LIBS) if test "x$DEBUGGING" = xyes; then AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) @@ -1810,7 +1830,7 @@ if test "$KDRIVE" = yes; then if test x"$XSDL" = xyes; then # PKG_CHECK_MODULES(XSDL_EXTRA, Xfont xau $XDMCP_MODULES) AC_DEFINE(XSDLSERVER,1,[Build Xsdl server]) - XSDL_LIBS="`sdl-config --libs` $XSERVER_LIBS" + XSDL_LIBS="`sdl-config --libs`" XSDL_INCS="`sdl-config --cflags` $XSERVER_CFLAGS" fi @@ -1839,7 +1859,7 @@ if test "$KDRIVE" = yes; then KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB" + KDRIVE_PURE_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a' case $host_os in *linux*) @@ -1924,7 +1944,7 @@ AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg], if test x$XORGCFG = xyes ; then PKG_CHECK_MODULES([XORGCFG_DEP], [xkbui >= 1.0.2 xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11]) - XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS $PIXMAN_CFLAGS" + XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS" AC_CHECK_LIB([curses],[waddstr], [XORGCFG_DEP_LIBS="$XORGCFG_DEP_LIBS -lcurses"; CURSES=yes], AC_CHECK_LIB([ncurses],[waddstr], diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index b773910fc..00811e746 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -56,34 +56,29 @@ Xquartz_SOURCES = \ quartz/xpr/x-hook.c \ quartz/xpr/x-list.c -XDarwin_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - ./libdarwinShared.a \ - ./iokit/libiokit.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) +DARWIN_LIBS = \ + $(top_builddir)/dix/dixfonts.lo \ + $(top_builddir)/config/libconfig.a \ + $(top_builddir)/miext/shadow/libshadow.la \ + $(top_builddir)/miext/cw/libcw.la \ + @DARWIN_LIBS@ \ + $(top_builddir)/miext/rootless/librootless.la \ + $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ + $(top_builddir)/miext/rootless/accel/librlAccel.la \ + ./libdarwinShared.a \ + $(XSERVER_LIBS) -Xquartz_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - ./libdarwinShared.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) -lXplugin +XDARWIN_LIBS = \ + $(DARWIN_LIBS) \ + ./iokit/libiokit.a +XQUARTZ_LIBS = \ + $(DARWIN_LIBS) + +XDarwin_DEPENDENCIES = $(XDARWIN_LIBS) +XDarwin_LDADD = $(XDARWIN_LIBS) $(XSERVER_SYS_LIBS) + +Xquartz_DEPENDENCIES = $(XQUARTZ_LIBS) +Xquartz_LDADD = $(XQUARTZ_LIBS) $(XSERVER_SYS_LIBS) -lXplugin XDarwin_LDFLAGS = \ -XCClinker -Objc \ @@ -118,22 +113,16 @@ XDarwinApp_SOURCES = \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xi/stubs.c -XDarwinApp_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - $(top_builddir)/os/libos.la \ - ./quartz/XApplication.o \ - ./libdarwinShared.a \ - ./quartz/libXQuartz.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) +XDARWINAPP_LIBS = \ + $(DARWIN_LIBS) \ + $(top_builddir)/dix/dixfonts.lo \ + ./quartz/XApplication.o \ + ./libdarwinShared.a \ + ./quartz/libXQuartz.a \ + $(XSERVER_LIBS) + +XDarwinApp_DEPENDENCIES = $(XDARWINAPP_LIBS) +XDarwinApp_LDADD = $(XDARWINAPP_LIBS) $(XSERVER_SYS_LIBS) XDarwinApp_LDFLAGS = \ -XCClinker -Objc \ diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index 002ea112a..8457aea60 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -81,13 +81,16 @@ Xdmx_SOURCES = dmx.c \ #Xdmx_SOURCES += fakecw.c #endif +XDMX_LIBS = \ + @XDMX_LIBS@ \ + $(GLX_LIBS) \ + input/libdmxinput.a \ + config/libdmxconfig.a \ + $(XSERVER_LIBS) + Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Xdmx_LDADD = $(XORG_CORE_LIBS) \ - $(XDMX_LIBS) \ - $(GLX_LIBS) \ - input/libdmxinput.a \ - config/libdmxconfig.a \ - @DMXMODULES_LIBS@ +Xdmx_DEPENDENCIES= $(XDMX_LIBS) +Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) # Man page appmandir = $(APP_MAN_DIR) diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 6842b45a5..9ceecccc0 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -19,12 +19,13 @@ libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c Xvfb_SOURCES = $(SRCS) -Xvfb_LDADD = $(XORG_CORE_LIBS) \ - $(XVFB_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) \ - $(XVFBMODULES_LIBS) \ - libfbcmap.a +XVFB_LIBS = \ + @XVFB_LIBS@ \ + libfbcmap.a \ + $(XSERVER_LIBS) + +Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) +Xvfb_DEPENDENCIES = $(XVFB_LIBS) # Man page include $(top_srcdir)/cpprules.in diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 3ba6adc16..511e224d3 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -48,7 +48,7 @@ osandcommon.c xorg.c: DISTCLEANFILES = osandcommon.c xorg.c XORG_LIBS = \ - @XORG_CORE_LIBS@ \ + $(XSERVER_LIBS \ common/libinit.a \ loader/libloader.a \ libosandcommon.la \ @@ -59,14 +59,11 @@ XORG_LIBS = \ ramdac/libramdac.a \ ddc/libddc.a \ i2c/libi2c.a \ + dixmods/libxorgxkb.la \ @XORG_LIBS@ -Xorg_DEPENDENCIES = \ - $(XORG_LIBS) - -Xorg_LDADD = $(XORG_LIBS) \ - @XSERVER_LIBS@ \ - dixmods/libxorgxkb.la +Xorg_DEPENDENCIES = $(XORG_LIBS) +Xorg_LDADD = $(XORG_LIBS) $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/hw/xgl/Makefile.am b/hw/xgl/Makefile.am index 81484b99a..ef9fc0ea9 100644 --- a/hw/xgl/Makefile.am +++ b/hw/xgl/Makefile.am @@ -70,12 +70,14 @@ Xgl_SOURCES = \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/fb/fbcmap.c -Xgl_LDADD = \ + +XGL_LIBS = \ libxgl.a \ - $(XORG_CORE_LIBS) \ - $(XGL_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) -lglitz -ldl + @XGL_LIBS@ \ + $(XSERVER_LIBS) + +Xgl_DEPENDENCIES = $(XGL_LIBS) +Xgl_LDADD = $(XGL_LIBS) $(XSERVER_SYS_LIBS) $(XGL_SYS_LIBS) Xgl_programs = Xgl bin_PROGRAMS = $(Xgl_programs) diff --git a/hw/xgl/egl/Makefile.am b/hw/xgl/egl/Makefile.am index 5136e58b1..8c4e9af75 100644 --- a/hw/xgl/egl/Makefile.am +++ b/hw/xgl/egl/Makefile.am @@ -24,7 +24,12 @@ libxegl_la_SOURCES = \ kinput.c \ evdev.c -Xegl_DEPENDENCIES = @XEGL_LIBS@ +XEGL_LIBS = \ + @XEGL_LIBS@ \ + libxegl.la \ + ../libxgl.a \ + $XSERVER_LIBS + Xegl_LDFLAGS = -export-dynamic Xegl_SOURCES = \ xeglinit.c \ @@ -32,14 +37,8 @@ Xegl_SOURCES = \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/fb/fbcmap.c -Xegl_LDADD = \ - libxegl.la \ - ../libxgl.a \ - $(XORG_CORE_LIBS) \ - $(XEGL_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) \ - $(XGLXMODULES_LIBS) -Xegl_programs = Xegl -bin_PROGRAMS = $(Xegl_programs) +Xegl_DEPENDENCIES = $(XEGL_LIBS) +Xegl_LDADD = $(XEGL_LIBS) $(XSERVER_SYS_LIBS) $(XEGL_SYS_LIBS) + +bin_PROGRAMS = Xegl diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index 99dba60bd..92f840c97 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -48,12 +48,15 @@ SRCS = Args.c \ libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c libfbcmap_a_CFLAGS = $(AM_CFLAGS) +XNEST_LIBS = \ + @XNEST_LIBS@ \ + libfbcmap.a \ + $(XSERVER_LIBS) + Xnest_SOURCES = $(SRCS) -Xnest_LDADD = $(XORG_CORE_LIBS) \ - $(XNEST_LIBS) \ - $(XNESTMODULES_LIBS) \ - libfbcmap.a +Xnest_DEPENDENCIES = $(XNEST_LIBS) +Xnest_LDADD = $(XNEST_LIBS) $(XNEST_SYS_LIBS) $(XSERVER_SYS_LIBS) EXTRA_DIST = icon \ screensaver \ diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 57e20102e..8aaed8c21 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -146,10 +146,12 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless \ -I$(top_srcdir)/miext/rootless/safeAlpha -XWin_LDADD = $(XORG_CORE_LIBS) \ - $(top_builddir)/fb/libfb.la \ - $(XWIN_LIBS) \ - $(XWINMODULES_LIBS) +XWIN_LIBS = \ + $(top_builddir)/fb/libfb.la \ + $(XSERVER_LIBS) + +XWin_DEPENDENCIES = $(XWIN_LIBS) +XWin_LDADD = $(XWIN_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static From ca82d4bddf235c9b68d51d68636bab40eafb9889 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 31 Aug 2007 13:00:23 -0700 Subject: [PATCH 15/81] Bug #7186: Fix an excessive request size limitation that broke big-requests. MAXBUFSIZE appears to be a leftover of some previous time. Instead, just use maxBigRequestSize when bigreqs are available (limiting buffers to ~16MB). When bigreqs are not available, needed won't be larger than the maximum size of a non-bigreqs request (256kB). --- os/io.c | 4 +++- os/osdep.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/os/io.c b/os/io.c index 835af54d9..9de75eeaa 100644 --- a/os/io.c +++ b/os/io.c @@ -304,12 +304,14 @@ ReadRequestFromClient(ClientPtr client) */ oci->lenLastReq = 0; - if (needed > MAXBUFSIZE) +#ifdef BIGREQS + if (needed > maxBigRequestSize << 2) { /* request is too big for us to handle */ YieldControlDeath(); return -1; } +#endif if ((gotnow == 0) || ((oci->bufptr - oci->buffer + needed) > oci->size)) { diff --git a/os/osdep.h b/os/osdep.h index 965436df5..2d455aa67 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -55,9 +55,6 @@ SOFTWARE. #define BOTIMEOUT 200 /* in milliseconds */ #define BUFSIZE 4096 #define BUFWATERMARK 8192 -#ifndef MAXBUFSIZE -#define MAXBUFSIZE (1 << 22) -#endif #include From 07630d897ef37cad8b79d073d9edc891d5a7bddd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 31 Aug 2007 15:16:01 -0700 Subject: [PATCH 16/81] Bug #7364: Require renderproto 0.9.3 on 64-bit, and fix build with it. --- configure.ac | 9 ++++++++- render/picturestr.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cad85a91d..f9c8408a5 100644 --- a/configure.ac +++ b/configure.ac @@ -628,7 +628,14 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la' XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' dnl Core modules for most extensions, et al. -REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" +# Require updated renderproto for ABI sanity if we're 64-bit. +if test "$ac_cv_sizeof_unsigned_long" = 8; then + RENDERPROTO="[renderproto >= 0.9.3]" +else + RENDERPROTO="renderproto" +fi + +REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]" dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas diff --git a/render/picturestr.h b/render/picturestr.h index 005c58808..09a713199 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -24,8 +24,8 @@ #ifndef _PICTURESTR_H_ #define _PICTURESTR_H_ -#include "glyphstr.h" #include "scrnintstr.h" +#include "glyphstr.h" #include "resource.h" typedef struct _DirectFormat { From 0dc2bb6101704d0fd25f36e2c3df79687f119f5b Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 31 Aug 2007 21:36:37 -0700 Subject: [PATCH 17/81] [RANDR] Compare only milliseconds of config time. (Bug #6502) The timestamp transferred in the X protocol is a 32-bit number of milliseconds. The timestamp stored in the server is a structure that contains two fields: months (!) and milliseconds. When the server passes the config timestamp to the client, it discards the months part and sends only the milliseconds part. When the server receives the config timestamp from the client, it tries to guess the "months" part by looking at the current time and then maybe adding or subtracting one. The guess is wrong after the server has been running long enough (several hours). I have added two ErrorF calls around the 'if' statement that returns RRSetConfigInvalidConfigTimestamp in randr/randr.c and my Xorg.0.log has this: randr request got good config time: 0:-2103495671 for the first few successful xrandr calls, and randr request failed with RRSetConfigInvalidConfigTime: client passed 1:-2103495671, server has 0:-2103495671 when it fails. The server has been running for 8 and a half hours. The obvious fix would be to ignore the months field and only compare the milliseconds. --- randr/rrscreen.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 8798b4244..811a5571b 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -766,7 +766,6 @@ ProcRRSetScreenConfig (ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); if (!pScrPriv) { @@ -788,11 +787,15 @@ ProcRRSetScreenConfig (ClientPtr client) crtc = output->crtc; /* - * if the client's config timestamp is not the same as the last config + * If the client's config timestamp is not the same as the last config * timestamp, then the config information isn't up-to-date and - * can't even be validated + * can't even be validated. + * + * Note that the client only knows about the milliseconds part of the + * timestamp, so using CompareTimeStamps here would cause randr to suddenly + * stop working after several hours have passed (freedesktop bug #6502). */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) + if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) { rep.status = RRSetConfigInvalidConfigTime; goto sendReply; From 1afdf8b0a92437dffe84fa98b6083b3d8fd55e27 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 31 Aug 2007 22:11:13 -0700 Subject: [PATCH 18/81] [RANDR] Don't mark Xinerama as active if no crtcs are enabled. (bug #11504). Clients expect any Xinerama-enabled screen to report at least one monitor, but with RandR, there may not be any enabled crtcs. In this case, tell the client that Xinerama is not active. --- randr/rrxinerama.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 2a57e4e32..896f61fb5 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -147,12 +147,6 @@ ProcRRXineramaGetState(ClientPtr client) return client->noClientException; } -static Bool -RRXineramaScreenActive (ScreenPtr pScreen) -{ - return rrGetScrPriv(pScreen) != NULL; -} - static Bool RRXineramaCrtcActive (RRCrtcPtr crtc) { @@ -165,7 +159,7 @@ RRXineramaScreenCount (ScreenPtr pScreen) int i, n; n = 0; - if (RRXineramaScreenActive (pScreen)) + if (rrGetScrPriv (pScreen)) { rrScrPriv(pScreen); for (i = 0; i < pScrPriv->numCrtcs; i++) @@ -175,6 +169,12 @@ RRXineramaScreenCount (ScreenPtr pScreen) return n; } +static Bool +RRXineramaScreenActive (ScreenPtr pScreen) +{ + return RRXineramaScreenCount (pScreen) > 0; +} + int ProcRRXineramaGetScreenCount(ClientPtr client) { From f98dfec79dadb70fa7bba84e7335f92b3a73dc02 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 1 Sep 2007 21:14:22 -0700 Subject: [PATCH 19/81] [COMPOSITE] Composite used for pixmap population on redirect. (Bug #7447) compNewPixmap copies bits from the parent window to the redirected child pixmap to populate the pixmap with reasonable data. It cannot always use CopyArea as that only works across matching depths. Use Composite when the depths do not match. --- composite/compalloc.c | 73 +++++++++++++++++++++++++++++++----------- composite/compint.h | 3 ++ composite/compwindow.c | 2 +- 3 files changed, 59 insertions(+), 19 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index f555411bf..006e80840 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -461,7 +461,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pPixmap; - GCPtr pGC; pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); @@ -471,25 +470,63 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; - pGC = GetScratchGC (pWin->drawable.depth, pScreen); - - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ - if (pGC) + if (pParent->drawable.depth == pWin->drawable.depth) { - XID val = IncludeInferiors; + GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); - ValidateGC(&pPixmap->drawable, pGC); - dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); - (*pGC->ops->CopyArea) (&pParent->drawable, - &pPixmap->drawable, - pGC, - x - pParent->drawable.x, - y - pParent->drawable.y, - w, h, 0, 0); - FreeScratchGC (pGC); + /* + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ + if (pGC) + { + XID val = IncludeInferiors; + + ValidateGC(&pPixmap->drawable, pGC); + dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); + (*pGC->ops->CopyArea) (&pParent->drawable, + &pPixmap->drawable, + pGC, + x - pParent->drawable.x, + y - pParent->drawable.y, + w, h, 0, 0); + FreeScratchGC (pGC); + } + } + else + { + PictFormatPtr pSrcFormat = compWindowFormat (pParent); + PictFormatPtr pDstFormat = compWindowFormat (pWin); + XID inferiors = IncludeInferiors; + int error; + + PicturePtr pSrcPicture = CreatePicture (None, + &pParent->drawable, + pSrcFormat, + CPSubwindowMode, + &inferiors, + serverClient, &error); + + PicturePtr pDstPicture = CreatePicture (None, + &pPixmap->drawable, + pDstFormat, + 0, 0, + serverClient, &error); + + if (pSrcPicture && pDstPicture) + { + CompositePicture (PictOpSrc, + pSrcPicture, + NULL, + pDstPicture, + x - pParent->drawable.x, + y - pParent->drawable.y, + 0, 0, 0, 0, w, h); + } + if (pSrcPicture) + FreePicture (pSrcPicture, 0); + if (pDstPicture) + FreePicture (pDstPicture, 0); } return pPixmap; } diff --git a/composite/compint.h b/composite/compint.h index 38b1777a2..f69595ccc 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -237,6 +237,9 @@ compCheckTree (ScreenPtr pScreen); #define compCheckTree(s) #endif +PictFormatPtr +compWindowFormat (WindowPtr pWin); + void compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap); diff --git a/composite/compwindow.c b/composite/compwindow.c index a4c4e6f32..bfd29460b 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -685,7 +685,7 @@ compGetWindowVisual (WindowPtr pWin) return 0; } -static PictFormatPtr +PictFormatPtr compWindowFormat (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; From c56930e6ca90a61d2f4cbd845f7d0a51a66f83cb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 31 Aug 2007 18:27:41 -0700 Subject: [PATCH 20/81] Remove backend.[ch] from neomagic to fix distcheck. --- hw/kdrive/neomagic/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/kdrive/neomagic/Makefile.am b/hw/kdrive/neomagic/Makefile.am index 468654711..95f0e1eaa 100644 --- a/hw/kdrive/neomagic/Makefile.am +++ b/hw/kdrive/neomagic/Makefile.am @@ -19,8 +19,6 @@ bin_PROGRAMS = Xneomagic noinst_LIBRARIES = libneomagic.a libneomagic_a_SOURCES = \ - backend.h \ - backend.c \ neomagic.c \ neomagic.h \ neo_draw.c From 529acb175440969af9d7fa38aab8d7dea0dc2661 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 2 Sep 2007 15:16:01 -0700 Subject: [PATCH 21/81] Fix Xorg build by listing circular dependency libraries twice. One of these I introduced by listing dix and mi in the same library list to simplify other servers. The other had been hacked around using libosandcommon, which is now gone. --- hw/xfree86/Makefile.am | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 511e224d3..b9a85798c 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -35,23 +35,18 @@ INCLUDES = @XORG_INCS@ Xorg_SOURCES = xorg.c -# libxorgos and libcommon need symbols from each other -noinst_LTLIBRARIES = libosandcommon.la -libosandcommon_la_SOURCES = osandcommon.c -libosandcommon_la_LIBADD = \ - os-support/libxorgos.la \ - common/libcommon.la - -osandcommon.c xorg.c: +xorg.c: touch $@ DISTCLEANFILES = osandcommon.c xorg.c XORG_LIBS = \ - $(XSERVER_LIBS \ + $(XSERVER_LIBS) \ common/libinit.a \ loader/libloader.a \ - libosandcommon.la \ + os-support/libxorgos.la \ + common/libcommon.la \ + os-support/libxorgos.la \ rac/librac.a \ parser/libxf86config.a \ dixmods/libdixmods.la \ @@ -60,7 +55,10 @@ XORG_LIBS = \ ddc/libddc.a \ i2c/libi2c.a \ dixmods/libxorgxkb.la \ - @XORG_LIBS@ + $(top_builddir)/mi/libmi.la \ + $(top_builddir)/os/libos.la \ + @XORG_LIBS@ \ + dixmods/libxorgxkb.la Xorg_DEPENDENCIES = $(XORG_LIBS) Xorg_LDADD = $(XORG_LIBS) $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) From 9adea807038b64292403ede982075fe1dcfd4c9a Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Tue, 4 Sep 2007 08:46:46 +0100 Subject: [PATCH 22/81] bgPixel (unsigned long) is 64-bit on x86_64, so -1 != 0xffffffff This patch should fix bug 8080. --- hw/xfree86/xaa/xaaGC.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index f3434c9f4..b3dc83ada 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -80,10 +80,11 @@ XAAValidateGC( } if(pGC->depth != 32) { - if(pGC->bgPixel == -1) /* -1 is reserved for transparency */ - pGC->bgPixel = 0x7fffffff; - if(pGC->fgPixel == -1) /* -1 is reserved for transparency */ - pGC->fgPixel = 0x7fffffff; + /* 0xffffffff is reserved for transparency */ + if(pGC->bgPixel == 0xffffffff) + pGC->bgPixel = 0x7fffffff; + if(pGC->fgPixel == 0xffffffff) + pGC->fgPixel = 0x7fffffff; } if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){ From 7c5de093d499de63d39fe038d86da0a085262017 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 4 Sep 2007 15:07:17 +0200 Subject: [PATCH 23/81] Fixing sig11 in xf86I2CGetScreenBuses(). Dereferencing a pointer once too often caused a sig11 in xf86I2CGetScreenBuses(). --- hw/xfree86/i2c/xf86i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 53382a859..0139612f5 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -883,7 +883,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); - *pppI2CBus[n - 1] = pI2CBus; + pppI2CBus[n - 1] = pI2CBus; } return n; From 735da3dcd09f59c40f68eca8c9a91c2e826cd1b9 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 4 Sep 2007 16:42:57 +0200 Subject: [PATCH 24/81] Fixing xf86I2CGetScreenBuses(), now dereferencing the correct pointer. --- hw/xfree86/i2c/xf86i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 0139612f5..5cc83faa3 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -883,7 +883,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); - pppI2CBus[n - 1] = pI2CBus; + (*pppI2CBus)[n - 1] = pI2CBus; } return n; From 4062db4020c671fc0921a3a4e7fe5d8dc1be2e1d Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 4 Sep 2007 22:39:14 +0200 Subject: [PATCH 25/81] typo in comment --- Xext/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/Makefile.am b/Xext/Makefile.am index d0d23b77f..946c118b1 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -87,7 +87,7 @@ endif XCALIBRATE_SRCS = xcalibrate.c if XCALIBRATE BUILTIN_SRCS += $(XCALIBRATE_SRCS) -# XCalibrare needs tslib +# XCalibrate needs tslib endif # X EVent Interception Extension: allows accessibility helpers & composite From e89d16be07e45e487913509788a9e8cb1ee09bc7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 4 Sep 2007 14:49:49 -0700 Subject: [PATCH 26/81] Revert part of 529acb175440969af9d7fa38aab8d7dea0dc2661 because libtool is smart. --- hw/xfree86/Makefile.am | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index b9a85798c..9be022010 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -35,7 +35,14 @@ INCLUDES = @XORG_INCS@ Xorg_SOURCES = xorg.c -xorg.c: +# libxorgos and libcommon need symbols from each other +noinst_LTLIBRARIES = libosandcommon.la +libosandcommon_la_SOURCES = osandcommon.c +libosandcommon_la_LIBADD = \ + os-support/libxorgos.la \ + common/libcommon.la + +osandcommon.c xorg.c: touch $@ DISTCLEANFILES = osandcommon.c xorg.c @@ -44,9 +51,7 @@ XORG_LIBS = \ $(XSERVER_LIBS) \ common/libinit.a \ loader/libloader.a \ - os-support/libxorgos.la \ - common/libcommon.la \ - os-support/libxorgos.la \ + libosandcommon.la \ rac/librac.a \ parser/libxf86config.a \ dixmods/libdixmods.la \ From f7f79724fdea0cc6fda0e90e56431df937d49335 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 4 Sep 2007 15:10:49 -0700 Subject: [PATCH 27/81] Increase despair by fixing xprint build after my _DEPENDENCIES changes. --- configure.ac | 18 ++++++++++-------- hw/xprint/Makefile.am | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index f9c8408a5..a5bdfb40a 100644 --- a/configure.ac +++ b/configure.ac @@ -1649,11 +1649,10 @@ AC_MSG_CHECKING([whether to build Xprint DDX]) AC_MSG_RESULT([$XPRINT]) if test "x$XPRINT" = xyes; then - PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau]) - XPRINT_EXTENSIONS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS" - XPRINT_LIBS="$DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MIEXT_DAMAGE_LIB $CWRAP_LIB $XPRINT_LIBS" - AC_SUBST([XPRINT_CFLAGS]) - AC_SUBST([XPRINT_LIBS]) + PKG_CHECK_MODULES([XPRINTMODULES], [printproto x11 xfont $XDMCP_MODULES xau]) + XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS" + XPRINT_LIBS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $CWRAP_LIBS $XKB_LIB $XKB_STUB_LIB" + XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS" xpconfigdir=$libdir/X11/xserver AC_SUBST([xpconfigdir]) @@ -1689,10 +1688,13 @@ if test "x$XPRINT" = xyes; then FREETYPE_LIBS="" FREETYPE_REQUIRES="" fi - AC_SUBST(FREETYPE_LIBS) - AC_SUBST(FREETYPE_CFLAGS) - AC_SUBST(FREETYPE_REQUIRES) + XPRINT_CFLAGS="$XPRINT_CFLAGS $FREETYPE_CFLAGS" + XPRINT_SYS_LIBS="$XPRINT_SYS_LIBS $FREETYPE_LIBS" # end freetype support + + AC_SUBST([XPRINT_CFLAGS]) + AC_SUBST([XPRINT_LIBS]) + AC_SUBST([XPRINT_SYS_LIBS]) fi AM_CONDITIONAL(XP_USE_FREETYPE, [test "x$XPRINT" = xyes && test "x$XP_USE_FREETYPE" = xyes]) diff --git a/hw/xprint/Makefile.am b/hw/xprint/Makefile.am index dc8764a02..c440473a0 100644 --- a/hw/xprint/Makefile.am +++ b/hw/xprint/Makefile.am @@ -9,10 +9,22 @@ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \ -DXFree86Server Xprt_LDFLAGS = -L$(top_srcdir) -Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \ - pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \ - $(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \ - $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@ +XPRINT_LIBS = \ + @XPRINT_LIBS@ \ + ps/libps.la \ + raster/libraster.la \ + pcl/libpcl.la \ + pcl-mono/libpcl.la \ + $(top_builddir)/fb/libfb.la \ + $(top_builddir)/render/librender.la \ + $(XSERVER_LIBS) \ + $(top_builddir)/Xext/libXext.la \ + $(top_builddir)/xkb/libxkb.la \ + $(top_builddir)/xkb/libxkbstubs.la \ + $(top_builddir)/os/libos.la # for Xprintf + +Xprt_DEPENDENCIES = $(XPRINT_LIBS) +Xprt_LDADD = $(XPRINT_LIBS) $(XPRINT_SYS_LIBS) $(XSERVER_SYS_LIBS) miinitext-wrapper.c: echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@ From d67e210f3458b62d7d4a6032aabfda0004d661c1 Mon Sep 17 00:00:00 2001 From: Gerte Hoogewerf Date: Tue, 4 Sep 2007 16:09:38 -0700 Subject: [PATCH 28/81] Add stub symbols to make xprint build. --- hw/xprint/ddxInit.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/xprint/ddxInit.c b/hw/xprint/ddxInit.c index a465c4c6d..1e7652e60 100644 --- a/hw/xprint/ddxInit.c +++ b/hw/xprint/ddxInit.c @@ -310,6 +310,17 @@ ChangeDeviceControl ( return BadMatch; } +int +NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) +{ + return BadValue; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr dev) +{ +} + void OpenInputDevice ( DeviceIntPtr dev, From 205183a733237ea418a25c7423b689fcc8eae628 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 4 Sep 2007 16:19:22 -0700 Subject: [PATCH 29/81] Fix driver build by including an appropriate Requires.private line on pixman. We'd previously been substituting PIXMAN_CFLAGS, but we've got a better tool now, plus I deleted the PIXMAN_CFLAGS substitution without noticing. --- xorg-server.pc.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xorg-server.pc.in b/xorg-server.pc.in index fba3b15a6..d3ffaa2f8 100644 --- a/xorg-server.pc.in +++ b/xorg-server.pc.in @@ -8,5 +8,6 @@ sdkdir=@sdkdir@ Name: xorg-server Description: Modular X.Org X Server Version: @PACKAGE_VERSION@ -Cflags: -I${sdkdir} @PIXMAN_CFLAGS@ +Requires.private: pixman-1 +Cflags: -I${sdkdir} Libs: -L${libdir} From eb6a933dc60bec5601260794eeb973e946af37b6 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 3 Jul 2007 13:44:03 -0300 Subject: [PATCH 30/81] Add xorg.conf man section about catalogue: FPE catalogue: FPEs were introduced in libXfont 1.2.9 --- hw/xfree86/doc/man/xorg.conf.man.pre | 48 ++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index ce54ea982..54d8eaa87 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -293,15 +293,50 @@ server searches for font databases. Multiple .B FontPath entries may be specified, and they will be concatenated to build up the -fontpath used by the server. Font path elements may be either absolute -directory paths, or a font server identifier. -Font server identifiers have the form: +fontpath used by the server. Font path elements can be absolute +directory paths, catalogue directories or a font server identifier. The +formats of the later two are explained below: +.PP +.RS 7 +Catalogue directories: +.PP +.RS 4 +Catalogue directories can be specified using the prefix \fBcatalogue:\fR +before the directory name. The directory can then be populated with +symlinks pointing to the real font directories, using the following +syntax in the symlink name: +.PP +.RS 4 +.IR : [attribute]: pri= +.RE +.PP +where +.I +is an alphanumeric identifier, +.I [attribute] +is an attribute wich will be passed to the underlying FPE and +.I +is a number used to order the fontfile FPEs. Examples: +.PP +.RS 4 +.nf +.I 75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi +.I gscript:pri=60 -> /usr/share/fonts/default/ghostscript +.I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc +.fi +.PP +.RE .RE .RE +.PP +.RS 7 +Font server identifiers: +.PP +.RS 4 +Font server identifiers have the form: +.RS 4 .PP -.RS 11 .IR / : .RE .PP -.RS 7 where .I is the transport type to use to connect to the font server (e.g., @@ -313,10 +348,11 @@ for a TCP/IP connection), is the hostname of the machine running the font server, and .I is the port number that the font server is listening on (usually 7100). +.RE .PP When this entry is not specified in the config file, the server falls back to the compiled\-in default font path, which contains the following -font path elements: +font path elements (which can be set inside a catalogue directory): .PP .RS 4 .nf From 136fde2c7b5ed590bc6c63d11ede31e92dc679a2 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 3 Jul 2007 13:44:28 -0300 Subject: [PATCH 31/81] Add Xserver man section about catalogue: FPE catalogue: FPEs were introduced in libXfont 1.2.9 --- doc/Xserver.man.pre | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre index aac3b51c3..c9ee019c6 100644 --- a/doc/Xserver.man.pre +++ b/doc/Xserver.man.pre @@ -508,8 +508,7 @@ its parent process after it has set up the various connection schemes. \fIXdm\fP uses this feature to recognize when connecting to the server is possible. .SH FONTS -The X server -can obtain fonts from directories and/or from font servers. +The X server can obtain fonts from directories and/or from font servers. The list of directories and font servers the X server uses when trying to open a font is controlled by the \fIfont path\fP. @@ -517,8 +516,45 @@ by the \fIfont path\fP. The default font path is __default_font_path__ . .LP +A special kind of directory can be specified using the the \fBcatalogue\fP: +prefix. Directories specified this way can contain symlinks pointing to the +real font directories. See the FONTPATH.D section for details. +.LP The font path can be set with the \fB\-fp\fP option or by \fIxset\fP(1) after the server has started. +.SH "FONTPATH.D" +You can specify a special kind of font path in the form \fBcatalogue:\fR. +The directory specified after the catalogue: prefix will be scanned for symlinks +and each symlink destination will be added as a local fontfile FPE. +.PP +The symlink can be suffixed by attributes such as '\fBunscaled\fR', which +will be passed through to the underlying fontfile FPE. The only exception is +the newly introduced '\fBpri\fR' attribute, which will be used for ordering +the font paths specified by the symlinks. + +An example configuration: + +.nf + 75dpi:unscaled:pri=20 \-> /usr/share/X11/fonts/75dpi + ghostscript:pri=60 \-> /usr/share/fonts/default/ghostscript + misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc + type1:pri=40 \-> /usr/share/X11/fonts/Type1 + type1:pri=50 \-> /usr/share/fonts/default/Type1 +.fi + +This will add /usr/share/X11/fonts/misc as the first FPE with the attribute +'unscaled', second FPE will be /usr/share/X11/fonts/75dpi, also with +the attribute unscaled etc. This is functionally equivalent to setting +the following font path: + +.nf + /usr/share/X11/fonts/misc:unscaled, + /usr/share/X11/fonts/75dpi:unscaled, + /usr/share/X11/fonts/Type1, + /usr/share/fonts/default/Type1, + /usr/share/fonts/default/ghostscript +.fi + .SH FILES .TP 30 .I /etc/X\fBn\fP.hosts From b6c0697fd67323893a9ad3676c33f2f1ec48e15e Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 04:40:03 -0700 Subject: [PATCH 32/81] fixed path for event_status_driver.h (The path currently used is deprecated on Tiger and invalid on Leopard.) --- hw/darwin/iokit/xfIOKit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c index c7ebd1c18..9de33c064 100644 --- a/hw/darwin/iokit/xfIOKit.c +++ b/hw/darwin/iokit/xfIOKit.c @@ -62,8 +62,8 @@ #define NO_CFPLUGIN #include #include +#include #include -#include // Define this to work around bugs in the display drivers for // older PowerBook G3's. If the X server starts without this From 28e48cd8e6e4c412a49d7177daad6d3c93c28e08 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 04:43:17 -0700 Subject: [PATCH 33/81] Another pathname fix for event_status_driver.h --- hw/darwin/utils/dumpkeymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c index d2eeca5c2..0c8bdcd01 100644 --- a/hw/darwin/utils/dumpkeymap.c +++ b/hw/darwin/utils/dumpkeymap.c @@ -143,7 +143,7 @@ #include #include #if !defined(DUMPKEYMAP_FILE_ONLY) -#include +#include #endif #define PROG_NAME "dumpkeymap" From 6c89d1237c4fdce961b30a8eaee964af5d56565e Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Wed, 5 Sep 2007 17:46:49 +0200 Subject: [PATCH 34/81] Kdrive: unbreak kdrive linking * configure.ac: re-sort Kdrive libs so that symbols get properly resolved. Basically, all some libs are present in both $KDRIVE_LIBS and $XSERVER_LIBS, and some libs orders are not correct. So I made sure Kdrive servers don't have to link against $KDRIVE_LIBS *and* $XSERVER_LIBS. They just have to link against $KDRIVE_LIBS now. * hw/kdrive/*/Makefile.am: update those makefile to reflect the change in configure.ac --- configure.ac | 8 +++++--- hw/kdrive/ati/Makefile.am | 3 +-- hw/kdrive/chips/Makefile.am | 3 +-- hw/kdrive/epson/Makefile.am | 3 +-- hw/kdrive/fbdev/Makefile.am | 3 +-- hw/kdrive/i810/Makefile.am | 3 +-- hw/kdrive/mach64/Makefile.am | 3 +-- hw/kdrive/mga/Makefile.am | 3 +-- hw/kdrive/nvidia/Makefile.am | 3 +-- hw/kdrive/pm2/Makefile.am | 3 +-- hw/kdrive/r128/Makefile.am | 3 +-- hw/kdrive/sdl/Makefile.am | 3 +-- hw/kdrive/smi/Makefile.am | 3 +-- hw/kdrive/vesa/Makefile.am | 3 +-- hw/kdrive/via/Makefile.am | 3 +-- 15 files changed, 19 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index a5bdfb40a..c909c1da5 100644 --- a/configure.ac +++ b/configure.ac @@ -1868,7 +1868,7 @@ if test "$KDRIVE" = yes; then KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - KDRIVE_PURE_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" + KDRIVE_PURE_LIBS="$FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a' case $host_os in *linux*) @@ -1877,8 +1877,10 @@ if test "$KDRIVE" = yes; then ;; esac KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.a' - KDRIVE_LOCAL_LIBS="$DIX_LIB $CONFIG_LIB $KDRIVE_LIB $TSLIB_LIBS $KDRIVE_OS_LIB $KDRIVE_PURE_LIBS $KDRIVE_STUB_LIB" - KDRIVE_LIBS="$XSERVERLIBS_LIBS $KDRIVE_LOCAL_LIBS" + KDRIVE_LOCAL_LIBS="$TSLIB_LIBS $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVERLIBS_LIBS" # check if we can build Xephyr PKG_CHECK_MODULES(XEPHYR, x11 xext xfont xau xdmcp, [xephyr="yes"], [xephyr="no"]) diff --git a/hw/kdrive/ati/Makefile.am b/hw/kdrive/ati/Makefile.am index 9e1fc7f57..8429250f3 100644 --- a/hw/kdrive/ati/Makefile.am +++ b/hw/kdrive/ati/Makefile.am @@ -60,8 +60,7 @@ ATI_LIBS = \ Xati_LDADD = \ $(ATI_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xati_DEPENDENCIES = \ libati.a \ diff --git a/hw/kdrive/chips/Makefile.am b/hw/kdrive/chips/Makefile.am index 8188a8e7e..51b0edf31 100644 --- a/hw/kdrive/chips/Makefile.am +++ b/hw/kdrive/chips/Makefile.am @@ -22,8 +22,7 @@ CHIPS_LIBS = \ Xchips_LDADD = \ $(CHIPS_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xchips_DEPENDENCIES = \ libchips.a \ diff --git a/hw/kdrive/epson/Makefile.am b/hw/kdrive/epson/Makefile.am index cd2057132..2a440149d 100644 --- a/hw/kdrive/epson/Makefile.am +++ b/hw/kdrive/epson/Makefile.am @@ -22,8 +22,7 @@ EPSON_LIBS = \ Xepson_LDADD = \ $(EPSON_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xepson_DEPENDENCIES = \ libepson.a \ diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am index ea2aff3b3..1ce4833a7 100644 --- a/hw/kdrive/fbdev/Makefile.am +++ b/hw/kdrive/fbdev/Makefile.am @@ -16,8 +16,7 @@ Xfbdev_SOURCES = \ Xfbdev_LDADD = \ libfbdev.a \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xfbdev_DEPENDENCIES = \ libfbdev.a \ diff --git a/hw/kdrive/i810/Makefile.am b/hw/kdrive/i810/Makefile.am index e3a702dde..ea02cb67d 100644 --- a/hw/kdrive/i810/Makefile.am +++ b/hw/kdrive/i810/Makefile.am @@ -25,8 +25,7 @@ I810_LIBS = \ Xi810_LDADD = \ $(I810_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xi810_DEPENDENCIES = \ libi810.a \ diff --git a/hw/kdrive/mach64/Makefile.am b/hw/kdrive/mach64/Makefile.am index 537939083..746ffff8f 100644 --- a/hw/kdrive/mach64/Makefile.am +++ b/hw/kdrive/mach64/Makefile.am @@ -29,8 +29,7 @@ MACH64_LIBS = \ Xmach64_LDADD = \ $(MACH64_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xmach64_DEPENDENCIES = \ libmach64.a \ diff --git a/hw/kdrive/mga/Makefile.am b/hw/kdrive/mga/Makefile.am index 0598651d6..37bc50cf2 100644 --- a/hw/kdrive/mga/Makefile.am +++ b/hw/kdrive/mga/Makefile.am @@ -24,8 +24,7 @@ MGA_LIBS = \ Xmga_LDADD = \ $(MGA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xmga_DEPENDENCIES = \ libmga.a \ diff --git a/hw/kdrive/nvidia/Makefile.am b/hw/kdrive/nvidia/Makefile.am index 8ebfec9de..b380e44ee 100644 --- a/hw/kdrive/nvidia/Makefile.am +++ b/hw/kdrive/nvidia/Makefile.am @@ -25,8 +25,7 @@ NVIDIA_LIBS = \ Xnvidia_LDADD = \ $(NVIDIA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xnvidia_DEPENDENCIES = \ libnvidia.a \ diff --git a/hw/kdrive/pm2/Makefile.am b/hw/kdrive/pm2/Makefile.am index b2b48ba6a..208d0319e 100644 --- a/hw/kdrive/pm2/Makefile.am +++ b/hw/kdrive/pm2/Makefile.am @@ -23,8 +23,7 @@ PM2_LIBS = \ Xpm2_LDADD = \ $(PM2_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xpm2_DEPENDENCIES = \ libpm2.a \ diff --git a/hw/kdrive/r128/Makefile.am b/hw/kdrive/r128/Makefile.am index 609e0f5d2..62c1fcfa3 100644 --- a/hw/kdrive/r128/Makefile.am +++ b/hw/kdrive/r128/Makefile.am @@ -22,8 +22,7 @@ R128_LIBS = \ Xr128_LDADD = \ $(R128_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xr128_DEPENDENCIES = \ libr128.a \ diff --git a/hw/kdrive/sdl/Makefile.am b/hw/kdrive/sdl/Makefile.am index e74249967..fe9309e46 100644 --- a/hw/kdrive/sdl/Makefile.am +++ b/hw/kdrive/sdl/Makefile.am @@ -7,9 +7,8 @@ bin_PROGRAMS = Xsdl Xsdl_SOURCES = sdl.c -Xsdl_LDADD = @KDRIVE_PURE_LIBS@ \ +Xsdl_LDADD = \ @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ \ @XSDL_LIBS@ Xsdl_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ diff --git a/hw/kdrive/smi/Makefile.am b/hw/kdrive/smi/Makefile.am index 6cee31610..a4d6624c5 100644 --- a/hw/kdrive/smi/Makefile.am +++ b/hw/kdrive/smi/Makefile.am @@ -27,8 +27,7 @@ SMI_LIBS = \ Xsmi_LDADD = \ $(SMI_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xsmi_DEPENDENCIES = \ libsmi.a \ diff --git a/hw/kdrive/vesa/Makefile.am b/hw/kdrive/vesa/Makefile.am index d58f20f95..ac50d2bf5 100644 --- a/hw/kdrive/vesa/Makefile.am +++ b/hw/kdrive/vesa/Makefile.am @@ -21,8 +21,7 @@ Xvesa_SOURCES = \ Xvesa_LDADD = \ libvesa.a \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xvesa_DEPENDENCIES = \ libvesa.a \ diff --git a/hw/kdrive/via/Makefile.am b/hw/kdrive/via/Makefile.am index 8c8189d12..249b3f31e 100644 --- a/hw/kdrive/via/Makefile.am +++ b/hw/kdrive/via/Makefile.am @@ -23,8 +23,7 @@ VIA_LIBS = \ Xvia_LDADD = \ $(VIA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xvia_DEPENDENCIES = \ libvia.a \ From 47300ed2be59d0ba7ea9345b954bf3104877c095 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 5 Sep 2007 12:34:29 -0700 Subject: [PATCH 35/81] Fix server version reporting to be the server package version. Previously, the server version reported by xdpyinfo and Xorg -version would bear some vague resemblance to a X.Org katamari version, but in the presence of modularization (and client-server relationships with different katamari versions on each side) those numbers don't really make sense. Instead, just report the package version. When branching a stable branch, master's version should be immediately updated to the endpoint of the stable branch plus a snapshot of 1 (for example, 1.4.0.1 after server-1.4-branch). The stable branch should then be changed to RC0 at that time (1.3.99.0, for example). This scheme was partially attempted for server 1.3, but lacked the appropriate master updates, thus why it had to be revisited now. While here, we can also remove a lot of versioning complexity since everything is based on the package version. --- configure.ac | 86 +++++++++++------------------------- dix/Makefile.am | 2 +- dix/main.c | 2 +- hw/xfree86/common/xf86Init.c | 6 +-- 4 files changed, 30 insertions(+), 66 deletions(-) diff --git a/configure.ac b/configure.ac index c909c1da5..fab5cf34d 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -dnl This is the not the Xorg version number, it's the server version number. -dnl Yes, that's weird. -AC_INIT([xorg-server], 1.3.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +AC_INIT([xorg-server], 1.4.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE @@ -374,14 +372,22 @@ case $host_os in esac AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes) -DEFAULT_VENDOR_NAME="The X.Org Foundation" -DEFAULT_VENDOR_NAME_SHORT="X.Org" -DEFAULT_VERSION_MAJOR=7 -DEFAULT_VERSION_MINOR=2 -DEFAULT_VERSION_PATCH=0 -DEFAULT_VERSION_SNAP=0 -DEFAULT_RELEASE_DATE="21 December 2005" -DEFAULT_VENDOR_WEB="http://wiki.x.org" +XORG_RELEASE_VERSION +dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the +dnl major number +PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` +PVS=`echo $PACKAGE_VERSION | cut -d . -f 4` +if test "x$PVS" = "x"; then + PVS="0" +fi + +VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" +VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" + +VENDOR_NAME="The X.Org Foundation" +VENDOR_NAME_SHORT="X.Org" +RELEASE_DATE="5 September 2007" +VENDOR_WEB="http://wiki.x.org" m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) @@ -397,36 +403,13 @@ AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backe [INT10="$DEFAULT_INT10"]) AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], [Vendor string reported by the server]), - [ VENDOR_STRING="$withval" ], - [ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ]) + [ VENDOR_NAME="$withval" ], []) AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], [Short version of vendor string reported by the server]), - [ VENDOR_STRING_SHORT="$withval" ], - [ VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ]) -AC_ARG_WITH(release-major, AS_HELP_STRING([--with-release-major=MAJOR], - [Release major number reported by the server]), - [ VERSION_MAJOR="$withval" ], - [ VERSION_MAJOR="$DEFAULT_VERSION_MAJOR" ]) -AC_ARG_WITH(release-minor, AS_HELP_STRING([--with-release-minor=MINOR], - [Release minor number reported by the server]), - [ VERSION_MINOR="$withval" ], - [ VERSION_MINOR="$DEFAULT_VERSION_MINOR" ]) -AC_ARG_WITH(release-patch, AS_HELP_STRING([--with-release-patch=PATCH], - [Release patch number reported by the server]), - [ VERSION_PATCH="$withval" ], - [ VERSION_PATCH="$DEFAULT_VERSION_PATCH" ]) -AC_ARG_WITH(release-snap, AS_HELP_STRING([--with-release-snap=SNAP], - [Release snap number reported by the server]), - [ VERSION_SNAP="$withval" ], - [ VERSION_SNAP="$DEFAULT_VERSION_SNAP" ]) -AC_ARG_WITH(release-date, AS_HELP_STRING([--with-release-date=DATE], - [Release date reported by the server]), - [ RELEASE_DATE="$withval" ], - [ RELEASE_DATE="$DEFAULT_RELEASE_DATE" ]) + [ VENDOR_NAME_SHORT="$withval" ], []) AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], [Vendor web address reported by the server]), - [ VENDOR_WEB="$withval" ], - [ VENDOR_WEB="$DEFAULT_VENDOR_WEB" ]) + [ VENDOR_WEB="$withval" ], []) AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], [Directory where modules are installed (default: $libdir/xorg/modules)]), [ moduledir="$withval" ], @@ -1004,29 +987,13 @@ if test "x$USE_RGB_BUILTIN" = xyes; then AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database]) fi -VENDOR_RELEASE="((($VERSION_MAJOR) * 10000000) + (($VERSION_MINOR) * 100000) + (($VERSION_PATCH) * 1000) + $VERSION_SNAP)" - -if test $VERSION_SNAP = "0"; then - if test $VERSION_PATCH = "0"; then - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}" - else - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" - fi -else - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SNAP}" -fi - -VENDOR_RELEASE_STRING="Release ${VENDOR_VERSION_STRING}" -VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}" - AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path]) -AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name]) -AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_STRING_SHORT"], [Short vendor name]) -AC_DEFINE_UNQUOTED(XORG_RELEASE, ["$VENDOR_RELEASE_STRING"], [Vendor release]) +AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) +AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) @@ -1039,8 +1006,8 @@ AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) -AC_SUBST([VENDOR_STRING]) -AC_SUBST([VENDOR_STRING_SHORT]) +AC_SUBST([VENDOR_NAME]) +AC_SUBST([VENDOR_NAME_SHORT]) AC_SUBST([VENDOR_RELEASE]) AC_SUBST([VENDOR_MAN_VERSION]) @@ -1375,7 +1342,7 @@ return 0;} AC_CHECK_LIB([Xplugin],[xp_init],[:]) AC_SUBST([APPLE_APPLICATIONS_DIR]) CFLAGS="${CFLAGS} -D__DARWIN__" - PLIST_VERSION_STRING=$VENDOR_VERSION_STRING + PLIST_VERSION_STRING=$PACKAGE_VERSION AC_SUBST([PLIST_VERSION_STRING]) PLIST_VENDOR_WEB=$VENDOR_WEB AC_SUBST([PLIST_VENDOR_WEB]) @@ -2007,9 +1974,6 @@ AC_SUBST([libdir exec_prefix prefix]) # Man page sections - used in config utils & generating man pages XORG_MANPAGE_SECTIONS -# XORG in this case refers to the roll-up releases, not the Xorg DDX. -XORG_RELEASE_VERSION - AC_OUTPUT([ Makefile GL/Makefile diff --git a/dix/Makefile.am b/dix/Makefile.am index 3c92a4a00..28c2d8b6e 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -1,7 +1,7 @@ noinst_LTLIBRARIES = libdix.la libxpstubs.la AM_CFLAGS = $(DIX_CFLAGS) \ - -DVENDOR_STRING=\""@VENDOR_STRING@"\" \ + -DVENDOR_NAME=\""@VENDOR_NAME@"\" \ -DVENDOR_RELEASE="@VENDOR_RELEASE@" libdix_la_SOURCES = \ diff --git a/dix/main.c b/dix/main.c index 9fe822b29..31e291b02 100644 --- a/dix/main.c +++ b/dix/main.c @@ -509,7 +509,7 @@ main(int argc, char *argv[], char *envp[]) } static int VendorRelease = VENDOR_RELEASE; -static char *VendorString = VENDOR_STRING; +static char *VendorString = VENDOR_NAME; void SetVendorRelease(int release) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 72f7150fd..2f1651cc7 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1821,7 +1821,7 @@ xf86PrintBanner() "latest version in the X.Org Foundation git repository.\n" "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); #endif - ErrorF("\nX Window System Version %d.%d.%d", + ErrorF("\nX.Org X Server %d.%d.%d", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH); @@ -1855,8 +1855,8 @@ xf86PrintBanner() #define XORG_DATE XF86_DATE #endif ErrorF("\nRelease Date: %s\n", XORG_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); + ErrorF("X Protocol Version %d, Revision %d\n", + X_PROTOCOL, X_PROTOCOL_REVISION); ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); #ifdef HAS_UTSNAME { From 8ba8c16af773ec83a0b1c0661a23d746b401944e Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 13:46:30 -0700 Subject: [PATCH 36/81] build fixes for XDarwin --- hw/darwin/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 00811e746..4cec3b1b4 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -90,6 +90,7 @@ Xquartz_LDFLAGS = \ -Wl,-u,_miDCInitialize \ -Wl,-framework,Carbon \ -Wl,-framework,OpenGL \ + -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib \ -Wl,-framework,Cocoa \ -Wl,-framework,CoreAudio \ -Wl,-framework,IOKit @@ -115,7 +116,6 @@ XDarwinApp_SOURCES = \ XDARWINAPP_LIBS = \ $(DARWIN_LIBS) \ - $(top_builddir)/dix/dixfonts.lo \ ./quartz/XApplication.o \ ./libdarwinShared.a \ ./quartz/libXQuartz.a \ @@ -152,6 +152,7 @@ cr_la_LIBADD = \ $(top_builddir)/miext/rootless/accel/librlAccel.la cr_la_LDFLAGS = -shrext '' -Wl,-framework,ApplicationServices \ + -lpixman-1 \ -Wl,-framework,Cocoa \ -Wl,-framework,Carbon \ -XCClinker -ObjC \ @@ -211,6 +212,7 @@ xpr_la_LIBADD = \ $(top_builddir)/miext/rootless/accel/librlAccel.la xpr_la_LDFLAGS = -shrext '' -Wl,-framework,ApplicationServices \ + -lpixman-1 \ -lXplugin \ -XCClinker -bundle_loader -XCClinker XDarwinApp \ -module -avoid-version -no-undefined From 20c6677d1b5f8d77325dd878ffa3df1d0fb01864 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 14:31:01 -0700 Subject: [PATCH 37/81] configure.ac: exclude pci-access dependency from XDarwin XDarwin doesn't need any of this pci stuff since it doesn't talk directly to hardware, so it doesn't make sense to require it when building on OSX/Darwin. --- configure.ac | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index fab5cf34d..cba9d315d 100644 --- a/configure.ac +++ b/configure.ac @@ -1297,8 +1297,6 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. - PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" case $host_os in @@ -1496,6 +1494,12 @@ return 0;} ;; esac + if ! test "$XORG_OS" = "Darwin" ; then + PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS" + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" + fi + if test "x$XORG_OS_PCI" = x ; then XORG_OS_PCI=$XORG_OS fi From 8b77dc7e808f61f1ed10fe05cf898bb47459a76d Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 14:48:38 -0700 Subject: [PATCH 38/81] XDARWIN: build breakage fix --- hw/darwin/darwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c index 7b4836805..4e3495409 100644 --- a/hw/darwin/darwin.c +++ b/hw/darwin/darwin.c @@ -156,7 +156,7 @@ DarwinPrintBanner() #endif ErrorF("\nRelease Date: %s\n", XF86_DATE); ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); + X_PROTOCOL, X_PROTOCOL_REVISION, XORG_VERSION_CURRENT ); ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); #ifdef HAS_UTSNAME { From accd71bda6f958ea6892ad3a10879232d345774c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 5 Sep 2007 14:19:19 -0700 Subject: [PATCH 39/81] Deliver correct event when releasing keys on VT switch. In commit 41bb9fce47f6366cc3f7d45790f7883f74289b5a, the event delivery loop for Xinput enabled keyboards was changed and accidentally used the wrong index variable, causing random events to be delivered when returning from VT switch. In addition, in commit aeba855b07832354f59678e20cc29a085e42bd99, SIGIO was blocked during delivery of these events, but not for the entire period the xf86Events array was being used. Block SIGIO for the whole loop to avoid other event delivery from trashing the key release events. (cherry picked from commit aa7ed1f5f35cd043bc38d985500aa0a32e857e84) --- hw/xfree86/common/xf86Events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index dd9c34e5c..91964c950 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -811,9 +811,11 @@ xf86ReleaseKeys(DeviceIntPtr pDev) (*pDev->public.processInputProc) (&ke, pDev, 1); } else { + int sigstate = xf86BlockSIGIO (); nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); for (j = 0; j < nevents; j++) - EqEnqueue(pDev, xf86Events + i); + mieqEnqueue(pDev, xf86Events + j); + xf86UnblockSIGIO(sigstate); } break; } From 7381e9149e3cbb7e672070781a16e3f096202be9 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 15:51:11 -0700 Subject: [PATCH 40/81] added an exclusion for setting XORG on darwin --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index cba9d315d..9c3ee9946 100644 --- a/configure.ac +++ b/configure.ac @@ -1220,6 +1220,7 @@ if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; + darwin*) XORG="no" ;; esac fi AC_MSG_RESULT([$XORG]) From 81c28ffd2b13a83770eadcfd7829d35d319d637f Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 5 Sep 2007 17:46:23 -0700 Subject: [PATCH 41/81] Fix key repeats during VT switch. Add keyc->postdown, which represents the key state as of the last mieqEnqueue call, and use it when we need to know the posted state, instead of the processed state (keyc->down). Add small functions to getevents.c to query and modify key state in postdown and use them all through, eliminating previously broken uses. --- dix/devices.c | 1 + dix/getevents.c | 37 +++++++++++++++++++++++++++------- hw/xfree86/common/atKeynames.h | 2 +- include/inputstr.h | 1 + 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index 923bc0d86..9f3c57653 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -868,6 +868,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers else bzero((char *)keyc->modifierMap, MAP_LENGTH); bzero((char *)keyc->down, DOWN_LENGTH); + bzero((char *)keyc->postdown, DOWN_LENGTH); for (i = 0; i < 8; i++) keyc->modifierKeyCount[i] = 0; if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc)) diff --git a/dix/getevents.c b/dix/getevents.c index 68993030d..738bd361f 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -80,6 +80,23 @@ GetMotionHistorySize(void) return MOTION_HISTORY_SIZE; } +static void +set_key_down(DeviceIntPtr pDev, int key_code) +{ + pDev->key->postdown[key_code >> 3] |= (1 << (key_code & 7)); +} + +static void +set_key_up(DeviceIntPtr pDev, int key_code) +{ + pDev->key->postdown[key_code >> 3] &= ~(1 << (key_code & 7)); +} + +static Bool +key_is_down(DeviceIntPtr pDev, int key_code) +{ + return pDev->key->postdown[key_code >> 3] >> (key_code & 7); +} /** * Allocate the motion history buffer. @@ -414,17 +431,15 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, case XK_Shift_Lock: if (type == KeyRelease) return 0; - else if (type == KeyPress && - (pDev->key->down[key_code >> 3] & (key_code & 7)) & 1) - type = KeyRelease; + else if (type == KeyPress && key_is_down(pDev, key_code)) + type = KeyRelease; } } /* Handle core repeating, via press/release/press/release. * FIXME: In theory, if you're repeating with two keyboards in non-XKB, * you could get unbalanced events here. */ - if (type == KeyPress && - (((pDev->key->down[key_code >> 3] & (key_code & 7))) & 1)) { + if (type == KeyPress && key_is_down(pDev, key_code)) { if (!pDev->kbdfeed->ctrl.autoRepeat || pDev->key->modifierMap[key_code] || !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] @@ -449,6 +464,10 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, events->u.keyButtonPointer.time = ms; events->u.u.type = type; events->u.u.detail = key_code; + if (type == KeyPress) + set_key_down(inputInfo.keyboard, key_code); + else if (type == KeyRelease) + set_key_up(inputInfo.keyboard, key_code); events++; } @@ -456,10 +475,14 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, kbp->time = ms; kbp->deviceid = pDev->id; kbp->detail = key_code; - if (type == KeyPress) + if (type == KeyPress) { kbp->type = DeviceKeyPress; - else if (type == KeyRelease) + set_key_down(pDev, key_code); + } + else if (type == KeyRelease) { kbp->type = DeviceKeyRelease; + set_key_up(pDev, key_code); + } events++; if (num_valuators) { diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h index f31f53377..85f13ac32 100644 --- a/hw/xfree86/common/atKeynames.h +++ b/hw/xfree86/common/atKeynames.h @@ -66,7 +66,7 @@ #define KanaMask Mod4Mask #define ScrollLockMask Mod5Mask -#define KeyPressed(k) (keyc->down[k >> 3] & (1 << (k & 7))) +#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7))) #define ModifierDown(k) ((keyc->state & (k)) == (k)) /* diff --git a/include/inputstr.h b/include/inputstr.h index 3398949d4..d0cc85811 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -122,6 +122,7 @@ typedef struct _GrabRec { typedef struct _KeyClassRec { CARD8 down[DOWN_LENGTH]; + CARD8 postdown[DOWN_LENGTH]; KeyCode *modifierKeyMap; KeySymsRec curKeySyms; int modifierKeyCount[8]; From 71c21dea748ea0dcad758679c40ee39192d170f9 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 18:45:50 -0700 Subject: [PATCH 42/81] added HAVE_LAUNCHD check to configure.ac (mostly for OSX) --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 9c3ee9946..44dbda4eb 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,8 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) +AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], []) + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) From bf1641b94cffa54b786e18eaeff3839d8790b9f2 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 20:33:43 -0700 Subject: [PATCH 43/81] XDARWIN: Add launchd support This adds a bit of glue to configure.ac to support launchd detection; on OS X (or other platforms which choose to implement launchd), this allows the system to automagically start the Xserver as necessary to serve clients. --- configure.ac | 4 ++++ os/connection.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 44dbda4eb..0d35d81f4 100644 --- a/configure.ac +++ b/configure.ac @@ -1075,6 +1075,10 @@ XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" AC_SUBST([XSERVER_LIBS]) AC_SUBST([XSERVER_SYS_LIBS]) +if test "x$HAVE_LAUNCHD" = xyes; then + XSERVER_CFLAGS="$XSERVER_CFLAGS -DHAVE_LAUNCHD" +fi + # The Xorg binary needs to export symbols so that they can be used from modules # Some platforms require extra flags to do this. gcc should set these flags # when -rdynamic is passed to it, other compilers/linkers may need to be added diff --git a/os/connection.c b/os/connection.c index d975f87d2..d1bc4d04e 100644 --- a/os/connection.c +++ b/os/connection.c @@ -74,6 +74,9 @@ SOFTWARE. #define TRANS_SERVER #define TRANS_REOPEN #include +#ifdef HAVE_LAUNCHD +#include +#endif #include #include #include @@ -660,10 +663,21 @@ ClientAuthorized(ClientPtr client, XID auth_id; char *reason = NULL; XtransConnInfo trans_conn; +#ifdef HAVE_LAUNCHD + struct sockaddr *saddr; +#endif priv = (OsCommPtr)client->osPrivate; trans_conn = priv->trans_conn; +#ifdef HAVE_LAUNCHD + saddr = (struct sockaddr *) (trans_conn->addr); + /* Allow any client to connect without authorization on a launchd socket, + because it is securely created -- this prevents a race condition on launch */ + if (saddr->sa_len > 11 && saddr->sa_family == AF_UNIX && + !strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done; +#endif + auth_id = CheckAuthorization (proto_n, auth_proto, string_n, auth_string, client, &reason); @@ -719,6 +733,7 @@ ClientAuthorized(ClientPtr client, } } priv->auth_id = auth_id; + done: priv->conn_time = 0; #ifdef XDMCP From f3f614cd01ae56d84d61b4f5c907c6edd7c8c6d3 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Wed, 5 Sep 2007 20:34:00 -0700 Subject: [PATCH 44/81] Revert "configure.ac: exclude pci-access dependency from XDarwin" This reverts commit 20c6677d1b5f8d77325dd878ffa3df1d0fb01864. --- configure.ac | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 0d35d81f4..74a0aea0f 100644 --- a/configure.ac +++ b/configure.ac @@ -1304,6 +1304,8 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. + PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" case $host_os in @@ -1501,12 +1503,6 @@ return 0;} ;; esac - if ! test "$XORG_OS" = "Darwin" ; then - PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS" - XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" - fi - if test "x$XORG_OS_PCI" = x ; then XORG_OS_PCI=$XORG_OS fi From 35ec8b89f4cdf5ec48b292d47b2dad42d2fb9534 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Thu, 6 Sep 2007 05:34:14 -0700 Subject: [PATCH 45/81] DDX changes for XDarwin Creating a real DDX section for XDarwin instead of stuffing it into the XORG section in a half-assed manner. --- GL/Makefile.am | 6 +- configure.ac | 137 ++++++++++++++++++----------------- hw/Makefile.am | 12 +-- hw/darwin/Makefile.am | 2 +- hw/darwin/quartz/Makefile.am | 2 +- 5 files changed, 79 insertions(+), 80 deletions(-) diff --git a/GL/Makefile.am b/GL/Makefile.am index df9f533e2..38cef7b39 100644 --- a/GL/Makefile.am +++ b/GL/Makefile.am @@ -1,8 +1,4 @@ -# someone could get really crazy someday and add support for the SI... - -# xwin/darwin/xfree86 have their accel support under the DDX - -if BUILD_DARWIN +if XDARWIN DARWIN_SUBDIRS = apple endif SUBDIRS = glx mesa $(DARWIN_SUBDIRS) diff --git a/configure.ac b/configure.ac index 74a0aea0f..1621a03c1 100644 --- a/configure.ac +++ b/configure.ac @@ -525,6 +525,7 @@ AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) +AC_ARG_ENABLE(xdarwin, AS_HELP_STRING([--enable-xdarwin], [Build XDarwin server (default: auto)]), [XDARWIN=$enableval], [XDARWIN=auto]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no]) AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no]) @@ -1309,64 +1310,6 @@ dnl has it in libc), or if libdl is needed to get it. XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" case $host_os in - darwin*) - XORG_OS="Darwin" - build_darwin=yes - if test "X$XQUARTZ" = Xauto; then - AC_CACHE_CHECK([for Carbon framework],xorg_cv_Carbon_framework,[ - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -framework Carbon" - AC_LINK_IFELSE([char FSFindFolder(); -int main() { -FSFindFolder(); -return 0;} - ],[xorg_cv_Carbon_framework=yes], - [xorg_cv_Carbon_framework=no]) - LDFLAGS=$save_LDFLAGS]) - if test "X$xorg_cv_Carbon_framework" = Xyes; then - AC_DEFINE([DARWIN_WITH_QUARTZ],[1], - [Have Quartz]) - XQUARTZ=yes - else - XQUARTZ=no - fi - fi -# glxAGL / glxCGL don't work yet -# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[ -# save_LDFLAGS=$LDFLAGS -# LDFLAGS="$LDFLAGS -framework AGL" -# AC_LINK_IFELSE([char aglEnable(); -#int main() { -#aglEnable(); -#return 0;} -# ],[xorg_cv_AGL_framework=yes], -# [xorg_cv_AGL_framework=no]) -# LDFLAGS=$save_LDFLAGS -# ]) - xorg_cv_AGL_framework=no - DARWIN_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" - AC_SUBST([DARWIN_LIBS]) - AC_CHECK_LIB([Xplugin],[xp_init],[:]) - AC_SUBST([APPLE_APPLICATIONS_DIR]) - CFLAGS="${CFLAGS} -D__DARWIN__" - PLIST_VERSION_STRING=$PACKAGE_VERSION - AC_SUBST([PLIST_VERSION_STRING]) - PLIST_VENDOR_WEB=$VENDOR_WEB - AC_SUBST([PLIST_VENDOR_WEB]) - # Not sure that we should be disabling all these... - if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then - AC_MSG_NOTICE([Disabling XF86Misc extension]) - XF86MISC=no - fi - if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then - AC_MSG_NOTICE([Disabling XF86VidMode extension]) - XF86VIDMODE=no - fi - if test "x$DGA" = xyes || test "x$DGA" = xauto; then - AC_MSG_NOTICE([Disabling DGA extension]) - DGA=no - fi - ;; linux*) if test "x$LNXAPM" = xyes; then XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" @@ -1600,8 +1543,6 @@ AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes]) AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) -AM_CONDITIONAL([BUILD_DARWIN],[test "X$build_darwin" = Xyes]) -AM_CONDITIONAL([XQUARTZ],[test "X$XQUARTZ" = Xyes]) AM_CONDITIONAL(DGA, [test "x$DGA" = xyes]) dnl legacy fb support @@ -1743,10 +1684,73 @@ AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) dnl Darwin / OS X DDX -AM_CONDITIONAL(HAVE_X_PLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes]) -AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes]) -# Support for objc in autotools is minimal and not -# documented. +AC_MSG_CHECKING([whether to build XDarwin (Mac OS X) DDX]) +if test "x$XDARWIN" = xauto; then + case $host_os in + darwin*) XDARWIN="yes" ;; + *) XWIN="no" ;; + esac + XWIN_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $SHADOW_LIB" + AC_SUBST([XWIN_LIBS]) +fi +AC_MSG_RESULT([$XDARWIN]) + +if test "x$XDARWIN" = xyes; then + if test "X$XQUARTZ" = Xauto; then + AC_CACHE_CHECK([for Carbon framework],xorg_cv_Carbon_framework,[ + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -framework Carbon" + AC_LINK_IFELSE([char FSFindFolder(); +int main() { +FSFindFolder(); +return 0;} + ],[xorg_cv_Carbon_framework=yes], + [xorg_cv_Carbon_framework=no]) + LDFLAGS=$save_LDFLAGS]) + if test "X$xorg_cv_Carbon_framework" = Xyes; then + AC_DEFINE([DARWIN_WITH_QUARTZ],[1], + [Have Quartz]) + XQUARTZ=yes + else + XQUARTZ=no + fi + fi +# glxAGL / glxCGL don't work yet +# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[ +# save_LDFLAGS=$LDFLAGS +# LDFLAGS="$LDFLAGS -framework AGL" +# AC_LINK_IFELSE([char aglEnable(); +#int main() { +#aglEnable(); +#return 0;} +# ],[xorg_cv_AGL_framework=yes], +# [xorg_cv_AGL_framework=no]) +# LDFLAGS=$save_LDFLAGS +# ]) + xorg_cv_AGL_framework=no + DARWIN_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" + AC_SUBST([DARWIN_LIBS]) + AC_CHECK_LIB([Xplugin],[xp_init],[:]) + AC_SUBST([APPLE_APPLICATIONS_DIR]) + CFLAGS="${CFLAGS} -D__DARWIN__" + PLIST_VERSION_STRING=$PACKAGE_VERSION + AC_SUBST([PLIST_VERSION_STRING]) + PLIST_VENDOR_WEB=$VENDOR_WEB + AC_SUBST([PLIST_VENDOR_WEB]) + if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then + AC_MSG_NOTICE([Disabling XF86Misc extension]) + XF86MISC=no + fi + if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then + AC_MSG_NOTICE([Disabling XF86VidMode extension]) + XF86VIDMODE=no + fi + if test "x$DGA" = xyes || test "x$DGA" = xauto; then + AC_MSG_NOTICE([Disabling DGA extension]) + DGA=no + fi +fi +# Support for objc in autotools is minimal and not documented. OBJC='$(CC)' OBJCLD='$(CCLD)' OBJCLINK='$(LINK)' @@ -1757,7 +1761,10 @@ AC_SUBST([OBJCLINK]) AC_SUBST([OBJCFLAGS]) # internal, undocumented automake func follows :( _AM_DEPENDENCIES([OBJC]) - +AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes]) +AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes]) +AM_CONDITIONAL(XDARWIN, [test "x$XDARWIN" = xyes]) +AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) dnl kdrive DDX XEPHYR_LIBS= diff --git a/hw/Makefile.am b/hw/Makefile.am index 99df8e230..30662ccdd 100644 --- a/hw/Makefile.am +++ b/hw/Makefile.am @@ -1,5 +1,5 @@ if DMX -if BUILD_DARWIN +if XDARWIN # Darwin does not need the dmx subdir else DMX_SUBDIRS = dmx @@ -7,12 +7,8 @@ endif endif if XORG -if BUILD_DARWIN -# Darwin does not need the xfree86 subdir -else XORG_SUBDIRS = xfree86 endif -endif if XVFB XVFB_SUBDIRS = vfb @@ -38,15 +34,15 @@ if XPRINT XPRINT_SUBDIRS = xprint endif -if BUILD_DARWIN -DARWIN_SUBDIRS = darwin +if XDARWIN +XDARWIN_SUBDIRS = darwin endif SUBDIRS = \ $(XORG_SUBDIRS) \ $(XGL_SUBDIRS) \ $(XWIN_SUBDIRS) \ - $(DARWIN_SUBDIRS) \ + $(XDARWIN_SUBDIRS) \ $(XVFB_SUBDIRS) \ $(XNEST_SUBDIRS) \ $(DMX_SUBDIRS) \ diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 4cec3b1b4..a6f84ee01 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -191,7 +191,7 @@ glxMesa_la_DEPENDENCIES = XDarwinApp endif endif -if HAVE_X_PLUGIN +if HAVE_XPLUGIN xprplugindir = $(darwinappdir)/Contents/Resources/xpr.bundle/Contents/MacOS xprplugin_LTLIBRARIES = xpr.la diff --git a/hw/darwin/quartz/Makefile.am b/hw/darwin/quartz/Makefile.am index 993cdb0ec..f8dc16765 100644 --- a/hw/darwin/quartz/Makefile.am +++ b/hw/darwin/quartz/Makefile.am @@ -5,7 +5,7 @@ AM_OBJCFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ INCLUDES = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ AM_DEFS = -DHAS_CG_MACH_PORT -DHAS_KL_API -if HAVE_X_PLUGIN +if HAVE_XPLUGIN AM_DEFS += -DBUILD_XPR endif DEFS = @DEFS@ $(AM_DEFS) -DXBINDIR=\"${bindir}\" From 84eb7e62248ddc2761af8cefe33d1b7147477528 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 6 Sep 2007 13:36:37 +0100 Subject: [PATCH 46/81] Fix Xdmx build --- configure.ac | 2 +- hw/dmx/dmxinput.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1621a03c1..f02ad6dfa 100644 --- a/configure.ac +++ b/configure.ac @@ -1153,7 +1153,7 @@ if test "x$DMX" = xyes; then fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $CWRAP_LIB" + XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c index d644b5d0d..83f8a4a90 100644 --- a/hw/dmx/dmxinput.c +++ b/hw/dmx/dmxinput.c @@ -105,3 +105,14 @@ void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow) if (!dmxInput->detached && dmxInput->updateWindowInfo) dmxInput->updateWindowInfo(dmxInput, type, pWindow); } + +int +NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) +{ + return BadRequest; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr pDev) +{ +} From e510a77ba4d65d5d6ead514cd698f1b1e3f8a2b6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 17 Jul 2007 17:16:51 +1000 Subject: [PATCH 47/81] EXA: Add a couple of missing exaPrepare/FinishAccess calls. --- exa/exa.c | 57 +++++++++++++++++++++++++++++++++++++++++++---- exa/exa_priv.h | 9 ++++++++ exa/exa_unaccel.c | 7 ++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 99707fa5c..46fb55718 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -452,11 +452,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) if (!pGC->tileIsPixel && FbEvenTile (pGC->tile.pixmap->drawable.width * pDrawable->bitsPerPixel)) { - /* XXX This fixes corruption with tiled pixmaps, but may just be a - * workaround for broken drivers - */ - exaMoveOutPixmap(pGC->tile.pixmap); + exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); fbPadPixmap (pGC->tile.pixmap); + exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); exaPixmapDirty(pGC->tile.pixmap, 0, 0, pGC->tile.pixmap->drawable.width, pGC->tile.pixmap->drawable.height); @@ -467,7 +465,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) changes &= ~GCTile; } + exaPrepareAccessGC(pGC); fbValidateGC (pGC, changes, pDrawable); + exaFinishAccessGC(pGC); pGC->ops = (GCOps *) &exaOps; } @@ -497,6 +497,47 @@ exaCreateGC (GCPtr pGC) return TRUE; } +void +exaPrepareAccessWindow(WindowPtr pWin) +{ + if (pWin->backgroundState == BackgroundPixmap) + exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + + if (pWin->borderIsPixel == FALSE) + exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); +} + +void +exaFinishAccessWindow(WindowPtr pWin) +{ + if (pWin->backgroundState == BackgroundPixmap) + exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + + if (pWin->borderIsPixel == FALSE) + exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); +} + +static Bool +exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) +{ + Bool ret; + + exaPrepareAccessWindow(pWin); + ret = fbChangeWindowAttributes(pWin, mask); + exaFinishAccessWindow(pWin); + return ret; +} + +static RegionPtr +exaBitmapToRegion(PixmapPtr pPix) +{ + RegionPtr ret; + exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC); + ret = fbPixmapToRegion(pPix); + exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC); + return ret; +} + /** * exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's * screen private, before calling down to the next CloseSccreen. @@ -518,6 +559,8 @@ exaCloseScreen(int i, ScreenPtr pScreen) pScreen->CreatePixmap = pExaScr->SavedCreatePixmap; pScreen->DestroyPixmap = pExaScr->SavedDestroyPixmap; pScreen->CopyWindow = pExaScr->SavedCopyWindow; + pScreen->ChangeWindowAttributes = pExaScr->SavedChangeWindowAttributes; + pScreen->BitmapToRegion = pExaScr->SavedBitmapToRegion; #ifdef RENDER if (ps) { ps->Composite = pExaScr->SavedComposite; @@ -660,6 +703,12 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->SavedCopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = exaCopyWindow; + pExaScr->SavedChangeWindowAttributes = pScreen->ChangeWindowAttributes; + pScreen->ChangeWindowAttributes = exaChangeWindowAttributes; + + pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion; + pScreen->BitmapToRegion = exaBitmapToRegion; + pExaScr->SavedPaintWindowBackground = pScreen->PaintWindowBackground; pScreen->PaintWindowBackground = exaPaintWindow; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index a456da05e..a08acfa69 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -106,6 +106,8 @@ typedef struct { DestroyPixmapProcPtr SavedDestroyPixmap; PaintWindowBorderProcPtr SavedPaintWindowBorder; CopyWindowProcPtr SavedCopyWindow; + ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; + BitmapToRegionProcPtr SavedBitmapToRegion; #ifdef RENDER CompositeProcPtr SavedComposite; RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid; @@ -113,6 +115,7 @@ typedef struct { GlyphsProcPtr SavedGlyphs; TrapezoidsProcPtr SavedTrapezoids; #endif + Bool swappedOut; enum ExaMigrationHeuristic migration; Bool hideOffscreenPixmapData; @@ -190,6 +193,12 @@ typedef struct _ExaMigrationRec { */ void exaDDXDriverInit (ScreenPtr pScreen); +void +exaPrepareAccessWindow(WindowPtr pWin); + +void +exaFinishAccessWindow(WindowPtr pWin); + /* exa_unaccel.c */ void exaPrepareAccessGC(GCPtr pGC); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index d793ec2b9..8db28667f 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -35,10 +35,13 @@ * * Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are * 1bpp and never in fb, so we don't worry about them. + * We should worry about them for completeness sake and going forward. */ void exaPrepareAccessGC(GCPtr pGC) { + if (pGC->stipple) + exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC); if (pGC->fillStyle == FillTiled) exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); } @@ -51,6 +54,8 @@ exaFinishAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled) exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); + if (pGC->stipple) + exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC); } #if DEBUG_TRACE_FALL @@ -294,7 +299,9 @@ ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what) EXA_FALLBACK(("from %p (%c)\n", pWin, exaDrawableLocation(&pWin->drawable))); exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST); + exaPrepareAccessWindow(pWin); fbPaintWindow (pWin, pRegion, what); + exaFinishAccessWindow(pWin); exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST); } From 8cfcf9973c765f11d1b45b95b8091ef7e01d7f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 5 Sep 2007 20:10:09 +0200 Subject: [PATCH 48/81] EXA: Migrate out pixmap in exaPrepareAccess. Also fix exaFinishAccessGC not to use the same index for tile and stipple. --- exa/exa.c | 30 +++++++++++++++++++------- exa/exa_accel.c | 52 ++++----------------------------------------- exa/exa_migration.c | 13 ++++-------- exa/exa_priv.h | 7 +++--- exa/exa_render.c | 23 ++++++-------------- exa/exa_unaccel.c | 9 ++------ 6 files changed, 41 insertions(+), 93 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 46fb55718..514b88ba7 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -329,14 +329,8 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp) return NULL; } -/** - * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. - * - * It deals with waiting for synchronization with the card, determining if - * PrepareAccess() is necessary, and working around PrepareAccess() failure. - */ void -exaPrepareAccess(DrawablePtr pDrawable, int index) +ExaDoPrepareAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv (pScreen); @@ -367,6 +361,26 @@ exaPrepareAccess(DrawablePtr pDrawable, int index) } } +/** + * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. + * + * It deals with waiting for synchronization with the card, determining if + * PrepareAccess() is necessary, and working around PrepareAccess() failure. + */ +void +exaPrepareAccess(DrawablePtr pDrawable, int index) +{ + ExaMigrationRec pixmaps[1]; + + pixmaps[0].as_dst = index == EXA_PREPARE_DEST; + pixmaps[0].as_src = index != EXA_PREPARE_DEST; + pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + + exaDoMigration(pixmaps, 1, FALSE); + + ExaDoPrepareAccess(pDrawable, index); +} + /** * exaFinishAccess() is EXA's wrapper for the driver's FinishAccess() handler. * @@ -698,7 +712,7 @@ exaDriverInit (ScreenPtr pScreen, pScreen->GetImage = exaGetImage; pExaScr->SavedGetSpans = pScreen->GetSpans; - pScreen->GetSpans = exaGetSpans; + pScreen->GetSpans = ExaCheckGetSpans; pExaScr->SavedCopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = exaCopyWindow; diff --git a/exa/exa_accel.c b/exa/exa_accel.c index feedd49a2..07ada153f 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -61,7 +61,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY) { - exaDoMigration (pixmaps, 1, FALSE); ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); return; } else { @@ -74,7 +73,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, pGC->planemask, pGC->fgPixel)) { - exaDoMigration (pixmaps, 1, FALSE); ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); return; } @@ -158,11 +156,11 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) - goto migrate_and_fallback; + goto fallback; /* Only accelerate copies: no rop or planemask. */ if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) - goto migrate_and_fallback; + goto fallback; if (pExaScr->swappedOut) goto fallback; @@ -240,9 +238,6 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, return TRUE; -migrate_and_fallback: - exaDoMigration (pixmaps, 1, FALSE); - fallback: return FALSE; } @@ -468,7 +463,6 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, exaDrawableLocation(pSrcDrawable), exaDrawableLocation(pDstDrawable))); - exaDoMigration (pixmaps, 2, FALSE); exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, @@ -731,15 +725,6 @@ exaPolyFillRect(DrawablePtr pDrawable, pGC->fgPixel)) { fallback: - if (pGC->fillStyle == FillTiled && !pGC->tileIsPixel) { - pixmaps[1].as_dst = FALSE; - pixmaps[1].as_src = TRUE; - pixmaps[1].pPix = pGC->tile.pixmap; - exaDoMigration (pixmaps, 2, FALSE); - } else { - exaDoMigration (pixmaps, 1, FALSE); - } - ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect); goto out; } @@ -860,7 +845,6 @@ exaSolidBoxClipped (DrawablePtr pDrawable, { EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 1, FALSE); fallback = TRUE; exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); @@ -969,7 +953,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, depthMask = FbFullMask(pDrawable->depth); if ((pGC->planemask & depthMask) != depthMask) { - exaDoMigration(pixmaps, 1, FALSE); ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); goto damage; } @@ -1004,7 +987,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaDoMigration(pixmaps, 1, FALSE); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccessGC (pGC); @@ -1146,7 +1128,6 @@ fallback: return FALSE; EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 1, FALSE); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); fbFillRegionSolid (pDrawable, pRegion, 0, fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); @@ -1262,7 +1243,6 @@ fallback: EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, exaDrawableLocation(&pTile->drawable), exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 2, FALSE); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); fbFillRegionTiled (pDrawable, pRegion, pTile); @@ -1349,7 +1329,6 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { ExaScreenPriv (pDrawable->pScreen); - ExaMigrationRec pixmaps[1]; PixmapPtr pPix; int xoff, yoff; Bool ok; @@ -1362,13 +1341,13 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, /* Only cover the ZPixmap, solid copy case. */ if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask)) - goto migrate_and_fallback; + goto fallback; /* Only try to handle the 8bpp and up cases, since we don't want to think * about <8bpp. */ if (pDrawable->bitsPerPixel < 8) - goto migrate_and_fallback; + goto fallback; pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); if (pPix == NULL) @@ -1384,29 +1363,6 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, return; } -migrate_and_fallback: - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); fallback: ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d); } - -/** - * GetSpans isn't accelerated yet, but performs migration so that we'll - * hopefully avoid the read-from-framebuffer cost. - */ -void -exaGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, - int nspans, char *pdstStart) -{ - ExaMigrationRec pixmaps[1]; - - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); - - ExaCheckGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); -} diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 5f07a8db4..661ff40e3 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -152,7 +152,7 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, pExaPixmap->sys_pitch)) { - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); exaMemcpyBox (pPixmap, pBox, pExaPixmap->fb_ptr, pExaPixmap->fb_pitch, pExaPixmap->sys_ptr, pExaPixmap->sys_pitch); @@ -220,7 +220,7 @@ exaCopyDirtyToFb (PixmapPtr pPixmap) + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, pExaPixmap->sys_pitch)) { - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST); + ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST); exaMemcpyBox (pPixmap, pBox, pExaPixmap->sys_ptr, pExaPixmap->sys_pitch, pExaPixmap->fb_ptr, pExaPixmap->fb_pitch); @@ -471,7 +471,7 @@ exaAssertNotDirty (PixmapPtr pPixmap) src_pitch = pExaPixmap->fb_pitch; cpp = pPixmap->drawable.bitsPerPixel / 8; - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); while (nbox--) { int rowbytes; @@ -622,14 +622,9 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) exaMoveInPixmap(pixmaps[i].pPix); } - /* If we couldn't fit everything in, then kick back out */ + /* If we couldn't fit everything in, abort */ for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsOffscreen(pixmaps[i].pPix)) { - EXA_FALLBACK(("Pixmap %p (%dx%d) not in fb\n", pixmaps[i].pPix, - pixmaps[i].pPix->drawable.width, - pixmaps[i].pPix->drawable.height)); - for (j = 0; j < npixmaps; j++) - exaMoveOutPixmap(pixmaps[j].pPix); return; } } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index a08acfa69..409bc4d7d 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -298,10 +298,6 @@ void exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); -void -exaGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, - int nspans, char *pdstStart); - extern const GCOps exaOps; #ifdef MITSHM @@ -338,6 +334,9 @@ void ExaOffscreenFini (ScreenPtr pScreen); /* exa.c */ +void +ExaDoPrepareAccess(DrawablePtr pDrawable, int index); + void exaPrepareAccess(DrawablePtr pDrawable, int index); diff --git a/exa/exa_render.c b/exa/exa_render.c index 2dd3fc1ce..738ac15b1 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -738,7 +738,6 @@ fallback: exaPrintCompositeFallback (op, pSrc, pMask, pDst); #endif - exaDoMigration(pixmaps, npixmaps, FALSE); ExaCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); @@ -889,18 +888,13 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, int x_off, int y_off) { DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; + PixmapPtr pPixmap = exaGetDrawablePixmap(pDraw); int xoff, yoff; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDraw); - exaDoMigration(pixmaps, 1, FALSE); - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); fbRasterizeTrapezoid(pPicture, trap, x_off, y_off); - exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); - exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, + exaGetDrawableDeltas(pDraw, pPixmap, &xoff, &yoff); + exaPixmapDirty(pPixmap, pDraw->x + xoff, pDraw->y + yoff, pDraw->x + xoff + pDraw->width, pDraw->y + yoff + pDraw->height); exaFinishAccess(pDraw, EXA_PREPARE_DEST); @@ -915,18 +909,13 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, xTriangle *tris) { DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; + PixmapPtr pPixmap = exaGetDrawablePixmap(pDraw); int xoff, yoff; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDraw); - exaDoMigration(pixmaps, 1, FALSE); - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); fbAddTriangles(pPicture, x_off, y_off, ntri, tris); - exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); - exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, + exaGetDrawableDeltas(pDraw, pPixmap, &xoff, &yoff); + exaPixmapDirty(pPixmap, pDraw->x + xoff, pDraw->y + yoff, pDraw->x + xoff + pDraw->width, pDraw->y + yoff + pDraw->height); exaFinishAccess(pDraw, EXA_PREPARE_DEST); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 8db28667f..8dadd066d 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -41,7 +41,7 @@ void exaPrepareAccessGC(GCPtr pGC) { if (pGC->stipple) - exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC); + exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); if (pGC->fillStyle == FillTiled) exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); } @@ -53,7 +53,7 @@ void exaFinishAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled) - exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); + exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_MASK); if (pGC->stipple) exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC); } @@ -358,7 +358,6 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) void *fb; Bool need_finish = FALSE; BoxRec box; - ExaMigrationRec pixmaps[1]; ExaPixmapPriv (pPixmap); fb = pExaPixmap->sys_ptr; @@ -368,10 +367,6 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) { need_finish = TRUE; - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = pPixmap; - exaDoMigration (pixmaps, 1, FALSE); exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); fb = pPixmap->devPrivate.ptr; } From 5c7ee3f47fa0c067102a17dee3f75a51cc0bdb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 24 Aug 2007 19:24:18 +0200 Subject: [PATCH 49/81] EXA: Track valid bits in Sys and FB separately. Also consolidate exaCopyDirtyToFb/Sys. --- exa/exa.c | 6 +- exa/exa_migration.c | 154 +++++++++++++++++++------------------------- exa/exa_priv.h | 6 +- 3 files changed, 74 insertions(+), 92 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 514b88ba7..ecdb76139 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -186,7 +186,8 @@ exaDestroyPixmap (PixmapPtr pPixmap) pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; } - REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validReg); + REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validSys); + REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validFB); } return fbDestroyPixmap (pPixmap); } @@ -267,7 +268,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); /* None of the pixmap bits are valid initially */ - REGION_NULL(pScreen, &pExaPixmap->validReg); + REGION_NULL(pScreen, &pExaPixmap->validSys); + REGION_NULL(pScreen, &pExaPixmap->validFB); return pPixmap; } diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 661ff40e3..99058f138 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -90,7 +90,8 @@ exaPixmapIsDirty (PixmapPtr pPix) ExaPixmapPriv (pPix); return pExaPixmap == NULL || - REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)); + REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) || + !REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB); } /** @@ -113,21 +114,34 @@ exaPixmapShouldBeInFB (PixmapPtr pPix) /** * If the pixmap is currently dirty, this copies at least the dirty area from - * the framebuffer memory copy to the system memory copy. Both areas must be - * allocated. + * FB to system or vice versa. Both areas must be allocated. */ -static void -exaCopyDirtyToSys (PixmapPtr pPixmap) +static _X_INLINE void +exaCopyDirty(PixmapPtr pPixmap, RegionPtr pValidDst, RegionPtr pValidSrc, + Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h, + char *sys, int sys_pitch), CARD8 *fallback_src, + CARD8 *fallback_dst, int fallback_srcpitch, int fallback_dstpitch, + int fallback_index, void (*sync) (ScreenPtr pScreen)) { - ExaScreenPriv (pPixmap->drawable.pScreen); ExaPixmapPriv (pPixmap); - RegionPtr pRegion = DamageRegion (pExaPixmap->pDamage); + RegionPtr pDamageReg = DamageRegion (pExaPixmap->pDamage); + RegionRec CopyReg; CARD8 *save_ptr; int save_pitch; - BoxPtr pBox = REGION_RECTS(pRegion); - int nbox = REGION_NUM_RECTS(pRegion); + BoxPtr pBox; + int nbox; Bool do_sync = FALSE; + /* Damaged bits are valid in source but invalid in destination */ + REGION_UNION(pScreen, pValidSrc, pValidSrc, pDamageReg); + REGION_SUBTRACT(pScreen, pValidDst, pValidDst, pDamageReg); + + /* Copy bits valid in ssource but not in destination */ + REGION_NULL(pScreen, &CopyReg); + REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst); + pBox = REGION_RECTS(&CopyReg); + nbox = REGION_NUM_RECTS(&CopyReg); + save_ptr = pPixmap->devPrivate.ptr; save_pitch = pPixmap->devKind; pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; @@ -142,21 +156,20 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) continue; - if (pExaScr->info->DownloadFromScreen == NULL || - !pExaScr->info->DownloadFromScreen (pPixmap, - pBox->x1, pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - pExaPixmap->sys_ptr - + pBox->y1 * pExaPixmap->sys_pitch - + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, - pExaPixmap->sys_pitch)) + if (!transfer || !transfer (pPixmap, + pBox->x1, pBox->y1, + pBox->x2 - pBox->x1, + pBox->y2 - pBox->y1, + pExaPixmap->sys_ptr + + pBox->y1 * pExaPixmap->sys_pitch + + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, + pExaPixmap->sys_pitch)) { - ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + ExaDoPrepareAccess(&pPixmap->drawable, fallback_index); exaMemcpyBox (pPixmap, pBox, - pExaPixmap->fb_ptr, pExaPixmap->fb_pitch, - pExaPixmap->sys_ptr, pExaPixmap->sys_pitch); - exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + fallback_src, fallback_srcpitch, + fallback_dst, fallback_dstpitch); + exaFinishAccess(&pPixmap->drawable, fallback_index); } else do_sync = TRUE; @@ -164,19 +177,34 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) pBox++; } - /* Make sure the bits have actually landed, since we don't necessarily sync - * when accessing pixmaps in system memory. - */ if (do_sync) - exaWaitSync (pPixmap->drawable.pScreen); + sync (pPixmap->drawable.pScreen); pPixmap->devPrivate.ptr = save_ptr; pPixmap->devKind = save_pitch; - /* The previously damaged bits are now no longer damaged but valid */ - REGION_UNION(pPixmap->drawable.pScreen, - &pExaPixmap->validReg, &pExaPixmap->validReg, pRegion); - DamageEmpty (pExaPixmap->pDamage); + /* The copied bits are now no longer damaged but valid in destination */ + REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg); + REGION_SUBTRACT(pScreen, pDamageReg, pDamageReg, &CopyReg); + + REGION_NULL(pScreen, &CopyReg); +} + +/** + * If the pixmap is currently dirty, this copies at least the dirty area from + * the framebuffer memory copy to the system memory copy. Both areas must be + * allocated. + */ +static void +exaCopyDirtyToSys (PixmapPtr pPixmap) +{ + ExaScreenPriv (pPixmap->drawable.pScreen); + ExaPixmapPriv (pPixmap); + + exaCopyDirty(pPixmap, &pExaPixmap->validSys, &pExaPixmap->validFB, + pExaScr->info->DownloadFromScreen, pExaPixmap->fb_ptr, + pExaPixmap->sys_ptr, pExaPixmap->fb_pitch, + pExaPixmap->sys_pitch, EXA_PREPARE_SRC, exaWaitSync); } /** @@ -189,59 +217,11 @@ exaCopyDirtyToFb (PixmapPtr pPixmap) { ExaScreenPriv (pPixmap->drawable.pScreen); ExaPixmapPriv (pPixmap); - RegionPtr pRegion = DamageRegion (pExaPixmap->pDamage); - CARD8 *save_ptr; - int save_pitch; - BoxPtr pBox = REGION_RECTS(pRegion); - int nbox = REGION_NUM_RECTS(pRegion); - Bool do_sync = FALSE; - save_ptr = pPixmap->devPrivate.ptr; - save_pitch = pPixmap->devKind; - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; - pPixmap->devKind = pExaPixmap->fb_pitch; - - while (nbox--) { - pBox->x1 = max(pBox->x1, 0); - pBox->y1 = max(pBox->y1, 0); - pBox->x2 = min(pBox->x2, pPixmap->drawable.width); - pBox->y2 = min(pBox->y2, pPixmap->drawable.height); - - if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) - continue; - - if (pExaScr->info->UploadToScreen == NULL || - !pExaScr->info->UploadToScreen (pPixmap, - pBox->x1, pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - pExaPixmap->sys_ptr - + pBox->y1 * pExaPixmap->sys_pitch - + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, - pExaPixmap->sys_pitch)) - { - ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST); - exaMemcpyBox (pPixmap, pBox, - pExaPixmap->sys_ptr, pExaPixmap->sys_pitch, - pExaPixmap->fb_ptr, pExaPixmap->fb_pitch); - exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_DEST); - } - else - do_sync = TRUE; - - pBox++; - } - - if (do_sync) - exaMarkSync (pPixmap->drawable.pScreen); - - pPixmap->devPrivate.ptr = save_ptr; - pPixmap->devKind = save_pitch; - - /* The previously damaged bits are now no longer damaged but valid */ - REGION_UNION(pPixmap->drawable.pScreen, - &pExaPixmap->validReg, &pExaPixmap->validReg, pRegion); - DamageEmpty (pExaPixmap->pDamage); + exaCopyDirty(pPixmap, &pExaPixmap->validFB, &pExaPixmap->validSys, + pExaScr->info->UploadToScreen, pExaPixmap->sys_ptr, + pExaPixmap->fb_ptr, pExaPixmap->sys_pitch, + pExaPixmap->fb_pitch, EXA_PREPARE_DEST, exaMarkSync); } /** @@ -254,7 +234,6 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) { PixmapPtr pPixmap = area->privData; ExaPixmapPriv(pPixmap); - RegionPtr pDamageReg = DamageRegion(pExaPixmap->pDamage); DBG_MIGRATE (("Save %p (%p) (%dx%d) (%c)\n", pPixmap, (void*)(ExaGetPixmapPriv(pPixmap)->area ? @@ -273,9 +252,9 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) pExaPixmap->fb_ptr = NULL; pExaPixmap->area = NULL; - /* Mark all valid bits as damaged, so they'll get copied to FB next time */ - REGION_UNION(pPixmap->drawable.pScreen, pDamageReg, pDamageReg, - &pExaPixmap->validReg); + /* Mark all FB bits as invalid, so all valid system bits get copied to FB + * next time */ + REGION_NULL(pPixmap->drawable.pScreen, &pExaPixmap->validFB); } /** @@ -459,7 +438,8 @@ exaAssertNotDirty (PixmapPtr pPixmap) { ExaPixmapPriv (pPixmap); CARD8 *dst, *src; - RegionPtr pValidReg = &pExaPixmap->validReg; + RegionPtr pValidReg = exaPixmapIsOffscreen(pPixmap) ? &pExaPixmap->validFB : + &pExaPixmap->validSys; int dst_pitch, src_pitch, cpp, y, nbox = REGION_NUM_RECTS(pValidReg); BoxPtr pBox = REGION_RECTS(pValidReg); Bool ret = TRUE; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 409bc4d7d..b9e501625 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -175,10 +175,10 @@ typedef struct { */ DamagePtr pDamage; /** - * The valid region marks the valid bits of a drawable (at least, as it's - * derived from damage, which may be overreported). + * The valid regions mark the valid bits (at least, as they're derived from + * damage, which may be overreported) of a pixmap's system and FB copies. */ - RegionRec validReg; + RegionRec validSys, validFB; } ExaPixmapPrivRec, *ExaPixmapPrivPtr; typedef struct _ExaMigrationRec { From f27931bdd26fc9a1e6bb5173b5537e32c51a98b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 29 Aug 2007 19:41:52 +0200 Subject: [PATCH 50/81] Add DamagePendingRegion. DamagePendingRegion returns a pointer to the region of a drawable that will be damaged by the current operation for damage records that chose to get damage reported only at the end of the operation. --- miext/damage/damage.c | 6 ++++++ miext/damage/damage.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 65314d8a9..472b1b887 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1987,6 +1987,12 @@ DamageRegion (DamagePtr pDamage) return &pDamage->damage; } +_X_EXPORT RegionPtr +DamagePendingRegion (DamagePtr pDamage) +{ + return &pDamage->pendingDamage; +} + _X_EXPORT void DamageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion) diff --git a/miext/damage/damage.h b/miext/damage/damage.h index 4cfc8127d..102da6ebe 100755 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -75,6 +75,9 @@ DamageEmpty (DamagePtr pDamage); RegionPtr DamageRegion (DamagePtr pDamage); +RegionPtr +DamagePendingRegion (DamagePtr pDamage); + void DamageDamageRegion (DrawablePtr pDrawable, const RegionPtr pRegion); From 962eddd7a2863a8475f5fd8107d3112df08d1172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 29 Aug 2007 19:55:22 +0200 Subject: [PATCH 51/81] EXA: Support partial migration of pixmap contents between Sys and FB. The initiator of migration can pass in a region that defines the relevant area of each source pixmap or the irrelevant area of the destination pixmap. By default, the pending damage region is assumed relevant for the destination pixmap, and everything for source pixmaps. Thanks to Jarno Manninen for reassuring me that my own ideas for this were feasible and for providing additional ideas. --- exa/exa.c | 25 +++-- exa/exa_accel.c | 29 ++++-- exa/exa_migration.c | 232 ++++++++++++++++++++++++++++---------------- exa/exa_priv.h | 4 + exa/exa_render.c | 10 +- 5 files changed, 196 insertions(+), 104 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index ecdb76139..145d5b2b0 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -363,6 +363,21 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) } } +void +exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg) +{ + ExaMigrationRec pixmaps[1]; + + pixmaps[0].as_dst = index == EXA_PREPARE_DEST; + pixmaps[0].as_src = index != EXA_PREPARE_DEST; + pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = pReg; + + exaDoMigration(pixmaps, 1, FALSE); + + ExaDoPrepareAccess(pDrawable, index); +} + /** * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. * @@ -372,15 +387,7 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) void exaPrepareAccess(DrawablePtr pDrawable, int index) { - ExaMigrationRec pixmaps[1]; - - pixmaps[0].as_dst = index == EXA_PREPARE_DEST; - pixmaps[0].as_src = index != EXA_PREPARE_DEST; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - - exaDoMigration(pixmaps, 1, FALSE); - - ExaDoPrepareAccess(pDrawable, index); + exaPrepareAccessReg(pDrawable, index, NULL); } /** diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 07ada153f..ceb6c7bb5 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -55,6 +55,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = NULL; if (pExaScr->swappedOut || pGC->fillStyle != FillSolid || @@ -153,6 +154,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = NULL; /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) @@ -211,7 +213,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int dstXoff, dstYoff; if (!access_prepared) { - exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg(pDrawable, EXA_PREPARE_DEST, + pixmaps[0].pReg); access_prepared = TRUE; } @@ -232,6 +235,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, if (access_prepared) exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + else + exaMarkSync(pDrawable->pScreen); exaPixmapDirty(pixmaps[0].pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); } @@ -420,9 +425,11 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pDstPixmap = exaGetDrawablePixmap (pDstDrawable); + pixmaps[0].pReg = NULL; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); + pixmaps[1].pReg = NULL; /* Respect maxX/maxY in a trivial way: don't set up drawing when we might * violate the limits. The proper solution would be a temporary pixmap @@ -463,7 +470,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, exaDrawableLocation(pSrcDrawable), exaDrawableLocation(pDstDrawable))); - exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown, @@ -682,7 +689,8 @@ exaPolyFillRect(DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; - + pixmaps[0].pReg = NULL; + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); if (pExaScr->swappedOut || @@ -828,6 +836,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = NULL; if (pExaScr->swappedOut || pPixmap->drawable.width > pExaScr->info->maxX || @@ -846,7 +855,7 @@ exaSolidBoxClipped (DrawablePtr pDrawable, EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); fallback = TRUE; - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, fbAnd (GXcopy, fg, pm), @@ -949,6 +958,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = TRUE; pixmaps[0].pPix = pPixmap; + pixmaps[0].pReg = NULL; depthMask = FbFullMask(pDrawable->depth); if ((pGC->planemask & depthMask) != depthMask) @@ -987,7 +997,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); exaPrepareAccessGC (pGC); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); @@ -1099,7 +1109,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - + pixmaps[0].pReg = NULL; + if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY) { @@ -1128,7 +1139,7 @@ fallback: return FALSE; EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); fbFillRegionSolid (pDrawable, pRegion, 0, fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); @@ -1170,9 +1181,11 @@ exaFillRegionTiled (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = NULL; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; + pixmaps[1].pReg = NULL; if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY || @@ -1243,7 +1256,7 @@ fallback: EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, exaDrawableLocation(&pTile->drawable), exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); fbFillRegionTiled (pDrawable, pRegion, pTile); exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 99058f138..f48e93a78 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -117,28 +117,62 @@ exaPixmapShouldBeInFB (PixmapPtr pPix) * FB to system or vice versa. Both areas must be allocated. */ static _X_INLINE void -exaCopyDirty(PixmapPtr pPixmap, RegionPtr pValidDst, RegionPtr pValidSrc, +exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h, char *sys, int sys_pitch), CARD8 *fallback_src, CARD8 *fallback_dst, int fallback_srcpitch, int fallback_dstpitch, int fallback_index, void (*sync) (ScreenPtr pScreen)) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); - RegionPtr pDamageReg = DamageRegion (pExaPixmap->pDamage); + RegionPtr damage = DamageRegion (pExaPixmap->pDamage); RegionRec CopyReg; CARD8 *save_ptr; int save_pitch; BoxPtr pBox; int nbox; - Bool do_sync = FALSE; + Bool access_prepared = FALSE; - /* Damaged bits are valid in source but invalid in destination */ - REGION_UNION(pScreen, pValidSrc, pValidSrc, pDamageReg); - REGION_SUBTRACT(pScreen, pValidDst, pValidDst, pDamageReg); + /* Damaged bits are valid in current copy but invalid in other one */ + if (exaPixmapIsOffscreen(pPixmap)) { + REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + damage); + REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + damage); + } else { + REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + damage); + REGION_SUBTRACT(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + damage); + } - /* Copy bits valid in ssource but not in destination */ + REGION_EMPTY(pScreen, damage); + + /* Copy bits valid in source but not in destination */ REGION_NULL(pScreen, &CopyReg); REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst); + + if (migrate->as_dst) { + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + + if (REGION_NIL(pending_damage)) { + static Bool firsttime = TRUE; + + if (firsttime) { + ErrorF("%s: Pending damage region empty!\n", __func__); + firsttime = FALSE; + } + } + + REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage); + + if (migrate->pReg) + REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + } else { + if (migrate->pReg) + REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + } + pBox = REGION_RECTS(&CopyReg); nbox = REGION_NUM_RECTS(&CopyReg); @@ -165,29 +199,30 @@ exaCopyDirty(PixmapPtr pPixmap, RegionPtr pValidDst, RegionPtr pValidSrc, + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, pExaPixmap->sys_pitch)) { - ExaDoPrepareAccess(&pPixmap->drawable, fallback_index); + if (!access_prepared) { + ExaDoPrepareAccess(&pPixmap->drawable, fallback_index); + access_prepared = TRUE; + } exaMemcpyBox (pPixmap, pBox, fallback_src, fallback_srcpitch, fallback_dst, fallback_dstpitch); - exaFinishAccess(&pPixmap->drawable, fallback_index); } - else - do_sync = TRUE; pBox++; } - if (do_sync) + if (access_prepared) + exaFinishAccess(&pPixmap->drawable, fallback_index); + else sync (pPixmap->drawable.pScreen); pPixmap->devPrivate.ptr = save_ptr; pPixmap->devKind = save_pitch; - /* The copied bits are now no longer damaged but valid in destination */ + /* The copied bits are now valid in destination */ REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg); - REGION_SUBTRACT(pScreen, pDamageReg, pDamageReg, &CopyReg); - REGION_NULL(pScreen, &CopyReg); + REGION_UNINIT(pScreen, &CopyReg); } /** @@ -196,12 +231,13 @@ exaCopyDirty(PixmapPtr pPixmap, RegionPtr pValidDst, RegionPtr pValidSrc, * allocated. */ static void -exaCopyDirtyToSys (PixmapPtr pPixmap) +exaCopyDirtyToSys (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaScreenPriv (pPixmap->drawable.pScreen); ExaPixmapPriv (pPixmap); - exaCopyDirty(pPixmap, &pExaPixmap->validSys, &pExaPixmap->validFB, + exaCopyDirty(migrate, &pExaPixmap->validSys, &pExaPixmap->validFB, pExaScr->info->DownloadFromScreen, pExaPixmap->fb_ptr, pExaPixmap->sys_ptr, pExaPixmap->fb_pitch, pExaPixmap->sys_pitch, EXA_PREPARE_SRC, exaWaitSync); @@ -213,50 +249,18 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) * allocated. */ static void -exaCopyDirtyToFb (PixmapPtr pPixmap) +exaCopyDirtyToFb (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaScreenPriv (pPixmap->drawable.pScreen); ExaPixmapPriv (pPixmap); - exaCopyDirty(pPixmap, &pExaPixmap->validFB, &pExaPixmap->validSys, + exaCopyDirty(migrate, &pExaPixmap->validFB, &pExaPixmap->validSys, pExaScr->info->UploadToScreen, pExaPixmap->sys_ptr, pExaPixmap->fb_ptr, pExaPixmap->sys_pitch, pExaPixmap->fb_pitch, EXA_PREPARE_DEST, exaMarkSync); } -/** - * Copies out important pixmap data and removes references to framebuffer area. - * Called when the memory manager decides it's time to kick the pixmap out of - * framebuffer entirely. - */ -void -exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) -{ - PixmapPtr pPixmap = area->privData; - ExaPixmapPriv(pPixmap); - - DBG_MIGRATE (("Save %p (%p) (%dx%d) (%c)\n", pPixmap, - (void*)(ExaGetPixmapPriv(pPixmap)->area ? - ExaGetPixmapPriv(pPixmap)->area->offset : 0), - pPixmap->drawable.width, - pPixmap->drawable.height, - exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - - if (exaPixmapIsOffscreen(pPixmap)) { - exaCopyDirtyToSys (pPixmap); - pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; - pPixmap->devKind = pExaPixmap->sys_pitch; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - pExaPixmap->fb_ptr = NULL; - pExaPixmap->area = NULL; - - /* Mark all FB bits as invalid, so all valid system bits get copied to FB - * next time */ - REGION_NULL(pPixmap->drawable.pScreen, &pExaPixmap->validFB); -} - /** * Allocates a framebuffer copy of the pixmap if necessary, and then copies * any necessary pixmap data into the framebuffer copy and points the pixmap at @@ -272,10 +276,11 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) * we mark the pixmap dirty, so that the next exaMoveInPixmap will actually move * all the data, since it's almost surely all valid now. */ -void -exaMoveInPixmap (PixmapPtr pPixmap) +static void +exaDoMoveInPixmap (ExaMigrationPtr migrate) { - ScreenPtr pScreen = pPixmap->drawable.pScreen; + PixmapPtr pPixmap = migrate->pPix; + ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv (pScreen); ExaPixmapPriv (pPixmap); @@ -283,10 +288,6 @@ exaMoveInPixmap (PixmapPtr pPixmap) if (pExaScr->swappedOut) return; - /* If we're already in FB, our work is done. */ - if (exaPixmapIsOffscreen(pPixmap)) - return; - /* If we're not allowed to move, then fail. */ if (exaPixmapIsPinned(pPixmap)) return; @@ -310,6 +311,11 @@ exaMoveInPixmap (PixmapPtr pPixmap) pExaPixmap->area->offset; } + exaCopyDirtyToFb (migrate); + + if (exaPixmapIsOffscreen(pPixmap)) + return; + DBG_MIGRATE (("-> %p (0x%x) (%dx%d) (%c)\n", pPixmap, (ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0), @@ -317,8 +323,6 @@ exaMoveInPixmap (PixmapPtr pPixmap) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - exaCopyDirtyToFb (pPixmap); - if (pExaScr->hideOffscreenPixmapData) pPixmap->devPrivate.ptr = NULL; else @@ -327,18 +331,31 @@ exaMoveInPixmap (PixmapPtr pPixmap) pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } +void +exaMoveInPixmap (PixmapPtr pPixmap) +{ + static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE, + .pReg = NULL }; + + migrate.pPix = pPixmap; + exaDoMoveInPixmap (&migrate); +} + /** * Switches the current active location of the pixmap to system memory, copying * updated data out if necessary. */ -void -exaMoveOutPixmap (PixmapPtr pPixmap) +static void +exaDoMoveOutPixmap (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); - if (exaPixmapIsPinned(pPixmap)) + if (!pExaPixmap->area || exaPixmapIsPinned(pPixmap)) return; + exaCopyDirtyToSys (migrate); + if (exaPixmapIsOffscreen(pPixmap)) { DBG_MIGRATE (("<- %p (%p) (%dx%d) (%c)\n", pPixmap, @@ -348,21 +365,52 @@ exaMoveOutPixmap (PixmapPtr pPixmap) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - exaCopyDirtyToSys (pPixmap); - pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } } +void +exaMoveOutPixmap (PixmapPtr pPixmap) +{ + static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE, + .pReg = NULL }; + + migrate.pPix = pPixmap; + exaDoMoveOutPixmap (&migrate); +} + + +/** + * Copies out important pixmap data and removes references to framebuffer area. + * Called when the memory manager decides it's time to kick the pixmap out of + * framebuffer entirely. + */ +void +exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) +{ + PixmapPtr pPixmap = area->privData; + ExaPixmapPriv(pPixmap); + + exaMoveOutPixmap(pPixmap); + + pExaPixmap->fb_ptr = NULL; + pExaPixmap->area = NULL; + + /* Mark all FB bits as invalid, so all valid system bits get copied to FB + * next time */ + REGION_EMPTY(pPixmap->drawable.pScreen, &pExaPixmap->validFB); +} + /** * For the "greedy" migration scheme, pushes the pixmap toward being located in * framebuffer memory. */ static void -exaMigrateTowardFb (PixmapPtr pPixmap) +exaMigrateTowardFb (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); if (pExaPixmap == NULL) { @@ -382,7 +430,7 @@ exaMigrateTowardFb (PixmapPtr pPixmap) (pointer)pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) { - exaMoveInPixmap(pPixmap); + exaDoMoveInPixmap(migrate); pExaPixmap->score = 0; } @@ -392,7 +440,7 @@ exaMigrateTowardFb (PixmapPtr pPixmap) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN && !exaPixmapIsOffscreen(pPixmap)) { - exaMoveInPixmap (pPixmap); + exaDoMoveInPixmap(migrate); } ExaOffscreenMarkUsed (pPixmap); @@ -403,8 +451,9 @@ exaMigrateTowardFb (PixmapPtr pPixmap) * system memory. */ static void -exaMigrateTowardSys (PixmapPtr pPixmap) +exaMigrateTowardSys (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); if (pExaPixmap == NULL) { @@ -426,7 +475,7 @@ exaMigrateTowardSys (PixmapPtr pPixmap) pExaPixmap->score--; if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area) - exaMoveOutPixmap (pPixmap); + exaDoMoveOutPixmap(migrate); } /** @@ -438,15 +487,24 @@ exaAssertNotDirty (PixmapPtr pPixmap) { ExaPixmapPriv (pPixmap); CARD8 *dst, *src; - RegionPtr pValidReg = exaPixmapIsOffscreen(pPixmap) ? &pExaPixmap->validFB : - &pExaPixmap->validSys; - int dst_pitch, src_pitch, cpp, y, nbox = REGION_NUM_RECTS(pValidReg); - BoxPtr pBox = REGION_RECTS(pValidReg); + RegionRec ValidReg; + int dst_pitch, src_pitch, cpp, y, nbox; + BoxPtr pBox; Bool ret = TRUE; - if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL) + if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL) return ret; + REGION_NULL(pScreen, &ValidReg); + REGION_INTERSECT(pScreen, &ValidReg, &pExaPixmap->validFB, + &pExaPixmap->validSys); + nbox = REGION_NUM_RECTS(&ValidReg); + + if (!nbox) + goto out; + + pBox = REGION_RECTS(&ValidReg); + dst_pitch = pExaPixmap->sys_pitch; src_pitch = pExaPixmap->fb_pitch; cpp = pPixmap->drawable.bitsPerPixel / 8; @@ -479,6 +537,8 @@ exaAssertNotDirty (PixmapPtr pPixmap) } exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); +out: + REGION_UNINIT(pScreen, &ValidReg); return ret; } @@ -533,7 +593,7 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) { for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsDirty (pixmaps[i].pPix)) - exaMoveOutPixmap (pixmaps[i].pPix); + exaDoMoveOutPixmap (pixmaps + i); } return; } @@ -544,17 +604,17 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) { - exaMigrateTowardSys (pixmaps[i].pPix); + exaMigrateTowardSys (pixmaps + i); if (!exaPixmapIsDirty (pixmaps[i].pPix)) - exaMoveOutPixmap (pixmaps[i].pPix); + exaDoMoveOutPixmap (pixmaps + i); } return; } /* Finally, the acceleration path. Move them all in. */ for (i = 0; i < npixmaps; i++) { - exaMigrateTowardFb(pixmaps[i].pPix); - exaMoveInPixmap(pixmaps[i].pPix); + exaMigrateTowardFb(pixmaps + i); + exaDoMoveInPixmap(pixmaps + i); } } else if (pExaScr->migration == ExaMigrationGreedy) { /* If we can't accelerate, either because the driver can't or because one of @@ -570,7 +630,7 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) - exaMigrateTowardSys (pixmaps[i].pPix); + exaMigrateTowardSys (pixmaps + i); return; } @@ -578,14 +638,14 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) if (exaPixmapIsOffscreen(pixmaps[i].pPix)) { /* Found one in FB, so move all to FB. */ for (j = 0; j < npixmaps; j++) - exaMigrateTowardFb(pixmaps[j].pPix); + exaMigrateTowardFb(pixmaps + i); return; } } /* Nobody's in FB, so move all away from FB. */ for (i = 0; i < npixmaps; i++) - exaMigrateTowardSys(pixmaps[i].pPix); + exaMigrateTowardSys(pixmaps + i); } else if (pExaScr->migration == ExaMigrationAlways) { /* Always move the pixmaps out if we can't accelerate. If we can * accelerate, try to move them all in. If that fails, then move them @@ -593,13 +653,13 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) - exaMoveOutPixmap(pixmaps[i].pPix); + exaDoMoveOutPixmap(pixmaps + i); return; } /* Now, try to move them all into FB */ for (i = 0; i < npixmaps; i++) { - exaMoveInPixmap(pixmaps[i].pPix); + exaDoMoveInPixmap(pixmaps + i); } /* If we couldn't fit everything in, abort */ diff --git a/exa/exa_priv.h b/exa/exa_priv.h index b9e501625..491d80b8e 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -185,6 +185,7 @@ typedef struct _ExaMigrationRec { Bool as_dst; Bool as_src; PixmapPtr pPix; + RegionPtr pReg; } ExaMigrationRec, *ExaMigrationPtr; /** @@ -337,6 +338,9 @@ ExaOffscreenFini (ScreenPtr pScreen); void ExaDoPrepareAccess(DrawablePtr pDrawable, int index); +void +exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg); + void exaPrepareAccess(DrawablePtr pDrawable, int index); diff --git a/exa/exa_render.c b/exa/exa_render.c index 738ac15b1..067f88b89 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -267,6 +267,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); + pixmaps[0].pReg = NULL; exaDoMigration(pixmaps, 1, TRUE); pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); @@ -381,13 +382,16 @@ exaTryDriverComposite(CARD8 op, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = exaOpReadsDestination(op); pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); + pixmaps[0].pReg = NULL; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable); + pixmaps[1].pReg = NULL; if (pMask) { pixmaps[2].as_dst = FALSE; pixmaps[2].as_src = TRUE; pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable); + pixmaps[2].pReg = NULL; exaDoMigration(pixmaps, 3, TRUE); } else { exaDoMigration(pixmaps, 2, TRUE); @@ -579,12 +583,14 @@ exaComposite(CARD8 op, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = exaOpReadsDestination(op); pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); + pixmaps[0].pReg = NULL; if (pSrc->pDrawable) { pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable); pixmaps[npixmaps].as_dst = FALSE; pixmaps[npixmaps].as_src = TRUE; pixmaps[npixmaps].pPix = pSrcPixmap; + pixmaps[npixmaps].pReg = NULL; npixmaps++; } @@ -592,6 +598,7 @@ exaComposite(CARD8 op, pixmaps[npixmaps].as_dst = FALSE; pixmaps[npixmaps].as_src = TRUE; pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable); + pixmaps[npixmaps].pReg = NULL; npixmaps++; } @@ -1159,8 +1166,9 @@ exaGlyphs (CARD8 op, * it'll stick there. */ pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; + pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; + pixmaps[0].pReg = NULL; exaDoMigration (pixmaps, 1, pExaScr->info->PrepareComposite != NULL); while (n--) From 6c9d7ed61bc4a19d21c53717b8af3d90b5d82ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 6 Sep 2007 13:10:16 +0200 Subject: [PATCH 52/81] EXA: Hide pixmap pointer outside of exaPrepare/FinishAccess whenever possible. We finally want to catch all cases where the pixmap pointer is dereferenced outside of exaPrepare/FinishAccess. Also fix a couple of such cases exposed by this change. --- exa/exa.c | 99 ++++++++++++++++++++++++++++----------------- exa/exa_accel.c | 15 +++---- exa/exa_migration.c | 9 ++--- exa/exa_priv.h | 3 +- 4 files changed, 76 insertions(+), 50 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 145d5b2b0..5a850372f 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -44,6 +44,17 @@ static int exaGeneration; int exaScreenPrivateIndex; int exaPixmapPrivateIndex; +static _X_INLINE void* +ExaGetPixmapAddress(PixmapPtr p) +{ + ExaPixmapPriv(p); + + if (pExaPixmap->offscreen && pExaPixmap->fb_ptr) + return pExaPixmap->fb_ptr; + else + return pExaPixmap->sys_ptr; +} + /** * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer of * the beginning of the given pixmap. @@ -58,16 +69,9 @@ unsigned long exaGetPixmapOffset(PixmapPtr pPix) { ExaScreenPriv (pPix->drawable.pScreen); - ExaPixmapPriv (pPix); - void *ptr; - /* Return the offscreen pointer if we've hidden the data. */ - if (pPix->devPrivate.ptr == NULL) - ptr = pExaPixmap->fb_ptr; - else - ptr = pPix->devPrivate.ptr; - - return ((unsigned long)ptr - (unsigned long)pExaScr->info->memoryBase); + return ((unsigned long)ExaGetPixmapAddress(pPix) - + (unsigned long)pExaScr->info->memoryBase); } /** @@ -241,6 +245,9 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr; pExaPixmap->sys_pitch = pPixmap->devKind; + pPixmap->devPrivate.ptr = NULL; + pExaPixmap->offscreen = FALSE; + pExaPixmap->fb_ptr = NULL; if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8; @@ -274,6 +281,23 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) return pPixmap; } +static Bool +exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData) +{ + ExaScreenPriv(pPixmap->drawable.pScreen); + ExaPixmapPriv(pPixmap); + + if (!pPixmap) + return FALSE; + + if (pExaPixmap) + pExaPixmap->sys_ptr = pPixData; + + return pExaScr->SavedModifyPixmapHeader(pPixmap, width, height, depth, + bitsPerPixel, devKind, pPixData); +} + /** * exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen * memory, meaning that acceleration could probably be done to it, and that it @@ -291,18 +315,25 @@ exaPixmapIsOffscreen(PixmapPtr p) { ScreenPtr pScreen = p->drawable.pScreen; ExaScreenPriv(pScreen); + ExaPixmapPriv(p); + void *save_ptr; + Bool ret; - /* If the devPrivate.ptr is NULL, it's offscreen but we've hidden the data. - */ - if (p->devPrivate.ptr == NULL) - return TRUE; + save_ptr = p->devPrivate.ptr; + + if (!save_ptr && pExaPixmap) + p->devPrivate.ptr = ExaGetPixmapAddress(p); if (pExaScr->info->PixmapIsOffscreen) - return pExaScr->info->PixmapIsOffscreen(p); + ret = pExaScr->info->PixmapIsOffscreen(p); + else + ret = ((unsigned long) ((CARD8 *) p->devPrivate.ptr - + (CARD8 *) pExaScr->info->memoryBase) < + pExaScr->info->memorySize); - return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - - (CARD8 *) pExaScr->info->memoryBase) < - pExaScr->info->memorySize); + p->devPrivate.ptr = save_ptr; + + return ret; } /** @@ -336,22 +367,19 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv (pScreen); - PixmapPtr pPixmap; - - pPixmap = exaGetDrawablePixmap (pDrawable); - - if (exaPixmapIsOffscreen (pPixmap)) - exaWaitSync (pDrawable->pScreen); - else - return; + PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable); + Bool offscreen = exaPixmapIsOffscreen(pPixmap); /* Unhide pixmap pointer */ if (pPixmap->devPrivate.ptr == NULL) { - ExaPixmapPriv (pPixmap); - - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap); } + if (!offscreen) + return; + + exaWaitSync (pDrawable->pScreen); + if (pExaScr->info->PrepareAccess == NULL) return; @@ -400,18 +428,13 @@ exaFinishAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv (pScreen); - PixmapPtr pPixmap; - ExaPixmapPrivPtr pExaPixmap; - - pPixmap = exaGetDrawablePixmap (pDrawable); - - pExaPixmap = ExaGetPixmapPriv(pPixmap); + PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable); + ExaPixmapPriv (pPixmap); /* Rehide pixmap pointer if we're doing that. */ - if (pExaPixmap != NULL && pExaScr->hideOffscreenPixmapData && - pExaPixmap->fb_ptr == pPixmap->devPrivate.ptr) + if (pExaPixmap) { - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pPixmap->devPrivate.ptr = NULL; } if (pExaScr->info->FinishAccess == NULL) @@ -783,6 +806,8 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->SavedDestroyPixmap = pScreen->DestroyPixmap; pScreen->DestroyPixmap = exaDestroyPixmap; + pExaScr->SavedModifyPixmapHeader = pScreen->ModifyPixmapHeader; + pScreen->ModifyPixmapHeader = exaModifyPixmapHeader; LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %d bytes\n", pScreen->myNum, pExaScr->info->memorySize - pExaScr->info->offScreenBase); diff --git a/exa/exa_accel.c b/exa/exa_accel.c index ceb6c7bb5..1fd299eb3 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -213,8 +213,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int dstXoff, dstYoff; if (!access_prepared) { - exaPrepareAccessReg(pDrawable, EXA_PREPARE_DEST, - pixmaps[0].pReg); + ExaDoPrepareAccess(pDrawable, EXA_PREPARE_DEST); access_prepared = TRUE; } @@ -233,14 +232,14 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, GXcopy, FB_ALLONES, dstBpp); } - if (access_prepared) - exaFinishAccess(pDrawable, EXA_PREPARE_DEST); - else - exaMarkSync(pDrawable->pScreen); - exaPixmapDirty(pixmaps[0].pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); } + if (access_prepared) + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + else + exaMarkSync(pDrawable->pScreen); + return TRUE; fallback: @@ -271,8 +270,10 @@ exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, src_stride)) return; + exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); } ShmFuncs exaShmFuncs = { NULL, exaShmPutImage }; diff --git a/exa/exa_migration.c b/exa/exa_migration.c index f48e93a78..ace90765d 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -323,10 +323,8 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - if (pExaScr->hideOffscreenPixmapData) - pPixmap->devPrivate.ptr = NULL; - else - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pExaPixmap->offscreen = TRUE; + pPixmap->devKind = pExaPixmap->fb_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } @@ -365,7 +363,8 @@ exaDoMoveOutPixmap (ExaMigrationPtr migrate) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; + pExaPixmap->offscreen = FALSE; + pPixmap->devKind = pExaPixmap->sys_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 491d80b8e..da5e4599b 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -108,6 +108,7 @@ typedef struct { CopyWindowProcPtr SavedCopyWindow; ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; BitmapToRegionProcPtr SavedBitmapToRegion; + ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; #ifdef RENDER CompositeProcPtr SavedComposite; RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid; @@ -118,7 +119,6 @@ typedef struct { Bool swappedOut; enum ExaMigrationHeuristic migration; - Bool hideOffscreenPixmapData; Bool checkDirtyCorrectness; unsigned disableFbCount; } ExaScreenPrivRec, *ExaScreenPrivPtr; @@ -160,6 +160,7 @@ extern int exaPixmapPrivateIndex; typedef struct { ExaOffscreenArea *area; int score; /**< score for the move-in vs move-out heuristic */ + Bool offscreen; CARD8 *sys_ptr; /**< pointer to pixmap data in system memory */ int sys_pitch; /**< pitch of pixmap in system memory */ From 2e0895a4ba27c1308713022820444c8f57f7a69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:30:03 +0200 Subject: [PATCH 53/81] EXA: Improvements for trapezoids and triangles. Only migrate once in exaTrapezoids/Triangles instead of every time in exaRasterizeTrapezoid/AddTriangles. Adapt manual damage tracking to new infrastructure. Also move definition of NeedsComponent() closer to where it's used. --- exa/exa.c | 7 +- exa/exa_priv.h | 12 ++-- exa/exa_render.c | 173 +++++++++++++++++++++++++++++++++++------------ 3 files changed, 136 insertions(+), 56 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index 5a850372f..ad8d9673d 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -766,11 +766,8 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->SavedComposite = ps->Composite; ps->Composite = exaComposite; - pExaScr->SavedRasterizeTrapezoid = ps->RasterizeTrapezoid; - ps->RasterizeTrapezoid = exaRasterizeTrapezoid; - - pExaScr->SavedAddTriangles = ps->AddTriangles; - ps->AddTriangles = exaAddTriangles; + pExaScr->SavedTriangles = ps->Triangles; + ps->Triangles = exaTriangles; pExaScr->SavedGlyphs = ps->Glyphs; ps->Glyphs = exaGlyphs; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index da5e4599b..db5bd02ab 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -111,8 +111,7 @@ typedef struct { ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; #ifdef RENDER CompositeProcPtr SavedComposite; - RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid; - AddTrianglesProcPtr SavedAddTriangles; + TrianglesProcPtr SavedTriangles; GlyphsProcPtr SavedGlyphs; TrapezoidsProcPtr SavedTrapezoids; #endif @@ -405,12 +404,9 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, int ntrap, xTrapezoid *traps); void -exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - int x_off, int y_off); - -void -exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - xTriangle *tris); +exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntri, xTriangle *tris); void exaGlyphs (CARD8 op, diff --git a/exa/exa_render.c b/exa/exa_render.c index 067f88b89..3cfa81e6f 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -760,7 +760,7 @@ done: * of PolyFillRect to initialize the pixmap after creating it, to prevent * the pixmap from being migrated. * - * See the comments about exaTrapezoids. + * See the comments about exaTrapezoids and exaTriangles. */ static PicturePtr exaCreateAlphaPicture (ScreenPtr pScreen, @@ -832,36 +832,70 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); + BoxRec bounds; + Bool direct = op == PictOpAdd && miIsSolidAlpha (pSrc); + + if (maskFormat || direct) { + miTrapezoidBounds (ntrap, traps, &bounds); + + if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) + return; + } /* * Check for solid alpha add */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) + if (direct) { + DrawablePtr pDraw = pDst->pDrawable; + PixmapPtr pixmap = exaGetDrawablePixmap (pDraw); + ExaPixmapPriv (pixmap); + RegionRec migration; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + int xoff, yoff; + + exaGetDrawableDeltas(pDraw, pixmap, &xoff, &yoff); + + xoff += pDraw->x; + yoff += pDraw->y; + + bounds.x1 += xoff; + bounds.y1 += yoff; + bounds.x2 += xoff; + bounds.y2 += yoff; + + REGION_INIT(pScreen, &migration, &bounds, 1); + REGION_UNION(pScreen, pending_damage, pending_damage, &migration); + REGION_UNINIT(pScreen, &migration); + + exaPrepareAccess(pDraw, EXA_PREPARE_DEST); + for (; ntrap; ntrap--, traps++) (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); + + exaFinishAccess(pDraw, EXA_PREPARE_DEST); } else if (maskFormat) { PicturePtr pPicture; - BoxRec bounds; INT16 xDst, yDst; INT16 xRel, yRel; xDst = traps[0].left.p1.x >> 16; yDst = traps[0].left.p1.y >> 16; - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; pPicture = exaCreateAlphaPicture (pScreen, pDst, maskFormat, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); if (!pPicture) return; + + exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); for (; ntrap; ntrap--, traps++) (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1); + exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + xRel = bounds.x1 + xSrc - xDst; yRel = bounds.y1 + ySrc - yDst; CompositePicture (op, pSrc, pPicture, pDst, @@ -881,51 +915,102 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, } } -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - /** - * exaRasterizeTrapezoid is just a wrapper around the software implementation. + * exaTriangles is essentially a copy of miTriangles that uses + * exaCreateAlphaPicture instead of miCreateAlphaPicture. * - * The trapezoid specification is basically too hard to be done in hardware (at - * the very least, without programmability), so we just do the appropriate - * Prepare/FinishAccess for it before using fbtrap.c. + * The problem with miCreateAlphaPicture is that it calls PolyFillRect + * to initialize the contents after creating the pixmap, which + * causes the pixmap to be moved in for acceleration. The subsequent + * call to AddTriangles won't be accelerated however, which forces the pixmap + * to be moved out again. + * + * exaCreateAlphaPicture avoids this roundtrip by using ExaCheckPolyFillRect + * to initialize the contents. */ void -exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - int x_off, int y_off) +exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntri, xTriangle *tris) { - DrawablePtr pDraw = pPicture->pDrawable; - PixmapPtr pPixmap = exaGetDrawablePixmap(pDraw); - int xoff, yoff; + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + BoxRec bounds; + Bool direct = op == PictOpAdd && miIsSolidAlpha (pSrc); - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbRasterizeTrapezoid(pPicture, trap, x_off, y_off); - exaGetDrawableDeltas(pDraw, pPixmap, &xoff, &yoff); - exaPixmapDirty(pPixmap, pDraw->x + xoff, pDraw->y + yoff, - pDraw->x + xoff + pDraw->width, - pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); -} + if (maskFormat || direct) { + miTriangleBounds (ntri, tris, &bounds); -/** - * exaAddTriangles does migration and syncing before dumping down to the - * software implementation. - */ -void -exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - xTriangle *tris) -{ - DrawablePtr pDraw = pPicture->pDrawable; - PixmapPtr pPixmap = exaGetDrawablePixmap(pDraw); - int xoff, yoff; + if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) + return; + } - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbAddTriangles(pPicture, x_off, y_off, ntri, tris); - exaGetDrawableDeltas(pDraw, pPixmap, &xoff, &yoff); - exaPixmapDirty(pPixmap, pDraw->x + xoff, pDraw->y + yoff, - pDraw->x + xoff + pDraw->width, - pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); + /* + * Check for solid alpha add + */ + if (direct) + { + DrawablePtr pDraw = pDst->pDrawable; + PixmapPtr pixmap = exaGetDrawablePixmap (pDraw); + ExaPixmapPriv (pixmap); + RegionRec migration; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + int xoff, yoff; + + exaGetDrawableDeltas(pDraw, pixmap, &xoff, &yoff); + + xoff += pDraw->x; + yoff += pDraw->y; + + bounds.x1 += xoff; + bounds.y1 += yoff; + bounds.x2 += xoff; + bounds.y2 += yoff; + + REGION_INIT(pScreen, &migration, &bounds, 1); + REGION_UNION(pScreen, pending_damage, pending_damage, &migration); + REGION_UNINIT(pScreen, &migration); + + exaPrepareAccess(pDraw, EXA_PREPARE_DEST); + (*ps->AddTriangles) (pDst, 0, 0, ntri, tris); + exaFinishAccess(pDraw, EXA_PREPARE_DEST); + } + else if (maskFormat) + { + PicturePtr pPicture; + INT16 xDst, yDst; + INT16 xRel, yRel; + + xDst = tris[0].p1.x >> 16; + yDst = tris[0].p1.y >> 16; + + pPicture = exaCreateAlphaPicture (pScreen, pDst, maskFormat, + bounds.x2 - bounds.x1, + bounds.y2 - bounds.y1); + if (!pPicture) + return; + + exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); + exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + + xRel = bounds.x1 + xSrc - xDst; + yRel = bounds.y1 + ySrc - yDst; + CompositePicture (op, pSrc, pPicture, pDst, + xRel, yRel, 0, 0, bounds.x1, bounds.y1, + bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); + FreePicture (pPicture, 0); + } + else + { + if (pDst->polyEdge == PolyEdgeSharp) + maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); + else + maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); + + for (; ntri; ntri--, tris++) + exaTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris); + } } /** @@ -1001,6 +1086,8 @@ exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs) return FALSE; } +#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) + /* exaGlyphs is a slight variation on miGlyphs, to support acceleration. The * issue is that miGlyphs' use of ModifyPixmapHeader makes it impossible to * migrate these pixmaps. So, instead we create a pixmap at the beginning of From 489bc7551ffc7360ba9648ca5c98b59c7e7a1fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:37:53 +0200 Subject: [PATCH 54/81] EXA: exaImageGlyphBlt improvements. As we can't actually accelerate anything interesting here, just migrate out once and call fbSolidBoxClipped instead of taking a round trip via offscreen memory with exaSolidBoxClipped. Reuse pending damage region for extents and to prevent any actual migration of pixmap contents when we're overwriting the whole pending damage region. Remove superfluous manual damage tracking. --- exa/exa_accel.c | 174 ++++++++++++------------------------------------ 1 file changed, 41 insertions(+), 133 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 1fd299eb3..e9ca47263 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -815,97 +815,6 @@ out: REGION_DESTROY(pScreen, pReg); } -static void -exaSolidBoxClipped (DrawablePtr pDrawable, - RegionPtr pClip, - FbBits pm, - FbBits fg, - int x1, - int y1, - int x2, - int y2) -{ - ExaScreenPriv (pDrawable->pScreen); - PixmapPtr pPixmap; - BoxPtr pbox; - int nbox; - int xoff, yoff; - int partX1, partX2, partY1, partY2; - ExaMigrationRec pixmaps[1]; - Bool fallback = FALSE; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - pixmaps[0].pReg = NULL; - - if (pExaScr->swappedOut || - pPixmap->drawable.width > pExaScr->info->maxX || - pPixmap->drawable.height > pExaScr->info->maxY) - { - fallback = TRUE; - } else { - exaDoMigration (pixmaps, 1, TRUE); - } - - exaGetDrawableDeltas (pDrawable, pPixmap, &xoff, &yoff); - - if (fallback || !exaPixmapIsOffscreen(pPixmap) || - !(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg)) - { - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - fallback = TRUE; - exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); - fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); - fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, - fbAnd (GXcopy, fg, pm), - fbXor (GXcopy, fg, pm)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - } - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); - nbox--; - pbox++) - { - partX1 = pbox->x1; - if (partX1 < x1) - partX1 = x1; - - partX2 = pbox->x2; - if (partX2 > x2) - partX2 = x2; - - if (partX2 <= partX1) - continue; - - partY1 = pbox->y1; - if (partY1 < y1) - partY1 = y1; - - partY2 = pbox->y2; - if (partY2 > y2) - partY2 = y2; - - if (partY2 <= partY1) - continue; - - if (!fallback) { - (*pExaScr->info->Solid) (pPixmap, - partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); - } - - exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff, - partY2 + yoff); - } - - if (fallback) - return; - - (*pExaScr->info->DoneSolid) (pPixmap); - exaMarkSync(pDrawable->pScreen); -} - static void exaImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, @@ -922,7 +831,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, int gWidth, gHeight; /* width and height of glyph */ FbStride gStride; /* stride of glyph */ Bool opaque; - int n; int gx, gy; void (*glyph) (FbBits *, FbStride, @@ -936,37 +844,33 @@ exaImageGlyphBlt (DrawablePtr pDrawable, int dstBpp; int dstXoff, dstYoff; FbBits depthMask; + Bool fallback; PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + ExaPixmapPriv(pPixmap); ExaMigrationRec pixmaps[1]; - int xBack, widthBack, yBack, heightBack; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + BoxRec extents = *REGION_EXTENTS(pScreen, pending_damage); + int xoff, yoff; - for (ppci = ppciInit, n = nglyph, widthBack = 0; n; n--) - widthBack += (*ppci++)->metrics.characterWidth; - - xBack = x; - if (widthBack < 0) - { - xBack += widthBack; - widthBack = -widthBack; - } - yBack = y - FONTASCENT(pGC->font); - heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - - if (xBack >= pDrawable->width || yBack >= pDrawable->height || - (xBack + widthBack) <= 0 || (yBack + heightBack) <= 0) + if (extents.x1 >= extents.x2 || extents.y1 >= extents.y2) return; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = pPixmap; - pixmaps[0].pReg = NULL; - depthMask = FbFullMask(pDrawable->depth); - if ((pGC->planemask & depthMask) != depthMask) + fallback = (pGC->planemask & depthMask) != depthMask; + + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = pPixmap; + pixmaps[0].pReg = fallback ? NULL : pending_damage; + + exaDoMigration(pixmaps, 1, FALSE); + + if (fallback) { ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); - goto damage; + return; } + glyph = NULL; switch (pDrawable->bitsPerPixel) { case 8: glyph = fbGlyph8; break; @@ -977,8 +881,14 @@ exaImageGlyphBlt (DrawablePtr pDrawable, x += pDrawable->x; y += pDrawable->y; - xBack += pDrawable->x; - yBack += pDrawable->y; + + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + extents.x1 -= xoff; + extents.x2 -= xoff; + extents.y1 -= yoff; + extents.y2 -= yoff; + + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); if (TERMINALFONT (pGC->font) && !glyph) { @@ -986,19 +896,22 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } else { - exaSolidBoxClipped (pDrawable, - fbGetCompositeClip(pGC), - pGC->planemask, - pGC->bgPixel, - xBack, - yBack, - xBack + widthBack, - yBack + heightBack); + FbBits fg = fbReplicatePixel (pGC->bgPixel, pDrawable->bitsPerPixel); + + fbSolidBoxClipped (pDrawable, + fbGetCompositeClip(pGC), + extents.x1, + extents.y1, + extents.x2, + extents.y2, + fbAnd (GXcopy, fg, pGC->planemask), + fbXor (GXcopy, fg, pGC->planemask)); + opaque = FALSE; } EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + exaPrepareAccessGC (pGC); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); @@ -1011,9 +924,9 @@ exaImageGlyphBlt (DrawablePtr pDrawable, gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; - if (!gWidth || !gHeight || (gx + gWidth) <= xBack || - (gy + gHeight) <= yBack || gx >= (xBack + widthBack) || - gy >= (yBack + heightBack)) + if (!gWidth || !gHeight || (gx + gWidth) <= extents.x1 || + (gy + gHeight) <= extents.y1 || gx >= extents.x2 || + gy >= extents.y2) continue; pglyph = FONTGLYPHBITS(pglyphBase, pci); @@ -1036,11 +949,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } exaFinishAccessGC (pGC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - -damage: - exaGetDrawableDeltas(pDrawable, pPixmap, &dstXoff, &dstYoff); - exaPixmapDirty(pPixmap, xBack + dstXoff, yBack + dstYoff, - xBack + dstXoff + widthBack, yBack + dstYoff + heightBack); } const GCOps exaOps = { From 1f457ff3db24178eefecfbbf177aaf6554adb204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:44:20 +0200 Subject: [PATCH 55/81] EXA: Improvements for 1x1 pixmaps. Initialize system and FB copy in exaFillRegionSolid and adapt exaGetPixmapFirstPixel to the new migration infrastructure. This should mostly eliminate migration overhead for these, whether they are used for acceleration or fallbacks. --- exa/exa_accel.c | 36 +++++++++++++++++++++++++++++++----- exa/exa_unaccel.c | 22 ++++++++++++++++++---- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index e9ca47263..4cae1985e 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1012,8 +1012,6 @@ exaFillRegionSolid (DrawablePtr pDrawable, PixmapPtr pPixmap; int xoff, yoff; ExaMigrationRec pixmaps[1]; - int nbox = REGION_NUM_RECTS (pRegion); - BoxPtr pBox = REGION_RECTS (pRegion); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; @@ -1031,15 +1029,43 @@ exaFillRegionSolid (DrawablePtr pDrawable, if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel)) { + int nbox; + BoxPtr pBox; + + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + + nbox = REGION_NUM_RECTS (pRegion); + pBox = REGION_RECTS (pRegion); + while (nbox--) { - (*pExaScr->info->Solid) (pPixmap, - pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); + (*pExaScr->info->Solid) (pPixmap, pBox->x1, pBox->y1, pBox->x2, + pBox->y2); pBox++; } (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pDrawable->pScreen); + + if (pDrawable->width == 1 && pDrawable->height == 1 && + pDrawable->bitsPerPixel != 24) { + ExaPixmapPriv(pPixmap); + + switch (pDrawable->bitsPerPixel) { + case 32: + *(CARD32*)pExaPixmap->sys_ptr = pixel; + break; + case 16: + *(CARD16*)pExaPixmap->sys_ptr = pixel; + break; + case 8: + *(CARD8*)pExaPixmap->sys_ptr = pixel; + } + + REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + pRegion); + } + + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); } else { diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 8dadd066d..fbc48dd34 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -358,16 +358,28 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) void *fb; Bool need_finish = FALSE; BoxRec box; + RegionRec migration; ExaPixmapPriv (pPixmap); + Bool sys_valid = !miPointInRegion(&pExaPixmap->validSys, 0, 0, &box); + Bool damaged = miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, + &box); + Bool offscreen = exaPixmapIsOffscreen(pPixmap); fb = pExaPixmap->sys_ptr; /* Try to avoid framebuffer readbacks */ - if (exaPixmapIsOffscreen(pPixmap) && - miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) + if ((!offscreen && !sys_valid && !damaged) || + (offscreen && (!sys_valid || damaged))) { + box.x1 = 0; + box.y1 = 0; + box.x2 = 1; + box.y2 = 1; + REGION_INIT(pScreen, &migration, &box, 1); + need_finish = TRUE; - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + + exaPrepareAccessReg(&pPixmap->drawable, EXA_PREPARE_SRC, &migration); fb = pPixmap->devPrivate.ptr; } @@ -383,8 +395,10 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) break; } - if (need_finish) + if (need_finish) { exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + REGION_UNINIT(pScreen, &migration); + } return pixel; } From a634c9b03494ba80aeec28be19662ac96657cc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:48:03 +0200 Subject: [PATCH 56/81] EXA: RENDER improvements. Exclude bits that will be overwritten from migration. Use exaGlyphs even when Composite can't be accelerated, to avoid PolyFillRect roundtrip via offscreen memory. Initialize mask pixmap in exaGlyphs in FB in addition to system if the driver provides Composite hooks to avoid migration overhead. Remove manual damage tracking where superfluous. --- exa/exa.c | 8 ++- exa/exa_priv.h | 3 ++ exa/exa_render.c | 127 ++++++++++++++++------------------------------ exa/exa_unaccel.c | 29 ++++++++++- 4 files changed, 80 insertions(+), 87 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index ad8d9673d..458272daf 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -285,15 +285,19 @@ static Bool exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, pointer pPixData) { - ExaScreenPriv(pPixmap->drawable.pScreen); - ExaPixmapPriv(pPixmap); + ExaScreenPrivPtr pExaScr; + ExaPixmapPrivPtr pExaPixmap; if (!pPixmap) return FALSE; + pExaPixmap = ExaGetPixmapPriv(pPixmap); + if (pExaPixmap) pExaPixmap->sys_ptr = pPixData; + pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen); + return pExaScr->SavedModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index db5bd02ab..a8bdbd67e 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -384,6 +384,9 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, void *closure); /* exa_render.c */ +Bool +exaOpReadsDestination (CARD8 op); + void exaComposite(CARD8 op, PicturePtr pSrc, diff --git a/exa/exa_render.c b/exa/exa_render.c index 3cfa81e6f..9df795f37 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -111,7 +111,7 @@ exaPrintCompositeFallback(CARD8 op, } #endif /* DEBUG_TRACE_FALL */ -static Bool +Bool exaOpReadsDestination (CARD8 op) { /* FALSE (does not read destination) is the list of ops in the protocol @@ -261,17 +261,21 @@ exaTryDriverSolidFill(PicturePtr pSrc, width, height)) return 1; + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); + + REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); pixel = exaGetPixmapFirstPixel (pSrcPix); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); - pixmaps[0].pReg = NULL; + pixmaps[0].pPix = pDstPix; + pixmaps[0].pReg = ®ion; exaDoMigration(pixmaps, 1, TRUE); - pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - if (!pDstPix) { + if (!exaPixmapIsOffscreen(pDstPix)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); return 0; } @@ -301,9 +305,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, while (nbox--) { - (*pExaScr->info->Solid) (pDstPix, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); + (*pExaScr->info->Solid) (pDstPix, pbox->x1, pbox->y1, pbox->x2, pbox->y2); pbox++; } @@ -367,22 +369,26 @@ exaTryDriverComposite(CARD8 op, xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; + if (pExaScr->info->CheckComposite && + !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) + { + return -1; + } + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) return 1; - if (pExaScr->info->CheckComposite && - !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); + + REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = exaOpReadsDestination(op); - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); - pixmaps[0].pReg = NULL; + pixmaps[0].pPix = pDstPix; + pixmaps[0].pReg = pixmaps[0].as_src ? NULL : ®ion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable); @@ -401,9 +407,8 @@ exaTryDriverComposite(CARD8 op, if (pMask) pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x, &mask_off_y); - pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - if (!pDstPix) { + if (!exaPixmapIsOffscreen(pDstPix)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); return 0; } @@ -433,21 +438,21 @@ exaTryDriverComposite(CARD8 op, nbox = REGION_NUM_RECTS(®ion); pbox = REGION_RECTS(®ion); - xMask -= xDst; - yMask -= yDst; + xMask = xMask + mask_off_x - xDst - dst_off_x; + yMask = yMask + mask_off_y - yDst - dst_off_y; - xSrc -= xDst; - ySrc -= yDst; + xSrc = xSrc + src_off_x - xDst - dst_off_x; + ySrc = ySrc + src_off_y - yDst - dst_off_y; while (nbox--) { (*pExaScr->info->Composite) (pDstPix, - pbox->x1 + xSrc + src_off_x, - pbox->y1 + ySrc + src_off_y, - pbox->x1 + xMask + mask_off_x, - pbox->y1 + yMask + mask_off_y, - pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, + pbox->x1 + xSrc, + pbox->y1 + ySrc, + pbox->x1 + xMask, + pbox->y1 + yMask, + pbox->x1, + pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; @@ -523,9 +528,6 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, CARD16 height) { ExaScreenPriv (pDst->pDrawable->pScreen); - DrawablePtr pDstDraw = pDst->pDrawable; - PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDstDraw); - int xoff, yoff; assert(op == PictOpOver); @@ -544,12 +546,6 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); - exaGetDrawableDeltas(pDstDraw, pDstPixmap, &xoff, &yoff); - xoff += pDstDraw->x; - yoff += pDstDraw->y; - exaPixmapDirty(pDstPixmap, xDst + xoff, yDst + yoff, xDst + xoff + width, - yDst + yoff + height); - /* Then, add in the source value times the destination alpha factors (1.0). */ exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, @@ -576,31 +572,8 @@ exaComposite(CARD8 op, int ret = -1; Bool saveSrcRepeat = pSrc->repeat; Bool saveMaskRepeat = pMask ? pMask->repeat : 0; - ExaMigrationRec pixmaps[3]; - int npixmaps = 1; PixmapPtr pSrcPixmap = NULL; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = exaOpReadsDestination(op); - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); - pixmaps[0].pReg = NULL; - - if (pSrc->pDrawable) { - pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable); - pixmaps[npixmaps].as_dst = FALSE; - pixmaps[npixmaps].as_src = TRUE; - pixmaps[npixmaps].pPix = pSrcPixmap; - pixmaps[npixmaps].pReg = NULL; - npixmaps++; - } - - if (pMask && pMask->pDrawable) { - pixmaps[npixmaps].as_dst = FALSE; - pixmaps[npixmaps].as_src = TRUE; - pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable); - pixmaps[npixmaps].pReg = NULL; - npixmaps++; - } + RegionRec region; /* We currently don't support acceleration of gradients, or other pictures * with a NULL pDrawable. @@ -638,8 +611,6 @@ exaComposite(CARD8 op, } else if (pSrcPixmap && !pSrc->repeat && !pSrc->transform) { - RegionRec region; - xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; @@ -661,7 +632,6 @@ exaComposite(CARD8 op, else if (pSrcPixmap && !pSrc->transform && pSrc->repeatType == RepeatNormal) { - RegionRec region; DDXPointRec srcOrg; /* Let's see if the driver can do the repeat in one go */ @@ -1092,6 +1062,9 @@ exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs) * issue is that miGlyphs' use of ModifyPixmapHeader makes it impossible to * migrate these pixmaps. So, instead we create a pixmap at the beginning of * the loop and upload each glyph into the pixmap before compositing. + * + * This is now used even when Composite can't be accelerated for better + * migration control. */ void exaGlyphs (CARD8 op, @@ -1108,11 +1081,10 @@ exaGlyphs (CARD8 op, PixmapPtr pPixmap = NULL; PicturePtr pPicture; PixmapPtr pMaskPixmap = NULL; - PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable); PicturePtr pMask; ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; - int x, y, x1, y1, xoff, yoff; + int x, y, x1, y1; int xDst = list->xOff, yDst = list->yOff; int n; int error; @@ -1140,16 +1112,6 @@ exaGlyphs (CARD8 op, } } - /* If the driver doesn't support accelerated composite, there's no point in - * going to this extra work. Assume that any driver that supports Composite - * will be able to support component alpha using the two-pass helper. - */ - if (!pExaScr->info->PrepareComposite) - { - miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - return; - } - if (maskFormat) { GCPtr pGC; @@ -1186,8 +1148,11 @@ exaGlyphs (CARD8 op, rect.y = 0; rect.width = width; rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - exaPixmapDirty(pMaskPixmap, 0, 0, width, height); + ExaCheckPolyFillRect (&pMaskPixmap->drawable, pGC, 1, &rect); + if (pExaScr->info->PrepareComposite) + (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); + else + exaPixmapDirty(pMaskPixmap, 0, 0, width, height); FreeScratchGC (pGC); x = -extents.x1; y = -extents.y1; @@ -1199,8 +1164,6 @@ exaGlyphs (CARD8 op, y = 0; } - exaGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &xoff, &yoff); - while (nlist--) { GCPtr pGC = NULL; @@ -1339,10 +1302,6 @@ exaGlyphs (CARD8 op, xSrc + x1 - xDst, ySrc + y1 - yDst, 0, 0, x1, y1, glyph->info.width, glyph->info.height); - x1 += pDst->pDrawable->x + xoff; - y1 += pDst->pDrawable->y + yoff; - exaPixmapDirty(pDstPixmap, x1, y1, x1 + glyph->info.width, - y1 + glyph->info.height); } nextglyph: x += glyph->info.xOff; diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index fbc48dd34..24d5e3ff7 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -23,6 +23,10 @@ #include "exa_priv.h" +#ifdef RENDER +#include "mipict.h" +#endif + /* * These functions wrap the low-level fb rendering functions and * synchronize framebuffer/accelerated drawing by stalling until @@ -319,9 +323,30 @@ ExaCheckComposite (CARD8 op, CARD16 width, CARD16 height) { + RegionRec region; + int xoff, yoff; + + REGION_NULL(pScreen, ®ion); + + if (!exaOpReadsDestination(op)) { + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, xDst, yDst, + width, height)) + return; + + exaGetDrawableDeltas (pDst->pDrawable, + exaGetDrawablePixmap(pDst->pDrawable), + &xoff, &yoff); + + REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + + exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, ®ion); + } else + exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); - exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + if (pSrc->pDrawable != NULL) exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC); if (pMask && pMask->pDrawable != NULL) @@ -343,6 +368,8 @@ ExaCheckComposite (CARD8 op, if (pSrc->pDrawable != NULL) exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC); exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST); + + REGION_UNINIT(pScreen, ®ion); } /** From aa2ed73e0ec881947c969b67269e3206da4de359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:50:42 +0200 Subject: [PATCH 57/81] EXA: Remove superfluous manual damage tracking. These should all be covered by damage wrappers. --- exa/exa_accel.c | 78 +++++++++++++++++------------------------------ exa/exa_unaccel.c | 1 - 2 files changed, 28 insertions(+), 51 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 4cae1985e..36815e2cc 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -394,8 +394,6 @@ exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, dst_off_y + pbox->y1 + i, pbox->x2 - pbox->x1, 1); } - exaPixmapDirty(pDstPixmap, dst_off_x + pbox->x1, dst_off_y + pbox->y1, - dst_off_x + pbox->x2, dst_off_y + pbox->y2); } if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); @@ -421,7 +419,6 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, int src_off_x, src_off_y; int dst_off_x, dst_off_y; ExaMigrationRec pixmaps[2]; - Bool fallback = FALSE; pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; @@ -441,18 +438,18 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, pDstPixmap->drawable.width > pExaScr->info->maxX || pDstPixmap->drawable.height > pExaScr->info->maxY) { - fallback = TRUE; + goto fallback; } else { exaDoMigration (pixmaps, 2, TRUE); } /* Mixed directions must be handled specially if the card is lame */ - if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && + if ((pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && reverse != upsidedown) { if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy)) return; - fallback = TRUE; + goto fallback; } pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); @@ -461,43 +458,40 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); - if (fallback || !exaPixmapIsOffscreen(pSrcPixmap) || + if (!exaPixmapIsOffscreen(pSrcPixmap) || !exaPixmapIsOffscreen(pDstPixmap) || !(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1, upsidedown ? -1 : 1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) { - fallback = TRUE; - EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, - exaDrawableLocation(pSrcDrawable), - exaDrawableLocation(pDstDrawable))); - exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); - exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); - fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, - pbox, nbox, dx, dy, reverse, upsidedown, - bitplane, closure); - exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); - exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); + goto fallback; } while (nbox--) { - if (!fallback) - (*pExaScr->info->Copy) (pDstPixmap, - pbox->x1 + dx + src_off_x, - pbox->y1 + dy + src_off_y, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); - exaPixmapDirty (pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); + (*pExaScr->info->Copy) (pDstPixmap, + pbox->x1 + dx + src_off_x, + pbox->y1 + dy + src_off_y, + pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, + pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } - if (fallback) - return; - (*pExaScr->info->DoneCopy) (pDstPixmap); exaMarkSync (pDstDrawable->pScreen); + + return; + +fallback: + EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, + exaDrawableLocation(pSrcDrawable), + exaDrawableLocation(pDstDrawable))); + exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); + fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, + upsidedown, bitplane, closure); + exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); + exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); } RegionPtr @@ -1204,12 +1198,8 @@ void exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) { ExaScreenPriv (pWin->drawable.pScreen); - PixmapPtr pPixmap = exaGetDrawablePixmap((DrawablePtr)pWin); - int xoff, yoff; - BoxPtr pBox; - int nbox = REGION_NUM_RECTS(pRegion); - if (!nbox) + if (REGION_NIL(pRegion)) return; if (!pExaScr->swappedOut) { @@ -1230,39 +1220,27 @@ exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) case BackgroundPixel: exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel, FB_ALLONES, GXcopy); - goto damage; + return; case BackgroundPixmap: exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap, &zeros, FB_ALLONES, GXcopy); - goto damage; + return; } break; case PW_BORDER: if (pWin->borderIsPixel) { exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel, FB_ALLONES, GXcopy); - goto damage; + return; } else { exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap, &zeros, FB_ALLONES, GXcopy); - goto damage; + return; } break; } } ExaCheckPaintWindow (pWin, pRegion, what); - -damage: - exaGetDrawableDeltas((DrawablePtr)pWin, pPixmap, &xoff, &yoff); - - pBox = REGION_RECTS(pRegion); - - while (nbox--) - { - exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); - pBox++; - } } /** diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 24d5e3ff7..970c2cba2 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -105,7 +105,6 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); - exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h); } RegionPtr From ea92ea415665e294a1ba233e9a1d39b6daa0cee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:54:18 +0200 Subject: [PATCH 58/81] EXA: exaGetImage improvements. Use the new migration infrastructure to cache FB bits we need in the system copy, for the benefit of repeated calls. --- exa/exa_accel.c | 51 ++++++++++++++++++++++++++++++++++------------- exa/exa_priv.h | 6 ------ exa/exa_unaccel.c | 13 ------------ 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 36815e2cc..df6a62d68 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1247,22 +1247,43 @@ exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory. * * This is probably the only case we actually care about. The rest fall through - * to migration and ExaCheckGetImage, which hopefully will result in migration - * pushing the pixmap out of framebuffer. + * to migration and fbGetImage, which hopefully will result in migration pushing + * the pixmap out of framebuffer. */ void exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d) { ExaScreenPriv (pDrawable->pScreen); + ExaMigrationRec pixmaps[1]; + BoxRec Box; + RegionRec Reg; PixmapPtr pPix; int xoff, yoff; Bool ok; - if (pExaScr->swappedOut || (w == 1 && h == 1)) + if (pExaScr->swappedOut) goto fallback; - if (pExaScr->info->DownloadFromScreen == NULL) + pixmaps[0].as_dst = FALSE; + pixmaps[0].as_src = TRUE; + pixmaps[0].pPix = pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = &Reg; + + exaGetDrawableDeltas (pDrawable, pPix, &xoff, &yoff); + + Box.x1 = pDrawable->y + x + xoff; + Box.y1 = pDrawable->y + y + yoff; + Box.x2 = Box.x1 + w; + Box.y2 = Box.y1 + h; + + REGION_INIT(pScreen, &Reg, &Box, 1); + + exaDoMigration(pixmaps, 1, FALSE); + + pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); + + if (pPix == NULL || pExaScr->info->DownloadFromScreen == NULL) goto fallback; /* Only cover the ZPixmap, solid copy case. */ @@ -1275,20 +1296,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, if (pDrawable->bitsPerPixel < 8) goto fallback; - pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); - if (pPix == NULL) - goto fallback; - - xoff += pDrawable->x; - yoff += pDrawable->y; - - ok = pExaScr->info->DownloadFromScreen(pPix, x + xoff, y + yoff, w, h, d, + ok = pExaScr->info->DownloadFromScreen(pPix, pDrawable->x + x + xoff, + pDrawable->y + y + yoff, w, h, d, PixmapBytePad(w, pDrawable->depth)); if (ok) { exaWaitSync(pDrawable->pScreen); - return; + goto out; } fallback: - ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d); + EXA_FALLBACK(("from %p (%c)\n", pDrawable, + exaDrawableLocation(pDrawable))); + + exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg); + fbGetImage (pDrawable, x, y, w, h, format, planeMask, d); + exaFinishAccess (pDrawable, EXA_PREPARE_SRC); + +out: + REGION_UNINIT(pScreen, &Reg); } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index a8bdbd67e..8e51f5d72 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -264,12 +264,6 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y); -void -ExaCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d); - void ExaCheckGetSpans (DrawablePtr pDrawable, int wMax, diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 970c2cba2..8fb7b526e 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -264,19 +264,6 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, exaFinishAccess (pDrawable, EXA_PREPARE_DEST); } -void -ExaCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d) -{ - EXA_FALLBACK(("from %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_SRC); - fbGetImage (pDrawable, x, y, w, h, format, planeMask, d); - exaFinishAccess (pDrawable, EXA_PREPARE_SRC); -} - void ExaCheckGetSpans (DrawablePtr pDrawable, int wMax, From be922b30486abce3a8c13996d579b211a7b56f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Aug 2007 13:59:07 +0200 Subject: [PATCH 59/81] EXA: exa(Shm)PutImage improvements. Improve exaShmPutImage performance and reuse its core in exaPutImage as it seems faster than the previous code when the driver doesn't provide an UploadToScreen hook. Make sure all damage records are notified of the damage incurred by actual ShmPutImage calls. Remove superfluous manual damage tracking for actual PutImage calls. --- exa/exa_accel.c | 140 +++++++++++++++++++++++++++++++++------------- exa/exa_priv.h | 10 ++++ exa/exa_unaccel.c | 10 ++-- 3 files changed, 117 insertions(+), 43 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index df6a62d68..136fca22d 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -139,10 +139,11 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, static Bool exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *bits, int src_stride) + int w, int h, int format, char *bits, int src_stride) { ExaScreenPriv (pDrawable->pScreen); - PixmapPtr pPix; + PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); + ExaPixmapPriv(pPix); ExaMigrationRec pixmaps[1]; RegionPtr pClip; BoxPtr pbox; @@ -151,26 +152,28 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int bpp = pDrawable->bitsPerPixel; Bool access_prepared = FALSE; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - pixmaps[0].pReg = NULL; - /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) - goto fallback; + return FALSE; /* Only accelerate copies: no rop or planemask. */ if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) - goto fallback; + return FALSE; if (pExaScr->swappedOut) - goto fallback; + return FALSE; + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = pPix; + pixmaps[0].pReg = DamagePendingRegion(pExaPixmap->pDamage); exaDoMigration (pixmaps, 1, TRUE); pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); + if (!pPix || !pExaScr->info->UploadToScreen) + return FALSE; + x += pDrawable->x; y += pDrawable->y; @@ -199,10 +202,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, continue; src = bits + (y1 - y) * src_stride + (x1 - x) * (bpp / 8); - ok = (pPix && pExaScr->info->UploadToScreen) ? - pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff, - x2 - x1, y2 - y1, src, src_stride) : - FALSE; + ok = pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff, + x2 - x1, y2 - y1, src, src_stride); /* If we fail to accelerate the upload, fall back to using unaccelerated * fb calls. */ @@ -231,8 +232,6 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, y2 - y1, GXcopy, FB_ALLONES, dstBpp); } - - exaPixmapDirty(pixmaps[0].pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); } if (access_prepared) @@ -241,45 +240,110 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, exaMarkSync(pDrawable->pScreen); return TRUE; - -fallback: - return FALSE; -} - -static void -exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *bits) -{ - if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits, - PixmapBytePad(w, pDrawable->depth))) - ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, - bits); } #ifdef MITSHM +static Bool +exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, + unsigned int format, int w, int h, int sx, int sy, int sw, + int sh, int dx, int dy, char *data) +{ + int src_stride = PixmapBytePad(w, depth); + + if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, format, data + + sy * src_stride + sx * BitsPerPixel(depth) / 8, + src_stride)) + return TRUE; + + if (format == ZPixmap) + { + PixmapPtr pPixmap; + + pPixmap = GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth, + BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); + if (!pPixmap) + return FALSE; + + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); + fbCopyArea((DrawablePtr)pPixmap, pDrawable, pGC, sx, sy, sw, sh, dx, dy); + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + + FreeScratchPixmapHeader(pPixmap); + + return TRUE; + } + + return FALSE; +} + +/* The actual ShmPutImage isn't wrapped by the damage layer, so we need to + * inform any interested parties of the damage incurred to the drawable. + * + * We also need to set the pending damage to ensure correct migration in all + * cases. + */ static void exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, char *data) { - int src_stride = PixmapBytePad(w, depth); + PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + ExaPixmapPriv(pPixmap); + BoxRec box = { .x1 = pDrawable->x + dx, .y1 = pDrawable->y + dy, + .x2 = pDrawable->x + dx + sw, .y2 = pDrawable->y + dy + sh }; + RegionRec region; + int xoff, yoff; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, 0, format, data + - sy * src_stride + sx * BitsPerPixel(depth) / 8, - src_stride)) - return; + REGION_INIT(pScreen, ®ion, &box, 1); - exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); - fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); - exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + + REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + REGION_UNION(pScreen, pending_damage, pending_damage, ®ion); + + if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, + dx, dy, data)) { + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); + fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, + data); + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + } + + REGION_TRANSLATE(pScreen, ®ion, -xoff, -yoff); + DamageDamageRegion(pDrawable, ®ion); + + REGION_UNINIT(pScreen, ®ion); } ShmFuncs exaShmFuncs = { NULL, exaShmPutImage }; #endif +static void +exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ +#ifdef MITSHM + if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, 0, 0, w, h, x, y, + bits)) +#else + if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, format, bits, + PixmapBytePad(w, pDrawable->depth))) +#endif + ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, + bits); +} + static Bool inline exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy) diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 8e51f5d72..a6ac92106 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -279,6 +279,16 @@ CARD32 exaGetPixmapFirstPixel (PixmapPtr pPixmap); /* exa_accel.c */ + +static _X_INLINE Bool +exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask, + unsigned int fillStyle, unsigned char alu) +{ + return ((alu != GXcopy && alu != GXclear &&alu != GXset && + alu != GXcopyInverted) || fillStyle == FillStippled || + !EXA_PM_IS_SOLID(pDrawable, planemask)); +} + void exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 8fb7b526e..f4d453eaa 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -97,14 +97,14 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { - PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); - int xoff, yoff; - EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); } RegionPtr From 5f7da4da8de7449e1c2a4c679632a0b2a5858b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 31 Aug 2007 16:59:28 +0200 Subject: [PATCH 60/81] EXA: Use exaShmPutImage for pushing glyphs to scratch pixmap in exaGlyphs. --- exa/exa_accel.c | 2 +- exa/exa_priv.h | 5 +++++ exa/exa_render.c | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 136fca22d..e44ce6005 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -287,7 +287,7 @@ exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, * We also need to set the pending damage to ensure correct migration in all * cases. */ -static void +void exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, char *data) diff --git a/exa/exa_priv.h b/exa/exa_priv.h index a6ac92106..02371d7d8 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -299,6 +299,11 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, void exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); +void +exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, + int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, + char *data); + void exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); diff --git a/exa/exa_render.c b/exa/exa_render.c index 9df795f37..943a4c8f6 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -1282,6 +1282,15 @@ exaGlyphs (CARD8 op, pScratchPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } +#ifdef MITSHM + if (pExaScr->info->PrepareComposite) + exaShmPutImage(&pPixmap->drawable, pGC, + pPixmap->drawable.depth, ZPixmap, + glyph->info.width, glyph->info.height, 0, 0, + glyph->info.width, glyph->info.height, 0, 0, + glyphdata); + else +#endif exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC, 0, 0, glyph->info.width, glyph->info.height, 0, 0); } From e81af8ba643df3be53b0a46d9d4a0eaf21557c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 3 Sep 2007 13:14:29 +0200 Subject: [PATCH 61/81] EXA: exaFillRegion{Solid,Tiled} improvements. Use region to exclude bits that will be overwritten from migration. Also make exaFillRegionSolid use the same logic as exaFillRegionTiled. --- exa/exa_accel.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index e44ce6005..0a03d7157 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1074,7 +1074,11 @@ exaFillRegionSolid (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - pixmaps[0].pReg = NULL; + pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid, + alu) ? NULL : pRegion; + + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY) @@ -1090,8 +1094,6 @@ exaFillRegionSolid (DrawablePtr pDrawable, int nbox; BoxPtr pBox; - REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); - nbox = REGION_NUM_RECTS (pRegion); pBox = REGION_RECTS (pRegion); @@ -1124,19 +1126,21 @@ exaFillRegionSolid (DrawablePtr pDrawable, } REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + return TRUE; } - else - { + fallback: - if (alu != GXcopy || planemask != FB_ALLONES) - return FALSE; - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); - fbFillRegionSolid (pDrawable, pRegion, 0, - fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); + if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + return FALSE; } + EXA_FALLBACK(("to %p (%c)\n", pDrawable, + exaDrawableLocation(pDrawable))); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + fbFillRegionSolid (pDrawable, pRegion, 0, + fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); + exaFinishAccess (pDrawable, EXA_PREPARE_DEST); return TRUE; } @@ -1174,12 +1178,16 @@ exaFillRegionTiled (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - pixmaps[0].pReg = NULL; + pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillTiled, + alu) ? NULL : pRegion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; pixmaps[1].pReg = NULL; + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY || tileWidth > pExaScr->info->maxX || @@ -1208,7 +1216,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight; + tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1219,7 +1227,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth; + tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1228,8 +1236,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->Copy) (pPixmap, tileX + tileXoff, tileY + tileYoff, - dstX + xoff, dstY + yoff, - w, h); + dstX, dstY, w, h); dstX += w; tileX = 0; } @@ -1240,16 +1247,20 @@ exaFillRegionTiled (DrawablePtr pDrawable, } (*pExaScr->info->DoneCopy) (pPixmap); exaMarkSync(pDrawable->pScreen); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); return TRUE; } fallback: - if (alu != GXcopy || planemask != FB_ALLONES) + if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); return FALSE; + } EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, exaDrawableLocation(&pTile->drawable), exaDrawableLocation(pDrawable))); exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); fbFillRegionTiled (pDrawable, pRegion, pTile); exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); From e8093e15c7df7a3d5a9717bc9d7d7517b0743f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 3 Sep 2007 13:52:29 +0200 Subject: [PATCH 62/81] EXA: Exclude bits that will be overwritten from migration in exaCopyNtoN. Also plug a region leak in exaPolyFillRect. --- exa/exa_accel.c | 59 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 0a03d7157..232ec9934 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -483,14 +483,48 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, int src_off_x, src_off_y; int dst_off_x, dst_off_y; ExaMigrationRec pixmaps[2]; + RegionPtr region = NULL; + + pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); + pDstPixmap = exaGetDrawablePixmap (pDstDrawable); + + exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); + exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); + + if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, + pGC->fillStyle, pGC->alu)) { + xRectangle *rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + + if (rects) { + int i; + + for (i = 0; i < nbox; i++) { + rects[i].x = pbox[i].x1 + dst_off_x; + rects[i].y = pbox[i].y1 + dst_off_y; + rects[i].width = pbox[i].x2 - pbox[i].x1; + rects[i].height = pbox[i].y2 - pbox[i].y1; + } + + region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED); + DEALLOCATE_LOCAL(rects); + + if (region) { + src_off_x -= dst_off_x; + src_off_y -= dst_off_y; + dst_off_x = dst_off_y = 0; + pbox = REGION_RECTS(region); + nbox = REGION_NUM_RECTS(region); + } + } + } pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = pDstPixmap = exaGetDrawablePixmap (pDstDrawable); - pixmaps[0].pReg = NULL; + pixmaps[0].pPix = pDstPixmap; + pixmaps[0].pReg = region; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; - pixmaps[1].pPix = pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); + pixmaps[1].pPix = pSrcPixmap; pixmaps[1].pReg = NULL; /* Respect maxX/maxY in a trivial way: don't set up drawing when we might @@ -512,16 +546,10 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, reverse != upsidedown) { if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy)) - return; + goto out; goto fallback; } - pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); - pDstPixmap = exaGetDrawablePixmap (pDstDrawable); - - exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); - exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); - if (!exaPixmapIsOffscreen(pSrcPixmap) || !exaPixmapIsOffscreen(pDstPixmap) || !(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1, @@ -544,18 +572,24 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, (*pExaScr->info->DoneCopy) (pDstPixmap); exaMarkSync (pDstDrawable->pScreen); - return; + goto out; fallback: EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, exaDrawableLocation(pSrcDrawable), exaDrawableLocation(pDstDrawable))); - exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, region); exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, upsidedown, bitplane, closure); exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); + +out: + if (region) { + REGION_UNINIT(pScreen, region); + REGION_DESTROY(pScreen, region); + } } RegionPtr @@ -870,6 +904,7 @@ fallback: exaMarkSync(pDrawable->pScreen); out: + REGION_UNINIT(pScreen, pReg); REGION_DESTROY(pScreen, pReg); } From f8637137ab43818d45d249b337820cbf427a05ec Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Thu, 6 Sep 2007 05:39:57 -0700 Subject: [PATCH 63/81] XDARWIN: build fix for quartz/pseudoramiX.c --- hw/darwin/quartz/pseudoramiX.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c index 7ba6d5a15..e65be69a0 100644 --- a/hw/darwin/quartz/pseudoramiX.c +++ b/hw/darwin/quartz/pseudoramiX.c @@ -43,6 +43,9 @@ Equipment Corporation. #include #include "globals.h" +extern int noPseudoramiXExtension; +extern int noPanoramiXExtension; + extern int ProcPanoramiXQueryVersion (ClientPtr client); static void PseudoramiXResetProc(ExtensionEntry *extEntry); From 0ff273fd1e2ea7242b3e6c5effb2a623ef32ec6f Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Thu, 6 Sep 2007 18:52:26 -0700 Subject: [PATCH 64/81] XDARWIN: fixes to make Xquartz build again --- hw/darwin/apple/X11Application.m | 2 +- hw/darwin/darwin.c | 123 +++++++------------------------ hw/darwin/darwin.h | 2 +- hw/darwin/quartz/Preferences.m | 2 +- hw/darwin/quartz/quartzCocoa.m | 2 +- 5 files changed, 30 insertions(+), 101 deletions(-) diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 57795f452..2d2132102 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -41,7 +41,7 @@ # include "micmap.h" #undef BOOL -#include "xf86Version.h" +//#include "xf86Version.h" #include #include diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c index 4e3495409..0b22141b5 100644 --- a/hw/darwin/darwin.c +++ b/hw/darwin/darwin.c @@ -6,6 +6,7 @@ **************************************************************/ /* * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2007 Apple Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -46,8 +47,6 @@ #include "fb.h" // fb framebuffer code #include "site.h" #include "globals.h" -#include "xorgVersion.h" -#include "xf86Date.h" #include "dix.h" #ifdef XINPUT @@ -83,7 +82,7 @@ int darwinScreenIndex = 0; io_connect_t darwinParamConnect = 0; int darwinEventReadFD = -1; int darwinEventWriteFD = -1; -int darwinMouseAccelChange = 1; +// int darwinMouseAccelChange = 1; int darwinFakeButtons = 0; // location of X11's (0,0) point in global screen coordinates @@ -127,86 +126,23 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); #ifndef PRE_RELEASE #define PRE_RELEASE XORG_VERSION_SNAP #endif - -void -DarwinPrintBanner() -{ -#if PRE_RELEASE - ErrorF("\n" - "This is a pre-release version of the " XVENDORNAME " X11.\n" - "Portions of this release are based on XFree86 4.4RC2 and selected\n" - "files from XFree86 4.4RC3. It is not supported in any way.\n" - "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" - "Select the \"xorg\" product for bugs you find in this release.\n" - "Before reporting bugs in pre-release versions please check the\n" - "latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n" - "repository hosted at http://www.freedesktop.org/Software/xorg/"); +#ifndef BUILD_DATE +#define BUILD_DATE "" #endif -#if XORG_VERSION_SNAP > 0 - ErrorF(".%d", XORG_VERSION_SNAP); +#ifndef XORG_RELEASE +#define XORG_RELEASE "?" #endif -#if XORG_VERSION_SNAP >= 900 - ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1, - XORG_VERSION_SNAP - 900); -#endif - -#ifdef XORG_CUSTOM_VERSION - ErrorF(" (%s)", XF86_CUSTOM_VERSION); -#endif - ErrorF("\nRelease Date: %s\n", XF86_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_VERSION_CURRENT ); - ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); -#ifdef HAS_UTSNAME - { - struct utsname name; - - if (uname(&name) == 0) { - ErrorF("Current Operating System: %s %s %s %s %s\n", - name.sysname, name.nodename, name.release, name.version, name.machine); - } - } -#endif -#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = BUILD_DATE % 100; - t.tm_mon = (BUILD_DATE / 100) % 100 - 1; - t.tm_year = BUILD_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Build Date: %s\n", buf); - } -#endif -#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = CLOG_DATE % 100; - t.tm_mon = (CLOG_DATE / 100) % 100 - 1; - t.tm_year = CLOG_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Changelog Date: %s\n", buf); - } -#endif -#if defined(BUILDERSTRING) - ErrorF("%s \n",BUILDERSTRING); -#endif - ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n" - "\tto make sure that you have the latest version.\n"); +void DDXRingBell(int volume, int pitch, int duration) { + // FIXME -- make some noise, yo } - -void DDXRingBell(int volume, int pitch, int duration) -{ - // FIXME -- make some noise, yo +void +DarwinPrintBanner(void) +{ + // this should change depending on which specific server we are building + ErrorF("X11.app starting:\n"); + ErrorF("Xquartz server based on X.org %s, built on %s\n", XORG_RELEASE, BUILD_DATE ); } @@ -359,8 +295,8 @@ static Bool DarwinAddScreen( dixScreenOrigins[index].x = dfb->x; dixScreenOrigins[index].y = dfb->y; - ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); + /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", + index, dfb->width, dfb->height, dfb->x, dfb->y); */ return TRUE; } @@ -373,6 +309,7 @@ static Bool DarwinAddScreen( ============================================================================= */ +#if 0 /* * DarwinChangePointerControl * Set mouse acceleration and thresholding @@ -393,7 +330,7 @@ static void DarwinChangePointerControl( if (kr != KERN_SUCCESS) ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); } - +#endif /* * DarwinMouseProc @@ -416,12 +353,11 @@ static int DarwinMouseProc( map[3] = 3; map[4] = 4; map[5] = 5; - InitPointerDeviceStruct( (DevicePtr)pPointer, - map, - 5, // numbuttons (4 & 5 are scroll wheel) - GetMotionHistory, - DarwinChangePointerControl, - GetMotionHistorySize(), 2 ); + InitPointerDeviceStruct( (DevicePtr)pPointer, map, 5, + GetMotionHistory, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 2); + #ifdef XINPUT InitValuatorAxisStruct( pPointer, 0, // X axis @@ -643,8 +579,8 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) for (i = 0; i < pScreenInfo->numScreens; i++) { dixScreenOrigins[i].x -= darwinMainScreenX; dixScreenOrigins[i].y -= darwinMainScreenY; - ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); + /* ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", + i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); */ } } } @@ -725,10 +661,6 @@ void OsVendorInit(void) } darwinKeymapFile = tempStr; } - - if ( !darwinKeymapFile ) { - ErrorF("Reading keymap from the system.\n"); - } } @@ -926,7 +858,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( "Quitting XDarwin...\n" ); + ErrorF( "Quitting XQuartz...\n" ); DarwinModeGiveUp(); } @@ -949,7 +881,6 @@ void AbortDDX( void ) } -#ifdef DPMSExtension /* * DPMS extension stubs */ @@ -966,8 +897,6 @@ int DPMSGet(int *level) { return -1; } -#endif - #include "mivalidate.h" // for union _Validate used by windowstr.h #include "windowstr.h" // for struct _Window diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h index fc4a58a95..de104006c 100644 --- a/hw/darwin/darwin.h +++ b/hw/darwin/darwin.h @@ -48,7 +48,7 @@ typedef struct { // From darwin.c -void DarwinPrintBanner(); +void DarwinPrintBanner(void); int DarwinParseModifierList(const char *constmodifiers); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m index eb78fd32a..a79454b13 100644 --- a/hw/darwin/quartz/Preferences.m +++ b/hw/darwin/quartz/Preferences.m @@ -356,7 +356,7 @@ static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents"; [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange forKey:@"AllowMouseAccelChange"]; // Update the setting used by the X server thread - darwinMouseAccelChange = newMouseAccelChange; + // darwinMouseAccelChange = newMouseAccelChange; } + (void)setUseQDCursor:(int)newUseQDCursor diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m index c54c18acb..42eabcbae 100644 --- a/hw/darwin/quartz/quartzCocoa.m +++ b/hw/darwin/quartz/quartzCocoa.m @@ -66,7 +66,7 @@ void QuartzReadPreferences(void) darwinFakeButtons = [Preferences fakeButtons]; darwinFakeMouse2Mask = [Preferences button2Mask]; darwinFakeMouse3Mask = [Preferences button3Mask]; - darwinMouseAccelChange = [Preferences mouseAccelChange]; + // darwinMouseAccelChange = [Preferences mouseAccelChange]; quartzUseSysBeep = [Preferences systemBeep]; quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents]; From 321e0a21600e418bbeb164043a9a21a0ff80cbe9 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sun, 9 Sep 2007 16:28:41 -0700 Subject: [PATCH 65/81] fixed cut-and-paste typo --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f02ad6dfa..0025ecca0 100644 --- a/configure.ac +++ b/configure.ac @@ -1688,10 +1688,8 @@ AC_MSG_CHECKING([whether to build XDarwin (Mac OS X) DDX]) if test "x$XDARWIN" = xauto; then case $host_os in darwin*) XDARWIN="yes" ;; - *) XWIN="no" ;; + *) XDARWIN="no" ;; esac - XWIN_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $SHADOW_LIB" - AC_SUBST([XWIN_LIBS]) fi AC_MSG_RESULT([$XDARWIN]) From e8c73ac697aa472e10b4d8c093a715df0bf545af Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 11 Sep 2007 00:20:45 +0200 Subject: [PATCH 66/81] Xephyr: fix compilation breakage. * hw/kdrive/ephyr/ephyr_draw.c: (exaDDXDriverInit): pExaScr->hideOffscreenPixmapData does not exist anymore, so don't set it. --- hw/kdrive/ephyr/ephyr_draw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c index 84faecc00..93ef27ad3 100644 --- a/hw/kdrive/ephyr/ephyr_draw.c +++ b/hw/kdrive/ephyr/ephyr_draw.c @@ -520,6 +520,5 @@ exaDDXDriverInit(ScreenPtr pScreen) ExaScreenPriv(pScreen); pExaScr->migration = ExaMigrationSmart; - pExaScr->hideOffscreenPixmapData = TRUE; pExaScr->checkDirtyCorrectness = TRUE; } From 2e3e08d31e908ceadeef16d6069cdaf8c61d7ed1 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 11 Sep 2007 08:50:41 +0200 Subject: [PATCH 67/81] xserver: test presence of strlcpy in configure * configure.ac: define HAVE_STRLCPY when function strlcat is present this serves at least to unbreak libxtrans code compilation. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 0025ecca0..24b12dff1 100644 --- a/configure.ac +++ b/configure.ac @@ -186,6 +186,7 @@ AC_CHECK_FUNC([getpeerucred], AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) +AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) From a5b8053606d6e786cdcf6734f271acc05f9cc588 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 11 Sep 2007 11:37:06 -0400 Subject: [PATCH 68/81] Ignore - not just block - SIGALRM around Popen()/Pclose(). Because our "popen" implementation uses stdio, and because nobody's stdio library is capable of surviving signals, we need to make absolutely sure that we hide the SIGALRM from the smart scheduler. Otherwise, when you open a menu in openoffice, and it recompiles XKB to deal with the accelerators, and you popen xkbcomp because we suck, then the scheduler will tell you you're taking forever doing something stupid, and the wait() code will get confused, and input will hang and your CPU usage slams to 100%. Down, not across. --- os/utils.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/os/utils.c b/os/utils.c index 3bb7dbeba..afcaae41b 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1720,6 +1720,8 @@ static struct pid { int pid; } *pidlist; +static sighandler_t old_alarm = NULL; /* XXX horrible awful hack */ + pointer Popen(char *command, char *type) { @@ -1741,11 +1743,15 @@ Popen(char *command, char *type) return NULL; } + /* Ignore the smart scheduler while this is going on */ + old_alarm = signal(SIGALRM, SIG_IGN); + switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); xfree(cur); + signal(SIGALRM, old_alarm); return NULL; case 0: /* child */ if (setgid(getgid()) == -1) @@ -1921,6 +1927,8 @@ Pclose(pointer iop) /* allow EINTR again */ OsReleaseSignals (); + signal(SIGALRM, old_alarm); + return pid == -1 ? -1 : pstat; } From 43dc41034735d84765233a78bd619f3f0e7ace75 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 12 Sep 2007 01:43:37 +0200 Subject: [PATCH 69/81] Replace a non-ascii char with the corresponding groff escape in exa.man.pre --- hw/xfree86/exa/exa.man.pre | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/exa/exa.man.pre b/hw/xfree86/exa/exa.man.pre index b0eecd5cc..31e1cfe34 100644 --- a/hw/xfree86/exa/exa.man.pre +++ b/hw/xfree86/exa/exa.man.pre @@ -37,4 +37,4 @@ default is intended to be the best performing one for general use, though others may help with specific use cases. Available options include \*qalways\*q, \*qgreedy\*q, and \*qsmart\*q. Default: always. .SH AUTHORS -Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel Dänzer +Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer From 257c8ed17f4f908e0d0d5e53aaf13aa3b1313f50 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2007 12:11:49 +0100 Subject: [PATCH 70/81] Rewrite miPaintWindow to draw to window pixmap. miPaintWindow was drawing to the root window, or (sometimes) drawing to the window after smashing the window clip list. This is losing, and easily fixed by just drawing to the window pixmap. --- mi/miexpose.c | 242 ++++++++++---------------------------------------- 1 file changed, 46 insertions(+), 196 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index 8ae411835..e82a0b573 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -581,62 +581,49 @@ tossGC ( return 0; } - _X_EXPORT void -miPaintWindow(pWin, prgn, what) -WindowPtr pWin; -RegionPtr prgn; -int what; +miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { - int status; + ScreenPtr pScreen = pWin->drawable.pScreen; + ChangeGCVal gcval[5]; + BITS32 gcmask; + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + GCPtr pGC; + int i; + BoxPtr pbox; + xRectangle *prect; + int numRects; + int xoff, yoff; - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 + while (pWin->backgroundState == ParentRelative) + pWin = pWin->parent; - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - int i; - BoxPtr pbox; - ScreenPtr pScreen = pWin->drawable.pScreen; - xRectangle *prect; - int numRects; - - gcmask = 0; +#ifdef COMPOSITE + xoff = -pPixmap->screen_x; + yoff = -pPixmap->screen_y; +#else + xoff = 0; + yoff = 0; +#endif + gcval[0].val = GXcopy; + gcmask = GCFunction; if (what == PW_BACKGROUND) { switch (pWin->backgroundState) { case None: return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; + gcval[1].val = pWin->background.pixel; + gcval[2].val = FillSolid; gcmask |= GCForeground | GCFillStyle; break; case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; + gcval[1].val = FillTiled; + gcval[2].ptr = (pointer)pWin->background.pixmap; + gcval[3].val = pWin->drawable.x + xoff; + gcval[4].val = pWin->drawable.y + yoff; + gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; break; } } @@ -644,15 +631,17 @@ int what; { if (pWin->borderIsPixel) { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; + gcval[1].val = pWin->border.pixel; + gcval[2].val = FillSolid; gcmask |= GCForeground | GCFillStyle; } else { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; + gcval[1].val = FillTiled; + gcval[2].ptr = (pointer)pWin->border.pixmap; + gcval[3].val = pWin->drawable.x + xoff; + gcval[4].val = pWin->drawable.y + yoff; + gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } } @@ -661,169 +650,30 @@ int what; if (!prect) return; - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) + pGC = GetScratchGC(pPixmap->drawable.depth, pPixmap->drawable.pScreen); + if (!pGC) { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; + DEALLOCATE_LOCAL(prect); + return; } - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); + dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); + ValidateGC(&pPixmap->drawable, pGC); numRects = REGION_NUM_RECTS(prgn); pbox = REGION_RECTS(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; + prect->x = pbox->x1 + xoff; + prect->y = pbox->y1 + yoff; prect->width = pbox->x2 - pbox->x1; prect->height = pbox->y2 - pbox->y1; } prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); + (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, numRects, prect); DEALLOCATE_LOCAL(prect); - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } + FreeScratchGC(pGC); } From 6da39c67905500ab2db00a45cda4a9f756cdde96 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Sep 2007 13:23:13 +0000 Subject: [PATCH 71/81] Fix build on FreeBSD after Popen changes. --- os/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/utils.c b/os/utils.c index afcaae41b..144098b37 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1720,7 +1720,7 @@ static struct pid { int pid; } *pidlist; -static sighandler_t old_alarm = NULL; /* XXX horrible awful hack */ +void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */ pointer Popen(char *command, char *type) From dd3992eb86377684a5dbe86fa19c756a9e53cda2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2007 22:39:31 +0100 Subject: [PATCH 72/81] miPaintWindow draw to window for background. Instead of drawing to window pixmap for everything, draw to window for background as that works for Xnest and Xdmx; draw to pixmap for borders which neither of those X servers use. --- mi/miexpose.c | 94 ++++++++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index e82a0b573..ad1356f24 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -587,62 +587,72 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) ScreenPtr pScreen = pWin->drawable.pScreen; ChangeGCVal gcval[5]; BITS32 gcmask; - PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); GCPtr pGC; int i; BoxPtr pbox; xRectangle *prect; int numRects; - int xoff, yoff; + int tile_x_off = 0, tile_y_off = 0; + int draw_x_off = 0, draw_y_off = 0; + PixUnion fill; + Bool solid = TRUE; + DrawablePtr drawable = &pWin->drawable; + + draw_x_off = pWin->drawable.x; + draw_y_off = pWin->drawable.y; while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; -#ifdef COMPOSITE - xoff = -pPixmap->screen_x; - yoff = -pPixmap->screen_y; -#else - xoff = 0; - yoff = 0; -#endif - gcval[0].val = GXcopy; - gcmask = GCFunction; - if (what == PW_BACKGROUND) { + tile_x_off = -pWin->drawable.x; + tile_y_off = -pWin->drawable.y; + fill = pWin->background; switch (pWin->backgroundState) { case None: return; - case BackgroundPixel: - gcval[1].val = pWin->background.pixel; - gcval[2].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; case BackgroundPixmap: - gcval[1].val = FillTiled; - gcval[2].ptr = (pointer)pWin->background.pixmap; - gcval[3].val = pWin->drawable.x + xoff; - gcval[4].val = pWin->drawable.y + yoff; - gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; + solid = FALSE; break; } } else { - if (pWin->borderIsPixel) - { - gcval[1].val = pWin->border.pixel; - gcval[2].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - gcval[1].val = FillTiled; - gcval[2].ptr = (pointer)pWin->border.pixmap; - gcval[3].val = pWin->drawable.x + xoff; - gcval[4].val = pWin->drawable.y + yoff; - gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; - } + PixmapPtr pPixmap; + + /* servers without pixmaps draw their own borders */ + if (!pScreen->GetWindowPixmap) + return; + pPixmap = (*pScreen->GetWindowPixmap) (pWin); + drawable = &pPixmap->drawable; +#ifdef COMPOSITE + draw_x_off = -pPixmap->screen_x; + draw_y_off = -pPixmap->screen_y; +#else + draw_x_off = 0; + draw_y_off = 0; +#endif + fill = pWin->border; + solid = pWin->borderIsPixel; + } + + gcval[0].val = GXcopy; + gcmask = GCFunction; + + if (solid) + { + gcval[1].val = fill.pixel; + gcval[2].val = FillSolid; + gcmask |= GCForeground | GCFillStyle; + } + else + { + gcval[1].val = FillTiled; + gcval[2].ptr = (pointer)fill.pixmap; + gcval[3].val = tile_x_off + draw_x_off; + gcval[4].val = tile_y_off + draw_y_off; + gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * @@ -650,27 +660,27 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) if (!prect) return; - pGC = GetScratchGC(pPixmap->drawable.depth, pPixmap->drawable.pScreen); + pGC = GetScratchGC(drawable->depth, drawable->pScreen); if (!pGC) { DEALLOCATE_LOCAL(prect); return; } - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - ValidateGC(&pPixmap->drawable, pGC); + dixChangeGC (NullClient, pGC, gcmask, NULL, gcval); + ValidateGC (drawable, pGC); numRects = REGION_NUM_RECTS(prgn); pbox = REGION_RECTS(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { - prect->x = pbox->x1 + xoff; - prect->y = pbox->y1 + yoff; + prect->x = pbox->x1 + draw_x_off; + prect->y = pbox->y1 + draw_y_off; prect->width = pbox->x2 - pbox->x1; prect->height = pbox->y2 - pbox->y1; } prect -= numRects; - (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, numRects, prect); + (*pGC->ops->PolyFillRect)(drawable, pGC, numRects, prect); DEALLOCATE_LOCAL(prect); FreeScratchGC(pGC); From 06d27f8045966c1fb154eafaff308a01b93f265b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2007 23:57:30 +0100 Subject: [PATCH 73/81] Try again to fix drawable and tile offsets in miPaintWindow Many coordinate spaces are hard. Let's go drinking. --- mi/miexpose.c | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/mi/miexpose.c b/mi/miexpose.c index ad1356f24..2dc8f1508 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -592,22 +592,30 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) BoxPtr pbox; xRectangle *prect; int numRects; - int tile_x_off = 0, tile_y_off = 0; - int draw_x_off = 0, draw_y_off = 0; + /* + * Distance from screen to destination drawable, use this + * to adjust rendering coordinates which come in in screen space + */ + int draw_x_off, draw_y_off; + /* + * Tile offset for drawing; these need to align the tile + * to the appropriate window origin + */ + int tile_x_off, tile_y_off; PixUnion fill; Bool solid = TRUE; DrawablePtr drawable = &pWin->drawable; - draw_x_off = pWin->drawable.x; - draw_y_off = pWin->drawable.y; - while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; if (what == PW_BACKGROUND) { - tile_x_off = -pWin->drawable.x; - tile_y_off = -pWin->drawable.y; + draw_x_off = drawable->x; + draw_y_off = drawable->y; + + tile_x_off = 0; + tile_y_off = 0; fill = pWin->background; switch (pWin->backgroundState) { case None: @@ -619,16 +627,21 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) } else { - PixmapPtr pPixmap; + PixmapPtr pixmap; + tile_x_off = drawable->x; + tile_y_off = drawable->y; + /* servers without pixmaps draw their own borders */ if (!pScreen->GetWindowPixmap) return; - pPixmap = (*pScreen->GetWindowPixmap) (pWin); - drawable = &pPixmap->drawable; + pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); + drawable = &pixmap->drawable; #ifdef COMPOSITE - draw_x_off = -pPixmap->screen_x; - draw_y_off = -pPixmap->screen_y; + draw_x_off = pixmap->screen_x; + draw_y_off = pixmap->screen_y; + tile_x_off -= draw_x_off; + tile_y_off -= draw_y_off; #else draw_x_off = 0; draw_y_off = 0; @@ -650,8 +663,8 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { gcval[1].val = FillTiled; gcval[2].ptr = (pointer)fill.pixmap; - gcval[3].val = tile_x_off + draw_x_off; - gcval[4].val = tile_y_off + draw_y_off; + gcval[3].val = tile_x_off; + gcval[4].val = tile_y_off; gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } @@ -674,8 +687,8 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) pbox = REGION_RECTS(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { - prect->x = pbox->x1 + draw_x_off; - prect->y = pbox->y1 + draw_y_off; + prect->x = pbox->x1 - draw_x_off; + prect->y = pbox->y1 - draw_y_off; prect->width = pbox->x2 - pbox->x1; prect->height = pbox->y2 - pbox->y1; } From e4d11e58ce349dfe6af2f73ff341317f9b39684c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Sep 2007 13:58:46 +0000 Subject: [PATCH 74/81] Remove the PaintWindow optimization. This was an attempt to avoid scratch gc creation and validation for paintwin because that was expensive. This is not the case in current servers, and the danger of failure to implement it correctly (as seen in all previous implementations) is high enough to justify removing it. No performance difference detected with x11perf -create -move -resize -circulate on Xvfb. Leave the screen hooks for PaintWindow* in for now to avoid ABI change. --- Xext/mbufbf.c | 9 +- afb/Makefile.am | 2 +- afb/afb.h | 15 - afb/afbpntwin.c | 126 ---- afb/afbscrinit.c | 9 +- afb/afbwindow.c | 163 +---- cfb/Makefile.am.inc | 2 +- cfb/cfb.h | 37 - cfb/cfballpriv.c | 18 +- cfb/cfbmap.h | 6 - cfb/cfbpntwin.c | 768 --------------------- cfb/cfbscrinit.c | 4 +- cfb/cfbtile32.c | 2 +- cfb/cfbunmap.h | 3 - cfb/cfbwindow.c | 185 +---- composite/compinit.c | 4 - composite/compint.h | 4 - composite/compwindow.c | 17 +- dix/window.c | 2 +- exa/exa.c | 8 - exa/exa_accel.c | 48 -- exa/exa_priv.h | 8 - exa/exa_unaccel.c | 17 - fb/fb.h | 4 - fb/fboverlay.c | 11 - fb/fboverlay.h | 4 - fb/fbpseudocolor.c | 68 -- fb/fbscreen.c | 2 - fb/fbwindow.c | 55 -- fb/wfbrename.h | 2 - hw/darwin/quartz/quartz.c | 2 +- hw/darwin/quartz/xpr/xprScreen.c | 3 - hw/dmx/dmx.h | 2 - hw/dmx/dmxscrinit.c | 5 - hw/dmx/dmxwindow.c | 51 -- hw/dmx/dmxwindow.h | 4 - hw/kdrive/igs/igsdraw.c | 72 +- hw/kdrive/savage/s3.h | 1 - hw/kdrive/savage/s3draw.c | 118 ---- hw/kdrive/sis530/sisdraw.c | 73 +- hw/kdrive/src/kaa.c | 48 -- hw/kdrive/src/kasync.c | 10 - hw/kdrive/src/kdrive.h | 3 - hw/xfree86/rac/xf86RAC.c | 40 -- hw/xfree86/shadowfb/shadow.c | 42 -- hw/xfree86/xaa/Makefile.am | 2 +- hw/xfree86/xaa/xaa.h | 2 - hw/xfree86/xaa/xaaInit.c | 10 - hw/xfree86/xaa/xaaOverlay.c | 179 ----- hw/xfree86/xaa/xaaOverlayDF.c | 53 -- hw/xfree86/xaa/xaaPaintWin.c | 200 ------ hw/xfree86/xaa/xaaStateChange.c | 24 - hw/xfree86/xaa/xaaWrapper.c | 35 - hw/xfree86/xaa/xaalocal.h | 10 - hw/xfree86/xf1bpp/Makefile.am | 1 - hw/xfree86/xf1bpp/mfbmap.h | 1 - hw/xfree86/xf1bpp/mfbunmap.h | 1 - hw/xfree86/xf4bpp/Makefile.am | 1 - hw/xfree86/xf4bpp/ppcGC.c | 9 +- hw/xfree86/xf4bpp/ppcIO.c | 4 +- hw/xfree86/xf4bpp/ppcPntWin.c | 216 ------ hw/xfree86/xf4bpp/ppcWindow.c | 8 - hw/xfree86/xf4bpp/xf4bpp.h | 7 - hw/xfree86/xf8_32bpp/cfb8_32.h | 16 - hw/xfree86/xf8_32bpp/cfbpntwin.c | 129 ---- hw/xfree86/xf8_32bpp/cfbscrinit.c | 8 +- hw/xfree86/xf8_32bpp/cfbwindow.c | 5 - hw/xfree86/xf8_32bpp/xf86overlay.c | 65 -- hw/xgl/glx/xglx.c | 2 +- hw/xgl/xgl.h | 12 - hw/xgl/xglscreen.c | 2 - hw/xgl/xglwindow.c | 175 ----- hw/xnest/Screen.c | 2 - hw/xnest/Window.c | 24 - hw/xnest/XNWindow.h | 2 - hw/xprint/pcl/Pcl.h | 4 - hw/xprint/pcl/PclInit.c | 2 - hw/xprint/pcl/PclWindow.c | 226 ------ hw/xprint/pcl/Pclmap.h | 1 - hw/xprint/ps/Ps.h | 1 - hw/xprint/ps/PsInit.c | 2 - hw/xprint/ps/PsWindow.c | 224 ------ hw/xwin/win.h | 13 - hw/xwin/winpntwin.c | 47 -- hw/xwin/winscrinit.c | 2 - include/scrnintstr.h | 4 +- mfb/Makefile.am | 2 +- mfb/mfb.h | 20 - mfb/mfbpntwin.c | 126 ---- mfb/mfbscrinit.c | 19 +- mfb/mfbwindow.c | 176 +---- mi/mibank.c | 71 -- mi/miexpose.c | 60 +- mi/mioverlay.c | 20 +- mi/miscrinit.c | 2 +- mi/miwindow.c | 6 +- miext/cw/cw.c | 147 ---- miext/cw/cw.h | 2 - miext/damage/damage.c | 33 - miext/damage/damagestr.h | 2 - miext/rootless/rootlessCommon.h | 2 - miext/rootless/rootlessScreen.c | 2 - miext/rootless/rootlessWindow.c | 98 +-- miext/rootless/rootlessWindow.h | 4 - miext/rootless/safeAlpha/Makefile.am | 3 +- miext/rootless/safeAlpha/safeAlpha.h | 2 - miext/rootless/safeAlpha/safeAlphaWindow.c | 177 ----- 107 files changed, 62 insertions(+), 4720 deletions(-) delete mode 100644 afb/afbpntwin.c delete mode 100644 cfb/cfbpntwin.c delete mode 100644 hw/xfree86/xaa/xaaPaintWin.c delete mode 100644 hw/xfree86/xf4bpp/ppcPntWin.c delete mode 100644 hw/xwin/winpntwin.c delete mode 100644 mfb/mfbpntwin.c delete mode 100644 miext/rootless/safeAlpha/safeAlphaWindow.c diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c index e29c974a3..b879abcb0 100644 --- a/Xext/mbufbf.c +++ b/Xext/mbufbf.c @@ -504,7 +504,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) REGION_INTERSECT(pScreen, ®, ®, &pBuffer->clipList); if (pBuffer->backgroundState != None) - (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); + miPaintWindow(pBuffer, ®, PW_BACKGROUND); if (generateExposures) MultibufferExpose(pMBBuffer, ®); #ifdef _notdef @@ -517,7 +517,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) if (generateExposures) (*pScreen->WindowExposures)(pBuffer, ®, pBSReg); else if (pBuffer->backgroundState != None) - (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); + miPaintWindow(pBuffer, ®, PW_BACKGROUND); #endif REGION_UNINIT(pScreen, ®); if (pBSReg) @@ -836,8 +836,7 @@ bufClipNotify(pWin, dx,dy) /* * Updates buffer's background fields when the window's changes. - * This is necessary because pScreen->PaintWindowBackground - * is used to paint the buffer. + * This is necessary because miPaintWindow is used to paint the buffer. * * XXBS - Backingstore state will have be tracked too if it is supported. */ @@ -927,7 +926,7 @@ bufWindowExposures(pWin, prgn, other_exposed) pBuffer = (BufferPtr) pMBBuffer->pDrawable; if (i != pMBWindow->displayedMultibuffer) - (* pScreen->PaintWindowBackground)(pBuffer,&tmp_rgn,PW_BACKGROUND); + miPaintWindow(pBuffer, &tmp_rgn, PW_BACKGROUND); if ((pMBBuffer->otherEventMask | pMBBuffer->eventMask) & ExposureMask) MultibufferExpose(pMBBuffer, &tmp_rgn); } diff --git a/afb/Makefile.am b/afb/Makefile.am index d6b8901a1..9fc22ca54 100644 --- a/afb/Makefile.am +++ b/afb/Makefile.am @@ -6,7 +6,7 @@ libafb_gen_sources = afbbltC.c afbbltX.c afbbltCI.c afbbltO.c afbbltG.c afbtileC DISTCLEANFILES = $(libafb_gen_sources) -libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpntwin.c afbpixmap.c \ +libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpixmap.c \ afbimage.c afbline.c afbbres.c afbhrzvert.c afbbresd.c afbpushpxl.c afbply1rct.c \ afbzerarc.c afbfillarc.c afbfillsp.c afbsetsp.c afbscrinit.c afbplygblt.c \ afbclip.c afbgetsp.c afbpolypnt.c afbbitblt.c afbcmap.c afbimggblt.c afbpntarea.c \ diff --git a/afb/afb.h b/afb/afb.h index 9125951b3..943c2c68a 100644 --- a/afb/afb.h +++ b/afb/afb.h @@ -506,11 +506,6 @@ extern void afbCopyRotatePixmap( int /*xrot*/, int /*yrot*/ ); -extern void afbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* afbpolypnt.c */ extern void afbPolyPoint( @@ -744,16 +739,6 @@ extern int frameWindowPrivateIndex; /* index into Window private array */ #define afbGetGCPrivate(pGC) \ ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr)) -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; -} afbPrivWin; - /* Common macros for extracting drawing information */ #define afbGetTypedWidth(pDrawable,wtype)( \ diff --git a/afb/afbpntwin.c b/afb/afbpntwin.c deleted file mode 100644 index 6082f7caa..000000000 --- a/afb/afbpntwin.c +++ /dev/null @@ -1,126 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -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 -X CONSORTIUM 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 X Consortium 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 X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "afb.h" -#include "maskbits.h" -#include "mi.h" - -void -afbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register afbPrivWin *pPrivWin; - unsigned char rrops[AFB_MAX_DEPTH]; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) { - afbTileAreaPPWCopy((DrawablePtr)pWin, - REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground, ~0); - return; - } else { - afbTileAreaCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pWin->background.pixmap, 0, 0, ~0); - return; - } - break; - case BackgroundPixel: - afbReduceRop(GXcopy, pWin->background.pixel, ~0, - pWin->drawable.depth, rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - afbReduceRop(GXcopy, pWin->border.pixel, ~0, pWin->drawable.depth, - rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } else if (pPrivWin->fastBorder) { - afbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder, ~0); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c index 71e8d4c1e..f3a054268 100644 --- a/afb/afbscrinit.c +++ b/afb/afbscrinit.c @@ -71,7 +71,6 @@ SOFTWARE. #ifdef PIXMAP_PER_WINDOW int frameWindowPrivateIndex; #endif -int afbWindowPrivateIndex; int afbGCPrivateIndex; int afbScreenPrivateIndex; @@ -140,20 +139,16 @@ afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex) #ifdef PIXMAP_PER_WINDOW frameWindowPrivateIndex = AllocateWindowPrivateIndex(); #endif - afbWindowPrivateIndex = AllocateWindowPrivateIndex(); afbGCPrivateIndex = AllocateGCPrivateIndex(); afbGeneration = serverGeneration; } - if (pWinIndex) - *pWinIndex = afbWindowPrivateIndex; if (pGCIndex) *pGCIndex = afbGCPrivateIndex; afbScreenPrivateIndex = AllocateScreenPrivateIndex(); pScreen->GetWindowPixmap = afbGetWindowPixmap; pScreen->SetWindowPixmap = afbSetWindowPixmap; - return(AllocateWindowPrivate(pScreen, afbWindowPrivateIndex, sizeof(afbPrivWin)) && - AllocateGCPrivate(pScreen, afbGCPrivateIndex, sizeof(afbPrivGC))); + return(AllocateGCPrivate(pScreen, afbGCPrivateIndex, sizeof(afbPrivGC))); } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ @@ -198,8 +193,6 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i pScreen->ChangeWindowAttributes = afbChangeWindowAttributes; pScreen->RealizeWindow = afbMapWindow; pScreen->UnrealizeWindow = afbUnmapWindow; - pScreen->PaintWindowBackground = afbPaintWindow; - pScreen->PaintWindowBorder = afbPaintWindow; pScreen->CopyWindow = afbCopyWindow; pScreen->CreatePixmap = afbCreatePixmap; pScreen->DestroyPixmap = afbDestroyPixmap; diff --git a/afb/afbwindow.c b/afb/afbwindow.c index a4a1602bc..5c2f18aea 100644 --- a/afb/afbwindow.c +++ b/afb/afbwindow.c @@ -62,39 +62,16 @@ SOFTWARE. #include "maskbits.h" Bool -afbCreateWindow(pWin) - register WindowPtr pWin; +afbCreateWindow(WindowPtr pWin) { - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; -#ifdef PIXMAP_PER_WINDOW - pWin->devPrivates[frameWindowPrivateIndex].ptr = - pWin->pDrawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; -#endif - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -afbDestroyWindow(pWin) - WindowPtr pWin; +afbDestroyWindow(WindowPtr pWin) { - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); - return (TRUE); } @@ -106,46 +83,10 @@ afbMapWindow(pWindow) return (TRUE); } -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - afbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ - /*ARGSUSED*/ Bool -afbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +afbPositionWindow(WindowPtr pWin, int x, int y) { - register afbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) { - afbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -215,104 +156,8 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc) REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ Bool -afbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; +afbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register afbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) { - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) { - index = lowbit (mask); - mask &= ~index; - switch(index) { - case CWBackPixmap: - if (pWin->backgroundState == None) - pPrivWin->fastBackground = FALSE; - else if (pWin->backgroundState == ParentRelative) { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) { - afbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, pWin->drawable.y); - if (pPrivWin->pRotatedBackground) { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } else - pPrivWin->fastBackground = FALSE; - } else - pPrivWin->fastBackground = FALSE; - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } else - pPrivWin->fastBorder = FALSE; - } else - pPrivWin->fastBorder = FALSE; - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ return (TRUE); } diff --git a/cfb/Makefile.am.inc b/cfb/Makefile.am.inc index 5aa913aee..a2ee143aa 100644 --- a/cfb/Makefile.am.inc +++ b/cfb/Makefile.am.inc @@ -8,7 +8,7 @@ DISTCLEANFILES = $(libcfb_gen_sources) CFB_INCLUDES = -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb libcfb_common_sources = $(top_srcdir)/cfb/cfbgc.c $(top_srcdir)/cfb/cfbrrop.c \ - $(top_srcdir)/cfb/cfbwindow.c $(top_srcdir)/cfb/cfbpntwin.c \ + $(top_srcdir)/cfb/cfbwindow.c \ $(top_srcdir)/cfb/cfbmskbits.c $(top_srcdir)/cfb/cfbpixmap.c \ $(top_srcdir)/cfb/cfbbitblt.c $(top_srcdir)/cfb/cfbfillsp.c \ $(top_srcdir)/cfb/cfbsetsp.c $(top_srcdir)/cfb/cfbscrinit.c \ diff --git a/cfb/cfb.h b/cfb/cfb.h index 5614f4f31..c9ceda9e8 100644 --- a/cfb/cfb.h +++ b/cfb/cfb.h @@ -56,7 +56,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ extern int cfbGCPrivateIndex; -extern int cfbWindowPrivateIndex; /* private field of GC */ typedef struct { @@ -81,20 +80,6 @@ typedef struct { CfbBits xor, and; } cfbRRopRec, *cfbRRopPtr; -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } cfbPrivWin; - -#define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\ - (_pWin)->devPrivates[cfbWindowPrivateIndex].ptr) - - /* cfb8bit.c */ extern int cfbSetStipple( @@ -313,7 +298,6 @@ extern int cfb8SegmentSS1RectXor( extern Bool cfbAllocatePrivates( ScreenPtr /*pScreen*/, - int * /*window_index*/, int * /*gc_index*/ ); /* cfbbitblt.c */ @@ -806,27 +790,6 @@ extern void cfbFillPoly1RectGeneral( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* cfbpntwin.c */ - -extern void cfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); - -extern void cfbFillBoxSolid( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - unsigned long /*pixel*/ -); - -extern void cfbFillBoxTile32( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/ -); /* cfbpolypnt.c */ extern void cfbPolyPoint( diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c index e0ccdf4d0..858ff6061 100644 --- a/cfb/cfballpriv.c +++ b/cfb/cfballpriv.c @@ -45,7 +45,6 @@ in this Software without prior written authorization from The Open Group. #include "mibstore.h" #if 1 || PSZ==8 -int cfbWindowPrivateIndex = -1; int cfbGCPrivateIndex = -1; #endif #ifdef CFB_NEED_SCREEN_PRIVATE @@ -55,29 +54,20 @@ static unsigned long cfbGeneration = 0; Bool -cfbAllocatePrivates(pScreen, window_index, gc_index) - ScreenPtr pScreen; - int *window_index, *gc_index; +cfbAllocatePrivates(ScreenPtr pScreen, int *gc_index) { - if (!window_index || !gc_index || - (*window_index == -1 && *gc_index == -1)) + if (!gc_index || *gc_index == -1) { - if (!mfbAllocatePrivates(pScreen, - &cfbWindowPrivateIndex, &cfbGCPrivateIndex)) + if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex)) return FALSE; - if (window_index) - *window_index = cfbWindowPrivateIndex; if (gc_index) *gc_index = cfbGCPrivateIndex; } else { - cfbWindowPrivateIndex = *window_index; cfbGCPrivateIndex = *gc_index; } - if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, - sizeof(cfbPrivWin)) || - !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) + if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) return FALSE; #ifdef CFB_NEED_SCREEN_PRIVATE if (cfbGeneration != serverGeneration) diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h index 1d6a3f850..2e709b19d 100644 --- a/cfb/cfbmap.h +++ b/cfb/cfbmap.h @@ -71,8 +71,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbDoBitbltGeneral #undef cfbDoBitbltOr #undef cfbDoBitbltXor -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -108,7 +106,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect @@ -250,8 +247,6 @@ cfb can not hack PSZ yet #define cfbDoBitbltOr CFBNAME(DoBitbltOr) #define cfbDoBitbltXor CFBNAME(DoBitbltXor) #define cfbExpandDirectColors CFBNAME(cfbExpandDirectColors) -#define cfbFillBoxSolid CFBNAME(FillBoxSolid) -#define cfbFillBoxTile32 CFBNAME(FillBoxTile32) #define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy) #define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral) #define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd) @@ -288,7 +283,6 @@ cfb can not hack PSZ yet #define cfbNonTEOps CFBNAME(NonTEOps) #define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect) #define cfbPadPixmap CFBNAME(PadPixmap) -#define cfbPaintWindow CFBNAME(PaintWindow) #define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy) #define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral) #define cfbPolyFillRect CFBNAME(PolyFillRect) diff --git a/cfb/cfbpntwin.c b/cfb/cfbpntwin.c deleted file mode 100644 index 32f011e23..000000000 --- a/cfb/cfbpntwin.c +++ /dev/null @@ -1,768 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "mi.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -cfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register cfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBackground); - } - else - { - int xorg = pWin->drawable.x; - int yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixmap, - xorg, yorg); - } - break; - case BackgroundPixel: - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } - else if (pPrivWin->fastBorder) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBorder); - } - else - { - int xorg, yorg; - - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixmap, - xorg, yorg); - } - break; - } -} - -/* - * Use the RROP macros in copy mode - */ - -#define RROP GXcopy -#include "cfbrrop.h" - -#ifdef RROP_UNROLL -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & RROP_UNROLL_MASK; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= RROP_UNROLL_SHIFT; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += RROP_UNROLL; \ - RROP_UNROLL_LOOP(pdst) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} - -#else -# define Expand(left, right, leftAdjust) { \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - while (h--) { \ - left \ - m = nmiddle; \ - while (m--) {\ - RROP_SOLID(pdst); \ - pdst++; \ - } \ - right \ - pdst += widthStep; \ - } \ -} -#endif - -void -cfbFillBoxSolid (pDrawable, nBox, pBox, pixel) - DrawablePtr pDrawable; - int nBox; - BoxPtr pBox; - unsigned long pixel; -{ - CfbBits *pdstBase; - int widthDst; - register int h; - register CfbBits *pdst; - int nmiddle; - int w; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; /*upper left corner*/ - - piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24); - piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); - piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16); -#else - register CfbBits rrop_xor; - register CfbBits leftMask, rightMask; - register int m; -#endif - - cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase); - -#if PSZ != 24 - rrop_xor = PFILL(pixel); -#endif - for (; nBox; nBox--, pBox++) - { - pdst = pdstBase + pBox->y1 * widthDst; - h = pBox->y2 - pBox->y1; - w = pBox->x2 - pBox->x1; -#if PSZ == 8 - if (w == 1) - { - register char *pdstb = ((char *) pdst) + pBox->x1; - int incr = widthDst * PGSZB; - - while (h--) - { - *pdstb = rrop_xor; - pdstb += incr; - } - } - else - { -#endif -#if PSZ == 24 -/* _Box has x1, y1, x2, y2*/ - leftIndex = pBox->x1 & 3; - rightIndex = ((leftIndex+w)<5)?0:(pBox->x2 &3); - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + pBox->y1 * widthDst + ((pBox->x1*3) >> 2); - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; -/* maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);*/ - while(h--){ - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - - } - } -#else - pdst += (pBox->x1 >> PWSH); - if ((pBox->x1 & PIM) + w <= PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - while (h--) { - *pdst = (*pdst & ~leftMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits (pBox->x1, w, leftMask, rightMask, nmiddle); - if (leftMask) - { - if (rightMask) - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++; , - RROP_SOLID_MASK (pdst, rightMask); , - 1) - } - else - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (;, - RROP_SOLID_MASK (pdst, rightMask);, - 0) - } - else - { - Expand (;, - ;, - 0) - } - } - } -#endif -#if PSZ == 8 - } -#endif - } -} - -void -cfbFillBoxTile32 (pDrawable, nBox, pBox, tile) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* rotated, expanded tile */ -{ - register CfbBits *pdst; - CfbBits *psrc; - int tileHeight; - - int widthDst; - int w; - int h; - int nmiddle; - int y; - int srcy; - - CfbBits *pdstBase; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; -#else - register CfbBits rrop_xor; - register CfbBits leftMask; - register CfbBits rightMask; - register int m; -#endif - - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase); - - while (nBox--) - { -#if PSZ == 24 - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - leftIndex = pBox->x1 & 3; -/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/ - rightIndex = pBox->x2 &3; - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + ((pBox->x1 *3)>> 2) + pBox->y1 * widthDst; - srcy = y % tileHeight; - -#define StepTile piQxelArray[0] = (psrc[srcy] & 0xFFFFFF) | ((psrc[srcy] & 0xFF)<<24); \ - piQxelArray[1] = (psrc[srcy] & 0xFFFF00) | ((psrc[srcy] & 0xFFFF)<<16); \ - piQxelArray[2] = ((psrc[srcy] & 0xFF0000)>>16) | \ - ((psrc[srcy] & 0xFFFFFF)<<8); \ - /*rrop_xor = psrc[srcy];*/ \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - StepTile - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; - - while(h--){ - StepTile - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - } - } -#else - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - pdst = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); - srcy = y % tileHeight; - -#define StepTile rrop_xor = psrc[srcy]; \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - if ( ((pBox->x1 & PIM) + w) < PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - rightMask = ~leftMask; - while (h--) - { - StepTile - *pdst = (*pdst & rightMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits(pBox->x1, w, leftMask, rightMask, nmiddle); - - if (leftMask) - { - if (rightMask) - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - RROP_SOLID_MASK(pdst, rightMask);, - 1) - } - else - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (StepTile - , - RROP_SOLID_MASK(pdst, rightMask);, - 0) - } - else - { - Expand (StepTile - , - ;, - 0) - } - } - } -#endif - pBox++; - } -} diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c index 83f5cf0a2..ddfb41e6b 100644 --- a/cfb/cfbscrinit.c +++ b/cfb/cfbscrinit.c @@ -88,7 +88,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) + if (!cfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ @@ -103,8 +103,6 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes; pScreen->RealizeWindow = cfbMapWindow; pScreen->UnrealizeWindow = cfbUnmapWindow; - pScreen->PaintWindowBackground = cfbPaintWindow; - pScreen->PaintWindowBorder = cfbPaintWindow; pScreen->CopyWindow = cfbCopyWindow; pScreen->CreatePixmap = cfbCreatePixmap; pScreen->DestroyPixmap = cfbDestroyPixmap; diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c index fb6a10613..90439adc3 100644 --- a/cfb/cfbtile32.c +++ b/cfb/cfbtile32.c @@ -1,5 +1,5 @@ /* - * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. + * Fill 32 bit tiled rectangles. Used by PolyFillRect. * no depth dependencies. */ diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h index 61c7fc942..d15c23e30 100644 --- a/cfb/cfbunmap.h +++ b/cfb/cfbunmap.h @@ -74,8 +74,6 @@ #undef cfbDoBitbltOr #undef cfbDoBitbltXor #undef cfbExpandDirectColors -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -112,7 +110,6 @@ #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c index e04b73df2..c4f027b08 100644 --- a/cfb/cfbwindow.c +++ b/cfb/cfbwindow.c @@ -60,19 +60,8 @@ SOFTWARE. #include "cfbmskbits.h" Bool -cfbCreateWindow(pWin) - WindowPtr pWin; +cfbCreateWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pPrivWin->oldRotate.x = 0; - pPrivWin->oldRotate.y = 0; - #ifdef PIXMAP_PER_WINDOW /* Setup pointer to Screen pixmap */ pWin->devPrivates[frameWindowPrivateIndex].ptr = @@ -83,17 +72,8 @@ cfbCreateWindow(pWin) } Bool -cfbDestroyWindow(pWin) - WindowPtr pWin; +cfbDestroyWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return(TRUE); } @@ -105,47 +85,10 @@ cfbMapWindow(pWindow) return(TRUE); } -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - cfbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ /*ARGSUSED*/ Bool -cfbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +cfbPositionWindow(WindowPtr pWin, int x, int y) { - cfbPrivWin *pPrivWin; - int setxy = 0; - - pPrivWin = cfbGetWindowPrivate(pWin); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - cfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - if (setxy) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } return (TRUE); } @@ -209,129 +152,9 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivates[cfbWindowPrivateIndex].ptr. -*/ Bool -cfbChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; +cfbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register cfbPrivWin *pPrivWin; - int width; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if (((width = (pWin->background.pixmap->drawable.width * PSZ)) - <= PGSZ) && !(width & (width - 1))) - { - cfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if (((width = (pWin->border.pixmap->drawable.width * PSZ)) <= PGSZ) && - !(width & (width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } return (TRUE); } diff --git a/composite/compinit.c b/composite/compinit.c index c557eebc4..5f09fe2a4 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -70,7 +70,6 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->ChangeBorderWidth = cs->ChangeBorderWidth; pScreen->ClipNotify = cs->ClipNotify; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; pScreen->UnrealizeWindow = cs->UnrealizeWindow; pScreen->RealizeWindow = cs->RealizeWindow; pScreen->DestroyWindow = cs->DestroyWindow; @@ -431,9 +430,6 @@ compScreenInit (ScreenPtr pScreen) cs->UnrealizeWindow = pScreen->UnrealizeWindow; pScreen->UnrealizeWindow = compUnrealizeWindow; - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; - cs->ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = compClipNotify; diff --git a/composite/compint.h b/composite/compint.h index f69595ccc..535e1a423 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -123,7 +123,6 @@ typedef struct _CompScreen { DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; - PaintWindowProcPtr PaintWindowBackground; ClipNotifyProcPtr ClipNotify; /* * Called from ConfigureWindow, these @@ -255,9 +254,6 @@ compRealizeWindow (WindowPtr pWin); Bool compUnrealizeWindow (WindowPtr pWin); -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what); - void compClipNotify (WindowPtr pWin, int dx, int dy); diff --git a/composite/compwindow.c b/composite/compwindow.c index bfd29460b..579236713 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -99,7 +99,7 @@ compRepaintBorder (ClientPtr pClient, pointer closure) REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize); - (*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER); + miPaintWindow(pWindow, &exposed, PW_BORDER); REGION_UNINIT(pScreen, &exposed); } return TRUE; @@ -240,21 +240,6 @@ compUnrealizeWindow (WindowPtr pWin) return ret; } -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - CompSubwindowsPtr csw = GetCompSubwindows (pWin); - CompScreenPtr cs = GetCompScreen (pScreen); - - if (csw && csw->update == CompositeRedirectManual) - return; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; -} - /* * Called after the borderClip for the window has settled down * We use this to make sure our extra borderClip has the right origin diff --git a/dix/window.c b/dix/window.c index ca4335c7b..717c5a7ec 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1522,7 +1522,7 @@ PatchUp: REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); + miPaintWindow(pWin, &exposed, PW_BORDER); REGION_UNINIT(pScreen, &exposed); } return error; diff --git a/exa/exa.c b/exa/exa.c index 458272daf..eac2d91ce 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -604,8 +604,6 @@ exaCloseScreen(int i, ScreenPtr pScreen) pScreen->CloseScreen = pExaScr->SavedCloseScreen; pScreen->GetImage = pExaScr->SavedGetImage; pScreen->GetSpans = pExaScr->SavedGetSpans; - pScreen->PaintWindowBackground = pExaScr->SavedPaintWindowBackground; - pScreen->PaintWindowBorder = pExaScr->SavedPaintWindowBorder; pScreen->CreatePixmap = pExaScr->SavedCreatePixmap; pScreen->DestroyPixmap = pExaScr->SavedDestroyPixmap; pScreen->CopyWindow = pExaScr->SavedCopyWindow; @@ -759,12 +757,6 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion; pScreen->BitmapToRegion = exaBitmapToRegion; - pExaScr->SavedPaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = exaPaintWindow; - - pExaScr->SavedPaintWindowBorder = pScreen->PaintWindowBorder; - pScreen->PaintWindowBorder = exaPaintWindow; - #ifdef RENDER if (ps) { pExaScr->SavedComposite = ps->Composite; diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 232ec9934..8500c5b7c 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1304,54 +1304,6 @@ fallback: return TRUE; } -void -exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ExaScreenPriv (pWin->drawable.pScreen); - - if (REGION_NIL(pRegion)) - return; - - if (!pExaScr->swappedOut) { - DDXPointRec zeros = { 0, 0 }; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel, - FB_ALLONES, GXcopy); - return; - case BackgroundPixmap: - exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap, - &zeros, FB_ALLONES, GXcopy); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel, - FB_ALLONES, GXcopy); - return; - } else { - exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap, - &zeros, FB_ALLONES, GXcopy); - return; - } - break; - } - } - ExaCheckPaintWindow (pWin, pRegion, what); -} /** * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory. diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 02371d7d8..9e4f8bc52 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -101,10 +101,8 @@ typedef struct { CloseScreenProcPtr SavedCloseScreen; GetImageProcPtr SavedGetImage; GetSpansProcPtr SavedGetSpans; - PaintWindowBackgroundProcPtr SavedPaintWindowBackground; CreatePixmapProcPtr SavedCreatePixmap; DestroyPixmapProcPtr SavedDestroyPixmap; - PaintWindowBorderProcPtr SavedPaintWindowBorder; CopyWindowProcPtr SavedCopyWindow; ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; BitmapToRegionProcPtr SavedBitmapToRegion; @@ -272,9 +270,6 @@ ExaCheckGetSpans (DrawablePtr pDrawable, int nspans, char *pdstStart); -void -ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); - CARD32 exaGetPixmapFirstPixel (PixmapPtr pPixmap); @@ -296,9 +291,6 @@ Bool exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu); -void -exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - void exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index f4d453eaa..d487dc5f2 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -278,23 +278,6 @@ ExaCheckGetSpans (DrawablePtr pDrawable, exaFinishAccess (pDrawable, EXA_PREPARE_SRC); } -/* XXX: Note the lack of a prepare on the tile, if the window has a tiled - * background. This function happens to only be called if pExaScr->swappedOut, - * so we actually end up not having to do it since the tile won't be in fb. - * That doesn't make this not dirty, though. - */ -void -ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what) -{ - EXA_FALLBACK(("from %p (%c)\n", pWin, - exaDrawableLocation(&pWin->drawable))); - exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST); - exaPrepareAccessWindow(pWin); - fbPaintWindow (pWin, pRegion, what); - exaFinishAccessWindow(pWin); - exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST); -} - void ExaCheckComposite (CARD8 op, PicturePtr pSrc, diff --git a/fb/fb.h b/fb/fb.h index a924f49ad..379a00a34 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -2094,10 +2094,6 @@ fbFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile); -void -fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - - pixman_image_t *image_from_pict (PicturePtr pict, Bool has_clip); void free_pixman_pict (PicturePtr, pixman_image_t *); diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 5d7481eed..0d1eb88eb 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -278,16 +278,6 @@ fbOverlayWindowExposures (WindowPtr pWin, miWindowExposures(pWin, prgn, other_exposed); } -void -fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - if (what == PW_BORDER) - fbOverlayUpdateLayerRegion (pWin->drawable.pScreen, - fbOverlayWindowLayer (pWin), - pRegion); - fbPaintWindow (pWin, pRegion, what); -} - Bool fbOverlaySetupScreen(ScreenPtr pScreen, pointer pbits1, @@ -441,7 +431,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->CopyWindow = fbOverlayCopyWindow; - pScreen->PaintWindowBorder = fbOverlayPaintWindow; #ifdef FB_24_32BIT if (bpp == 24 && imagebpp == 32) { diff --git a/fb/fboverlay.h b/fb/fboverlay.h index af0acb889..55135ea4e 100644 --- a/fb/fboverlay.h +++ b/fb/fboverlay.h @@ -93,10 +93,6 @@ fbOverlayWindowExposures (WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed); -void -fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - - Bool fbOverlaySetupScreen(ScreenPtr pScreen, pointer pbits1, diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c index 271e98145..411bde1dc 100644 --- a/fb/fbpseudocolor.c +++ b/fb/fbpseudocolor.c @@ -94,8 +94,6 @@ typedef struct { CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; CopyWindowProcPtr CopyWindow; - PaintWindowProcPtr PaintWindowBackground; - PaintWindowProcPtr PaintWindowBorder; WindowExposuresProcPtr WindowExposures; CreateGCProcPtr CreateGC; CreateColormapProcPtr CreateColormap; @@ -794,70 +792,6 @@ xxWindowExposures (WindowPtr pWin, wrap(pScrPriv, pWin->drawable.pScreen, WindowExposures, xxWindowExposures); } -static void -xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xxScrPriv(pWin->drawable.pScreen); - RegionRec rgni; - - DBG("xxPaintWindow\n"); - - REGION_NULL (pWin->drawable.pScreen, &rgni); -#if 0 - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, &pWin->borderClip); - REGION_INTERSECT(pWin->drawable.pScreen, &rgni, &rgni, pRegion); -#else - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, pRegion); -#endif - switch (what) { - case PW_BORDER: - REGION_SUBTRACT (pWin->drawable.pScreen, &rgni, &rgni, &pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBorder\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBorder NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder); - pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBorder, - xxPaintWindow); - break; - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - default: - REGION_INTERSECT (pWin->drawable.pScreen, &rgni, - &rgni,&pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBackground\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBackground NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } - break; - } - - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBackground); - pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBackground, - xxPaintWindow); - break; - } - PRINT_RECTS(rgni); - PRINT_RECTS(pScrPriv->region); -#if 1 - REGION_UNINIT(pWin->drawable.pScreen,&rgni); -#endif -} - static void xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, xxCmapPrivPtr pCmapPriv) @@ -1171,8 +1105,6 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy wrap (pScrPriv, pScreen, CreateScreenResources, xxCreateScreenResources); wrap (pScrPriv, pScreen, CreateWindow, xxCreateWindow); wrap (pScrPriv, pScreen, CopyWindow, xxCopyWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, xxPaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBackground, xxPaintWindow); #if 0 /* can we leave this out even with backing store enabled ? */ wrap (pScrPriv, pScreen, WindowExposures, xxWindowExposures); #endif diff --git a/fb/fbscreen.c b/fb/fbscreen.c index 661268c74..41bef4739 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -122,8 +122,6 @@ fbSetupScreen(ScreenPtr pScreen, pScreen->ChangeWindowAttributes = fbChangeWindowAttributes; pScreen->RealizeWindow = fbMapWindow; pScreen->UnrealizeWindow = fbUnmapWindow; - pScreen->PaintWindowBackground = fbPaintWindow; - pScreen->PaintWindowBorder = fbPaintWindow; pScreen->CopyWindow = fbCopyWindow; pScreen->CreatePixmap = fbCreatePixmap; pScreen->DestroyPixmap = fbDestroyPixmap; diff --git a/fb/fbwindow.c b/fb/fbwindow.c index 144f08362..602b7e0dc 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -315,58 +315,3 @@ fbFillRegionTiled (DrawablePtr pDrawable, fbFinishAccess (&pTile->drawable); fbFinishAccess (pDrawable); } - -void -fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - WindowPtr pBgWin; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - fbFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap); - break; - case BackgroundPixel: - fbFillRegionSolid (&pWin->drawable, - pRegion, - 0, - fbReplicatePixel (pWin->background.pixel, - pWin->drawable.bitsPerPixel)); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - fbFillRegionSolid (&pWin->drawable, - pRegion, - 0, - fbReplicatePixel (pWin->border.pixel, - pWin->drawable.bitsPerPixel)); - } - else - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - fbFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap); - } - break; - } - fbValidateDrawable (&pWin->drawable); -} diff --git a/fb/wfbrename.h b/fb/wfbrename.h index 5ea9092f8..93ce41baf 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -119,14 +119,12 @@ #define fbOverlayGeneration wfbOverlayGeneration #define fbOverlayGetScreenPrivateIndex wfbOverlayGetScreenPrivateIndex #define fbOverlayPaintKey wfbOverlayPaintKey -#define fbOverlayPaintWindow wfbOverlayPaintWindow #define fbOverlayScreenPrivateIndex wfbOverlayScreenPrivateIndex #define fbOverlaySetupScreen wfbOverlaySetupScreen #define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion #define fbOverlayWindowExposures wfbOverlayWindowExposures #define fbOverlayWindowLayer wfbOverlayWindowLayer #define fbPadPixmap wfbPadPixmap -#define fbPaintWindow wfbPaintWindow #define fbPictureInit wfbPictureInit #define fbPixmapToRegion wfbPixmapToRegion #define fbPolyArc wfbPolyArc diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c index 038b21eff..b309b7b2c 100644 --- a/hw/darwin/quartz/quartz.c +++ b/hw/darwin/quartz/quartz.c @@ -217,7 +217,7 @@ static void QuartzUpdateScreens(void) pRoot = WindowTable[pScreen->myNum]; AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); - pScreen->PaintWindowBackground(pRoot, &pRoot->borderClip, PW_BACKGROUND); + miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); // QuartzIgnoreNextWarpCursor(); DefineInitialRootWindow(pRoot); diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c index 67a0737ef..034cbac6d 100644 --- a/hw/darwin/quartz/xpr/xprScreen.c +++ b/hw/darwin/quartz/xpr/xprScreen.c @@ -306,9 +306,6 @@ static Bool xprSetupScreen(int index, ScreenPtr pScreen) { // Add alpha protecting replacements for fb screen functions - pScreen->PaintWindowBackground = SafeAlphaPaintWindow; - pScreen->PaintWindowBorder = SafeAlphaPaintWindow; - #ifdef RENDER { PictureScreenPtr ps = GetPictureScreen(pScreen); diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index 37f42a76f..4fef91537 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -209,8 +209,6 @@ typedef struct _DMXScreenInfo { UnrealizeWindowProcPtr UnrealizeWindow; RestackWindowProcPtr RestackWindow; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ResizeWindowProcPtr ResizeWindow; diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 8ae448a5e..a78e3ae8d 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -346,9 +346,6 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen); DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen); DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); - DMX_WRAP(PaintWindowBackground, dmxPaintWindowBackground, dmxScreen, - pScreen); - DMX_WRAP(PaintWindowBorder, dmxPaintWindowBorder, dmxScreen, pScreen); DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen); DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen); @@ -485,8 +482,6 @@ Bool dmxCloseScreen(int idx, ScreenPtr pScreen) DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen); DMX_UNWRAP(RestackWindow, dmxScreen, pScreen); DMX_UNWRAP(WindowExposures, dmxScreen, pScreen); - DMX_UNWRAP(PaintWindowBackground, dmxScreen, pScreen); - DMX_UNWRAP(PaintWindowBorder, dmxScreen, pScreen); DMX_UNWRAP(CopyWindow, dmxScreen, pScreen); DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index b66f2a3bb..7ccecfb5b 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -796,57 +796,6 @@ void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); } -/** Paint background of \a pWindow in \a pRegion. */ -void dmxPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); - BoxPtr pBox; - int nBox; - - DMX_UNWRAP(PaintWindowBackground, dmxScreen, pScreen); -#if 0 - if (pScreen->PaintWindowBackground) - pScreen->PaintWindowBackground(pWindow, pRegion, what); -#endif - - if (pWinPriv->window) { - /* Paint window background on back-end server */ - pBox = REGION_RECTS(pRegion); - nBox = REGION_NUM_RECTS(pRegion); - while (nBox--) { - XClearArea(dmxScreen->beDisplay, pWinPriv->window, - pBox->x1 - pWindow->drawable.x, - pBox->y1 - pWindow->drawable.y, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - False); - pBox++; - } - dmxSync(dmxScreen, False); - } - - DMX_WRAP(PaintWindowBackground, dmxPaintWindowBackground, dmxScreen, pScreen); -} - -/** Paint window border for \a pWindow in \a pRegion. */ -void dmxPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - - DMX_UNWRAP(PaintWindowBorder, dmxScreen, pScreen); -#if 0 - if (pScreen->PaintWindowBorder) - pScreen->PaintWindowBorder(pWindow, pRegion, what); -#endif - - /* Paint window border on back-end server */ - - DMX_WRAP(PaintWindowBorder, dmxPaintWindowBorder, dmxScreen, pScreen); -} - /** Move \a pWindow on the back-end server. Determine whether or not it * is on or offscreen, and realize it if it is newly on screen and the * lazy window creation optimization is enabled. */ diff --git a/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h index f976c7954..79f85ac3a 100644 --- a/hw/dmx/dmxwindow.h +++ b/hw/dmx/dmxwindow.h @@ -81,10 +81,6 @@ extern Bool dmxUnrealizeWindow(WindowPtr pWindow); extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib); extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed); -extern void dmxPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, - int what); -extern void dmxPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, - int what); extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/hw/kdrive/igs/igsdraw.c b/hw/kdrive/igs/igsdraw.c index d2ae098a6..e1ff2befc 100644 --- a/hw/kdrive/igs/igsdraw.c +++ b/hw/kdrive/igs/igsdraw.c @@ -1367,74 +1367,6 @@ igsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } -void -igsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - KdScreenPriv(pWin->drawable.pScreen); - PixmapPtr pTile; - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pTile = pWin->background.pixmap; - if (igsPatternDimOk (pTile->drawable.width) && - igsPatternDimOk (pTile->drawable.height)) - { - igsFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - break; - case BackgroundPixel: - igsFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - igsFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - else - { - pTile = pWin->border.pixmap; - if (igsPatternDimOk (pTile->drawable.width) && - igsPatternDimOk (pTile->drawable.height)) - { - igsFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} Bool igsDrawInit (ScreenPtr pScreen) @@ -1453,9 +1385,7 @@ igsDrawInit (ScreenPtr pScreen) */ pScreen->CreateGC = igsCreateGC; pScreen->CopyWindow = igsCopyWindow; - pScreen->PaintWindowBackground = igsPaintWindow; - pScreen->PaintWindowBorder = igsPaintWindow; - + /* * Initialize patterns */ diff --git a/hw/kdrive/savage/s3.h b/hw/kdrive/savage/s3.h index 628abc806..d8db0ebbf 100644 --- a/hw/kdrive/savage/s3.h +++ b/hw/kdrive/savage/s3.h @@ -470,7 +470,6 @@ void s3CursorDisable (ScreenPtr pScreen); void s3CursorFini (ScreenPtr pScreen); void s3RecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdefs); -void s3DumbPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); void s3DumbCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); Bool s3DrawInit (ScreenPtr pScreen); diff --git a/hw/kdrive/savage/s3draw.c b/hw/kdrive/savage/s3draw.c index 258dbcf79..7b6543b4b 100644 --- a/hw/kdrive/savage/s3draw.c +++ b/hw/kdrive/savage/s3draw.c @@ -2261,71 +2261,6 @@ s3PaintKey (DrawablePtr pDrawable, } #endif -void -s3PaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - SetupS3(pWin->drawable.pScreen); - s3ScreenInfo(pScreenPriv); - s3PatternPtr pPattern; - - DRAW_DEBUG ((DEBUG_PAINT_WINDOW, "s3PaintWindow 0x%x extents %d %d %d %d n %d", - pWin->drawable.id, - pRegion->extents.x1, pRegion->extents.y1, - pRegion->extents.x2, pRegion->extents.y2, - REGION_NUM_RECTS(pRegion))); - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pPattern = s3GetWindowPrivate(pWin); - if (pPattern) - { - s3FillBoxPattern ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - GXcopy, ~0, pPattern); - return; - } - break; - case BackgroundPixel: - s3FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - break; - case PW_BORDER: -#ifndef S3_TRIO - if (s3s->fbmap[1] >= 0) - fbOverlayUpdateLayerRegion (pWin->drawable.pScreen, - fbOverlayWindowLayer (pWin), - pRegion); -#endif - if (pWin->borderIsPixel) - { - s3FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - void s3CopyWindowProc (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, @@ -3006,55 +2941,6 @@ s3_24CreateWindow(WindowPtr pWin) return fbCreateWindow (pWin); } -void -s3_24PaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - SetupS3(pWin->drawable.pScreen); - s3PatternPtr pPattern; - - DRAW_DEBUG ((DEBUG_PAINT_WINDOW, "s3PaintWindow 0x%x extents %d %d %d %d n %d", - pWin->drawable.id, - pRegion->extents.x1, pRegion->extents.y1, - pRegion->extents.x2, pRegion->extents.y2, - REGION_NUM_RECTS(pRegion))); - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - if (ok24(pWin->background.pixel)) - { - s3_24FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - } - break; - case PW_BORDER: - if (pWin->borderIsPixel && ok24(pWin->border.pixel)) - { - s3_24FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} Bool s3DrawInit (ScreenPtr pScreen) @@ -3089,8 +2975,6 @@ s3DrawInit (ScreenPtr pScreen) { pScreen->CreateGC = s3_24CreateGC; pScreen->CreateWindow = s3_24CreateWindow; - pScreen->PaintWindowBackground = s3_24PaintWindow; - pScreen->PaintWindowBorder = s3_24PaintWindow; pScreen->CopyWindow = s3CopyWindow; } else @@ -3109,8 +2993,6 @@ s3DrawInit (ScreenPtr pScreen) pScreen->CreateWindow = s3CreateWindow; pScreen->ChangeWindowAttributes = s3ChangeWindowAttributes; pScreen->DestroyWindow = s3DestroyWindow; - pScreen->PaintWindowBackground = s3PaintWindow; - pScreen->PaintWindowBorder = s3PaintWindow; #ifndef S3_TRIO if (pScreenPriv->screen->fb[1].depth) { diff --git a/hw/kdrive/sis530/sisdraw.c b/hw/kdrive/sis530/sisdraw.c index fd80fa76a..f2b39a477 100644 --- a/hw/kdrive/sis530/sisdraw.c +++ b/hw/kdrive/sis530/sisdraw.c @@ -1537,75 +1537,6 @@ sisCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } -void -sisPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - KdScreenPriv(pWin->drawable.pScreen); - PixmapPtr pTile; - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pTile = pWin->background.pixmap; - if (sisPatternDimOk (pTile->drawable.width) && - sisPatternDimOk (pTile->drawable.height)) - { - sisFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - break; - case BackgroundPixel: - sisFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - sisFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy); - return; - } - else - { - pTile = pWin->border.pixmap; - if (sisPatternDimOk (pTile->drawable.width) && - sisPatternDimOk (pTile->drawable.height)) - { - sisFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - Bool sisDrawInit (ScreenPtr pScreen) { @@ -1621,9 +1552,7 @@ sisDrawInit (ScreenPtr pScreen) */ pScreen->CreateGC = sisCreateGC; pScreen->CopyWindow = sisCopyWindow; - pScreen->PaintWindowBackground = sisPaintWindow; - pScreen->PaintWindowBorder = sisPaintWindow; - + return TRUE; } diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c index c9805ddb6..7ee6c0bcf 100644 --- a/hw/kdrive/src/kaa.c +++ b/hw/kdrive/src/kaa.c @@ -1009,52 +1009,6 @@ kaaFillRegionTiled (DrawablePtr pDrawable, } #endif -static void -kaaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel); - return; -#if 0 - case BackgroundPixmap: - kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap); - return; -#endif - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel); - return; - } -#if 0 - else - { - kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap); - return; - } -#endif - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - Bool kaaDrawInit (ScreenPtr pScreen, KaaScreenInfoPtr pScreenInfo) @@ -1091,8 +1045,6 @@ kaaDrawInit (ScreenPtr pScreen, */ pScreen->CreateGC = kaaCreateGC; pScreen->CopyWindow = kaaCopyWindow; - pScreen->PaintWindowBackground = kaaPaintWindow; - pScreen->PaintWindowBorder = kaaPaintWindow; #ifdef RENDER if (ps) { ps->Composite = kaaComposite; diff --git a/hw/kdrive/src/kasync.c b/hw/kdrive/src/kasync.c index 51909630e..5388f217d 100644 --- a/hw/kdrive/src/kasync.c +++ b/hw/kdrive/src/kasync.c @@ -223,14 +223,6 @@ KdCheckGetSpans (DrawablePtr pDrawable, fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); } -void -KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what) -{ - kaaWaitSync (pWin->drawable.pScreen); - kaaDrawableDirty ((DrawablePtr)pWin); - fbPaintWindow (pWin, pRegion, what); -} - void KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { @@ -265,8 +257,6 @@ KdScreenInitAsync (ScreenPtr pScreen) { pScreen->GetImage = KdCheckGetImage; pScreen->GetSpans = KdCheckGetSpans; - pScreen->PaintWindowBackground = KdCheckPaintWindow; - pScreen->PaintWindowBorder = KdCheckPaintWindow; pScreen->CopyWindow = KdCheckCopyWindow; #ifdef RENDER KdPictureInitAsync (pScreen); diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 2da008df9..2fde66c4d 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -611,9 +611,6 @@ KdCheckGetSpans (DrawablePtr pDrawable, int nspans, char *pdstStart); -void -KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); - void KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c index 8492cdb69..9d2812c49 100644 --- a/hw/xfree86/rac/xf86RAC.c +++ b/hw/xfree86/rac/xf86RAC.c @@ -98,8 +98,6 @@ typedef struct _RACScreen { GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; CreatePixmapProcPtr CreatePixmap; @@ -139,8 +137,6 @@ static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void RACSourceValidate (DrawablePtr pDrawable, int x, int y, int width, int height ); -static void RACPaintWindowBackground(WindowPtr pWin, RegionPtr prgn, int what); -static void RACPaintWindowBorder(WindowPtr pWin, RegionPtr prgn, int what); static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc ); static void RACClearToBackground (WindowPtr pWin, int x, int y, @@ -296,8 +292,6 @@ xf86RACInit(ScreenPtr pScreen, unsigned int flag) WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB); WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB); WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB); - WRAP_SCREEN_COND(PaintWindowBackground, RACPaintWindowBackground, RAC_FB); - WRAP_SCREEN_COND(PaintWindowBorder, RACPaintWindowBorder, RAC_FB); WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB); WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB); WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB); @@ -341,8 +335,6 @@ RACCloseScreen (int i, ScreenPtr pScreen) UNWRAP_SCREEN(GetImage); UNWRAP_SCREEN(GetSpans); UNWRAP_SCREEN(SourceValidate); - UNWRAP_SCREEN(PaintWindowBackground); - UNWRAP_SCREEN(PaintWindowBorder); UNWRAP_SCREEN(CopyWindow); UNWRAP_SCREEN(ClearToBackground); UNWRAP_SCREEN(SaveScreen); @@ -426,38 +418,6 @@ RACSourceValidate ( SCREEN_EPILOG (SourceValidate, RACSourceValidate); } -static void -RACPaintWindowBackground( - WindowPtr pWin, - RegionPtr prgn, - int what - ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACPaintWindowBackground",pScreen->myNum); - SCREEN_PROLOG (PaintWindowBackground); - ENABLE; - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - SCREEN_EPILOG (PaintWindowBackground, RACPaintWindowBackground); -} - -static void -RACPaintWindowBorder( - WindowPtr pWin, - RegionPtr prgn, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACPaintWindowBorder",pScreen->myNum); - SCREEN_PROLOG (PaintWindowBorder); - ENABLE; - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - SCREEN_EPILOG (PaintWindowBorder, RACPaintWindowBorder); -} - static void RACCopyWindow( WindowPtr pWin, diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index c1b6ed1ce..3511a635e 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -35,11 +35,6 @@ #define MAX(a,b) (((a)>(b))?(a):(b)) static Bool ShadowCloseScreen (int i, ScreenPtr pScreen); -static void ShadowPaintWindow ( - WindowPtr pWin, - RegionPtr prgn, - int what -); static void ShadowCopyWindow( WindowPtr pWin, DDXPointRec ptOldOrg, @@ -82,8 +77,6 @@ typedef struct { RefreshAreaFuncPtr preRefresh; RefreshAreaFuncPtr postRefresh; CloseScreenProcPtr CloseScreen; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CreateGCProcPtr CreateGC; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; @@ -200,8 +193,6 @@ ShadowFBInit2 ( pPriv->vtSema = TRUE; pPriv->CloseScreen = pScreen->CloseScreen; - pPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pPriv->PaintWindowBorder = pScreen->PaintWindowBorder; pPriv->CopyWindow = pScreen->CopyWindow; pPriv->CreateGC = pScreen->CreateGC; pPriv->ModifyPixmapHeader = pScreen->ModifyPixmapHeader; @@ -210,8 +201,6 @@ ShadowFBInit2 ( pPriv->LeaveVT = pScrn->LeaveVT; pScreen->CloseScreen = ShadowCloseScreen; - pScreen->PaintWindowBackground = ShadowPaintWindow; - pScreen->PaintWindowBorder = ShadowPaintWindow; pScreen->CopyWindow = ShadowCopyWindow; pScreen->CreateGC = ShadowCreateGC; pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader; @@ -276,8 +265,6 @@ ShadowCloseScreen (int i, ScreenPtr pScreen) #endif /* RENDER */ pScreen->CloseScreen = pPriv->CloseScreen; - pScreen->PaintWindowBackground = pPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pPriv->PaintWindowBorder; pScreen->CopyWindow = pPriv->CopyWindow; pScreen->CreateGC = pPriv->CreateGC; pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader; @@ -296,35 +283,6 @@ ShadowCloseScreen (int i, ScreenPtr pScreen) return (*pScreen->CloseScreen) (i, pScreen); } -static void -ShadowPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - int num = 0; - - if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn))) - if(pPriv->preRefresh) - (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn)); - - if(what == PW_BACKGROUND) { - pScreen->PaintWindowBackground = pPriv->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - pScreen->PaintWindowBackground = ShadowPaintWindow; - } else { - pScreen->PaintWindowBorder = pPriv->PaintWindowBorder; - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - pScreen->PaintWindowBorder = ShadowPaintWindow; - } - - if(num && pPriv->postRefresh) - (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn)); -} - - static void ShadowCopyWindow( WindowPtr pWin, diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am index 6ed8303a4..58c8e885f 100644 --- a/hw/xfree86/xaa/Makefile.am +++ b/hw/xfree86/xaa/Makefile.am @@ -16,7 +16,7 @@ libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \ xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \ xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c xaaWrapper.c \ - xaaPaintWin.c xaaRect.c xaaLineMisc.c xaaBitOrder.c \ + xaaRect.c xaaLineMisc.c xaaBitOrder.c \ xaaFillPoly.c xaaWideLine.c xaaTables.c xaaFillArc.c \ xaaLine.c xaaDashLine.c xaaOverlay.c xaaOffscreen.c \ xaaOverlayDF.c xaaStateChange.c xaaPict.c $(POLYSEG) \ diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h index c8d0467e9..1dc7ed2d5 100644 --- a/hw/xfree86/xaa/xaa.h +++ b/hw/xfree86/xaa/xaa.h @@ -1238,8 +1238,6 @@ typedef struct _XAAInfoRec { GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; BackingStoreSaveAreasProcPtr SaveAreas; BackingStoreRestoreAreasProcPtr RestoreAreas; diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 93f6995aa..422242513 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -147,10 +147,6 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) infoRec->GetImage = XAAGetImage; if(!infoRec->GetSpans) infoRec->GetSpans = XAAGetSpans; - if(!infoRec->PaintWindowBackground) - infoRec->PaintWindowBackground = XAAPaintWindow; - if(!infoRec->PaintWindowBorder) - infoRec->PaintWindowBorder = XAAPaintWindow; if(!infoRec->CopyWindow) infoRec->CopyWindow = XAACopyWindow; @@ -162,10 +158,6 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) pScreen->GetImage = infoRec->GetImage; pScreenPriv->GetSpans = pScreen->GetSpans; pScreen->GetSpans = infoRec->GetSpans; - pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = infoRec->PaintWindowBackground; - pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; - pScreen->PaintWindowBorder = infoRec->PaintWindowBorder; pScreenPriv->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = infoRec->CopyWindow; pScreenPriv->CreatePixmap = pScreen->CreatePixmap; @@ -236,8 +228,6 @@ XAACloseScreen (int i, ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; pScreen->CopyWindow = pScreenPriv->CopyWindow; pScreen->WindowExposures = pScreenPriv->WindowExposures; pScreen->CreatePixmap = pScreenPriv->CreatePixmap; diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 016459091..86b30ff22 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -93,183 +93,6 @@ XAACopyWindow8_32( REGION_DESTROY(pScreen, borderClip); } - - - -static void -XAAPaintWindow8_32( - WindowPtr pWin, - RegionPtr prgn, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - int nBox = REGION_NUM_RECTS(prgn); - BoxPtr pBox = REGION_RECTS(prgn); - PixmapPtr pPix = NULL; - int depth = pWin->drawable.depth; - int fg = 0, pm; - - if(!infoRec->pScrn->vtSema) goto BAILOUT; - - switch (what) { - case PW_BACKGROUND: - switch(pWin->backgroundState) { - case None: return; - case ParentRelative: - do { pWin = pWin->parent; } - while(pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what); - return; - case BackgroundPixel: - fg = pWin->background.pixel; - break; - case BackgroundPixmap: - pPix = pWin->background.pixmap; - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - fg = pWin->border.pixel; - else /* pixmap */ - pPix = pWin->border.pixmap; - break; - default: return; - } - - if(depth == 8) { - pm = 0xff000000; - fg <<= 24; - } else - pm = 0x00ffffff; - - if(!pPix) { - if(infoRec->FillSolidRects && - !(infoRec->FillSolidRectsFlags & NO_PLANEMASK) && - (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) || - (depth == 8) || CHECK_RGB_EQUAL(fg))) - { - (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, - pm, nBox, pBox); - return; - } - } else { /* pixmap */ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - WindowPtr pBgWin = pWin; - int xorg, yorg; - - if (what == PW_BORDER) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - } - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) { - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = - pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = - pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm, - nBox, pBox, xorg, yorg, pCache); - - return; - } - - if(pPriv->flags & DIRTY) { - pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - if(!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8); - } - - if(pPriv->flags & REDUCIBLE_TO_8x8) { - if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && - infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects && - !(infoRec->FillMono8x8PatternRectsFlags & NO_PLANEMASK) && - !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) && - (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) - { - (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn, - pPriv->fg, pPriv->bg, GXcopy, pm, nBox, pBox, - pPriv->pattern0, pPriv->pattern1, xorg, yorg); - return; - } - if(infoRec->CanDoColor8x8 && infoRec->FillColor8x8PatternRects && - !(infoRec->FillColor8x8PatternRectsFlags & NO_PLANEMASK)) - { - XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)( - infoRec->pScrn, pPix, -1, -1); - - (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn, - GXcopy, pm, nBox, pBox, xorg, yorg, pCache); - return; - } - } - - if(infoRec->UsingPixmapCache && infoRec->FillCacheBltRects && - !(infoRec->FillCacheBltRectsFlags & NO_PLANEMASK) && - (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) - { - XAACacheInfoPtr pCache = - (*infoRec->CacheTile)(infoRec->pScrn, pPix); - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(infoRec->FillImageWriteRects && - !(infoRec->FillImageWriteRectsFlags & NO_PLANEMASK)) - { - (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy, - pm, nBox, pBox, xorg, yorg, pPix); - return; - } - } - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - -BAILOUT: - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow8_32); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow8_32); - } -} - - static void XAASetColorKey8_32( ScreenPtr pScreen, @@ -295,8 +118,6 @@ XAASetupOverlay8_32Planar(ScreenPtr pScreen) XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); int i; - pScreen->PaintWindowBackground = XAAPaintWindow8_32; - pScreen->PaintWindowBorder = XAAPaintWindow8_32; pScreen->CopyWindow = XAACopyWindow8_32; if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK)) diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 5897e323b..bf910982a 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -28,7 +28,6 @@ /* Screen funcs */ static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr); -static void XAAOverPaintWindow(WindowPtr, RegionPtr, int); static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr); static int XAAOverStippledFillChooser(GCPtr); @@ -194,8 +193,6 @@ XAAInitDualFramebufferOverlay( /* Overwrite key screen functions. The XAA core will clean up */ pScreen->CopyWindow = XAAOverCopyWindow; - pScreen->PaintWindowBackground = XAAOverPaintWindow; - pScreen->PaintWindowBorder = XAAOverPaintWindow; pScreen->WindowExposures = XAAOverWindowExposures; pOverPriv->StippledFillChooser = infoRec->StippledFillChooser; @@ -410,56 +407,6 @@ XAAOverCopyWindow( } -static void -XAAOverPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = infoRec->pScrn; - - if(pScrn->vtSema) { - if(what == PW_BACKGROUND) { - SWITCH_DEPTH(pWin->drawable.depth); - (*infoRec->PaintWindowBackground)(pWin, pRegion, what); - return; - } else { - if(pWin->drawable.bitsPerPixel == 8) { - SWITCH_DEPTH(8); - (*infoRec->PaintWindowBorder)(pWin, pRegion, what); - return; - } else if (infoRec->FillSolidRects) { - SWITCH_DEPTH(8); - (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey, GXcopy, - ~0, REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion)); - - SWITCH_DEPTH(pWin->drawable.depth); - (*infoRec->PaintWindowBorder)(pWin, pRegion, what); - return; - } - } - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - } - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAOverPaintWindow); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, pRegion, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAOverPaintWindow); - } -} - - void XAAOverWindowExposures( WindowPtr pWin, diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c deleted file mode 100644 index af5680c67..000000000 --- a/hw/xfree86/xaa/xaaPaintWin.c +++ /dev/null @@ -1,200 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xaawrap.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -XAAPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - int nBox = REGION_NUM_RECTS(prgn); - BoxPtr pBox = REGION_RECTS(prgn); - int fg = -1; - PixmapPtr pPix = NULL; - - if(!infoRec->pScrn->vtSema) goto BAILOUT; - - switch (what) { - case PW_BACKGROUND: - switch(pWin->backgroundState) { - case None: return; - case ParentRelative: - do { pWin = pWin->parent; } - while(pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what); - return; - case BackgroundPixel: - fg = pWin->background.pixel; - break; - case BackgroundPixmap: - pPix = pWin->background.pixmap; - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - fg = pWin->border.pixel; - else /* pixmap */ - pPix = pWin->border.pixmap; - break; - default: return; - } - - - if(!pPix) { - if(infoRec->FillSolidRects && - (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(fg))) ) { - (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, ~0, - nBox, pBox); - return; - } - } else { /* pixmap */ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - WindowPtr pBgWin = pWin; - Bool NoCache = FALSE; - int xorg, yorg; - - /* Hack so we can use this with the dual framebuffer layers - which only support the pixmap cache in the primary bpp */ - if(pPix->drawable.bitsPerPixel != infoRec->pScrn->bitsPerPixel) - NoCache = TRUE; - - if (what == PW_BORDER) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - } - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) { - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = - pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = - pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(pPriv->flags & DIRTY) { - pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - if(!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8); - } - - if(pPriv->flags & REDUCIBLE_TO_8x8) { - if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && - infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects && - !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) && - (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) { - - (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn, - pPriv->fg, pPriv->bg, GXcopy, ~0, nBox, pBox, - pPriv->pattern0, pPriv->pattern1, xorg, yorg); - return; - } - if(infoRec->CanDoColor8x8 && !NoCache && - infoRec->FillColor8x8PatternRects) { - XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)( - infoRec->pScrn, pPix, -1, -1); - - (*infoRec->FillColor8x8PatternRects) ( infoRec->pScrn, - GXcopy, ~0, nBox, pBox, xorg, yorg, pCache); - return; - } - } - - /* The window size check is to reduce pixmap cache thrashing - when there are lots of little windows with pixmap backgrounds - like are sometimes used for buttons, etc... */ - - if(infoRec->UsingPixmapCache && - infoRec->FillCacheBltRects && !NoCache && - ((what == PW_BORDER) || - (pPix->drawable.height != pWin->drawable.height) || - (pPix->drawable.width != pWin->drawable.width)) && - (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) { - - XAACacheInfoPtr pCache = - (*infoRec->CacheTile)(infoRec->pScrn, pPix); - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(infoRec->FillImageWriteRects && - !(infoRec->FillImageWriteRectsFlags & NO_GXCOPY)) { - (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy, - ~0, nBox, pBox, xorg, yorg, pPix); - return; - } - } - - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - -BAILOUT: - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow); - } - -} diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c index 711f7791f..02c556b33 100644 --- a/hw/xfree86/xaa/xaaStateChange.c +++ b/hw/xfree86/xaa/xaaStateChange.c @@ -259,8 +259,6 @@ typedef struct _XAAStateWrapRec { XAACacheInfoPtr pCache); GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; #ifdef RENDER Bool (*SetupForCPUToScreenAlphaTexture2)(ScrnInfoPtr pScrn, int op, @@ -1449,26 +1447,6 @@ static void XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr pp pwidth, nspans, pdstStart); } -static void XAAStateWrapPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, - int what) -{ - GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PaintWindowBackground)(pWindow, pRegion, - what); -} - -static void XAAStateWrapPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, - int what) -{ - GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PaintWindowBorder)(pWindow, pRegion, - what); -} - static void XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { @@ -1649,8 +1627,6 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) XAA_STATE_WRAP(WriteColor8x8PatternToCache); XAA_STATE_WRAP(GetImage); XAA_STATE_WRAP(GetSpans); - XAA_STATE_WRAP(PaintWindowBackground); - XAA_STATE_WRAP(PaintWindowBorder); XAA_STATE_WRAP(CopyWindow); #ifdef RENDER XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture2); diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c index 6d8107b61..b0176f03f 100644 --- a/hw/xfree86/xaa/xaaWrapper.c +++ b/hw/xfree86/xaa/xaaWrapper.c @@ -54,8 +54,6 @@ typedef struct { CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; CopyWindowProcPtr CopyWindow; - PaintWindowProcPtr PaintWindowBackground; - PaintWindowProcPtr PaintWindowBorder; WindowExposuresProcPtr WindowExposures; CreateGCProcPtr CreateGC; CreateColormapProcPtr CreateColormap; @@ -73,8 +71,6 @@ typedef struct { CreateScreenResourcesProcPtr wrapCreateScreenResources; CreateWindowProcPtr wrapCreateWindow; CopyWindowProcPtr wrapCopyWindow; - PaintWindowProcPtr wrapPaintWindowBackground; - PaintWindowProcPtr wrapPaintWindowBorder; WindowExposuresProcPtr wrapWindowExposures; CreateGCProcPtr wrapCreateGC; CreateColormapProcPtr wrapCreateColormap; @@ -208,33 +204,6 @@ xaaWrapperWindowExposures (WindowPtr pWin, WindowExposures, wrapWindowExposures, xaaWrapperWindowExposures); } -static void -xaaWrapperPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xaaWrapperScrPriv(pWin->drawable.pScreen); - - switch (what) { - case PW_BORDER: - cond_unwrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBorder, wrapPaintWindowBorder); - - pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what); - cond_wrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBorder, wrapPaintWindowBorder, - xaaWrapperPaintWindow); - break; - case PW_BACKGROUND: - cond_unwrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBackground, wrapPaintWindowBackground); - - pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what); - cond_wrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBackground, wrapPaintWindowBackground, - xaaWrapperPaintWindow); - break; - } -} - static Bool xaaWrapperCreateColormap(ColormapPtr pmap) { @@ -327,8 +296,6 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f get (pScrPriv, pScreen, CreateScreenResources, wrapCreateScreenResources); get (pScrPriv, pScreen, CreateWindow, wrapCreateWindow); get (pScrPriv, pScreen, CopyWindow, wrapCopyWindow); - get (pScrPriv, pScreen, PaintWindowBorder, wrapPaintWindowBorder); - get (pScrPriv, pScreen, PaintWindowBackground, wrapPaintWindowBackground); get (pScrPriv, pScreen, WindowExposures, wrapWindowExposures); get (pScrPriv, pScreen, CreateGC, wrapCreateGC); get (pScrPriv, pScreen, CreateColormap, wrapCreateColormap); @@ -351,8 +318,6 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f xaaWrapperCreateScreenResources); wrap (pScrPriv, pScreen, CreateWindow, xaaWrapperCreateWindow); wrap (pScrPriv, pScreen, CopyWindow, xaaWrapperCopyWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, xaaWrapperPaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBackground, xaaWrapperPaintWindow); wrap (pScrPriv, pScreen, WindowExposures, xaaWrapperWindowExposures); wrap (pScrPriv, pScreen, CreateGC, xaaWrapperCreateGC); wrap (pScrPriv, pScreen, CreateColormap, xaaWrapperCreateColormap); diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 3ddea241c..686cc876d 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -45,8 +45,6 @@ typedef struct _XAAScreen { CloseScreenProcPtr CloseScreen; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; WindowExposuresProcPtr WindowExposures; CreatePixmapProcPtr CreatePixmap; @@ -1315,14 +1313,6 @@ XAAWritePixmapToCacheLinear( int bpp, int depth ); - -void -XAAPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -); - void XAASolidHorVertLineAsRects( ScrnInfoPtr pScrn, diff --git a/hw/xfree86/xf1bpp/Makefile.am b/hw/xfree86/xf1bpp/Makefile.am index 4ea7ef0c1..c724f760f 100644 --- a/hw/xfree86/xf1bpp/Makefile.am +++ b/hw/xfree86/xf1bpp/Makefile.am @@ -45,7 +45,6 @@ libxf1bppmfb_a_SOURCES = \ mfbline.c \ mfbmisc.c \ mfbpixmap.c \ - mfbpntwin.c \ mfbpolypnt.c \ mfbpushpxl.c \ mfbscrclse.c \ diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h index 5825c1cf4..e330ebd5b 100644 --- a/hw/xfree86/xf1bpp/mfbmap.h +++ b/hw/xfree86/xf1bpp/mfbmap.h @@ -61,7 +61,6 @@ #define mfbListInstalledColormaps xf1bppListInstalledColormaps #define mfbMapWindow xf1bppMapWindow #define mfbPadPixmap xf1bppPadPixmap -#define mfbPaintWindow xf1bppPaintWindow #define mfbPixmapToRegion xf1bppPixmapToRegion #define mfbPixmapToRegionWeak xf1bppPixmapToRegionWeak #define mfbPolyFillArcSolid xf1bppPolyFillArcSolid diff --git a/hw/xfree86/xf1bpp/mfbunmap.h b/hw/xfree86/xf1bpp/mfbunmap.h index 16237a163..56b734bcd 100644 --- a/hw/xfree86/xf1bpp/mfbunmap.h +++ b/hw/xfree86/xf1bpp/mfbunmap.h @@ -53,7 +53,6 @@ #undef mfbListInstalledColormaps #undef mfbMapWindow #undef mfbPadPixmap -#undef mfbPaintWindow #undef mfbPixmapToRegion #undef mfbPixmapToRegionWeak #undef mfbPolyFillArcSolid diff --git a/hw/xfree86/xf4bpp/Makefile.am b/hw/xfree86/xf4bpp/Makefile.am index 8665b2a6b..1414a0d0f 100644 --- a/hw/xfree86/xf4bpp/Makefile.am +++ b/hw/xfree86/xf4bpp/Makefile.am @@ -17,7 +17,6 @@ libxf4bpp_la_SOURCES = \ ppcGetSp.c \ ppcImg.c \ ppcPixmap.c \ - ppcPntWin.c \ ppcPolyPnt.c \ ppcQuery.c \ ppcRslvC.c \ diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c index b59dab312..674a38b78 100644 --- a/hw/xfree86/xf4bpp/ppcGC.c +++ b/hw/xfree86/xf4bpp/ppcGC.c @@ -176,8 +176,7 @@ register GCPtr pGC ; pGC->fExpose = TRUE; pGC->freeCompClip = FALSE; - pGC->pRotatedPixmap = NullPixmap; - + /* GJA: I don't like this code: * they allocated a mfbPrivGC, ignore the allocated data and place * a pointer to a ppcPrivGC in its slot. @@ -200,12 +199,6 @@ xf4bppDestroyGC( pGC ) { TRACE( ( "xf4bppDestroyGC(pGC=0x%x)\n", pGC ) ) ; - /* (ef) 11/9/87 -- ppc doesn't use rotated tile or stipple, but */ - /* *does* call mfbValidateGC under some conditions. */ - /* mfbValidateGC *does* use rotated tile and stipple */ - if ( pGC->pRotatedPixmap ) - mfbDestroyPixmap( pGC->pRotatedPixmap ) ; - if ( pGC->freeCompClip && pGC->pCompositeClip ) REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); if(pGC->ops->devPrivate.val) xfree( pGC->ops ); diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c index 8d726e758..313fcb0f8 100644 --- a/hw/xfree86/xf4bpp/ppcIO.c +++ b/hw/xfree86/xf4bpp/ppcIO.c @@ -205,8 +205,6 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware; pScreen-> DestroyWindow = xf4bppDestroyWindow; pScreen-> PositionWindow = xf4bppPositionWindow; - pScreen-> PaintWindowBackground = xf4bppPaintWindow; - pScreen-> PaintWindowBorder = xf4bppPaintWindow; pScreen-> CopyWindow = xf4bppCopyWindow; pScreen-> CreatePixmap = xf4bppCreatePixmap; pScreen-> CreateGC = xf4bppCreateGC; @@ -219,7 +217,7 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> ResolveColor = xf4bppResolveColor; mfbFillInScreen(pScreen); - if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; if (!miScreenInit(pScreen, pbits, virtx, virty, dpix, dpiy, width, diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c deleted file mode 100644 index 5d7a07e12..000000000 --- a/hw/xfree86/xf4bpp/ppcPntWin.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright IBM Corporation 1987,1988,1989 - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * 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 IBM not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * IBM 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 (c) 1987 X Consortium - -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 -X CONSORTIUM 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 X Consortium 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 X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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 -#endif - -#include "xf4bpp.h" -#include "mfbmap.h" -#include "mfb.h" -#include "mi.h" -#include "scrnintstr.h" -#include "ibmTrace.h" - -/* NOTE: These functions only work for visuals up to 31-bits deep */ -static void xf4bppPaintWindowSolid( - WindowPtr, - RegionPtr, - int -); -static void xf4bppPaintWindowTile( - WindowPtr, - RegionPtr, - int -); - -void -xf4bppPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - - register mfbPrivWin *pPrivWin; - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr); - - TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n", - pWin,pRegion,what)); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - xf4bppPaintWindowTile(pWin, pRegion, what); - return; - } - break; - case BackgroundPixel: - xf4bppPaintWindowSolid(pWin, pRegion, what); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - xf4bppPaintWindowSolid(pWin, pRegion, what); - return; - } - else if (pPrivWin->fastBorder) - { - xf4bppPaintWindowTile(pWin, pRegion, what); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} - -static void -xf4bppPaintWindowSolid(pWin, pRegion, what) - register WindowPtr pWin; - register RegionPtr pRegion; - int what; -{ - register int nbox; - register BoxPtr pbox; - register unsigned long int pixel; - register unsigned long int pm ; - - TRACE(("xf4bppPaintWindowSolid(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what)); - - if ( !( nbox = REGION_NUM_RECTS(pRegion))) - return ; - pbox = REGION_RECTS(pRegion); - - if (what == PW_BACKGROUND) - pixel = pWin->background.pixel; - else - pixel = pWin->border.pixel; - - pm = ( 1 << pWin->drawable.depth ) - 1 ; - for ( ; nbox-- ; pbox++ ) { - /* - * call fill routine, the parms are: - * fill(color, alu, planes, x, y, width, height); - */ - xf4bppFillSolid( pWin, pixel, GXcopy, pm, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1 ) ; - } - return ; -} - -static void -xf4bppPaintWindowTile(pWin, pRegion, what) - register WindowPtr pWin; - register RegionPtr pRegion; - int what; -{ - register int nbox; - register BoxPtr pbox; - register PixmapPtr pTile; - register unsigned long int pm ; - - TRACE(("xf4bppPaintWindowTile(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what)); - - if ( !( nbox = REGION_NUM_RECTS(pRegion))) - return ; - pbox = REGION_RECTS(pRegion); - - if (what == PW_BACKGROUND) - pTile = pWin->background.pixmap; - else - pTile = pWin->border.pixmap; - - pm = ( 1 << pWin->drawable.depth ) - 1 ; - for ( ; nbox-- ; pbox++ ) { - /* - * call tile routine, the parms are: - * tile(tile, alu, planes, x, y, width, height,xSrc,ySrc); - */ - xf4bppTileRect(pWin, pTile, GXcopy, pm, - pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - pWin->drawable.x, pWin->drawable.y ); - } - return ; -} diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c index 01768d9ff..8261af183 100644 --- a/hw/xfree86/xf4bpp/ppcWindow.c +++ b/hw/xfree86/xf4bpp/ppcWindow.c @@ -214,15 +214,7 @@ Bool xf4bppCreateWindowForXYhardware(pWin) register WindowPtr pWin ; { - register mfbPrivWin *pPrivWin; - TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin)); - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = 0; - pPrivWin->fastBorder = 0; - return TRUE; } diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h index 5d5dcdd9f..e7e3721f7 100644 --- a/hw/xfree86/xf4bpp/xf4bpp.h +++ b/hw/xfree86/xf4bpp/xf4bpp.h @@ -189,13 +189,6 @@ PixmapPtr xf4bppCopyPixmap( PixmapPtr ); -/* ppcPntWin.c */ -void xf4bppPaintWindow( - WindowPtr, - RegionPtr, - int -); - /* ppcPolyPnt.c */ void xf4bppPolyPoint( DrawablePtr, diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h index 31028a30b..e14096568 100644 --- a/hw/xfree86/xf8_32bpp/cfb8_32.h +++ b/hw/xfree86/xf8_32bpp/cfb8_32.h @@ -111,13 +111,6 @@ cfb8_32GetImage ( char *pdstLine ); -void -cfb8_32PaintWindow ( - WindowPtr pWin, - RegionPtr pRegion, - int what -); - Bool cfb8_32ScreenInit ( ScreenPtr pScreen, @@ -135,15 +128,6 @@ cfb8_32FillBoxSolid8 ( unsigned long color ); - -void -cfb8_32FillBoxSolid32 ( - DrawablePtr pDraw, - int nbox, - BoxPtr pBox, - unsigned long color -); - RegionPtr cfb8_32CopyPlane( DrawablePtr pSrc, diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c index a1b988716..fbf597d22 100644 --- a/hw/xfree86/xf8_32bpp/cfbpntwin.c +++ b/hw/xfree86/xf8_32bpp/cfbpntwin.c @@ -22,97 +22,6 @@ #include "panoramiXsrv.h" #endif -void -cfb8_32PaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -){ - WindowPtr pBgWin; - int xorg, yorg; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)( - pWin, pRegion, what); - break; - case BackgroundPixmap: - xorg = pWin->drawable.x; - yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion), - pWin->background.pixmap, xorg, yorg, GXcopy, - (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000); - break; - case BackgroundPixel: - if(pWin->drawable.depth == 24) - cfb8_32FillBoxSolid32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - else - cfb8_32FillBoxSolid8 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - if(pWin->drawable.depth == 24) { - cfb8_32FillBoxSolid32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } else - cfb8_32FillBoxSolid8 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } else { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion), - pWin->border.pixmap, xorg, yorg, GXcopy, - (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000); - } - break; - } - -} - void cfb8_32FillBoxSolid8( DrawablePtr pDraw, @@ -140,41 +49,3 @@ cfb8_32FillBoxSolid8( pbox++; } } - - -void -cfb8_32FillBoxSolid32( - DrawablePtr pDraw, - int nbox, - BoxPtr pbox, - unsigned long color -){ - CARD8 *ptr, *data; - CARD16 *ptr2, *data2; - int pitch, pitch2; - int height, width, i; - CARD8 c = (CARD8)(color >> 16); - CARD16 c2 = (CARD16)color; - - cfbGetByteWidthAndPointer(pDraw, pitch, ptr); - cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16); - ptr += 2; /* point to the third byte */ - - while(nbox--) { - data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2); - data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1); - width = (pbox->x2 - pbox->x1) << 1; - height = pbox->y2 - pbox->y1; - - while(height--) { - for(i = 0; i < width; i+=2) { - data[i << 1] = c; - data2[i] = c2; - } - data += pitch; - data2 += pitch2; - } - pbox++; - } -} - diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c index 29dc6691f..5e2657f2b 100644 --- a/hw/xfree86/xf8_32bpp/cfbscrinit.c +++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c @@ -56,11 +56,7 @@ cfb8_32AllocatePrivates(ScreenPtr pScreen) /* All cfb will have the same GC and Window private indicies */ - if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex)) - return FALSE; - - /* The cfb indicies are the mfb indicies. Reallocating them resizes them */ - if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin))) + if(!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex)) return FALSE; if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) @@ -109,8 +105,6 @@ cfb8_32SetupScreen( pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes; pScreen->RealizeWindow = cfb32MapWindow; /* OK */ pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */ - pScreen->PaintWindowBackground = cfb8_32PaintWindow; - pScreen->PaintWindowBorder = cfb8_32PaintWindow; pScreen->CopyWindow = cfb8_32CopyWindow; pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */ pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */ diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c index ce741cb55..787cbdec6 100644 --- a/hw/xfree86/xf8_32bpp/cfbwindow.c +++ b/hw/xfree86/xf8_32bpp/cfbwindow.c @@ -27,11 +27,6 @@ Bool cfb8_32CreateWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin); - - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pWin->drawable.bitsPerPixel = 32; return TRUE; } diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c index c5585ca6d..3cd351ad0 100644 --- a/hw/xfree86/xf8_32bpp/xf86overlay.c +++ b/hw/xfree86/xf8_32bpp/xf86overlay.c @@ -34,7 +34,6 @@ static Bool OverlayCreateGC(GCPtr pGC); static Bool OverlayDestroyPixmap(PixmapPtr); static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int); static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long); -static void OverlayPaintWindow(WindowPtr, RegionPtr, int); /** Funcs **/ static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -159,8 +158,6 @@ typedef struct { CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; ChangeWindowAttributesProcPtr ChangeWindowAttributes; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; int LockPrivate; } OverlayScreenRec, *OverlayScreenPtr; @@ -284,16 +281,12 @@ xf86Overlay8Plus32Init (ScreenPtr pScreen) pScreenPriv->CreatePixmap = pScreen->CreatePixmap; pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap; pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; - pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; pScreen->CreateGC = OverlayCreateGC; pScreen->CloseScreen = OverlayCloseScreen; pScreen->CreatePixmap = OverlayCreatePixmap; pScreen->DestroyPixmap = OverlayDestroyPixmap; pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes; - pScreen->PaintWindowBackground = OverlayPaintWindow; - pScreen->PaintWindowBorder = OverlayPaintWindow; pScreenPriv->LockPrivate = 0; @@ -402,8 +395,6 @@ OverlayCloseScreen (int i, ScreenPtr pScreen) pScreen->CreatePixmap = pScreenPriv->CreatePixmap; pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap; pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; xfree ((pointer) pScreenPriv); @@ -435,62 +426,6 @@ OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask) return result; } -static void -OverlayPaintWindow( - WindowPtr pWin, - RegionPtr pReg, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen); - OverlayPixmapPtr pixPriv; - PixmapPtr oldPix = NULL; - - if(what == PW_BACKGROUND) { - if(pWin->drawable.depth == 8) { - if(pWin->backgroundState == ParentRelative) { - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - } - - if(pWin->backgroundState == BackgroundPixmap) { - oldPix = pWin->background.pixmap; - pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix); - /* have to do this here because alot of applications - incorrectly assume changes to a pixmap that is - a window background go into effect immediatedly */ - if(pixPriv->dirty & IS_DIRTY) - OverlayRefreshPixmap(pWin->background.pixmap); - pWin->background.pixmap = pixPriv->pix32; - } - } - - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, pReg, what); - pScreen->PaintWindowBackground = OverlayPaintWindow; - - if(oldPix) - pWin->background.pixmap = oldPix; - } else { - if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) { - oldPix = pWin->border.pixmap; - pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix); - if(pixPriv->dirty & IS_DIRTY) - OverlayRefreshPixmap(pWin->border.pixmap); - pWin->border.pixmap = pixPriv->pix32; - } - - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; - (*pScreen->PaintWindowBorder) (pWin, pReg, what); - pScreen->PaintWindowBorder = OverlayPaintWindow; - - if(oldPix) - pWin->border.pixmap = oldPix; - } -} - - /*********************** GC Funcs *****************************/ diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c index 92974f0d4..87d8a4ea8 100644 --- a/hw/xgl/glx/xglx.c +++ b/hw/xgl/glx/xglx.c @@ -927,7 +927,7 @@ xglxWindowExposures (WindowPtr pWin, REGION_SUBTRACT (pScreen, &ClipList, &pWin->borderClip, &pWin->winSize); REGION_INTERSECT (pScreen, &ClipList, &ClipList, (RegionPtr) pReg); - (*pScreen->PaintWindowBorder) (pWin, &ClipList, PW_BORDER); + miPaintWindow(pWin, &ClipList, PW_BORDER); REGION_UNINIT (pScreen, &ClipList); } diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index 5710bbf5a..7bca1d53e 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -272,8 +272,6 @@ typedef struct _xglScreen { CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CreateGCProcPtr CreateGC; CloseScreenProcPtr CloseScreen; @@ -1090,16 +1088,6 @@ xglCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what); - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what); - PixmapPtr xglGetWindowPixmap (WindowPtr pWin); diff --git a/hw/xgl/xglscreen.c b/hw/xgl/xglscreen.c index e46869770..9b7297b91 100644 --- a/hw/xgl/xglscreen.c +++ b/hw/xgl/xglscreen.c @@ -210,8 +210,6 @@ xglScreenInit (ScreenPtr pScreen) XGL_SCREEN_WRAP (CreateWindow, xglCreateWindow); XGL_SCREEN_WRAP (DestroyWindow, xglDestroyWindow); XGL_SCREEN_WRAP (ChangeWindowAttributes, xglChangeWindowAttributes); - XGL_SCREEN_WRAP (PaintWindowBackground, xglPaintWindowBackground); - XGL_SCREEN_WRAP (PaintWindowBorder, xglPaintWindowBorder); XGL_SCREEN_WRAP (CreateGC, xglCreateGC); diff --git a/hw/xgl/xglwindow.c b/hw/xgl/xglwindow.c index 967d10f77..393f01df1 100644 --- a/hw/xgl/xglwindow.c +++ b/hw/xgl/xglwindow.c @@ -141,181 +141,6 @@ xglCopyWindow (WindowPtr pWin, REGION_UNINIT (pWin->drawable.pScreen, &rgnDst); } -static Bool -xglFillRegionSolid (DrawablePtr pDrawable, - RegionPtr pRegion, - Pixel pixel) -{ - glitz_pixel_format_t format; - glitz_surface_t *solid; - glitz_buffer_t *buffer; - BoxPtr pExtent; - Bool ret; - - XGL_DRAWABLE_PIXMAP_PRIV (pDrawable); - XGL_SCREEN_PRIV (pDrawable->pScreen); - - if (!xglPrepareTarget (pDrawable)) - return FALSE; - - solid = glitz_surface_create (pScreenPriv->drawable, - pPixmapPriv->pVisual->format.surface, - 1, 1, 0, NULL); - if (!solid) - return FALSE; - - glitz_surface_set_fill (solid, GLITZ_FILL_REPEAT); - - format.fourcc = GLITZ_FOURCC_RGB; - format.masks = pPixmapPriv->pVisual->pPixel->masks; - format.xoffset = 0; - format.skip_lines = 0; - format.bytes_per_line = sizeof (CARD32); - format.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP; - - buffer = glitz_buffer_create_for_data (&pixel); - - glitz_set_pixels (solid, 0, 0, 1, 1, &format, buffer); - - glitz_buffer_destroy (buffer); - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - ret = xglSolid (pDrawable, - GLITZ_OPERATOR_SRC, - solid, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion)); - - glitz_surface_destroy (solid); - - return ret; -} - -static Bool -xglFillRegionTiled (DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile, - int tileX, - int tileY) -{ - BoxPtr pExtent; - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - if (xglTile (pDrawable, - GLITZ_OPERATOR_SRC, - pTile, - tileX, tileY, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion))) - return TRUE; - - return FALSE; -} - -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - return; - case BackgroundPixmap: - if (xglFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap, - -pWin->drawable.x, - -pWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->background.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - break; - case BackgroundPixel: - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->background.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - break; - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBackground, - xglPaintWindowBackground); -} - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - if (pWin->borderIsPixel) - { - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->border.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - } - else - { - WindowPtr pBgWin = pWin; - - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - - if (xglFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap, - -pBgWin->drawable.x, - -pBgWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->border.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBorder, - xglPaintWindowBorder); -} - PixmapPtr xglGetWindowPixmap (WindowPtr pWin) { diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index d08e48245..86f856e35 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -294,8 +294,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->UnrealizeWindow = xnestUnrealizeWindow; pScreen->PostValidateTree = NULL; pScreen->WindowExposures = xnestWindowExposures; - pScreen->PaintWindowBackground = xnestPaintWindowBackground; - pScreen->PaintWindowBorder = xnestPaintWindowBorder; pScreen->CopyWindow = xnestCopyWindow; pScreen->ClipNotify = xnestClipNotify; diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index f87a1baa7..e83fb90d5 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -378,30 +378,6 @@ xnestUnrealizeWindow(WindowPtr pWin) return True; } -void -xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - int i; - BoxPtr pBox; - - xnestConfigureWindow(pWin, CWWidth | CWHeight); - - pBox = REGION_RECTS(pRegion); - for (i = 0; i < REGION_NUM_RECTS(pRegion); i++) - XClearArea(xnestDisplay, xnestWindow(pWin), - pBox[i].x1 - pWin->drawable.x, - pBox[i].y1 - pWin->drawable.y, - pBox[i].x2 - pBox[i].x1, - pBox[i].y2 - pBox[i].y1, - False); -} - -void -xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xnestConfigureWindow(pWin, CWBorderWidth); -} - void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) { diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h index 21be5f5e3..6c63f1f76 100644 --- a/hw/xnest/XNWindow.h +++ b/hw/xnest/XNWindow.h @@ -64,8 +64,6 @@ void xnestConfigureWindow(WindowPtr pWin, unsigned int mask); Bool xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask); Bool xnestRealizeWindow(WindowPtr pWin); Bool xnestUnrealizeWindow(WindowPtr pWin); -void xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what); -void xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what); void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion); void xnestClipNotify(WindowPtr pWin, int dx, int dy); void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, diff --git a/hw/xprint/pcl/Pcl.h b/hw/xprint/pcl/Pcl.h index 217e30438..0c50ed241 100644 --- a/hw/xprint/pcl/Pcl.h +++ b/hw/xprint/pcl/Pcl.h @@ -568,10 +568,6 @@ extern void PclCopyWindow( extern Bool PclChangeWindowAttributes( register WindowPtr pWin, register unsigned long mask); -extern void PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what); /****** * Functions in PclFonts.c diff --git a/hw/xprint/pcl/PclInit.c b/hw/xprint/pcl/PclInit.c index 183225274..574b481d2 100644 --- a/hw/xprint/pcl/PclInit.c +++ b/hw/xprint/pcl/PclInit.c @@ -201,8 +201,6 @@ InitializePclDriver( pScreen->RealizeWindow = PclMapWindow; pScreen->UnrealizeWindow = PclUnmapWindow; */ - pScreen->PaintWindowBackground = PclPaintWindow; - pScreen->PaintWindowBorder = PclPaintWindow; pScreen->CopyWindow = PclCopyWindow; /* XXX Hard routine to write! */ pScreen->CreatePixmap = fbCreatePixmap; diff --git a/hw/xprint/pcl/PclWindow.c b/hw/xprint/pcl/PclWindow.c index 80f4e91b1..f34ad7feb 100644 --- a/hw/xprint/pcl/PclWindow.c +++ b/hw/xprint/pcl/PclWindow.c @@ -198,232 +198,6 @@ PclChangeWindowAttributes( return TRUE; } - -/* - * This function is largely ripped from miPaintWindow, but modified so - * that the background is not painted to the root window, and so that - * the backing store is not referenced. - */ -void -PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PCL output. - */ - if( PclGetContextFromWindow( pWin ) == (XpContextPtr)NULL ) - return; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | - GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin - | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if ((pointer)(long) pGC->alu != newValues[FUNCTION]) { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if ((pointer)(long) pGC->patOrg.x != newValues[ABSX]) { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if ((pointer)(long) pGC->patOrg.y != newValues[ABSY]) { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if ((pointer)(long) pGC->clientClipType != (pointer)CT_NONE) { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if ((pointer)(long) pGC->subWindowMode != newValues[SUBWINDOW]) { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if (pGC->tileIsPixel || - (pointer) pGC->tile.pixmap != newValues[TILE]) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if ((pointer)(long) pGC->fillStyle != newValues[FILLSTYLE]) { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if ((pointer) pGC->fgPixel != newValues[FOREGROUND]) { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if (gcmask) - DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - -} - /*ARGSUSED*/ Bool PclDestroyWindow( diff --git a/hw/xprint/pcl/Pclmap.h b/hw/xprint/pcl/Pclmap.h index ae88b5a42..3990ab294 100644 --- a/hw/xprint/pcl/Pclmap.h +++ b/hw/xprint/pcl/Pclmap.h @@ -105,7 +105,6 @@ copyright holders. #define PclUnmapWindow PCLNAME(UnmapWindow) #define PclCopyWindow PCLNAME(CopyWindow) #define PclChangeWindowAttributes PCLNAME(ChangeWindowAttributes) -#define PclPaintWindow PCLNAME(PaintWindow) #define PclDestroyWindow PCLNAME(DestroyWindow) /* PclGC.c */ diff --git a/hw/xprint/ps/Ps.h b/hw/xprint/ps/Ps.h index 3adad39e4..25bd5333b 100644 --- a/hw/xprint/ps/Ps.h +++ b/hw/xprint/ps/Ps.h @@ -517,7 +517,6 @@ extern Bool PsUnmapWindow(WindowPtr pWin); extern void PsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern Bool PsChangeWindowAttributes(WindowPtr pWin, unsigned long mask); -extern void PsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); extern Bool PsDestroyWindow(WindowPtr pWin); /* diff --git a/hw/xprint/ps/PsInit.c b/hw/xprint/ps/PsInit.c index 639908f73..6d4bd06f3 100644 --- a/hw/xprint/ps/PsInit.c +++ b/hw/xprint/ps/PsInit.c @@ -169,8 +169,6 @@ InitializePsDriver(ndx, pScreen, argc, argv) pScreen->ChangeWindowAttributes = PsChangeWindowAttributes; pScreen->RealizeWindow = PsMapWindow; pScreen->UnrealizeWindow = PsUnmapWindow; - pScreen->PaintWindowBackground = PsPaintWindow; - pScreen->PaintWindowBorder = PsPaintWindow; pScreen->CloseScreen = PsCloseScreen; pScreen->CopyWindow = PsCopyWindow; /* XXX Hard routine to write! */ diff --git a/hw/xprint/ps/PsWindow.c b/hw/xprint/ps/PsWindow.c index 26075a80a..ded7dd638 100644 --- a/hw/xprint/ps/PsWindow.c +++ b/hw/xprint/ps/PsWindow.c @@ -213,230 +213,6 @@ PsChangeWindowAttributes( return TRUE; } - -void -PsPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PS output. - */ - if( PsGetContextFromWindow(pWin)==(XpContextPtr)NULL ) return; - - if( what==PW_BACKGROUND ) - { - switch(pWin->backgroundState) - { - case None: return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if( pWin->borderIsPixel ) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if( !prect ) return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while( pBgWin->backgroundState==ParentRelative ) pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if( !pGC ) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if( what==PW_BORDER ) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - - mask = gcmask; - gcmask = 0; - i = 0; - while( mask ) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case GCFunction: - if( (pointer)(long)pGC->alu!=newValues[FUNCTION] ) - { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if( (pointer)(long)pGC->patOrg.x!=newValues[ABSX] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if( (pointer)(long)pGC->patOrg.y!=newValues[ABSY] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if( (pointer)pGC->clientClipType!=(pointer)CT_NONE ) - { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if( (pointer)pGC->subWindowMode!=newValues[SUBWINDOW] ) - { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if( pGC->tileIsPixel || (pointer)pGC->tile.pixmap!=newValues[TILE] ) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if( (pointer)pGC->fillStyle!=newValues[FILLSTYLE] ) - { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if( (pointer)pGC->fgPixel!=newValues[FOREGROUND] ) - { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if( gcmask ) DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if( pWin->drawable.serialNumber!=pGC->serialNumber ) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for( i=numRects ; --i >= 0 ; pbox++,prect++ ) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if( what==PW_BORDER ) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); -} - /*ARGSUSED*/ Bool PsDestroyWindow(WindowPtr pWin) diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 09a9fb295..d3be39b73 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -579,8 +579,6 @@ typedef struct _winPrivScreenRec ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; @@ -1052,17 +1050,6 @@ winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, pointer pPixData); #endif - -#ifdef XWIN_NATIVEGDI -/* - * winpntwin.c - */ - -void -winPaintWindowNativeGDI (WindowPtr pWin, RegionPtr pRegion, int what); -#endif - - #ifdef XWIN_NATIVEGDI /* * winpolyline.c diff --git a/hw/xwin/winpntwin.c b/hw/xwin/winpntwin.c deleted file mode 100644 index caee712c9..000000000 --- a/hw/xwin/winpntwin.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *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 HAROLD L HUNT II 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 Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* See Porting Layer Definition - p. 39 - * Sometimes implemented as two functions: - * PaintWindowBackground (nKind = PW_BACKGROUND) - * PaintWindowBorder (nKind = PW_BORDER) - */ -void -winPaintWindowNativeGDI (WindowPtr pWin, - RegionPtr pRegion, - int nKind) -{ - ErrorF ("winPaintWindow()\n"); -} diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index 52adba819..a49f68f7e 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -717,8 +717,6 @@ winFinishScreenInitNativeGDI (int index, pScreen->UnrealizeWindow = winUnmapWindowNativeGDI; /* Paint window */ - pScreen->PaintWindowBackground = miPaintWindow; - pScreen->PaintWindowBorder = miPaintWindow; pScreen->CopyWindow = winCopyWindowNativeGDI; /* Fonts */ diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 110f4dce9..bcec02e39 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -477,8 +477,8 @@ typedef struct _Screen { ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; + PaintWindowBackgroundProcPtr PaintWindowBackground; /** unused */ + PaintWindowBorderProcPtr PaintWindowBorder; /** unused */ CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; diff --git a/mfb/Makefile.am b/mfb/Makefile.am index 8ff0260e7..274a32d7d 100644 --- a/mfb/Makefile.am +++ b/mfb/Makefile.am @@ -12,7 +12,7 @@ libmfb_gen_sources = mfbseg.c mfbpgbwht.c mfbpgbblak.c mfbpgbinv.c mfbigbwht.c \ DISTCLEANFILES = $(libmfb_gen_sources) libmfb_la_SOURCES = mfbgc.c mfbwindow.c mfbfont.c \ - mfbfillrct.c mfbpntwin.c maskbits.c mfbpixmap.c \ + mfbfillrct.c maskbits.c mfbpixmap.c \ mfbimage.c mfbline.c mfbbres.c mfbhrzvert.c mfbbresd.c \ mfbpushpxl.c mfbzerarc.c mfbfillarc.c \ mfbfillsp.c mfbsetsp.c mfbscrinit.c mfbscrclse.c mfbclip.c \ diff --git a/mfb/mfb.h b/mfb/mfb.h index bc07f02a3..69d2d6978 100644 --- a/mfb/mfb.h +++ b/mfb/mfb.h @@ -649,13 +649,6 @@ extern void mfbFillPolyWhite( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* mfbpntwin.c */ - -extern void mfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* mfbpolypnt.c */ extern void mfbPolyPoint( @@ -704,7 +697,6 @@ extern Bool mfbCloseScreen( extern Bool mfbAllocatePrivates( ScreenPtr /*pScreen*/, - int * /*pWinIndex*/, int * /*pGCIndex*/ ); @@ -893,24 +885,12 @@ typedef mfbPrivGC *mfbPrivGCPtr; /* XXX these should be static, but it breaks the ABI */ extern int mfbGCPrivateIndex; /* index into GC private array */ extern int mfbGetGCPrivateIndex(void); -extern int mfbWindowPrivateIndex; /* index into Window private array */ -extern int mfbGetWindowPrivateIndex(void); #ifdef PIXMAP_PER_WINDOW extern int frameWindowPrivateIndex; /* index into Window private array */ extern int frameGetWindowPrivateIndex(void); #endif #ifndef MFB_PROTOTYPES_ONLY -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } mfbPrivWin; - /* Common macros for extracting drawing information */ #define mfbGetTypedWidth(pDrawable,wtype) (\ diff --git a/mfb/mfbpntwin.c b/mfb/mfbpntwin.c deleted file mode 100644 index b18797a40..000000000 --- a/mfb/mfbpntwin.c +++ /dev/null @@ -1,126 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -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. - -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 -OPEN GROUP 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 Open Group 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 Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "mfb.h" -#include "maskbits.h" -#include "mi.h" - -void -mfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground); - return; - } - break; - case BackgroundPixel: - if (pWin->background.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - if (pWin->border.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - else if (pPrivWin->fastBorder) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c index 13ea5d365..6d364b76c 100644 --- a/mfb/mfbscrinit.c +++ b/mfb/mfbscrinit.c @@ -71,8 +71,6 @@ SOFTWARE. int frameWindowPrivateIndex; int frameGetWindowPrivateIndex(void) { return frameWindowPrivateIndex; } #endif -int mfbWindowPrivateIndex; -int mfbGetWindowPrivateIndex(void) { return mfbWindowPrivateIndex; } int mfbGCPrivateIndex; int mfbGetGCPrivateIndex(void) { return mfbGCPrivateIndex; } static unsigned long mfbGeneration = 0; @@ -90,30 +88,23 @@ static DepthRec depth = { }; Bool -mfbAllocatePrivates(pScreen, pWinIndex, pGCIndex) - ScreenPtr pScreen; - int *pWinIndex, *pGCIndex; +mfbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex) { if (mfbGeneration != serverGeneration) { #ifdef PIXMAP_PER_WINDOW frameWindowPrivateIndex = AllocateWindowPrivateIndex(); #endif - mfbWindowPrivateIndex = AllocateWindowPrivateIndex(); mfbGCPrivateIndex = miAllocateGCPrivateIndex(); visual.vid = FakeClientID(0); VID = visual.vid; mfbGeneration = serverGeneration; } - if (pWinIndex) - *pWinIndex = mfbWindowPrivateIndex; if (pGCIndex) *pGCIndex = mfbGCPrivateIndex; pScreen->GetWindowPixmap = mfbGetWindowPixmap; pScreen->SetWindowPixmap = mfbSetWindowPixmap; - return (AllocateWindowPrivate(pScreen, mfbWindowPrivateIndex, - sizeof(mfbPrivWin)) && - AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC))); + return AllocateGCPrivate(pScreen, mfbGCPrivateIndex, sizeof(mfbPrivGC)); } @@ -126,7 +117,7 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!mfbAllocatePrivates(pScreen, (int *)NULL, (int *)NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = (Colormap) FakeClientID(0); /* whitePixel, blackPixel */ @@ -135,13 +126,9 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->GetImage = mfbGetImage; pScreen->GetSpans = mfbGetSpans; pScreen->CreateWindow = mfbCreateWindow; - pScreen->DestroyWindow = mfbDestroyWindow; pScreen->PositionWindow = mfbPositionWindow; - pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes; pScreen->RealizeWindow = mfbMapWindow; pScreen->UnrealizeWindow = mfbUnmapWindow; - pScreen->PaintWindowBackground = mfbPaintWindow; - pScreen->PaintWindowBorder = mfbPaintWindow; pScreen->CopyWindow = mfbCopyWindow; pScreen->CreatePixmap = mfbCreatePixmap; pScreen->DestroyPixmap = mfbDestroyPixmap; diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c index b138d5805..4cbf59fdc 100644 --- a/mfb/mfbwindow.c +++ b/mfb/mfbwindow.c @@ -64,31 +64,14 @@ Bool mfbCreateWindow(pWin) register WindowPtr pWin; { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -mfbDestroyWindow(pWin) - WindowPtr pWin; +mfbDestroyWindow(WindowPtr pWin) { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return (TRUE); } @@ -113,35 +96,6 @@ mfbPositionWindow(pWin, x, y) register WindowPtr pWin; int x, y; { - register mfbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - mfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -211,131 +165,3 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) DEALLOCATE_LOCAL(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ -Bool -mfbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; -{ - register unsigned long index; - register mfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) - { - mfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} diff --git a/mi/mibank.c b/mi/mibank.c index 00638a4c2..3492f1e0e 100644 --- a/mi/mibank.c +++ b/mi/mibank.c @@ -121,8 +121,6 @@ typedef struct _miBankScreen GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; } miBankScreenRec, *miBankScreenPtr; @@ -1712,8 +1710,6 @@ miBankCloseScreen( SCREEN_UNWRAP(GetImage); SCREEN_UNWRAP(GetSpans); SCREEN_UNWRAP(CreateGC); - SCREEN_UNWRAP(PaintWindowBackground); - SCREEN_UNWRAP(PaintWindowBorder); SCREEN_UNWRAP(CopyWindow); Xfree(pScreenPriv); @@ -1877,71 +1873,6 @@ miBankCreateGC( return ret; } -static void -miBankPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - RegionRec tmpReg; - int i; - PaintWindowProcPtr PaintWindow; - - SCREEN_INIT; - SCREEN_SAVE; - - if (what == PW_BORDER) - { - SCREEN_UNWRAP(PaintWindowBorder); - PaintWindow = pScreen->PaintWindowBorder; - } - else - { - SCREEN_UNWRAP(PaintWindowBackground); - PaintWindow = pScreen->PaintWindowBackground; - } - - if (!IS_BANKED(pWin)) - { - (*PaintWindow)(pWin, pRegion, what); - } - else - { - REGION_NULL(pScreen, &tmpReg); - - for (i = 0; i < pScreenPriv->nBanks; i++) - { - if (!pScreenPriv->pBanks[i]) - continue; - - REGION_INTERSECT(pScreen, &tmpReg, pRegion, - pScreenPriv->pBanks[i]); - - if (REGION_NIL(&tmpReg)) - continue; - - SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); - - (*PaintWindow)(pWin, &tmpReg, what); - } - - REGION_UNINIT(pScreen, &tmpReg); - } - - if (what == PW_BORDER) - { - SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow); - } - else - { - SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow); - } - - SCREEN_RESTORE; -} - static void miBankCopyWindow( WindowPtr pWindow, @@ -2269,8 +2200,6 @@ miInitializeBanking( SCREEN_WRAP(GetImage, miBankGetImage); SCREEN_WRAP(GetSpans, miBankGetSpans); SCREEN_WRAP(CreateGC, miBankCreateGC); - SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow); - SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow); SCREEN_WRAP(CopyWindow, miBankCopyWindow); BANK_SCRPRIVLVAL = (pointer)pScreenPriv; diff --git a/mi/miexpose.c b/mi/miexpose.c index e82a0b573..03d4c27e0 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -307,8 +307,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, /* PaintWindowBackground doesn't clip, so we have to */ REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); + miPaintWindow((WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); if (extents) { @@ -517,7 +516,7 @@ miWindowExposures(pWin, prgn, other_exposed) REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); } if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); + miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !REGION_NIL(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -534,60 +533,13 @@ miWindowExposures(pWin, prgn, other_exposed) REGION_DESTROY( pWin->drawable.pScreen, exposures); } - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - _X_EXPORT void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { ScreenPtr pScreen = pWin->drawable.pScreen; ChangeGCVal gcval[5]; BITS32 gcmask; - PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + PixmapPtr pPixmap; GCPtr pGC; int i; BoxPtr pbox; @@ -595,8 +547,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) int numRects; int xoff, yoff; - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; + pPixmap = (*pScreen->GetWindowPixmap) (pWin); #ifdef COMPOSITE xoff = -pPixmap->screen_x; @@ -610,6 +561,9 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) if (what == PW_BACKGROUND) { + while (pWin->backgroundState == ParentRelative) + pWin = pWin->parent; + switch (pWin->backgroundState) { case None: return; diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 1dbb85da5..1dd28b85b 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -865,9 +865,10 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if((mival = pTree->valdata)) { if(!((*pPriv->InOverlay)(pTree->pWin))) { - if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) - (*pWin->drawable.pScreen->PaintWindowBorder)( - pTree->pWin, &mival->borderExposed, PW_BORDER); + if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) { + miPaintWindow(pTree->pWin, &mival->borderExposed, + PW_BORDER); + } REGION_UNINIT(pScreen, &mival->borderExposed); (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); @@ -903,10 +904,10 @@ miOverlayHandleExposures(WindowPtr pWin) REGION_RECTS(&val->after.exposed)); } } else { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); + if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) { + miPaintWindow(pChild, &val->after.borderExposed, + PW_BORDER); + } (*WindowExposures)(pChild, &val->after.exposed, NullRegion); } REGION_UNINIT(pScreen, &val->after.borderExposed); @@ -1066,8 +1067,7 @@ miOverlayWindowExposures( REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList); } if (prgn && !REGION_NIL(prgn)) - (*pScreen->PaintWindowBackground)( - pWin, prgn, PW_BACKGROUND); + miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !REGION_NIL(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -1738,7 +1738,7 @@ miOverlayClearToBackground( if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); + miPaintWindow(pWin, ®, PW_BACKGROUND); REGION_UNINIT(pScreen, ®); if (pBSReg) REGION_DESTROY(pScreen, pBSReg); diff --git a/mi/miscrinit.c b/mi/miscrinit.c index cc40cbede..d88eb7118 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -251,7 +251,7 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, pScreen->ValidateTree = miValidateTree; pScreen->PostValidateTree = (PostValidateTreeProcPtr) 0; pScreen->WindowExposures = miWindowExposures; - /* PaintWindowBackground, PaintWindowBorder, CopyWindow */ + /* CopyWindow */ pScreen->ClearToBackground = miClearToBackground; pScreen->ClipNotify = (ClipNotifyProcPtr) 0; pScreen->RestackWindow = (RestackWindowProcPtr) 0; diff --git a/mi/miwindow.c b/mi/miwindow.c index cab67ea07..77cb75009 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -118,7 +118,7 @@ miClearToBackground(pWin, x, y, w, h, generateExposures) if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); + miPaintWindow(pWin, ®, PW_BACKGROUND); REGION_UNINIT(pScreen, ®); if (pBSReg) REGION_DESTROY(pScreen, pBSReg); @@ -451,9 +451,7 @@ miHandleValidateExposures(pWin) if ( (val = pChild->valdata) ) { if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); + miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); REGION_UNINIT(pScreen, &val->after.borderExposed); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); REGION_UNINIT(pScreen, &val->after.exposed); diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 7ee013be1..bd49f3f0d 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -380,149 +380,6 @@ cwGetSpans(DrawablePtr pSrc, int wMax, DDXPointPtr ppt, int *pwidth, SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); } -static void -cwFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, unsigned long pixel) -{ - ScreenPtr pScreen = pDrawable->pScreen; - GCPtr pGC; - BoxPtr pBox; - int nbox, i; - ChangeGCVal v[3]; - - pGC = GetScratchGC(pDrawable->depth, pScreen); - v[0].val = GXcopy; - v[1].val = pixel; - v[2].val = FillSolid; - dixChangeGC(NullClient, pGC, (GCFunction | GCForeground | GCFillStyle), - NULL, v); - ValidateGC(pDrawable, pGC); - - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); - - for (i = 0; i < nbox; i++, pBox++) { - xRectangle rect; - rect.x = pBox->x1; - rect.y = pBox->y1; - rect.width = pBox->x2 - pBox->x1; - rect.height = pBox->y2 - pBox->y1; - (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &rect); - } - - FreeScratchGC(pGC); -} - -static void -cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, - int x_off, int y_off) -{ - ScreenPtr pScreen = pDrawable->pScreen; - GCPtr pGC; - BoxPtr pBox; - int nbox, i; - ChangeGCVal v[5]; - - pGC = GetScratchGC(pDrawable->depth, pScreen); - v[0].val = GXcopy; - v[1].val = FillTiled; - v[2].ptr = (pointer) pTile; - v[3].val = x_off; - v[4].val = y_off; - dixChangeGC(NullClient, pGC, (GCFunction | GCFillStyle | GCTile | - GCTileStipXOrigin | GCTileStipYOrigin), NULL, v); - - ValidateGC(pDrawable, pGC); - - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); - - for (i = 0; i < nbox; i++, pBox++) { - xRectangle rect; - rect.x = pBox->x1; - rect.y = pBox->y1; - rect.width = pBox->x2 - pBox->x1; - rect.height = pBox->y2 - pBox->y1; - (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &rect); - } - - FreeScratchGC(pGC); -} - -static void -cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, PaintWindowBackground); - - if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) { - (*pScreen->PaintWindowBackground)(pWin, pRegion, what); - } else { - DrawablePtr pBackingDrawable; - int x_off, y_off, x_screen, y_screen; - - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - - pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, - &y_off); - - x_screen = x_off - pWin->drawable.x; - y_screen = y_off - pWin->drawable.y; - - if (pWin && (pWin->backgroundState == BackgroundPixel || - pWin->backgroundState == BackgroundPixmap)) - { - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); - - if (pWin->backgroundState == BackgroundPixel) { - cwFillRegionSolid(pBackingDrawable, pRegion, - pWin->background.pixel); - } else { - cwFillRegionTiled(pBackingDrawable, pRegion, - pWin->background.pixmap, x_off, y_off); - } - - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); - } - } - - SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground); -} - -static void -cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, PaintWindowBorder); - - if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) { - (*pScreen->PaintWindowBorder)(pWin, pRegion, what); - } else { - DrawablePtr pBackingDrawable; - int x_off, y_off, x_screen, y_screen; - - pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, - &y_off); - - x_screen = x_off - pWin->drawable.x; - y_screen = y_off - pWin->drawable.y; - - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); - - if (pWin->borderIsPixel) { - cwFillRegionSolid(pBackingDrawable, pRegion, pWin->border.pixel); - } else { - cwFillRegionTiled(pBackingDrawable, pRegion, pWin->border.pixmap, - x_off, y_off); - } - - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); - } - - SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); -} static void cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) @@ -654,8 +511,6 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC); - SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground); - SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow); SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap); @@ -681,8 +536,6 @@ cwCloseScreen (int i, ScreenPtr pScreen) pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; pScreen->CreateGC = pScreenPriv->CreateGC; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; pScreen->CopyWindow = pScreenPriv->CopyWindow; #ifdef RENDER diff --git a/miext/cw/cw.h b/miext/cw/cw.h index 0d57b9b9d..8e42ac256 100644 --- a/miext/cw/cw.h +++ b/miext/cw/cw.h @@ -84,8 +84,6 @@ typedef struct { GetSpansProcPtr GetSpans; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; GetWindowPixmapProcPtr GetWindowPixmap; diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 472b1b887..58f37e990 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1634,35 +1634,6 @@ damageDestroyPixmap (PixmapPtr pPixmap) return TRUE; } -static void -damagePaintWindow(WindowPtr pWindow, - RegionPtr prgn, - int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - /* - * Painting background none doesn't actually *do* anything, so - * no damage is recorded - */ - if ((what != PW_BACKGROUND || pWindow->backgroundState != None) && - getWindowDamage (pWindow)) - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - if(what == PW_BACKGROUND) { - unwrap (pScrPriv, pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWindow, prgn, what); - damageReportPostOp (&pWindow->drawable); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - } else { - unwrap (pScrPriv, pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWindow, prgn, what); - damageReportPostOp (&pWindow->drawable); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - } -} - - static void damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, @@ -1763,8 +1734,6 @@ damageCloseScreen (int i, ScreenPtr pScreen) unwrap (pScrPriv, pScreen, DestroyPixmap); unwrap (pScrPriv, pScreen, CreateGC); - unwrap (pScrPriv, pScreen, PaintWindowBackground); - unwrap (pScrPriv, pScreen, PaintWindowBorder); unwrap (pScrPriv, pScreen, CopyWindow); unwrap (pScrPriv, pScreen, CloseScreen); xfree (pScrPriv); @@ -1814,8 +1783,6 @@ DamageSetup (ScreenPtr pScreen) wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h index 1e0efad4f..e603f02a4 100755 --- a/miext/damage/damagestr.h +++ b/miext/damage/damagestr.h @@ -60,8 +60,6 @@ typedef struct _damageScrPriv { */ DamagePtr pScreenDamage; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CloseScreenProcPtr CloseScreen; CreateGCProcPtr CreateGC; diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index 3bf6af02f..66b930d36 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -86,8 +86,6 @@ typedef struct _RootlessScreenRec { ChangeWindowAttributesProcPtr ChangeWindowAttributes; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; GetImageProcPtr GetImage; SourceValidateProcPtr SourceValidate; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 700de6edc..0bcd2f7f1 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -598,8 +598,6 @@ RootlessWrap(ScreenPtr pScreen) WRAP(CreateScreenResources); WRAP(CloseScreen); WRAP(CreateGC); - WRAP(PaintWindowBackground); - WRAP(PaintWindowBorder); WRAP(CopyWindow); WRAP(GetImage); WRAP(SourceValidate); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 30b7daaab..f7126590b 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -217,10 +217,8 @@ RootlessSetShape(WindowPtr pWin) /* Disallow ParentRelative background on top-level windows - because the root window doesn't really have the right background - and fb will try to draw on the root instead of on the window. - ParentRelative prevention is also in PaintWindowBackground/Border() - so it is no longer really needed here. */ + because the root window doesn't really have the right background. + */ Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask) { @@ -670,7 +668,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, /* * RootlessCopyWindow * Update *new* location of window. Old location is redrawn with - * PaintWindowBackground/Border. Cloned from fbCopyWindow. + * miPaintWindow. Cloned from fbCopyWindow. * The original always draws on the root pixmap, which we don't have. * Instead, draw on the parent window's pixmap. */ @@ -1326,96 +1324,6 @@ out: } } - -/* - * SetPixmapOfAncestors - * Set the Pixmaps on all ParentRelative windows up the ancestor chain. - */ -static void -SetPixmapOfAncestors(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr topWin = TopLevelParent(pWin); - RootlessWindowRec *topWinRec = WINREC(topWin); - - while (pWin->backgroundState == ParentRelative) { - if (pWin == topWin) { - // disallow ParentRelative background state on top level - XID pixel = 0; - ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); - RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); - break; - } - - pWin = pWin->parent; - pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); - } -} - - -/* - * RootlessPaintWindowBackground - */ -void -RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (IsRoot(pWin)) - return; - - RL_DEBUG_MSG("paintwindowbackground start (win 0x%x, framed %i) ", - pWin, IsFramedWindow(pWin)); - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows, we have to make sure the window - // pixmap is set correctly all the way up the ancestor chain. - if (pWin->backgroundState == ParentRelative) { - SetPixmapOfAncestors(pWin); - } - } - - SCREEN_UNWRAP(pScreen, PaintWindowBackground); - pScreen->PaintWindowBackground(pWin, pRegion, what); - SCREEN_WRAP(pScreen, PaintWindowBackground); - - RL_DEBUG_MSG("paintwindowbackground end\n"); -} - - -/* - * RootlessPaintWindowBorder - */ -void -RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin); - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows with tiled borders, we have to make - // sure the window pixmap is set correctly all the way up the - // ancestor chain. - if (!pWin->borderIsPixel && - pWin->backgroundState == ParentRelative) - { - SetPixmapOfAncestors(pWin); - } - } - - SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder); - pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what); - SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder); - - RL_DEBUG_MSG("paintwindowborder end\n"); -} - - /* * RootlessChangeBorderWidth * FIXME: untested! diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h index 093a2b384..9573068b4 100644 --- a/miext/rootless/rootlessWindow.h +++ b/miext/rootless/rootlessWindow.h @@ -54,10 +54,6 @@ void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind); void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib); void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent); -void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, - int what); -void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, - int what); void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width); #endif diff --git a/miext/rootless/safeAlpha/Makefile.am b/miext/rootless/safeAlpha/Makefile.am index 7592c1840..823fb777d 100644 --- a/miext/rootless/safeAlpha/Makefile.am +++ b/miext/rootless/safeAlpha/Makefile.am @@ -6,7 +6,6 @@ INCLUDES = -I$(srcdir)/.. -I$(top_srcdir)/hw/xfree86/os-support noinst_LTLIBRARIES = libsafeAlpha.la -libsafeAlpha_la_SOURCES = safeAlphaPicture.c \ - safeAlphaWindow.c +libsafeAlpha_la_SOURCES = safeAlphaPicture.c EXTRA_DIST = safeAlpha.h diff --git a/miext/rootless/safeAlpha/safeAlpha.h b/miext/rootless/safeAlpha/safeAlpha.h index bd1ce3203..9b9b39c92 100644 --- a/miext/rootless/safeAlpha/safeAlpha.h +++ b/miext/rootless/safeAlpha/safeAlpha.h @@ -32,8 +32,6 @@ #include "picturestr.h" -void SafeAlphaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - #ifdef RENDER void SafeAlphaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, diff --git a/miext/rootless/safeAlpha/safeAlphaWindow.c b/miext/rootless/safeAlpha/safeAlphaWindow.c deleted file mode 100644 index 5226782fe..000000000 --- a/miext/rootless/safeAlpha/safeAlphaWindow.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Specialized window functions to protect the alpha channel - */ -/* - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * 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 ABOVE LISTED COPYRIGHT HOLDER(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(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* Portions of this file are based on fbwindow.c, which contains the - * following copyright: - * - * Copyright © 1998 Keith Packard - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif -#include "fb.h" -#include "safeAlpha.h" -#include "rootlessCommon.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - * SafeAlphaFillRegionTiled - * Fill using a tile while leaving the alpha channel untouched. - * Based on fbfillRegionTiled. - */ -void -SafeAlphaFillRegionTiled( - DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile) -{ - FbBits *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbBits *tile; - FbStride tileStride; - int tileBpp; - int tileXoff, tileYoff; /* XXX assumed to be zero */ - int tileWidth, tileHeight; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); - int xRot = pDrawable->x; - int yRot = pDrawable->y; - FbBits planeMask; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - { - int index = pDrawable->pScreen->myNum; - if(&WindowTable[index]->drawable == pDrawable) - { - xRot -= panoramiXdataPtr[index].x; - yRot -= panoramiXdataPtr[index].y; - } - } -#endif - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, - tileXoff, tileYoff); - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - xRot += dstXoff; - yRot += dstYoff; - planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp); - - while (n--) - { - fbTile (dst + (pbox->y1 + dstYoff) * dstStride, - dstStride, - (pbox->x1 + dstXoff) * dstBpp, - (pbox->x2 - pbox->x1) * dstBpp, - pbox->y2 - pbox->y1, - tile, - tileStride, - tileWidth * dstBpp, - tileHeight, - GXcopy, - planeMask, - dstBpp, - xRot * dstBpp, - yRot - pbox->y1); - pbox++; - } -} - - -/* - * SafeAlphaPaintWindow - * Paint the window while filling in the alpha channel with all on. - * We can't use fbPaintWindow because it zeros the alpha channel. - */ -void -SafeAlphaPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - switch (what) { - case PW_BACKGROUND: - - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - SafeAlphaFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap); - break; - case BackgroundPixel: - { - Pixel pixel = pWin->background.pixel | - RootlessAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - break; - } - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - Pixel pixel = pWin->border.pixel | - RootlessAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - } - else - { - WindowPtr pBgWin; - for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - SafeAlphaFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap); - } - break; - } - fbValidateDrawable (&pWin->drawable); -} From 7bd65577018a574970b767b67967b65fcd5c2bf0 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sat, 15 Sep 2007 14:01:57 +0200 Subject: [PATCH 75/81] Initialize output->pendingProperties. --- randr/rroutput.c | 1 + 1 file changed, 1 insertion(+) diff --git a/randr/rroutput.c b/randr/rroutput.c index a67e4931a..c1e971ddc 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -95,6 +95,7 @@ RROutputCreate (ScreenPtr pScreen, output->numUserModes = 0; output->userModes = NULL; output->properties = NULL; + output->pendingProperties = FALSE; output->changed = FALSE; output->devPrivate = devPrivate; From a0dafd95e1e13a2f1b77ab9f82fd365a7be19de5 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 17 Sep 2007 16:45:20 +0200 Subject: [PATCH 76/81] Removed hw/xwin/winpntwin.c from Makefile.am. winpntwin.c was removed in e4d11e58ce349dfe6af2f73ff341317f9b39684c. --- hw/xwin/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 8aaed8c21..5ffba1274 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -45,7 +45,6 @@ SRCS_NATIVEGDI = \ wingetsp.c \ winnativegdi.c \ winpixmap.c \ - winpntwin.c \ winpolyline.c \ winpushpxl.c \ winrop.c \ From d5738ff2e0f93df4729c075ce31a1041d580e50e Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 17 Sep 2007 16:59:03 +0200 Subject: [PATCH 77/81] EXA: Added missing exaPrepare/FinishAccess calls in ExaCheckPushPixels. --- exa/exa_unaccel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index d487dc5f2..aecbfeb2d 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -258,9 +258,11 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, exaDrawableLocation(&pBitmap->drawable), exaDrawableLocation(pDrawable))); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccess (pBitmap, EXA_PREPARE_SRC); exaPrepareAccessGC (pGC); fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y); exaFinishAccessGC (pGC); + exaFinishAccess (pBitmap, EXA_PREPARE_SRC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); } From 3876c6c80534a6f7412ec806a2ba9ada22c5e505 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Mon, 17 Sep 2007 18:47:45 +0200 Subject: [PATCH 78/81] EXA: Fixed compiler warnings. --- exa/exa_unaccel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index aecbfeb2d..fcd4af953 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -258,11 +258,11 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, exaDrawableLocation(&pBitmap->drawable), exaDrawableLocation(pDrawable))); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - exaPrepareAccess (pBitmap, EXA_PREPARE_SRC); + exaPrepareAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaPrepareAccessGC (pGC); fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y); exaFinishAccessGC (pGC); - exaFinishAccess (pBitmap, EXA_PREPARE_SRC); + exaFinishAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); } From 7ac89060e02c7a803018afd580720f8326561fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 17 Sep 2007 20:33:55 +0200 Subject: [PATCH 79/81] EXA: Don't crash in exaGetImage when swapped out. --- exa/exa_accel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 8500c5b7c..2acade263 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1324,9 +1324,6 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, int xoff, yoff; Bool ok; - if (pExaScr->swappedOut) - goto fallback; - pixmaps[0].as_dst = FALSE; pixmaps[0].as_src = TRUE; pixmaps[0].pPix = pPix = exaGetDrawablePixmap (pDrawable); @@ -1341,6 +1338,9 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, REGION_INIT(pScreen, &Reg, &Box, 1); + if (pExaScr->swappedOut) + goto fallback; + exaDoMigration(pixmaps, 1, FALSE); pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); From 56cc24ffb21f7fd41f9ea9e8f969aa85021b9f53 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 17 Sep 2007 20:33:56 +0200 Subject: [PATCH 80/81] EXA: Don't crash in ExaCheckPolyArc. See https://bugs.freedesktop.org/show_bug.cgi?id=12286 . --- exa/exa_unaccel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index fcd4af953..c55ef032b 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -196,6 +196,12 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *pArcs) { EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); + + /* Disable this as fbPolyArc can call miZeroPolyArc which in turn + * can call accelerated functions, that as yet, haven't been notified + * with exaFinishAccess(). + */ +#if 0 if (pGC->lineWidth == 0) { exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); @@ -205,6 +211,7 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, exaFinishAccess (pDrawable, EXA_PREPARE_DEST); return; } +#endif miPolyArc (pDrawable, pGC, narcs, pArcs); } From 547ad2125ece93bbe01f6d09a3baf176ebd16bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 17 Sep 2007 20:33:56 +0200 Subject: [PATCH 81/81] EXA: Make sure driver hooks get correct offscreen offsets from exaCopyDirty. This should ensure the driver UploadTo/DownloadFromScreen hooks can always work as intended. --- exa/exa_migration.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exa/exa_migration.c b/exa/exa_migration.c index ace90765d..c0e022ca7 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -127,7 +127,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, ExaPixmapPriv (pPixmap); RegionPtr damage = DamageRegion (pExaPixmap->pDamage); RegionRec CopyReg; - CARD8 *save_ptr; + Bool save_offscreen; int save_pitch; BoxPtr pBox; int nbox; @@ -176,9 +176,9 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, pBox = REGION_RECTS(&CopyReg); nbox = REGION_NUM_RECTS(&CopyReg); - save_ptr = pPixmap->devPrivate.ptr; + save_offscreen = pExaPixmap->offscreen; save_pitch = pPixmap->devKind; - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pExaPixmap->offscreen = TRUE; pPixmap->devKind = pExaPixmap->fb_pitch; while (nbox--) { @@ -216,7 +216,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, else sync (pPixmap->drawable.pScreen); - pPixmap->devPrivate.ptr = save_ptr; + pExaPixmap->offscreen = save_offscreen; pPixmap->devKind = save_pitch; /* The copied bits are now valid in destination */