summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-03-14 13:57:14 -0600
committerJordan Crouse <jordan.crouse@amd.com>2008-03-14 14:16:43 -0600
commitc42454a5d1fba9dc0ef4d671cb839108ef827ec9 (patch)
tree7604cfe24cf8a6d9dd68f4de9efadbe83f056e61 /src
parent5e1f6e925bd92c389169c971502b1fd17c625056 (diff)
amd: fix compile and warning issues from the merge
Diffstat (limited to 'src')
-rw-r--r--src/durango.c12
-rw-r--r--src/geode.h59
-rw-r--r--src/geode_driver.c71
-rw-r--r--src/geode_msr.c1
-rw-r--r--src/gfx/rndr_gu2.c3
-rw-r--r--src/gx_accel.c6
-rw-r--r--src/lx_driver.c6
-rw-r--r--src/lx_exa.c6
-rw-r--r--src/lx_rotate.c4
9 files changed, 64 insertions, 104 deletions
diff --git a/src/durango.c b/src/durango.c
index 6861acc..9d6970b 100644
--- a/src/durango.c
+++ b/src/durango.c
@@ -79,8 +79,7 @@
#define FB4MB 1 /* Set to use 4Mb vid ram for Pyramid */
-#define GFX_NO_IO_IN_WAIT_MACROS 1 /* Set to remove I/O accesses in GP
- * bit testing */
+#define GFX_NO_IO_IN_WAIT_MACROS 1 /* Set to remove I/O accesses in GP */
#define GFX_READ_ROUTINES 1
#include "gfx_rtns.h"
@@ -107,6 +106,15 @@ unsigned char *gfx_phys_vipptr = (unsigned char *)0x40015000;
#define OUTW(port,data) outw(port, data)
#define OUTD(port,data) outl(port, data)
+/* Squash warnings */
+unsigned char gfx_inb(unsigned short);
+unsigned short gfx_inw(unsigned short);
+unsigned long gfx_ind(unsigned short);
+
+void gfx_outb(unsigned short, unsigned char);
+void gfx_outw(unsigned short, unsigned short);
+void gfx_outd(unsigned short, unsigned long);
+
inline unsigned char
gfx_inb(unsigned short port)
{
diff --git a/src/geode.h b/src/geode.h
index 970bdc8..2490315 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -24,8 +24,8 @@
* software without specific prior written permission.
*/
-#ifndef _AMD_GEODE_H_
-#define _AMD_GEODE_H_
+#ifndef _GEODE_H_
+#define _GEODE_H_
#include "geode_pcirename.h"
@@ -36,6 +36,7 @@
#include "vgaHW.h"
#include "xf86int10.h"
#include <X11/extensions/randr.h>
+#include "randrstr.h"
#include "xf86xv.h"
@@ -53,13 +54,9 @@
#define INT10_SUPPORT 1
/* Existing Processor Models */
-#define GX1 0x1
-#define GX2 0x10
-#define GX2_CRT 0x11
-#define GX2_TFT 0x12
-#define LX 0x20
-#define LX_CRT 0x21
-#define LX_TFT 0x22
+#define GX1 0x01
+#define GX 0x10
+#define LX 0x20
#define PCI_VENDOR_ID_CYRIX 0x1078
#define PCI_VENDOR_ID_NS 0x100B
@@ -68,9 +65,10 @@
#define PCI_CHIP_5530 0x0104
#define PCI_CHIP_SC1200 0x0504
#define PCI_CHIP_SC1400 0x0104
-#define PCI_CHIP_REDCLOUD 0x0030
+#define PCI_CHIP_GEODEGX 0x0030
#define PCI_CHIP_GEODELX 0x2081
-#define GFX_CPU_GEODELX 4
+
+#define GFX_CPU_GEODELX 4
#ifdef HAVE_GX
#define GX_FILL_RECT_SUPPORT 1
@@ -456,11 +454,11 @@ GX_GeodeOpts;
#define DCON_DEFAULT_BPP 16
#define DCON_DEFAULT_REFRESH 50
-/* amd_dcon.c */
+/* geode_dcon.c */
extern Bool dcon_init(ScrnInfoPtr pScrni);
extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode, int flags);
-/* amd_common.c */
+/* geode_common.c */
void geode_memory_to_screen_blt(unsigned long, unsigned long,
unsigned long, unsigned long, long, long, int);
@@ -468,7 +466,7 @@ int GeodeGetRefreshRate(DisplayModePtr);
void GeodeCopyGreyscale(unsigned char *, unsigned char *, int, int, int, int);
int GeodeGetSizeFromFB(unsigned int *);
-/* amd_gx_video.c */
+/* gx_video.c */
int
GeodeQueryImageAttributes(ScrnInfoPtr, int id, unsigned short *w,
@@ -476,7 +474,7 @@ GeodeQueryImageAttributes(ScrnInfoPtr, int id, unsigned short *w,
Bool RegionsEqual(RegionPtr A, RegionPtr B);
-/* amd_gx_driver.c */
+/* gx_driver.c */
void GeodeProbeDDC(ScrnInfoPtr pScrni, int index);
xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index);
@@ -484,49 +482,56 @@ int GeodeGetFPGeometry(const char *str, int *width, int *height);
void GeodePointerMoved(int index, int x, int y);
void GeodeFreeScreen(int scrnIndex, int flags);
int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp);
+void GXSetupChipsetFPtr(ScrnInfoPtr pScrn);
-/* amd_msr.c */
+/* geode_msr.c */
int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi);
int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi);
-/* amd_gx_cursor.c */
+/* gx_cursor.c */
Bool GXHWCursorInit(ScreenPtr pScrn);
void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src);
void GXHideCursor(ScrnInfoPtr pScrni);
void GXShowCursor(ScrnInfoPtr pScrni);
-/* amd_gx_randr.c */
+/* gx_randr.c */
Rotation GXGetRotation(ScreenPtr pScreen);
Bool GXRandRInit(ScreenPtr pScreen, int rotation);
+Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize);
-/* amd_gx_rotate.c */
+/* gx_rotate.c */
Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode);
-/* amd_gx_accel.c */
+/* gx_accel.c */
Bool GXAccelInit(ScreenPtr pScrn);
+void GXAccelSync(ScrnInfoPtr pScrni);
-/* amd_gx_video.c */
+/* gx_video.c */
void GXInitVideo(ScreenPtr pScrn);
-/* amd_lx_cursor.c */
+/* lx_driver.c */
+void LXSetupChipsetFPtr(ScrnInfoPtr pScrn);
+
+/* lx_cursor.c */
Bool LXHWCursorInit(ScreenPtr pScrn);
void LXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src);
void LXHideCursor(ScrnInfoPtr pScrni);
void LXShowCursor(ScrnInfoPtr pScrni);
-/* amd_lx_randr.c */
+/* lx_randr.c */
Rotation LXGetRotation(ScreenPtr pScreen);
Bool LXRandRInit(ScreenPtr pScreen, int rotation);
+Bool LXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize);
-/* amd_lx_rotate.c */
+/* lx_rotate.c */
Bool LXSetRotatePitch(ScrnInfoPtr pScrni);
Bool LXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode);
Bool LXAllocShadow(ScrnInfoPtr pScrni);
-/* amd_lx_exa.c */
+/* lx_exa.c */
Bool LXExaInit(ScreenPtr pScreen);
-/* amd_lx_video.c */
+/* lx_video.c */
void LXInitVideo(ScreenPtr pScrn);
-#endif /* _AMD_GEODE_H_ */
+#endif
diff --git a/src/geode_driver.c b/src/geode_driver.c
index f04d5e4..8e467ec 100644
--- a/src/geode_driver.c
+++ b/src/geode_driver.c
@@ -96,7 +96,7 @@ static Bool AmdProbe(DriverPtr, int);
#ifdef XSERVER_LIBPCIACCESS
static const struct pci_id_match amdDeviceMatch[] = {
- {PCI_VENDOR_ID_NS, PCI_CHIP_REDCLOUD, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0,
+ {PCI_VENDOR_ID_NS, PCI_CHIP_GEODEGX, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0,
0},
{PCI_VENDOR_ID_AMD, PCI_CHIP_GEODELX, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0,
0},
@@ -158,7 +158,7 @@ DeviceModel ChipModel[] = {
{PCI_CHIP_GEODELX, LX},
#endif
#ifdef HAVE_GX
- {PCI_CHIP_REDCLOUD, GX2},
+ {PCI_CHIP_GEODEGX, GX},
#endif
{-1, 0}
};
@@ -166,10 +166,10 @@ DeviceModel ChipModel[] = {
/* Supported chipsets */
SymTabRec GeodeChipsets[] = {
#ifdef HAVE_LX
- {PCI_CHIP_GEODELX, "GeodeLX"},
+ {PCI_CHIP_GEODELX, "Geode LX"},
#endif
#ifdef HAVE_GX
- {PCI_CHIP_REDCLOUD, "REDCLOUD"},
+ {PCI_CHIP_GEODEGX, "Geode GX"},
#endif
{-1, NULL}
};
@@ -179,13 +179,12 @@ PciChipsets GeodePCIchipsets[] = {
{PCI_CHIP_GEODELX, PCI_CHIP_GEODELX, RES_SHARED_VGA},
#endif
#ifdef HAVE_GX
- {PCI_CHIP_REDCLOUD, PCI_CHIP_REDCLOUD, RES_SHARED_VGA},
+ {PCI_CHIP_GEODEGX, PCI_CHIP_GEODEGX, RES_SHARED_VGA},
#endif
{-1, -1, RES_UNDEFINED},
};
#ifdef HAVE_LX
-void LXSetupChipsetFPtr(ScrnInfoPtr pScrni);
OptionInfoRec LX_GeodeOptions[] = {
{LX_OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
@@ -208,7 +207,6 @@ OptionInfoRec LX_GeodeOptions[] = {
#endif
#ifdef HAVE_GX
-void GXSetupChipsetFPtr(ScrnInfoPtr pScrni);
OptionInfoRec GX_GeodeOptions[] = {
{GX_OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
@@ -410,55 +408,6 @@ AmdIdentify(int flags)
GeodeChipsets);
}
-#ifdef XSERVER_LIBPCIACCESS
-
-static Bool
-AmdPciProbe(DriverPtr driver,
- int entity_num,
- struct pci_device *device,
- intptr_t match_data)
-{
- ScrnInfoPtr scrn = NULL;
- int cpu_detected;
-
- ErrorF("AmdPciProbe: Probing for supported devices!\n");
-
- scrn = xf86ConfigPciEntity(scrn, 0, entity_num, GeodePCIchipsets,
- NULL, NULL, NULL, NULL, NULL);
-
- if (scrn != NULL)
- {
- scrn->driverName = GEODE_DRIVER_NAME;
- scrn->driverVersion = GEODE_VERSION;
- scrn->name = GEODE_NAME;
- scrn->Probe = NULL;
-
- switch (device->device_id) {
-#ifdef HAVE_LX
- case PCI_CHIP_GEODELX:
- cpu_detected = LX;
- LXSetupChipsetFPtr(scrn);
- break;
-#endif
-#ifdef HAVE_GX
- case PCI_CHIP_REDCLOUD:
- cpu_detected = GX2;
- GXSetupChipsetFPtr(scrn);
- break;
-#endif
- default:
- ErrorF("AmdPciProbe: unknown device ID\n");
- return FALSE;
- }
-
- DEBUGMSG(1, (0, X_INFO, "AmdPciProbe: CPUDetected %d!\n",
- cpu_detected));
- }
- return scrn != NULL;
-}
-
-#else /* XSERVER_LIBPCIACCESS */
-
/*----------------------------------------------------------------------------
* AmdAvailableOptions.
*
@@ -483,7 +432,7 @@ AmdAvailableOptions(int chipid, int busid)
return LX_GeodeOptions;
#endif
#ifdef HAVE_GX
- case PCI_CHIP_REDCLOUD:
+ case PCI_CHIP_GEODEGX:
return GX_GeodeOptions;
#endif
}
@@ -518,8 +467,8 @@ AmdPciProbe(DriverPtr driver,
break;
#endif
#ifdef HAVE_GX
- case PCI_CHIP_REDCLOUD:
- cpu_detected = GX2;
+ case PCI_CHIP_GEODEGX:
+ cpu_detected = GX;
GXSetupChipsetFPtr(scrn);
break;
#endif
@@ -613,8 +562,8 @@ AmdProbe(DriverPtr drv, int flags)
break;
#endif
#ifdef HAVE_GX
- case PCI_CHIP_REDCLOUD:
- CPUDetected = GX2;
+ case PCI_CHIP_GEODEGX:
+ CPUDetected = GX;
drvr_setup = &GXSetupChipsetFPtr;
break;
#endif
diff --git a/src/geode_msr.c b/src/geode_msr.c
index 0d31192..167ccd6 100644
--- a/src/geode_msr.c
+++ b/src/geode_msr.c
@@ -5,6 +5,7 @@
#include <sys/types.h>
#include <sys/errno.h>
#include "os.h"
+#include "geode.h"
static int
_msr_open(void)
diff --git a/src/gfx/rndr_gu2.c b/src/gfx/rndr_gu2.c
index 31a26e7..db3ccf3 100644
--- a/src/gfx/rndr_gu2.c
+++ b/src/gfx/rndr_gu2.c
@@ -96,6 +96,9 @@ unsigned short gu2_bm_throttle = 0;
unsigned short gu2_vm_throttle = 0;
int gu2_current_line = 0;
+/* Kill a warning */
+void gfx_reset_pitch(unsigned short pitch);
+
/*---------------------------------------------------------------------------
* GFX_RESET_PITCH (PRIVATE ROUTINE - NOT PART OF API)
*
diff --git a/src/gx_accel.c b/src/gx_accel.c
index 35ca64e..025b06a 100644
--- a/src/gx_accel.c
+++ b/src/gx_accel.c
@@ -1757,9 +1757,9 @@ amd_gx_exa_Composite(PixmapPtr pxDst, int srcX, int srcY, int maskX,
int maskY, int dstX, int dstY, int width, int height)
{
int op, current_line, max_lines, lines, pass, scratchPitch;
- unsigned int srcOffset, srcOfs, srcPitch, srcPch, srcBpp;
- unsigned int dstOffset, dstOfs, dstPitch, dstPch, dstBpp;
- unsigned int sizes, strides, blt_mode, rop;
+ unsigned int srcOffset, srcOfs=0, srcPitch, srcPch=0, srcBpp;
+ unsigned int dstOffset, dstOfs=0, dstPitch, dstPch=0, dstBpp;
+ unsigned int sizes, strides, blt_mode = 0, rop = 0;
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
//ErrorF("amd_gx_exa_Composite() from %d,%d to %d,%d %dx%d\n",
diff --git a/src/lx_driver.c b/src/lx_driver.c
index d77a682..973d54d 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -634,7 +634,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
&pGeode->tryHWCursor);
if (!xf86GetOptValInteger(GeodeOptions, LX_OPTION_FBSIZE,
- &(pGeode->FBAvail)))
+ (int *) &(pGeode->FBAvail)))
pGeode->FBAvail = 0;
/* For compatability - allow SWCursor too */
@@ -664,7 +664,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
}
xf86GetOptValInteger(GeodeOptions, LX_OPTION_EXA_SCRATCH_BFRSZ,
- &(pGeode->exaBfrSz));
+ (int *) &(pGeode->exaBfrSz));
if (pGeode->exaBfrSz <= 0)
pGeode->exaBfrSz = 0;
@@ -1194,8 +1194,6 @@ LXLoadPalette(ScrnInfoPtr pScrni,
static void
LXDPMSSet(ScrnInfoPtr pScrni, int mode, int flags)
{
- GeodeRec *pGeode = GEODEPTR(pScrni);
-
if (!pScrni->vtSema)
return;
diff --git a/src/lx_exa.c b/src/lx_exa.c
index bd63573..f6978d8 100644
--- a/src/lx_exa.c
+++ b/src/lx_exa.c
@@ -251,7 +251,7 @@ static unsigned int
lx_get_source_color(PixmapPtr pSrc, int srcFormat, int dstFormat)
{
CARD32 in, out;
- CARD16 red, green, blue, alpha;
+ CARD16 red = 0, green = 0, blue = 0, alpha = 0;
/* Stall to avoid a race with the upload function */
/* for 1.4 and newer, the problem will be resolved within
@@ -561,7 +561,6 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk,
exaScratch.bufferOffset = pGeode->exaBfrOffset;
if (pMsk && op != PictOpClear) {
- unsigned int srcColor;
struct blend_ops_t *opPtr = &lx_alpha_ops[op * 2];
int direction = (opPtr->channel == CIMGP_CHANNEL_A_SOURCE) ? 0 : 1;
@@ -881,9 +880,6 @@ static void
lx_do_composite_mask(PixmapPtr pxDst, unsigned long dstOffset,
unsigned int maskOffset, int width, int height)
{
- GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
- unsigned char *data = pGeode->FBBase + maskOffset;
-
struct blend_ops_t *opPtr = &lx_alpha_ops[exaScratch.op * 2];
gp_declare_blt(0);
diff --git a/src/lx_rotate.c b/src/lx_rotate.c
index c63fb22..eee58c7 100644
--- a/src/lx_rotate.c
+++ b/src/lx_rotate.c
@@ -61,10 +61,10 @@ LXUpdateFunc(ScreenPtr pScreen, shadowBufPtr pBuf)
int nbox = REGION_NUM_RECTS(damage);
BoxPtr pbox = REGION_RECTS(damage);
- int x, y, w, h, degrees;
+ int x, y, w, h, degrees = 0;
FbStride shaStride;
FbBits *shaBits;
- int shaBpp, dx, dy, dw, dh;
+ int shaBpp, dx = 0, dy = 0, dw, dh;
int shaXoff, shaYoff;
unsigned int srcOffset, dstOffset;
PixmapPtr pShadow = pBuf->pPixmap;