summaryrefslogtreecommitdiff
path: root/driver/xf86-video-sunleo
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-03-07 10:15:50 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-03-07 10:15:50 +0000
commit9023e4af149e06454e8afeac2f99464fb32d6047 (patch)
treee7624bd41041c03deb4e095c5315a1b078abfb00 /driver/xf86-video-sunleo
parent73f6527097c1ca59fc2547e93e498b39c9d8378d (diff)
update to xf86-video-sunleo 1.2.0
Diffstat (limited to 'driver/xf86-video-sunleo')
-rw-r--r--driver/xf86-video-sunleo/configure.ac2
-rw-r--r--driver/xf86-video-sunleo/man/sunleo.man4
-rw-r--r--driver/xf86-video-sunleo/src/leo.h21
-rw-r--r--driver/xf86-video-sunleo/src/leo_accel.c27
-rw-r--r--driver/xf86-video-sunleo/src/leo_checks.c4
-rw-r--r--driver/xf86-video-sunleo/src/leo_driver.c8
-rw-r--r--driver/xf86-video-sunleo/src/leo_frect.c8
-rw-r--r--driver/xf86-video-sunleo/src/leo_frectsp.c4
-rw-r--r--driver/xf86-video-sunleo/src/leo_fspans.c16
-rw-r--r--driver/xf86-video-sunleo/src/leo_fspanssp.c16
-rw-r--r--driver/xf86-video-sunleo/src/leo_glyph.c8
-rw-r--r--driver/xf86-video-sunleo/src/leo_regs.h2
12 files changed, 62 insertions, 58 deletions
diff --git a/driver/xf86-video-sunleo/configure.ac b/driver/xf86-video-sunleo/configure.ac
index 3d72c9d16..2bc09fd82 100644
--- a/driver/xf86-video-sunleo/configure.ac
+++ b/driver/xf86-video-sunleo/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-sunleo],
- 1.1.0,
+ 1.2.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-sunleo)
diff --git a/driver/xf86-video-sunleo/man/sunleo.man b/driver/xf86-video-sunleo/man/sunleo.man
index 9735f0db9..44c796134 100644
--- a/driver/xf86-video-sunleo/man/sunleo.man
+++ b/driver/xf86-video-sunleo/man/sunleo.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.man,v 1.2 2001/01/27 18:20:54 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.man,v 1.3 2003/07/16 00:50:13 dawes Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH SUNLEO __drivermansuffix__ __vendorversion__
@@ -59,7 +59,7 @@ Please refer to __xconfigfile__(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.SH "SEE ALSO"
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
+__xservername__(1), __xconfigfile__(__filemansuffix__), xorgconfig(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
Driver authors include: Jakub Jelinek <jakub@redhat.com>
.br
diff --git a/driver/xf86-video-sunleo/src/leo.h b/driver/xf86-video-sunleo/src/leo.h
index b3454a0c6..46955a6a8 100644
--- a/driver/xf86-video-sunleo/src/leo.h
+++ b/driver/xf86-video-sunleo/src/leo.h
@@ -84,23 +84,16 @@ typedef struct {
OptionInfoPtr Options;
} LeoRec, *LeoPtr;
-extern int LeoScreenPrivateIndex;
-extern int LeoGCPrivateIndex;
-extern int LeoWindowPrivateIndex;
-
#define GET_LEO_FROM_SCRN(p) ((LeoPtr)((p)->driverPrivate))
-#define LeoGetScreenPrivate(s) \
-((LeoPtr) (s)->devPrivates[LeoScreenPrivateIndex].ptr)
-
-#define LeoGetGCPrivate(g) \
-((LeoPrivGCPtr) (g)->devPrivates [LeoGCPrivateIndex].ptr)
+extern int LeoGCPrivateIndex;
-#define LeoGetWindowPrivate(w) \
-((LeoStipplePtr) (w)->devPrivates[LeoWindowPrivateIndex].ptr)
-
-#define LeoSetWindowPrivate(w,p) \
-((w)->devPrivates[LeoWindowPrivateIndex].ptr = (pointer) p)
+#define LEO_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+#if LEO_OLDPRIV
+#define LeoGetGCPrivate(g) (g)->devPrivates[LeoGCPrivateIndex].ptr
+#else
+#define LeoGetGCPrivate(g) dixLookupPrivate(&(g)->devPrivates, &LeoGCPrivateIndex)
+#endif
extern int leoRopTable[];
diff --git a/driver/xf86-video-sunleo/src/leo_accel.c b/driver/xf86-video-sunleo/src/leo_accel.c
index 149c6c882..9bfbc4a90 100644
--- a/driver/xf86-video-sunleo/src/leo_accel.c
+++ b/driver/xf86-video-sunleo/src/leo_accel.c
@@ -42,10 +42,7 @@
#include "leo.h"
-int LeoScreenPrivateIndex;
-int LeoGCPrivateIndex;
-int LeoWindowPrivateIndex;
-int LeoGeneration;
+int LeoGCPrivateIndex;
int leoRopTable[16] = {
LEO_ATTR_RGBE_ENABLE|LEO_ROP_ZERO, /* GXclear */
@@ -68,7 +65,8 @@ int leoRopTable[16] = {
void LeoVtChange (ScreenPtr pScreen, int enter)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN (pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
@@ -99,20 +97,19 @@ Bool LeoAccelInit (ScreenPtr pScreen, LeoPtr pLeo)
LeoCommand0 *lc0;
LeoDraw *ld0;
+#if LEO_OLDPRIV
+ static int LeoGeneration;
if (serverGeneration != LeoGeneration) {
- LeoScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (LeoScreenPrivateIndex == -1) return FALSE;
- LeoGCPrivateIndex = AllocateGCPrivateIndex ();
- LeoWindowPrivateIndex = AllocateWindowPrivateIndex ();
+ LeoGCPrivateIndex = AllocateGCPrivateIndex();
LeoGeneration = serverGeneration;
}
+ if (!AllocateGCPrivate(pScreen, LeoGCPrivateIndex, sizeof(LeoPrivGCRec)))
+ return FALSE;
+#else
+ if (!dixRequestPrivate(&LeoGCPrivateIndex, sizeof(LeoPrivGCRec)))
+ return FALSE;
+#endif
- /* Allocate private structures holding pointer to both videoRAM and control registers.
- We do not have to map these by ourselves, because the XServer did it for us; we
- only copy the pointers to out structures. */
- if (!AllocateGCPrivate(pScreen, LeoGCPrivateIndex, sizeof(LeoPrivGCRec))) return FALSE;
- if (!AllocateWindowPrivate(pScreen, LeoWindowPrivateIndex, 0)) return FALSE;
- pScreen->devPrivates[LeoScreenPrivateIndex].ptr = pLeo;
pLeo->lc0 = lc0 = (LeoCommand0 *) ((char *)pLeo->fb + LEO_LC0_VOFF);
pLeo->ld0 = ld0 = (LeoDraw *) ((char *)pLeo->fb + LEO_LD0_VOFF);
diff --git a/driver/xf86-video-sunleo/src/leo_checks.c b/driver/xf86-video-sunleo/src/leo_checks.c
index 27e80a85e..e2565b2a4 100644
--- a/driver/xf86-video-sunleo/src/leo_checks.c
+++ b/driver/xf86-video-sunleo/src/leo_checks.c
@@ -129,7 +129,9 @@ int
LeoCheckFill (GCPtr pGC, DrawablePtr pDrawable)
{
LeoPrivGCPtr gcPriv = LeoGetGCPrivate (pGC);
- LeoPtr pLeo = LeoGetScreenPrivate(pDrawable->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoStipplePtr stipple;
unsigned int alu;
int xrot, yrot;
diff --git a/driver/xf86-video-sunleo/src/leo_driver.c b/driver/xf86-video-sunleo/src/leo_driver.c
index 47f624a88..664e645a1 100644
--- a/driver/xf86-video-sunleo/src/leo_driver.c
+++ b/driver/xf86-video-sunleo/src/leo_driver.c
@@ -21,7 +21,6 @@
* 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.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.8 2001/10/01 13:44:10 eich Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -31,7 +30,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Version.h"
#include "mipointer.h"
#include "mibstore.h"
#include "micmap.h"
@@ -66,9 +64,9 @@ void LeoSync(ScrnInfoPtr pScrn);
#define LEO_VERSION 4000
#define LEO_NAME "SUNLEO"
#define LEO_DRIVER_NAME "sunleo"
-#define LEO_MAJOR_VERSION 1
-#define LEO_MINOR_VERSION 1
-#define LEO_PATCHLEVEL 0
+#define LEO_MAJOR_VERSION PACKAGE_VERSION_MAJOR
+#define LEO_MINOR_VERSION PACKAGE_VERSION_MINOR
+#define LEO_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
/*
* This contains the functions needed by the server after loading the driver
diff --git a/driver/xf86-video-sunleo/src/leo_frect.c b/driver/xf86-video-sunleo/src/leo_frect.c
index e3a65fb81..dc5a17a72 100644
--- a/driver/xf86-video-sunleo/src/leo_frect.c
+++ b/driver/xf86-video-sunleo/src/leo_frect.c
@@ -39,7 +39,9 @@
void
LeoPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pDrawable->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
xRectangle *prect;
@@ -166,7 +168,9 @@ LeoPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
void
LeoPolyFillRect1Rect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pDrawable->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
xRectangle *prect;
diff --git a/driver/xf86-video-sunleo/src/leo_frectsp.c b/driver/xf86-video-sunleo/src/leo_frectsp.c
index c860a2601..f0e55c407 100644
--- a/driver/xf86-video-sunleo/src/leo_frectsp.c
+++ b/driver/xf86-video-sunleo/src/leo_frectsp.c
@@ -39,7 +39,9 @@
void
LeoPolyFillStippledRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pDrawable->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoPrivGCPtr gcPriv = LeoGetGCPrivate (pGC);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
diff --git a/driver/xf86-video-sunleo/src/leo_fspans.c b/driver/xf86-video-sunleo/src/leo_fspans.c
index ad375d933..23dcaac89 100644
--- a/driver/xf86-video-sunleo/src/leo_fspans.c
+++ b/driver/xf86-video-sunleo/src/leo_fspans.c
@@ -42,7 +42,9 @@ LeoFillSpansSolid (DrawablePtr pDrawable, GCPtr pGC,
int n, DDXPointPtr ppt,
int *pwidth, int fSorted)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pGC->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
int numRects, *pwidthFree;
@@ -66,11 +68,11 @@ LeoFillSpansSolid (DrawablePtr pDrawable, GCPtr pGC,
} else {
int nTmp = n * miFindMaxBand(clip);
- pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(nTmp * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec));
if (!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
n = miClipSpans(clip,
@@ -121,8 +123,8 @@ LeoFillSpansSolid (DrawablePtr pDrawable, GCPtr pGC,
}
if (numRects != 1) {
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
if (pGC->alu != GXcopy)
ld0->rop = LEO_ATTR_RGBE_ENABLE|LEO_ROP_NEW;
diff --git a/driver/xf86-video-sunleo/src/leo_fspanssp.c b/driver/xf86-video-sunleo/src/leo_fspanssp.c
index 26d27e41d..779edd9c4 100644
--- a/driver/xf86-video-sunleo/src/leo_fspanssp.c
+++ b/driver/xf86-video-sunleo/src/leo_fspanssp.c
@@ -43,7 +43,9 @@ LeoFillSpansStippled (DrawablePtr pDrawable, GCPtr pGC,
int *pwidth, int fSorted)
{
LeoPrivGCPtr gcPriv = LeoGetGCPrivate (pGC);
- LeoPtr pLeo = LeoGetScreenPrivate (pGC->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
int numRects, *pwidthFree;
@@ -67,11 +69,11 @@ LeoFillSpansStippled (DrawablePtr pDrawable, GCPtr pGC,
} else {
int nTmp = n * miFindMaxBand(clip);
- pwidthFree = (int *)ALLOCATE_LOCAL(nTmp * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(nTmp * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(nTmp * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(nTmp * sizeof(DDXPointRec));
if (!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
n = miClipSpans(clip,
@@ -159,8 +161,8 @@ LeoFillSpansStippled (DrawablePtr pDrawable, GCPtr pGC,
}
if (numRects != 1) {
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
if (pGC->alu != GXcopy)
ld0->rop = LEO_ATTR_RGBE_ENABLE|LEO_ROP_NEW;
diff --git a/driver/xf86-video-sunleo/src/leo_glyph.c b/driver/xf86-video-sunleo/src/leo_glyph.c
index 9399325aa..21a42d011 100644
--- a/driver/xf86-video-sunleo/src/leo_glyph.c
+++ b/driver/xf86-video-sunleo/src/leo_glyph.c
@@ -42,7 +42,9 @@ void
LeoPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y,
unsigned int nglyph, CharInfoPtr *ppci, pointer pGlyphBase)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pGC->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
RegionPtr clip;
@@ -167,7 +169,9 @@ void
LeoTEGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y,
unsigned int nglyph, CharInfoPtr *ppci, pointer pGlyphBase)
{
- LeoPtr pLeo = LeoGetScreenPrivate (pGC->pScreen);
+ ScreenPtr pScreen = pDrawable->pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ LeoPtr pLeo = GET_LEO_FROM_SCRN(pScrn);
LeoCommand0 *lc0 = pLeo->lc0;
LeoDraw *ld0 = pLeo->ld0;
RegionPtr clip;
diff --git a/driver/xf86-video-sunleo/src/leo_regs.h b/driver/xf86-video-sunleo/src/leo_regs.h
index 60686a9c9..e00158726 100644
--- a/driver/xf86-video-sunleo/src/leo_regs.h
+++ b/driver/xf86-video-sunleo/src/leo_regs.h
@@ -20,7 +20,7 @@
* 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.
*/
-/* $XFree86$ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_regs.h,v 1.1 2000/05/18 23:21:40 dawes Exp $ */
#ifndef LEOREGS_H
#define LEOREGS_H