aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h16
-rw-r--r--xorg-server/hw/xfree86/common/xf86DGA.c29
-rw-r--r--xorg-server/hw/xfree86/loader/sdksyms.c2
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.c4
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.h8
-rw-r--r--xorg-server/hw/xfree86/modes/xf86DiDGA.c15
-rw-r--r--xorg-server/hw/xfree86/modes/xf86EdidModes.c2
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Rotate.c10
-rw-r--r--xorg-server/hw/xfree86/os-support/hurd/hurd_video.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c52
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/bios_mmap.c2
-rw-r--r--xorg-server/hw/xfree86/vgahw/vgaHW.c16
12 files changed, 122 insertions, 36 deletions
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index 71a94c0c8..ae6a4615c 100644
--- a/xorg-server/hw/xfree86/common/compiler.h
+++ b/xorg-server/hw/xfree86/common/compiler.h
@@ -1211,6 +1211,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
+extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
+extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
/* Some macros to hide the system dependencies for MMIO accesses */
/* Changed to kill noise generated by gcc's -Wcast-align */
@@ -1342,4 +1344,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
# define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
# endif /* __alpha__ */
+
+/*
+ * With Intel, the version in os-support/misc/SlowBcopy.s is used.
+ * This avoids port I/O during the copy (which causes problems with
+ * some hardware).
+ */
+# ifdef __alpha__
+# define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
+# define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
+# else /* __alpha__ */
+# define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
+# define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
+# endif /* __alpha__ */
+
#endif /* _COMPILER_H */
diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c
index 42b7c5805..804fd37c1 100644
--- a/xorg-server/hw/xfree86/common/xf86DGA.c
+++ b/xorg-server/hw/xfree86/common/xf86DGA.c
@@ -120,8 +120,22 @@ DGAInit(
DGAScreenKey = &DGAScreenKeyIndex;
- if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
- return FALSE;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if (!pScreenPriv)
+ {
+ if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
+ return FALSE;
+ dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = DGACloseScreen;
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
+ pScreen->DestroyColormap = DGADestroyColormap;
+ pScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreen->InstallColormap = DGAInstallColormap;
+ pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
+ pScreen->UninstallColormap = DGAUninstallColormap;
+ }
pScreenPriv->pScrn = pScrn;
pScreenPriv->numModes = num;
@@ -146,17 +160,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
- dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = DGACloseScreen;
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
- pScreen->DestroyColormap = DGADestroyColormap;
- pScreenPriv->InstallColormap = pScreen->InstallColormap;
- pScreen->InstallColormap = DGAInstallColormap;
- pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
- pScreen->UninstallColormap = DGAUninstallColormap;
-
-
return TRUE;
}
diff --git a/xorg-server/hw/xfree86/loader/sdksyms.c b/xorg-server/hw/xfree86/loader/sdksyms.c
index df06ef561..12af6b72e 100644
--- a/xorg-server/hw/xfree86/loader/sdksyms.c
+++ b/xorg-server/hw/xfree86/loader/sdksyms.c
@@ -740,6 +740,7 @@ _X_HIDDEN void *xorg_symbols[] = {
(void *) &IsKeyboardDevice,
(void *) &IsPointerEvent,
(void *) &IsMaster,
+ (void *) &CopyKeyClass,
(void *) &CorePointerProc,
(void *) &CoreKeyboardProc,
(void *) &SecurityLookupWindow,
@@ -804,6 +805,7 @@ _X_HIDDEN void *xorg_symbols[] = {
(void *) &FreeColors,
(void *) &StoreColors,
(void *) &IsMapInstalled,
+ (void *) &ResizeVisualArray,
(void *) &screenInfo,
(void *) &InitOutput,
(void *) &FindGlyphHashSet,
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c
index c1e31e003..506fbb9cb 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.c
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c
@@ -806,7 +806,7 @@ xf86CrtcScreenInit (ScreenPtr screen)
screen->CloseScreen = xf86CrtcCloseScreen;
#ifdef XFreeXDGA
- xf86DiDGAInit(screen, 0);
+ _xf86_di_dga_init_internal(screen);
#endif
#ifdef RANDR_13_INTERFACE
return RANDR_INTERFACE_VERSION;
@@ -1928,7 +1928,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
scrn->currentMode = scrn->modes;
#ifdef XFreeXDGA
if (scrn->pScreen)
- xf86DiDGAReInit(scrn->pScreen);
+ _xf86_di_dga_reinit_internal(scrn->pScreen);
#endif
}
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h
index 69afaa5d1..9baa956a3 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.h
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h
@@ -833,6 +833,10 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus);
extern _X_EXPORT Bool
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address);
+/* this is the real function, used only internally */
+_X_INTERNAL Bool
+_xf86_di_dga_init_internal (ScreenPtr pScreen);
+
/**
* Re-initialize dga for this screen (as when the set of modes changes)
*/
@@ -841,6 +845,10 @@ extern _X_EXPORT Bool
xf86DiDGAReInit (ScreenPtr pScreen);
#endif
+/* This is the real function, used only internally */
+_X_INTERNAL Bool
+_xf86_di_dga_reinit_internal (ScreenPtr pScreen);
+
/*
* Set the subpixel order reported for the screen using
* the information from the outputs
diff --git a/xorg-server/hw/xfree86/modes/xf86DiDGA.c b/xorg-server/hw/xfree86/modes/xf86DiDGA.c
index 0f7b8342c..60fbdbf05 100644
--- a/xorg-server/hw/xfree86/modes/xf86DiDGA.c
+++ b/xorg-server/hw/xfree86/modes/xf86DiDGA.c
@@ -175,6 +175,12 @@ static DGAFunctionRec xf86_dga_funcs = {
Bool
xf86DiDGAReInit (ScreenPtr pScreen)
{
+ return TRUE;
+}
+
+Bool
+_xf86_di_dga_reinit_internal (ScreenPtr pScreen)
+{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -190,12 +196,15 @@ xf86DiDGAReInit (ScreenPtr pScreen)
Bool
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
{
+ return TRUE;
+}
+
+Bool
+_xf86_di_dga_init_internal (ScreenPtr pScreen)
+{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- if (DGAAvailable(pScreen->myNum))
- return TRUE;
-
xf86_config->dga_flags = 0;
xf86_config->dga_address = 0;
xf86_config->dga_width = 0;
diff --git a/xorg-server/hw/xfree86/modes/xf86EdidModes.c b/xorg-server/hw/xfree86/modes/xf86EdidModes.c
index 6e11f9a3d..2f80070cf 100644
--- a/xorg-server/hw/xfree86/modes/xf86EdidModes.c
+++ b/xorg-server/hw/xfree86/modes/xf86EdidModes.c
@@ -957,7 +957,7 @@ xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC)
quirks = xf86DDCDetectQuirks(scrnIndex, DDC, FALSE);
- if (Monitor->widthmm <= 0 && Monitor->heightmm <= 0) {
+ if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) {
Monitor->widthmm = 10 * DDC->features.hsize;
Monitor->heightmm = 10 * DDC->features.vsize;
}
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c
index 9e65c9969..5de6b0c00 100644
--- a/xorg-server/hw/xfree86/modes/xf86Rotate.c
+++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c
@@ -268,13 +268,9 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
rotation_active = xf86RotateRedisplay(pScreen);
pScreen->BlockHandler = xf86_config->BlockHandler;
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
- if (rotation_active) {
- /* Re-wrap if rotation is still happening */
- xf86_config->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = xf86RotateBlockHandler;
- } else {
- xf86_config->BlockHandler = NULL;
- }
+ /* cannot avoid re-wrapping until all wrapping is audited */
+ xf86_config->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = xf86RotateBlockHandler;
}
void
diff --git a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c
index b8b00c892..4a99db375 100644
--- a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c
@@ -42,7 +42,7 @@
* Video Memory Mapping section
***************************************************************************/
static pointer
-mapVidMem(int ScreenNum,int Flags, unsigned long Base, unsigned long Size)
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
{
mach_port_t device,iopl_dev;
memory_object_t iopl_mem;
diff --git a/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c b/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c
index 8a5017e52..182a3e6ec 100644
--- a/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -1,8 +1,15 @@
+/*******************************************************************************
+ for Alpha Linux
+*******************************************************************************/
+
/*
* Create a dependency that should be immune from the effect of register
* renaming as is commonly seen in superscalar processors. This should
* insert a minimum of 100-ns delays between reads/writes at clock rates
* up to 100 MHz---GGL
+ *
+ * Slowbcopy(char *src, char *dst, int count)
+ *
*/
#ifdef HAVE_XORG_CONFIG_H
@@ -47,3 +54,48 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
while(len--)
*dst++ = *src++;
}
+
+#ifdef __alpha__
+
+#ifdef linux
+
+#define SPARSE (7)
+
+#else
+
+#define SPARSE 0
+
+#endif
+
+void
+xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
+{
+ unsigned long addr;
+ long result;
+
+ addr = (unsigned long) src;
+ while( count ){
+ result = *(volatile int *) addr;
+ result >>= ((addr>>SPARSE) & 3) * 8;
+ *dst++ = (unsigned char) (0xffUL & result);
+ addr += 1<<SPARSE;
+ count--;
+ outb(0x80, 0x00);
+ }
+}
+
+void
+xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
+{
+ unsigned long addr;
+
+ addr = (unsigned long) dst;
+ while(count) {
+ *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
+ src++;
+ addr += 1<<SPARSE;
+ count--;
+ outb(0x80, 0x00);
+ }
+}
+#endif
diff --git a/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c b/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
index a615a1d45..40afd5b8e 100644
--- a/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/xorg-server/hw/xfree86/os-support/shared/bios_mmap.c
@@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
return(-1);
}
- xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
+ xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);
diff --git a/xorg-server/hw/xfree86/vgahw/vgaHW.c b/xorg-server/hw/xfree86/vgahw/vgaHW.c
index 025dde2da..004376b75 100644
--- a/xorg-server/hw/xfree86/vgahw/vgaHW.c
+++ b/xorg-server/hw/xfree86/vgahw/vgaHW.c
@@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo1) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
+ slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
}
#endif
@@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->FontInfo2) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
+ slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
}
#endif
@@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
if (hwp->TextInfo) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
+ slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
+ slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
hwp->Base, TEXT_AMOUNT);
}
#endif
@@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
- xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
+ slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
}
#endif /* SAVE_FONT1 */
#if SAVE_FONT2
if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
- xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
+ slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
}
#endif /* SAVE_FONT2 */
#if SAVE_TEXT
if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
- xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
+ slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
- xf86SlowBcopy(hwp->Base,
+ slowbcopy_frombus(hwp->Base,
(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
}
#endif /* SAVE_TEXT */