summaryrefslogtreecommitdiff
path: root/fb
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2004-07-30 20:30:57 +0000
committerAdam Jackson <ajax@nwnk.net>2004-07-30 20:30:57 +0000
commit48514fee3c8ec26f36e142ffc9272e510b9a4238 (patch)
tree2f0aaa0b3861f7ace00d2c1f5d0bc6a5e0ab8e93 /fb
parent29012adb37c533f57c684ad94c4d83a6c31793e5 (diff)
Bug #400 (partial): Driver fixes for the dlloader. When using dlloader, all
framebuffer formats except cfb and the overlay modes should work, and r128 and radeon need to be loaded from the ati driver (both issues to be fixed soon). Tested on i740, s3virge, mach64, tdfx, vesa, and vga drivers. elfloader users shouldn't be affected.
Diffstat (limited to 'fb')
-rw-r--r--fb/fb.h13
-rw-r--r--fb/fballpriv.c12
-rw-r--r--fb/fboverlay.c7
-rw-r--r--fb/fboverlay.h7
4 files changed, 31 insertions, 8 deletions
diff --git a/fb/fb.h b/fb/fb.h
index 0b5c98aff..d9bd145c2 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -22,7 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.4 2004/06/21 13:51:57 ago Exp $ */
#ifndef _FB_H_
#define _FB_H_
@@ -564,9 +564,13 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
} \
}
+/* XXX fb*PrivateIndex should be static, but it breaks the ABI */
+
extern int fbGCPrivateIndex;
+extern int fbGetGCPrivateIndex(void);
#ifndef FB_NO_WINDOW_PIXMAPS
extern int fbWinPrivateIndex;
+extern int fbGetWinPrivateIndex(void);
#endif
extern const GCOps fbGCOps;
extern const GCFuncs fbGCFuncs;
@@ -587,6 +591,7 @@ extern WindowPtr *WindowTable;
#ifdef FB_SCREEN_PRIVATE
extern int fbScreenPrivateIndex;
+extern int fbGetScreenPrivateIndex(void);
/* private field of a screen */
typedef struct {
@@ -595,7 +600,7 @@ typedef struct {
} FbScreenPrivRec, *FbScreenPrivPtr;
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
- (pScreen)->devPrivates[fbScreenPrivateIndex].ptr)
+ (pScreen)->devPrivates[fbGetScreenPrivateIndex()].ptr)
#endif
/* private field of GC */
@@ -619,7 +624,7 @@ typedef struct {
} FbGCPrivRec, *FbGCPrivPtr;
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
- (pGC)->devPrivates[fbGCPrivateIndex].ptr)
+ (pGC)->devPrivates[fbGetGCPrivateIndex()].ptr)
#ifdef FB_OLD_GC
#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
@@ -638,7 +643,7 @@ typedef struct {
#define fbGetWindowPixmap(d) fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
#else
#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
- ((WindowPtr) (pWin))->devPrivates[fbWinPrivateIndex].ptr)
+ ((WindowPtr) (pWin))->devPrivates[fbGetWinPrivateIndex()].ptr)
#endif
#if defined(__DARWIN__)||defined(__CYGWIN__)
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
index e7fcfd45b..29e98ae9f 100644
--- a/fb/fballpriv.c
+++ b/fb/fballpriv.c
@@ -27,10 +27,22 @@
#ifdef FB_SCREEN_PRIVATE
int fbScreenPrivateIndex;
+int fbGetScreenPrivateIndex(void)
+{
+ return fbScreenPrivateIndex;
+}
#endif
int fbGCPrivateIndex;
+int fbGetGCPrivateIndex(void)
+{
+ return fbGCPrivateIndex;
+}
#ifndef FB_NO_WINDOW_PIXMAPS
int fbWinPrivateIndex;
+int fbGetWinPrivateIndex(void)
+{
+ return fbWinPrivateIndex;
+}
#endif
int fbGeneration;
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index fdd82edf7..98bd5fc1c 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -23,7 +23,7 @@
* Author: Keith Packard, SuSE, Inc.
*/
-/* $XdotOrg: $ */
+/* $XdotOrg: xc/programs/Xserver/fb/fboverlay.c,v 1.3 2004/05/16 05:08:39 alanc Exp $ */
#include "fb.h"
#include "fboverlay.h"
@@ -31,6 +31,11 @@
int fbOverlayGeneration;
int fbOverlayScreenPrivateIndex = -1;
+int fbOverlayGetScreenPrivateIndex(void)
+{
+ return fbOverlayScreenPrivateIndex;
+}
+
/*
* Replace this if you want something supporting
* multiple overlays with the same depth
diff --git a/fb/fboverlay.h b/fb/fboverlay.h
index 72891ece3..aecb3856f 100644
--- a/fb/fboverlay.h
+++ b/fb/fboverlay.h
@@ -27,7 +27,8 @@
#define _FBOVERLAY_H_
extern int fbOverlayGeneration;
-extern int fbOverlayScreenPrivateIndex;
+extern int fbOverlayScreenPrivateIndex; /* XXX should be static */
+extern int fbOverlayGetScreenPrivateIndex(void);
#ifndef FB_OVERLAY_MAX
#define FB_OVERLAY_MAX 2
@@ -58,8 +59,8 @@ typedef struct _fbOverlayScrPriv {
} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
#define fbOverlayGetScrPriv(s) \
- ((fbOverlayScreenPrivateIndex != -1) ? \
- (s)->devPrivates[fbOverlayScreenPrivateIndex].ptr : NULL)
+ ((fbOverlayGetScreenPrivateIndex() != -1) ? \
+ (s)->devPrivates[fbOverlayGetScreenPrivateIndex()].ptr : NULL)
Bool
fbOverlayCreateWindow(WindowPtr pWin);