summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2024-08-02 08:32:14 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2024-08-02 08:32:14 +0200
commit9627fd587c9aa066d4ce6e852b26950030f9c3cd (patch)
tree50375cab018b3b62076bf4a6a674fca7613db68b /src
parent8b6ec6bb08fa9c3b19753acb436bbb8ecfae9233 (diff)
parent7047b6da264e946e77eeee4080d194c807562d68 (diff)
Merge remote-tracking branch 'origin/master' into obsdobsd
Diffstat (limited to 'src')
-rw-r--r--src/cim/cim_gp.c8
-rw-r--r--src/cim/cim_msr.c12
-rw-r--r--src/cim/cim_vg.c22
-rw-r--r--src/cimarron.c15
-rw-r--r--src/compat-api.h89
-rw-r--r--src/geode.h41
-rw-r--r--src/geode_dcon.c2
-rw-r--r--src/geode_ddc.c8
-rw-r--r--src/geode_driver.c4
-rw-r--r--src/gfx/disp_gu1.c3
-rw-r--r--src/gfx/disp_gu2.c6
-rw-r--r--src/gfx/gfx_priv.h11
-rw-r--r--src/gfx/gfx_vid.c2
-rw-r--r--src/gfx/vid_rdcl.c2
-rw-r--r--src/gx_accel.c135
-rw-r--r--src/gx_cursor.c1
-rw-r--r--src/gx_driver.c100
-rw-r--r--src/gx_randr.c40
-rw-r--r--src/gx_rotate.c19
-rw-r--r--src/gx_video.c76
-rw-r--r--src/lx_display.c7
-rw-r--r--src/lx_driver.c31
-rw-r--r--src/lx_output.c4
-rw-r--r--src/lx_panel.c8
-rw-r--r--src/lx_video.c24
-rw-r--r--src/panel/cen9211.c2
-rw-r--r--src/panel/platform.c12
-rw-r--r--src/z4l.c34
28 files changed, 150 insertions, 568 deletions
diff --git a/src/cim/cim_gp.c b/src/cim/cim_gp.c
index 2085d4f..4ab909f 100644
--- a/src/cim/cim_gp.c
+++ b/src/cim/cim_gp.c
@@ -2642,7 +2642,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width,
unsigned long total_dwords, size_dwords;
unsigned long dword_count, byte_count;
unsigned long srcoffset, size;
- unsigned long i, ch3_offset, base;
+ unsigned long j, ch3_offset, base;
unsigned long flags = 0;
if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO)
@@ -2688,7 +2688,7 @@ gp_masked_blt(unsigned long dstoffset, unsigned long width,
WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next);
gp3_cmd_current = gp3_cmd_next;
- for (i = 0; i < height; i++) {
+ for (j = 0; j < height; j++) {
/* UPDATE THE COMMAND POINTER
* The WRITE_COMMANDXX macros use a pointer to the current buffer
* space. This is created by adding gp3_cmd_current to the base
@@ -2880,7 +2880,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset,
unsigned long total_dwords, size_dwords;
unsigned long dword_count, byte_count;
unsigned long srcoff, size;
- unsigned long i, base;
+ unsigned long j, base;
unsigned long flags = 0;
if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO)
@@ -2926,7 +2926,7 @@ gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset,
WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next);
gp3_cmd_current = gp3_cmd_next;
- for (i = 0; i < height; i++) {
+ for (j = 0; j < height; j++) {
/* UPDATE THE COMMAND POINTER
* The WRITE_COMMANDXX macros use a pointer to the current buffer
* space. This is created by adding gp3_cmd_current to the base
diff --git a/src/cim/cim_msr.c b/src/cim/cim_msr.c
index d43bc4b..0d3c571 100644
--- a/src/cim/cim_msr.c
+++ b/src/cim/cim_msr.c
@@ -35,7 +35,7 @@
/* as well as a lookup table for easy device addressing. */
/*--------------------------------------------------------------*/
-GEODELINK_NODE gliu_nodes[24];
+GEODELINK_NODE gliu_node_list[24];
GEODELINK_NODE msr_dev_lookup[MSR_DEVICE_EMPTY];
#define GET_DEVICE_ID(macrohigh, macrolow) ((macrolow >> 12) & 0xFF)
@@ -79,7 +79,7 @@ msr_init_table(void)
if (return_value == CIM_STATUS_OK) {
/* BUILD LOCAL COPY OF THE GEODELINK BUS */
- msr_create_geodelink_table(gliu_nodes);
+ msr_create_geodelink_table(gliu_node_list);
/* CLEAR TABLE STATUS */
@@ -107,7 +107,7 @@ msr_init_table(void)
for (i = 0; i < MSR_DEVICE_EMPTY; i++) {
if (msr_dev_lookup[i].device_id == MSR_DEVICE_NOTFOUND) {
for (j = 0; j < 24; j++) {
- if (gliu_nodes[j].device_id == i)
+ if (gliu_node_list[j].device_id == i)
break;
}
@@ -116,7 +116,7 @@ msr_init_table(void)
else {
msr_dev_lookup[i].device_id = MSR_DEVICE_PRESENT;
msr_dev_lookup[i].address_from_cpu =
- gliu_nodes[j].address_from_cpu;
+ gliu_node_list[j].address_from_cpu;
}
}
}
@@ -125,8 +125,8 @@ msr_init_table(void)
/* ERROR OUT THE GEODELINK TABLES */
for (i = 0; i < 24; i++) {
- gliu_nodes[i].address_from_cpu = 0xFFFFFFFF;
- gliu_nodes[i].device_id = MSR_DEVICE_EMPTY;
+ gliu_node_list[i].address_from_cpu = 0xFFFFFFFF;
+ gliu_node_list[i].device_id = MSR_DEVICE_EMPTY;
}
for (i = 0; i < MSR_DEVICE_EMPTY; i++) {
diff --git a/src/cim/cim_vg.c b/src/cim/cim_vg.c
index 46984b5..a8a875b 100644
--- a/src/cim/cim_vg.c
+++ b/src/cim/cim_vg.c
@@ -1381,8 +1381,6 @@ vg_get_current_display_mode(VG_DISPLAY_MODE * current_display, int *bpp)
/* Cimarron when returning the current mode information. */
if (vg3_panel_enable) {
- Q_WORD msr_value;
-
flags |= VG_MODEFLAG_PANELOUT;
current_display->panel_width = vg3_panel_width;
@@ -2736,7 +2734,7 @@ vg_save_state(VG_SAVE_RESTORE * vg_state)
int
vg_restore_state(VG_SAVE_RESTORE * vg_state)
{
- unsigned long irqfilt, i;
+ unsigned long irqfilt, j;
unsigned long memoffset;
/* TEMPORARILY UNLOCK ALL REGISTERS */
@@ -2801,27 +2799,27 @@ vg_restore_state(VG_SAVE_RESTORE * vg_state)
/* RESTORE THE PALETTE */
WRITE_REG32(DC3_PAL_ADDRESS, 0);
- for (i = 0; i < 261; i++)
- WRITE_REG32(DC3_PAL_DATA, vg_state->palette[i]);
+ for (j = 0; j < 261; j++)
+ WRITE_REG32(DC3_PAL_DATA, vg_state->palette[j]);
/* RESTORE THE HORIZONTAL FILTER COEFFICIENTS */
irqfilt = READ_REG32(DC3_IRQ_FILT_CTL);
irqfilt |= DC3_IRQFILT_H_FILT_SEL;
- for (i = 0; i < 256; i++) {
- WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i));
- WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(i << 1)]);
- WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(i << 1) + 1]);
+ for (j = 0; j < 256; j++) {
+ WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j));
+ WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(j << 1)]);
+ WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(j << 1) + 1]);
}
/* RESTORE VERTICAL COEFFICIENTS */
irqfilt &= ~DC3_IRQFILT_H_FILT_SEL;
- for (i = 0; i < 256; i++) {
- WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i));
- WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[i]);
+ for (j = 0; j < 256; j++) {
+ WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | j));
+ WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[j]);
}
/* RESTORE THE CURSOR DATA */
diff --git a/src/cimarron.c b/src/cimarron.c
index e4376a9..4b54de8 100644
--- a/src/cimarron.c
+++ b/src/cimarron.c
@@ -145,6 +145,14 @@
/* #define CIMARRON_EXCLUDE_CUSTOM_MACROS */
+
+/* ROUTINE DEFINITIONS */
+/* All routines have a prototype, even those that are not included */
+/* via #ifdefs. This prevents the user from having to include the */
+/* correct #defines anywhere he/she wants to call a Cimarron routine. */
+
+#include "cim_rtns.h"
+
/*----------------------------------------------------------------------*/
/* MODULE VARIABLES */
/* The following #defines affect how global variables in each Cimarron */
@@ -190,13 +198,6 @@ void (*cim_wrmsr) (unsigned long, unsigned long, unsigned long);
#include "cim_regs.h"
-/* ROUTINE DEFINITIONS */
-/* All routines have a prototype, even those that are not included */
-/* via #ifdefs. This prevents the user from having to include the */
-/* correct #defines anywhere he/she wants to call a Cimarron routine. */
-
-#include "cim_rtns.h"
-
/* HARDWARE ACCESS MACROS */
#include "cim_defs.h"
diff --git a/src/compat-api.h b/src/compat-api.h
index f6df925..d8100c3 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -31,93 +31,12 @@
#ifndef COMPAT_API_H
#define COMPAT_API_H
-#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
-#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
-#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
-#endif
-
-#ifndef XF86_HAS_SCRN_CONV
-#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
-#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
-#endif
-
-#ifndef XF86_SCRN_INTERFACE
-
-#define DDC_CALL(pScrni) (pScrni->scrnIndex)
-
-#define SCRN_ARG_TYPE int
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = xf86Screens[(arg1)]
-
-#define SCREEN_ARG_TYPE int
-#define SCREEN_PTR(arg1) ScreenPtr pScrn = screenInfo.screens[(arg1)]
-
-#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScrn, int argc, char **argv
-
-#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
-#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
-
-#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScrn
-#define CLOSE_SCREEN_ARGS scrnIndex, pScrn
-
-#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
-#define ADJUST_FRAME_ARGS(x, y) pScrni->scrnIndex, (x), (y), 0
-
-#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr pMode, int flags
-
-#define FREE_SCREEN_ARGS_DECL int arg, int flags
-#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
-
-#define VT_FUNC_ARGS_DECL int arg, int flags
-#define VT_FUNC_ARGS(flags) pScrni->scrnIndex, (flags)
-
-#define XF86_ENABLEDISABLEFB_ARG(pScrni, x) ((pScrni)->scrnIndex), (x)
-
-#define POINTER_MOVED_ARGS_DECL int arg, int x, int y
-#define POINTER_MOVED_ARGS(x, y) pScrni->scrnIndex, (x), (y)
-
-#define VALID_MODE_ARGS_DECL int arg, DisplayModePtr pMode, Bool Verbose, int flags
-
-#else /*XF86_SCRN_INTERFACE) */
-
-#define DDC_CALL(pScrni) (pScrni)
-
-#define SCRN_ARG_TYPE ScrnInfoPtr
-#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = (arg1)
-
-#define SCREEN_ARG_TYPE ScreenPtr
-#define SCREEN_PTR(arg1) ScreenPtr pScrn = (arg1)
-
-#define SCREEN_INIT_ARGS_DECL ScreenPtr pScrn, int argc, char **argv
-
#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
-#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
-#define BLOCKHANDLER_ARGS arg, pTimeout
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout
+#define BLOCKHANDLER_ARGS pScreen, pTimeout
#else
-#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
-#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
-#endif
-
-#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScrn
-#define CLOSE_SCREEN_ARGS pScrn
-
-#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
-#define ADJUST_FRAME_ARGS(x, y) pScrni, (x), (y)
-
-#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode
-
-#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
-#define FREE_SCREEN_ARGS(x) (x)
-
-#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
-#define VT_FUNC_ARGS(flags) pScrni
-
-#define XF86_ENABLEDISABLEFB_ARG(pScrni, x) (pScrni), (x)
-
-#define POINTER_MOVED_ARGS_DECL ScrnInfoPtr arg, int x, int y
-#define POINTER_MOVED_ARGS(x, y) pScrni, (x), (y)
-
-#define VALID_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode, Bool Verbose, int flags
-
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask
#endif
#endif
diff --git a/src/geode.h b/src/geode.h
index 3dd3e15..5e6d422 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -32,9 +32,6 @@
#endif
#include "geode_pcirename.h"
-#ifdef HAVE_XAA_H
-#include "xaa.h"
-#endif
#include "exa.h"
#include "xf86Cursor.h"
@@ -57,12 +54,6 @@
#undef XF86EXA
#endif
-#ifdef HAVE_XAA_H
-#define XF86XAA 1
-#else
-#undef XF86XAA
-#endif
-
#define CFB 0
#define INT10_SUPPORT 1
@@ -83,21 +74,6 @@
#define GFX_CPU_GEODELX 4
-#if defined(HAVE_GX) && XF86XAA
-#define GX_FILL_RECT_SUPPORT 1
-#define GX_BRES_LINE_SUPPORT 1
-#define GX_DASH_LINE_SUPPORT 0 /* does not do dashed lines */
-#define GX_MONO_8X8_PAT_SUPPORT 1
-#define GX_CLREXP_8X8_PAT_SUPPORT 1
-#define GX_SCR2SCREXP_SUPPORT 1
-#define GX_SCR2SCRCPY_SUPPORT 1
-#define GX_CPU2SCREXP_SUPPORT 1
-#define GX_SCANLINE_SUPPORT 1
-#define GX_USE_OFFSCRN_MEM 0
-#define GX_ONE_LINE_AT_A_TIME 1
-#define GX_WRITE_PIXMAP_SUPPORT 1
-#endif
-
#define GFX(func) gfx_##func
#define GFX2(func) gfx2_##func
@@ -252,7 +228,7 @@ typedef struct _geodeRec {
/* Hooks */
- void (*PointerMoved) (POINTER_MOVED_ARGS_DECL);
+ void (*PointerMoved) (ScrnInfoPtr pScrn, int x, int y);
CloseScreenProcPtr CloseScreen;
Bool (*CreateScreenResources) (ScreenPtr);
@@ -297,8 +273,6 @@ typedef struct _geodeRec {
xf86CursorInfoPtr CursorInfo;
- /* XAA structures */
-
unsigned int cpySrcOffset;
int cpySrcPitch, cpySrcBpp;
int cpyDx, cpyDy;
@@ -311,9 +285,6 @@ typedef struct _geodeRec {
int NoOfImgBuffers;
unsigned char **AccelColorExpandBuffers;
int NoOfColorExpandLines;
-#if XF86XAA
- XAAInfoRecPtr AccelInfoRec;
-#endif
/* Save state */
unsigned long FBCompressionOffset;
@@ -407,11 +378,11 @@ Bool RegionsEqual(RegionPtr A, RegionPtr B);
void GeodeProbeDDC(ScrnInfoPtr pScrni, int index);
xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index);
-Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name);
+Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, const char *name);
int GeodeGetFPGeometry(const char *str, int *width, int *height);
-void GeodePointerMoved(POINTER_MOVED_ARGS_DECL);
-void GeodeFreeScreen(FREE_SCREEN_ARGS_DECL);
+void GeodePointerMoved(ScrnInfoPtr pScrn, int x, int y);
+void GeodeFreeScreen(ScrnInfoPtr pScrn);
int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp);
void GXSetupChipsetFPtr(ScrnInfoPtr pScrn);
@@ -465,9 +436,9 @@ void LXSetupOutput(ScrnInfoPtr);
/* lx_panel.c */
DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni);
-DisplayModePtr LXGetManualPanelMode(char *modestr);
+DisplayModePtr LXGetManualPanelMode(const char *modestr);
-void LXAdjustFrame(ADJUST_FRAME_ARGS_DECL);
+void LXAdjustFrame(ScrnInfoPtr pScrni, int x, int y);
/* lx_display.c */
void LXSetupCrtc(ScrnInfoPtr pScrni);
diff --git a/src/geode_dcon.c b/src/geode_dcon.c
index 5efd79e..20ca194 100644
--- a/src/geode_dcon.c
+++ b/src/geode_dcon.c
@@ -126,7 +126,7 @@ dcon_init(ScrnInfoPtr pScrni)
return FALSE;
}
- pGeode->panelMode = xnfcalloc(1, sizeof(DisplayModeRec));
+ pGeode->panelMode = XNFcallocarray(1, sizeof(DisplayModeRec));
if (pGeode->panelMode == NULL)
return FALSE;
diff --git a/src/geode_ddc.c b/src/geode_ddc.c
index 7b8277d..0a873c4 100644
--- a/src/geode_ddc.c
+++ b/src/geode_ddc.c
@@ -117,7 +117,7 @@ geode_ddc_getbits(I2CBusPtr b, int *scl, int *sda)
}
Bool
-GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name)
+GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, const char *name)
{
I2CBusPtr bus;
unsigned int ddciobase;
@@ -150,7 +150,7 @@ GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name)
if (!bus)
return FALSE;
- bus->BusName = name;
+ bus->BusName = (char *)name;
bus->scrnIndex = pScrni->scrnIndex;
bus->I2CGetBits = geode_ddc_getbits;
@@ -173,12 +173,10 @@ GeodeGetDDC(ScrnInfoPtr pScrni)
if (!GeodeI2CInit(pScrni, &bus, "CS5536 DDC BUS"))
return NULL;
- mon = xf86DoEDID_DDC2(DDC_CALL(pScrni), bus);
+ mon = xf86DoEDID_DDC2(pScrni, bus);
-#if (XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,4,99,0,0))
if (mon)
xf86DDCApplyQuirks(pScrni->scrnIndex, mon);
-#endif
xf86DestroyI2CBusRec(bus, FALSE, FALSE);
diff --git a/src/geode_driver.c b/src/geode_driver.c
index e16ea72..a8c9dee 100644
--- a/src/geode_driver.c
+++ b/src/geode_driver.c
@@ -42,11 +42,7 @@
/* Includes that are used by all drivers */
#include "xf86.h"
#include "xf86_OSproc.h"
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
-#include "xf86Resources.h"
-#endif
#include "compiler.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86cmap.h"
diff --git a/src/gfx/disp_gu1.c b/src/gfx/disp_gu1.c
index a03c754..fa081eb 100644
--- a/src/gfx/disp_gu1.c
+++ b/src/gfx/disp_gu1.c
@@ -25,9 +25,6 @@
void gu1_enable_compression(void); /* private routine definition */
void gu1_disable_compression(void); /* private routine definition */
-void gfx_reset_video(void); /* private routine definition */
-int gfx_set_display_control(int sync_polarities); /* private routine
- * definition */
int gu1_set_specified_mode(DISPLAYMODE * pMode, int bpp);
/* VIDEO BUFFER SIZE */
diff --git a/src/gfx/disp_gu2.c b/src/gfx/disp_gu2.c
index 1f0bbb6..8bd89e9 100644
--- a/src/gfx/disp_gu2.c
+++ b/src/gfx/disp_gu2.c
@@ -29,9 +29,6 @@
void gu2_enable_compression(void); /* private routine definition */
void gu2_disable_compression(void); /* private routine definition */
-int gfx_set_display_control(int sync_polarities); /* private routine
- * definition */
-void gfx_reset_video(void);
int gu2_set_specified_mode(DISPLAYMODE * pMode, int bpp);
/*---------------------------------------------------------------------------
@@ -1260,13 +1257,12 @@ void
gfx_set_display_video_enable(int enable)
#endif
{
- unsigned long lock, gcfg, dcfg;
+ unsigned long lock, gcfg;
/* READ CURRENT VALUES */
lock = READ_REG32(MDC_UNLOCK);
gcfg = READ_REG32(MDC_GENERAL_CFG);
- dcfg = READ_REG32(MDC_DISPLAY_CFG);
/* SET OR CLEAR VIDEO ENABLE IN GENERAL_CFG */
diff --git a/src/gfx/gfx_priv.h b/src/gfx/gfx_priv.h
index 4f63f62..7b255a5 100644
--- a/src/gfx/gfx_priv.h
+++ b/src/gfx/gfx_priv.h
@@ -77,12 +77,6 @@ unsigned long gu2_get_vip_register_base(void);
#if GFX_MSR_REDCLOUD
-/* PRIVATE ROUTINES */
-
-void redcloud_build_mbus_tree(void);
-int redcloud_init_msr_devices(MSR aDev[], unsigned int array_size);
-DEV_STATUS redcloud_find_msr_device(MSR * pDev);
-
/* DYNAMIC ROUTINES */
#if GFX_MSR_DYNAMIC
@@ -240,11 +234,6 @@ int gfx_get_display_video_downscale_enable(void);
#if GFX_DISPLAY_GU2
-/* PRIVATE ROUTINES */
-
-void gu2_enable_compression(void);
-void gu2_disable_compression(void);
-
/* DYNAMIC ROUTINES */
#if GFX_DISPLAY_DYNAMIC
diff --git a/src/gfx/gfx_vid.c b/src/gfx/gfx_vid.c
index 0dd7847..c4215e8 100644
--- a/src/gfx/gfx_vid.c
+++ b/src/gfx/gfx_vid.c
@@ -145,8 +145,6 @@ unsigned short gfx_vid_height = 0; /* copy from last gfx_set_video_window
int gfx_alpha_select = 0; /* currently selected alpha region */
-int gfx_set_screen_enable(int enable); /* forward declaration */
-
/* INCLUDE SUPPORT FOR CS5530, IF SPECIFIED. */
#if GFX_VIDEO_CS5530
diff --git a/src/gfx/vid_rdcl.c b/src/gfx/vid_rdcl.c
index 72f45d4..34a4659 100644
--- a/src/gfx/vid_rdcl.c
+++ b/src/gfx/vid_rdcl.c
@@ -256,14 +256,12 @@ gfx_set_clock_frequency(unsigned long frequency)
Q_WORD msr_value, sys_value;
unsigned long sys_low;
unsigned int i, index = 0;
- unsigned long value;
long timeout = 1000;
long min, diff;
/* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */
/* Search the table for the closest frequency (16.16 format). */
- value = RCDF_PLLtable[0].pll_value;
min = (long) RCDF_PLLtable[0].frequency - frequency;
if (min < 0L)
min = -min;
diff --git a/src/gx_accel.c b/src/gx_accel.c
index 1bc9a4c..8e68486 100644
--- a/src/gx_accel.c
+++ b/src/gx_accel.c
@@ -39,9 +39,6 @@
#include "vgaHW.h"
#include "xf86.h"
-#ifdef HAVE_XAA_H
-#include "xaalocal.h"
-#endif
#include "xf86fbman.h"
#include "miline.h"
#include "xaarop.h"
@@ -50,7 +47,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
-#include "xf86PciInfo.h"
#include "geode.h"
#include "gfx_defs.h"
#include "gfx_regs.h"
@@ -130,10 +126,6 @@ static GDashLine gdln;
static unsigned int gu2_xshift, gu2_yshift;
static unsigned int gu2_pitch;
-#if XF86XAA
-static XAAInfoRecPtr localRecPtr;
-#endif
-
/* pat 0xF0 */
/* src 0xCC */
/* dst 0xAA */
@@ -1490,7 +1482,7 @@ amd_gx_exa_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
char *src, int src_pitch)
{
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pDst);
- char *dst = pGeode->pExa->memoryBase + exaGetPixmapOffset(pDst);
+ unsigned char *dst = pGeode->pExa->memoryBase + exaGetPixmapOffset(pDst);
int dst_pitch = exaGetPixmapPitch(pDst);
int bpp = pDst->drawable.bitsPerPixel;
@@ -1506,7 +1498,7 @@ amd_gx_exa_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
char *dst, int dst_pitch)
{
GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pSrc);
- char *src = pGeode->pExa->memoryBase + exaGetPixmapOffset(pSrc);
+ unsigned char *src = pGeode->pExa->memoryBase + exaGetPixmapOffset(pSrc);
int src_pitch = exaGetPixmapPitch(pSrc);
int bpp = pSrc->drawable.bitsPerPixel;
@@ -1742,10 +1734,9 @@ amd_gx_exa_PrepareComposite(int op, PicturePtr pSrc, PicturePtr pMsk,
PixmapPtr pxDst)
{
int srcPitch;
- if (!pxSrc || !pSrc->pDrawable) return FALSE;
-
- GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
amd_gx_exa_fmt_t *sfp, *dfp;
+ GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst);
+ if (!pxSrc || !pSrc->pDrawable) return FALSE;
//ErrorF("amd_gx_exa_PrepareComposite()\n");
@@ -1971,123 +1962,5 @@ GXAccelInit(ScreenPtr pScrn)
}
#endif
-#if XF86XAA
-
- /* Getting the pointer for acceleration Inforecord */
- pGeode->AccelInfoRec = localRecPtr = XAACreateInfoRec();
- if (!pGeode->AccelInfoRec)
- return FALSE;
-
- /* SET ACCELERATION FLAGS */
- localRecPtr->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER;
-
- /* HOOK SYNCRONIZARION ROUTINE */
- localRecPtr->Sync = GXAccelSync;
-
-#if GX_FILL_RECT_SUPPORT
- /* HOOK FILLED RECTANGLES */
- HOOK(SetupForSolidFill);
- HOOK(SubsequentSolidFillRect);
- localRecPtr->SolidFillFlags = 0;
-#endif
-
-#if GX_MONO_8X8_PAT_SUPPORT
- /* Color expansion */
- HOOK(SetupForMono8x8PatternFill);
- HOOK(SubsequentMono8x8PatternFillRect);
-/* BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY | */
- localRecPtr->Mono8x8PatternFillFlags = BIT_ORDER_IN_BYTE_MSBFIRST |
- HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_SCREEN_ORIGIN;
-#endif
-
-#if GX_CLREXP_8X8_PAT_SUPPORT
- /* Color expansion */
- HOOK(SetupForColor8x8PatternFill);
- HOOK(SubsequentColor8x8PatternFillRect);
-/* BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY | */
- localRecPtr->Color8x8PatternFillFlags =
- BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD |
- HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_PROGRAMMED_ORIGIN;
-#endif
-
-#if GX_SCR2SCRCPY_SUPPORT
- /* HOOK SCREEN TO SCREEN COPIES
- * Set flag to only allow copy if transparency is enabled.
- */
- HOOK(SetupForScreenToScreenCopy);
- HOOK(SubsequentScreenToScreenCopy);
- localRecPtr->ScreenToScreenCopyFlags =
- BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD;
-#endif
-
-#if GX_BRES_LINE_SUPPORT
- /* HOOK BRESENHAM SOLID LINES */
- localRecPtr->SolidLineFlags = NO_PLANEMASK;
- HOOK(SetupForSolidLine);
- HOOK(SubsequentSolidBresenhamLine);
- HOOK(SubsequentSolidHorVertLine);
- HOOK(SubsequentSolidTwoPointLine);
- localRecPtr->SolidBresenhamLineErrorTermBits = 15;
-#endif
-
-#if GX_DASH_LINE_SUPPORT
- /* HOOK BRESENHAM DASHED LINES */
- HOOK(SetupForDashedLine);
- HOOK(SubsequentDashedBresenhamLine);
- HOOK(SubsequentDashedTwoPointLine);
- localRecPtr->DashedBresenhamLineErrorTermBits = 15;
- localRecPtr->DashPatternMaxLength = 64;
- localRecPtr->DashedLineFlags = NO_PLANEMASK | /* TRANSPARENCY_ONLY | */
- LINE_PATTERN_POWER_OF_2_ONLY | LINE_PATTERN_MSBFIRST_MSBJUSTIFIED;
-#endif
-
-#if GX_SCR2SCREXP_SUPPORT
- /* Color expansion */
- HOOK(SetupForScreenToScreenColorExpandFill);
- HOOK(SubsequentScreenToScreenColorExpandFill);
- localRecPtr->ScreenToScreenColorExpandFillFlags =
- BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY;
-#endif
-
- if (pGeode->AccelImageWriteBuffers) {
-#if GX_SCANLINE_SUPPORT
- localRecPtr->ScanlineImageWriteBuffers = pGeode->AccelImageWriteBuffers;
- localRecPtr->NumScanlineImageWriteBuffers = pGeode->NoOfImgBuffers;
- HOOK(SetupForScanlineImageWrite);
- HOOK(SubsequentScanlineImageWriteRect);
- HOOK(SubsequentImageWriteScanline);
- localRecPtr->ScanlineImageWriteFlags = NO_PLANEMASK | NO_GXCOPY |
- BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD;
-#endif
-
- }
- else {
- localRecPtr->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES;
- }
-
- if (pGeode->AccelColorExpandBuffers) {
-#if GX_CPU2SCREXP_SUPPORT
- /* Color expansion */
- localRecPtr->ScanlineColorExpandBuffers =
- pGeode->AccelColorExpandBuffers;
- localRecPtr->NumScanlineColorExpandBuffers =
- pGeode->NoOfColorExpandLines;
- HOOK(SetupForScanlineCPUToScreenColorExpandFill);
- HOOK(SubsequentScanlineCPUToScreenColorExpandFill);
- HOOK(SubsequentColorExpandScanline);
- localRecPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
- BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD;
-#endif
- }
-#if GX_WRITE_PIXMAP_SUPPORT
- pGeode->WritePixmap = localRecPtr->WritePixmap;
- HOOK(WritePixmap);
-#endif
-
- return (XAAInit(pScrn, localRecPtr));
-#else /* XF86XAA */
return FALSE;
-#endif
}
-
-/* END OF FILE */
diff --git a/src/gx_cursor.c b/src/gx_cursor.c
index 54a1bf1..8e1a6ac 100644
--- a/src/gx_cursor.c
+++ b/src/gx_cursor.c
@@ -37,7 +37,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
-#include "xf86PciInfo.h"
#include "geode.h"
/* Forward declarations of the functions */
diff --git a/src/gx_driver.c b/src/gx_driver.c
index 0471389..1850deb 100644
--- a/src/gx_driver.c
+++ b/src/gx_driver.c
@@ -38,9 +38,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
-#include "xf86Resources.h"
-#endif
#include "xf86cmap.h"
#include "compiler.h"
#include "mipointer.h"
@@ -258,50 +255,6 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate)
pExa->offScreenBase = fboffset;
pExa->memorySize = fboffset + fbavail;
}
-
- if (!pGeode->useEXA) {
-
-#if XF86XAA
- if (!xf86FBManagerRunning(pScrn)) {
-
- unsigned int offset = fboffset;
- unsigned int avail = fbavail;
- RegionRec OffscreenRegion;
- BoxRec AvailBox;
-
- /* Assume the shadow FB exists even if it doesn't */
-
- if (pGeode->shadowSize == 0) {
- size = (pScrn->width * bytpp) * pScrni->virtualX;
- offset += size;
- avail -= size;
- }
-
- AvailBox.x1 = 0;
- AvailBox.y1 =
- (offset + pGeode->displayPitch - 1) / pGeode->displayPitch;
-
- AvailBox.x2 = pGeode->displayWidth;
- AvailBox.y2 = (offset + avail) / pGeode->displayPitch;
-
- if (AvailBox.y1 < AvailBox.y2) {
- REGION_INIT(pScrn, &OffscreenRegion, &AvailBox, 2);
-
- if (!xf86InitFBManagerRegion(pScrn, &OffscreenRegion))
- xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
- "Memory manager initialization failed.\n");
-
- REGION_UNINIT(pScrn, &OffscreenRegion);
- }
- else
- xf86DrvMsg(pScrni->scrnIndex, X_INFO,
- "Cache disabled - no offscreen memory available.\n");
- }
- else
- xf86DrvMsg(pScrni->scrnIndex, X_INFO,
- "XAA offscreen memory has already been allocated.\n");
-#endif
- }
}
return ret;
}
@@ -450,7 +403,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
EntityInfoPtr pEnt;
rgb defaultWeight = { 0, 0, 0 };
int modecnt;
- char *s, *panelgeo;
+ const char *s, *panelgeo;
Bool useVGA;
if (pScrni->numEntities != 1)
@@ -462,7 +415,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
return FALSE;
#endif
- pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec));
+ pGeode = pScrni->driverPrivate = XNFcallocarray(1, sizeof(GeodeRec));
if (pGeode == NULL)
return FALSE;
@@ -615,14 +568,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
panelgeo = xf86GetOptValString(GeodeOptions, GX_OPTION_PANEL_GEOMETRY);
if ((s = xf86GetOptValString(GeodeOptions, GX_OPTION_ACCEL_METHOD))) {
-#if defined(XF86XAA) && defined(XF86EXA)
- if (!xf86NameCmp(s, "XAA"))
- pGeode->useEXA = FALSE;
- else if (xf86NameCmp(s, "EXA"))
- xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
- "Unknown acceleration method %s. Defaulting to XAA.\n",
- s);
-#elif defined(XF86EXA)
+#if defined(XF86EXA)
pGeode->useEXA = TRUE;
#else
pGeode->useEXA = FALSE;
@@ -631,7 +577,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
xf86DrvMsg(pScrni->scrnIndex, X_INFO,
"Using %s acceleration architecture\n",
- pGeode->useEXA ? "EXA" : "XAA");
+ pGeode->useEXA ? "EXA" : "none");
/* Set up the panel */
@@ -692,7 +638,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
else
pScrni->videoRam = pGeode->pEnt->device->videoRam;
- GeodeClockRange = (ClockRangePtr) xnfcalloc(1, sizeof(ClockRange));
+ GeodeClockRange = (ClockRangePtr) XNFcallocarray(1, sizeof(ClockRange));
GeodeClockRange->next = NULL;
GeodeClockRange->minClock = 25175;
GeodeClockRange->maxClock = 229500;
@@ -824,9 +770,8 @@ GXSetDvLineSize(unsigned int pitch)
/* XXX - this is nothing like the original function - not sure exactly what the purpose is for this quite yet */
static void
-GXAdjustFrame(ADJUST_FRAME_ARGS_DECL)
+GXAdjustFrame(ScrnInfoPtr pScrni, int x, int y)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
unsigned long offset;
@@ -908,16 +853,15 @@ GXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
pGeode->HWCursor = FALSE;
}
- GXAdjustFrame(ADJUST_FRAME_ARGS(pScrni->frameX0, pScrni->frameY0));
+ GXAdjustFrame(pScrni, pScrni->frameX0, pScrni->frameY0);
gx_enable_dac_power();
return TRUE;
}
static Bool
-GXSwitchMode(SWITCH_MODE_ARGS_DECL)
+GXSwitchMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
int ret = TRUE;
int rotate;
@@ -1006,7 +950,7 @@ GXLeaveGraphics(ScrnInfoPtr pScrni)
}
static Bool
-GXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+GXCloseScreen(ScreenPtr pScrn)
{
ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
GeodeRec *pGeode = GEODEPTR(pScrni);
@@ -1014,11 +958,6 @@ GXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
if (pScrni->vtSema)
GXLeaveGraphics(pScrni);
-#ifdef XF86XAA
- if (pGeode->AccelInfoRec)
- XAADestroyInfoRec(pGeode->AccelInfoRec);
-#endif
-
if (pGeode->AccelImageWriteBuffers) {
free(pGeode->AccelImageWriteBuffers[0]);
free(pGeode->AccelImageWriteBuffers);
@@ -1044,7 +983,7 @@ GXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScrn->CloseScreen = pGeode->CloseScreen;
if (pScrn->CloseScreen)
- return (*pScrn->CloseScreen) (CLOSE_SCREEN_ARGS);
+ return (*pScrn->CloseScreen) (pScrn);
return TRUE;
}
@@ -1275,7 +1214,7 @@ GXCreateScreenResources(ScreenPtr pScreen)
}
static Bool
-GXScreenInit(SCREEN_INIT_ARGS_DECL)
+GXScreenInit(ScreenPtr pScrn, int argc, char **argv)
{
ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
GeodeRec *pGeode = GEODEPTR(pScrni);
@@ -1475,9 +1414,8 @@ GXScreenInit(SCREEN_INIT_ARGS_DECL)
}
static int
-GXValidMode(VALID_MODE_ARGS_DECL)
+GXValidMode(ScrnInfoPtr pScrni, DisplayModePtr pMode, Bool Verbose, int flags)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
int p;
int custom = 0;
@@ -1526,16 +1464,14 @@ GXValidMode(VALID_MODE_ARGS_DECL)
/* XXX - Way more to do here */
static Bool
-GXEnterVT(VT_FUNC_ARGS_DECL)
+GXEnterVT(ScrnInfoPtr pScrni)
{
- SCRN_INFO_PTR(arg);
return GXEnterGraphics(NULL, pScrni);
}
static void
-GXLeaveVT(VT_FUNC_ARGS_DECL)
+GXLeaveVT(ScrnInfoPtr pScrni)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
pGeode->PrevDisplayOffset = gfx_get_display_offset();
@@ -1562,9 +1498,8 @@ GXSetupChipsetFPtr(ScrnInfoPtr pScrn)
* ============================== */
void
-GeodePointerMoved(POINTER_MOVED_ARGS_DECL)
+GeodePointerMoved(ScrnInfoPtr pScrni, int x, int y)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
int newX = x, newY = y;
@@ -1586,7 +1521,7 @@ GeodePointerMoved(POINTER_MOVED_ARGS_DECL)
break;
}
- (*pGeode->PointerMoved) (POINTER_MOVED_ARGS(newX, newY));
+ (*pGeode->PointerMoved) (pScrni, newX, newY);
}
int
@@ -1608,9 +1543,8 @@ GeodeFreeRec(ScrnInfoPtr pScrni)
}
void
-GeodeFreeScreen(FREE_SCREEN_ARGS_DECL)
+GeodeFreeScreen(ScrnInfoPtr pScrni)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
if (pGeode == NULL)
diff --git a/src/gx_randr.c b/src/gx_randr.c
index c0ca3b9..48f7ce4 100644
--- a/src/gx_randr.c
+++ b/src/gx_randr.c
@@ -59,22 +59,11 @@ typedef struct _GXRandRInfo {
Rotation supported_rotations; /* driver supported */
} XF86RandRInfoRec, *XF86RandRInfoPtr;
-#if HAS_DEVPRIVATEKEYREC
static DevPrivateKeyRec GXRandRIndex;
-#else
-static int GXRandRIndex;
-#endif
-
-#define OLD_VIDEODRV_INTERFACE (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
-#if OLD_VIDEODRV_INTERFACE
-#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
-#define XF86RANDRSET(p, v) (p)->devPrivates[GXRandRIndex].ptr = v
-#else
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
dixLookupPrivate(&(p)->devPrivates, &GXRandRIndex))
#define XF86RANDRSET(p, v) dixSetPrivate(&(p)->devPrivates, &GXRandRIndex, v)
-#endif
static int
GXRandRModeRefresh(DisplayModePtr mode)
@@ -168,11 +157,7 @@ GXRandRSetMode(ScreenPtr pScreen,
int oldmmWidth = pScreen->mmWidth;
int oldmmHeight = pScreen->mmHeight;
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 8
- WindowPtr pRoot = WindowTable[pScreen->myNum];
-#else
WindowPtr pRoot = pScreen->root;
-#endif
DisplayModePtr currentMode = NULL;
Bool ret = TRUE;
@@ -181,8 +166,7 @@ GXRandRSetMode(ScreenPtr pScreen,
#endif
if (pRoot)
- (*pScrni->
- EnableDisableFBAccess) (XF86_ENABLEDISABLEFB_ARG(pScrni, FALSE));
+ (*pScrni->EnableDisableFBAccess) (pScrni, FALSE);
if (useVirtual) {
pScrni->virtualX = pRandr->virtualX;
@@ -237,8 +221,7 @@ GXRandRSetMode(ScreenPtr pScreen,
xf86SetViewport(pScreen, 0, 0);
if (pRoot)
- (*pScrni->
- EnableDisableFBAccess) (XF86_ENABLEDISABLEFB_ARG(pScrni, TRUE));
+ (*pScrni->EnableDisableFBAccess) (pScrni, TRUE);
return ret;
}
@@ -264,11 +247,7 @@ GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
}
/* FIXME: we don't have a new video ABI yet */
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
miPointerGetPosition(inputInfo.pointer, &px, &py);
-#else
- miPointerPosition(&px, &py);
-#endif
for (mode = pScrni->modes;; mode = mode->next) {
if (pRandr->maxX == 0 || pRandr->maxY == 0) {
@@ -308,11 +287,7 @@ GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
}
/* FIXME: we don't have a new video ABI yet */
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
if (pScreen == miPointerGetScreen(inputInfo.pointer))
-#else
- if (pScreen == miPointerCurrentScreen())
-#endif
{
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
@@ -320,11 +295,7 @@ GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
xf86SetViewport(pScreen, px, py);
/* FIXME: we don't have a new video ABI yet */
- (*pScreen->SetCursorPosition) (
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
- inputInfo.pointer,
-#endif
- pScreen, px, py, FALSE);
+ (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE);
}
return TRUE;
@@ -347,13 +318,8 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
if (GXRandRGeneration != serverGeneration) {
GXRandRGeneration = serverGeneration;
}
-#if OLD_VIDEODRV_INTERFACE
- GXRandRIndex = AllocateScreenPrivateIndex();
-#endif
-#if HAS_DIXREGISTERPRIVATEKEY
if (!dixRegisterPrivateKey(&GXRandRIndex, PRIVATE_SCREEN, 0))
return FALSE;
-#endif
pRandr = calloc(1, sizeof(XF86RandRInfoRec));
if (pRandr == NULL)
diff --git a/src/gx_rotate.c b/src/gx_rotate.c
index 6076a40..c849792 100644
--- a/src/gx_rotate.c
+++ b/src/gx_rotate.c
@@ -157,25 +157,6 @@ GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode)
(pointer) (pGeode->FBBase +
pScrni->fbOffset));
- /* Don't use XAA pixmap cache or offscreen pixmaps when rotated */
-#if XF86XAA
- if (pGeode->AccelInfoRec) {
- if (pGeode->rotation == RR_Rotate_0) {
- pGeode->AccelInfoRec->Flags =
- LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE;
- pGeode->AccelInfoRec->UsingPixmapCache = TRUE;
- pGeode->AccelInfoRec->maxOffPixWidth = 0;
- pGeode->AccelInfoRec->maxOffPixHeight = 0;
- }
- else {
- pGeode->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER;
- pGeode->AccelInfoRec->UsingPixmapCache = FALSE;
- pGeode->AccelInfoRec->maxOffPixWidth = 1;
- pGeode->AccelInfoRec->maxOffPixHeight = 1;
- }
- }
-#endif
-
return TRUE;
error:
diff --git a/src/gx_video.c b/src/gx_video.c
index cc69dc2..4cc2836 100644
--- a/src/gx_video.c
+++ b/src/gx_video.c
@@ -46,7 +46,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "compiler.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86fbman.h"
#include "regionstr.h"
@@ -54,10 +53,6 @@
#include "geode.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
-#ifdef HAVE_XAA_H
-#include "xaa.h"
-#include "xaalocal.h"
-#endif
#include "dixstruct.h"
#include "fourcc.h"
#include "geode_fourcc.h"
@@ -110,8 +105,6 @@ void GXSetVideoPosition(int x, int y, int width, int height,
short src_w, short src_h, short drw_w,
short drw_h, int id, int offset, ScrnInfoPtr pScrni);
-extern void GXAccelSync(ScrnInfoPtr pScrni);
-
extern int DeltaX, DeltaY;
unsigned long graphics_lut[256];
@@ -229,11 +222,11 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {
static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = {
#if DBUF
- {XvSettable | XvGettable, 0, 1, "XV_DOUBLE_BUFFER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_DOUBLE_BUFFER"},
#endif
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, 0, 1, "XV_FILTER"},
- {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"}
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_FILTER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORKEYMODE"}
};
#define NUM_IMAGES 8
@@ -416,11 +409,7 @@ GXSetupImageVideo(ScreenPtr pScrn)
#endif
/* gotta uninit this someplace */
-#if defined(REGION_NULL)
REGION_NULL(pScrn, &pPriv->clip);
-#else
- REGION_INIT(pScrn, &pPriv->clip, NullBox, 0);
-#endif
pGeode->adaptor = adapt;
@@ -768,11 +757,11 @@ GXAllocateMemory(ScrnInfoPtr pScrni, void **memp, int numlines)
return 0;
}
-static BoxRec dstBox;
+static BoxRec global_dstBox;
static int srcPitch = 0, srcPitch2 = 0, dstPitch = 0, dstPitch2 = 0;
static INT32 Bx1, Bx2, By1, By2;
static int top, left, npixels, nlines;
-static int offset, s1offset = 0, s2offset = 0, s3offset = 0;
+static int global_offset, s1offset = 0, s2offset = 0, s3offset = 0;
static unsigned char *dst_start;
static int d2offset = 0, d3offset = 0;
@@ -1083,15 +1072,15 @@ GXPutImage(ScrnInfoPtr pScrni,
if ((Bx1 >= Bx2) || (By1 >= By2))
return Success;
- dstBox.x1 = drw_x;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y1 = drw_y;
- dstBox.y2 = drw_y + drw_h;
+ global_dstBox.x1 = drw_x;
+ global_dstBox.x2 = drw_x + drw_w;
+ global_dstBox.y1 = drw_y;
+ global_dstBox.y2 = drw_y + drw_h;
- dstBox.x1 -= pScrni->frameX0;
- dstBox.x2 -= pScrni->frameX0;
- dstBox.y1 -= pScrni->frameY0;
- dstBox.y2 -= pScrni->frameY0;
+ global_dstBox.x1 -= pScrni->frameX0;
+ global_dstBox.x2 -= pScrni->frameX0;
+ global_dstBox.y1 -= pScrni->frameY0;
+ global_dstBox.y2 -= pScrni->frameY0;
switch (id) {
case FOURCC_YV12:
@@ -1147,13 +1136,13 @@ GXPutImage(ScrnInfoPtr pScrni,
top &= ~1;
- offset = pPriv->offset + (top * dstPitch);
+ global_offset = pPriv->offset + (top * dstPitch);
#if DBUF
if (pPriv->doubleBuffer && pPriv->currentBuffer)
- offset += (new_h >> 1) * pGeode->Pitch;
+ global_offset += (new_h >> 1) * pGeode->Pitch;
#endif
- dst_start = pGeode->FBBase + offset + left;
+ dst_start = pGeode->FBBase + global_offset + left;
tmp = ((top >> 1) * srcPitch2) + (left >> 1);
s2offset += tmp;
s3offset += tmp;
@@ -1173,13 +1162,13 @@ GXPutImage(ScrnInfoPtr pScrni,
left <<= 1;
buf += (top * srcPitch) + left;
nlines = By2 - top;
- offset = (pPriv->offset) + (top * dstPitch);
+ global_offset = (pPriv->offset) + (top * dstPitch);
#if DBUF
if (pPriv->doubleBuffer && pPriv->currentBuffer)
- offset += (new_h >> 1) * pGeode->Pitch;
+ global_offset += (new_h >> 1) * pGeode->Pitch;
#endif
- dst_start = pGeode->FBBase + offset + left;
+ dst_start = pGeode->FBBase + global_offset + left;
break;
}
s1offset = (top * srcPitch) + left;
@@ -1191,8 +1180,8 @@ GXPutImage(ScrnInfoPtr pScrni,
xf86XVFillKeyHelper(pScrni->pScreen, pPriv->colorKey, clipBoxes);
}
- GXDisplayVideo(pScrni, id, offset, width, height, dstPitch,
- Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h);
+ GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch,
+ Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h);
}
#endif
switch (id) {
@@ -1225,8 +1214,8 @@ GXPutImage(ScrnInfoPtr pScrni,
REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes));
}
- GXDisplayVideo(pScrni, id, offset, width, height, dstPitch,
- Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h);
+ GXDisplayVideo(pScrni, id, global_offset, width, height, dstPitch,
+ Bx1, By1, Bx2, By2, &global_dstBox, src_w, src_h, drw_w, drw_h);
#endif
#if XV_PROFILE
@@ -1322,14 +1311,13 @@ GeodeQueryImageAttributes(ScrnInfoPtr pScrni,
static void
GXBlockHandler(BLOCKHANDLER_ARGS_DECL)
{
- SCREEN_PTR(arg);
- ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
+ ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen);
GeodeRec *pGeode = GEODEPTR(pScrni);
GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni);
- pScrn->BlockHandler = pGeode->BlockHandler;
- (*pScrn->BlockHandler) (BLOCKHANDLER_ARGS);
- pScrn->BlockHandler = GXBlockHandler;
+ pScreen->BlockHandler = pGeode->BlockHandler;
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
+ pScreen->BlockHandler = GXBlockHandler;
if (pPriv->videoStatus & TIMER_MASK) {
GXAccelSync(pScrni);
@@ -1358,7 +1346,7 @@ GXBlockHandler(BLOCKHANDLER_ARGS_DECL)
if (pPriv->area) {
#ifdef XF86EXA
if (pGeode->useEXA)
- exaOffscreenFree(pScrn, pPriv->area);
+ exaOffscreenFree(pScrni->pScreen, pPriv->area);
#endif
if (!pGeode->useEXA)
xf86FreeOffscreenArea(pPriv->area);
@@ -1410,7 +1398,7 @@ GXAllocateSurface(ScrnInfoPtr pScrni,
fbpitch = pScrni->bitsPerPixel * pScrni->displayWidth >> 3;
numlines = ((pitch * h) + fbpitch - 1) / fbpitch;
- if (!(offset = GXAllocateMemory(pScrni, &area, numlines)))
+ if (!(global_offset = GXAllocateMemory(pScrni, &area, numlines)))
return BadAlloc;
surface->width = w;
@@ -1431,14 +1419,14 @@ GXAllocateSurface(ScrnInfoPtr pScrni,
}
pPriv->area = area;
- pPriv->offset = offset;
+ pPriv->offset = global_offset;
pPriv->isOn = FALSE;
surface->pScrn = pScrni;
surface->id = id;
surface->pitches[0] = pitch;
- surface->offsets[0] = offset;
+ surface->offsets[0] = global_offset;
surface->devPrivate.ptr = (pointer) pPriv;
return Success;
diff --git a/src/lx_display.c b/src/lx_display.c
index 2aeb3b4..8ee6443 100644
--- a/src/lx_display.c
+++ b/src/lx_display.c
@@ -324,7 +324,6 @@ lx_crtc_commit(xf86CrtcPtr crtc)
/* Load the cursor */
if (crtc->scrn->pScreen != NULL) {
- xf86_reload_cursors(crtc->scrn->pScreen);
crtc->funcs->hide_cursor(crtc);
crtc->cursor_shown = FALSE;
}
@@ -389,11 +388,7 @@ lx_create_bo_pixmap(ScreenPtr pScreen,
{
PixmapPtr pixmap;
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,5,0,0,0)
pixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0);
-#else
- pixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth);
-#endif
if (!pixmap)
return NULL;
@@ -576,7 +571,7 @@ LXSetupCrtc(ScrnInfoPtr pScrni)
return;
}
- lxpriv = xnfcalloc(1, sizeof(LXCrtcPrivateRec));
+ lxpriv = XNFcallocarray(1, sizeof(LXCrtcPrivateRec));
if (!lxpriv) {
xf86CrtcDestroy(crtc);
diff --git a/src/lx_driver.c b/src/lx_driver.c
index 0f04579..0d43096 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -39,9 +39,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
-#include "xf86Resources.h"
-#endif
#include "xf86i2c.h"
#include "xf86Crtc.h"
#include "xf86cmap.h"
@@ -309,7 +306,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
EntityInfoPtr pEnt;
OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0];
rgb defaultWeight = { 0, 0, 0 };
- char *s;
+ const char *s;
if (pScrni->numEntities != 1)
return FALSE;
@@ -324,7 +321,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
return TRUE;
}
- pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec));
+ pGeode = pScrni->driverPrivate = XNFcallocarray(1, sizeof(GeodeRec));
if (pGeode == NULL)
return FALSE;
@@ -357,7 +354,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
/* Fill in the monitor information */
pScrni->monitor = pScrni->confScreen->monitor;
- if (!xf86SetDepthBpp(pScrni, 16, 16, 16, Support24bppFb | Support32bppFb))
+ if (!xf86SetDepthBpp(pScrni, 0, 0, 0, Support24bppFb | Support32bppFb))
return FALSE;
switch (pScrni->depth) {
@@ -472,7 +469,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
pGeode->Output = OUTPUT_PANEL | OUTPUT_DCON;
}
else if (pGeode->Output & OUTPUT_PANEL) {
- char *pmode = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_MODE);
+ const char *pmode = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_MODE);
if (pmode != NULL)
pGeode->panelMode = LXGetManualPanelMode(pmode);
@@ -651,9 +648,8 @@ LXUnmapMem(ScrnInfoPtr pScrni)
/* These should be correctly accounted for rotation */
void
-LXAdjustFrame(ADJUST_FRAME_ARGS_DECL)
+LXAdjustFrame(ScrnInfoPtr pScrni, int x, int y)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
unsigned long offset;
@@ -665,9 +661,8 @@ LXAdjustFrame(ADJUST_FRAME_ARGS_DECL)
}
static Bool
-LXSwitchMode(SWITCH_MODE_ARGS_DECL)
+LXSwitchMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
/* Set the new mode */
@@ -717,7 +712,7 @@ LXLeaveGraphics(ScrnInfoPtr pScrni)
}
static Bool
-LXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+LXCloseScreen(ScreenPtr pScrn)
{
ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
GeodeRec *pGeode = GEODEPTR(pScrni);
@@ -743,7 +738,7 @@ LXCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScrn->CloseScreen = pGeode->CloseScreen;
if (pScrn->CloseScreen)
- return (*pScrn->CloseScreen) (CLOSE_SCREEN_ARGS);
+ return (*pScrn->CloseScreen) (pScrn);
return TRUE;
}
@@ -839,7 +834,7 @@ LXLoadPalette(ScrnInfoPtr pScrni,
}
static Bool
-LXScreenInit(SCREEN_INIT_ARGS_DECL)
+LXScreenInit(ScreenPtr pScrn, int argc, char **argv)
{
ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
GeodeRec *pGeode = GEODEPTR(pScrni);
@@ -1009,22 +1004,20 @@ LXScreenInit(SCREEN_INIT_ARGS_DECL)
}
static int
-LXValidMode(VALID_MODE_ARGS_DECL)
+LXValidMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Bool Verbose, int flags)
{
return MODE_OK;
}
static Bool
-LXEnterVT(VT_FUNC_ARGS_DECL)
+LXEnterVT(ScrnInfoPtr pScrni)
{
- SCRN_INFO_PTR(arg);
return LXEnterGraphics(NULL, pScrni);
}
static void
-LXLeaveVT(VT_FUNC_ARGS_DECL)
+LXLeaveVT(ScrnInfoPtr pScrni)
{
- SCRN_INFO_PTR(arg);
GeodeRec *pGeode = GEODEPTR(pScrni);
pGeode->PrevDisplayOffset = vg_get_display_offset();
diff --git a/src/lx_output.c b/src/lx_output.c
index 40455ce..fbe21ab 100644
--- a/src/lx_output.c
+++ b/src/lx_output.c
@@ -47,7 +47,7 @@ static void
lx_create_resources(xf86OutputPtr output)
{
int ret;
- char *s;
+ const char *s;
ScrnInfoPtr pScrni = output->scrn;
GeodeRec *pGeode = GEODEPTR(pScrni);
@@ -285,7 +285,7 @@ LXSetupOutput(ScrnInfoPtr pScrni)
output = xf86OutputCreate(pScrni, &lx_output_funcs, "default");
- lxpriv = xnfcalloc(1, sizeof(LXOutputPrivateRec));
+ lxpriv = XNFcallocarray(1, sizeof(LXOutputPrivateRec));
if (!lxpriv) {
xf86OutputDestroy(output);
diff --git a/src/lx_panel.c b/src/lx_panel.c
index 6b5d4ed..4a304a9 100644
--- a/src/lx_panel.c
+++ b/src/lx_panel.c
@@ -110,7 +110,7 @@ LXGetLegacyPanelMode(ScrnInfoPtr pScrni)
/* Construct a moderec from the specified panel mode */
DisplayModePtr
-LXGetManualPanelMode(char *modestr)
+LXGetManualPanelMode(const char *modestr)
{
int clock;
int hactive, hsstart, hsend, htotal;
@@ -126,15 +126,15 @@ LXGetManualPanelMode(char *modestr)
if (ret != 9)
return NULL;
- mode = xnfcalloc(1, sizeof(DisplayModeRec));
+ mode = XNFcallocarray(1, sizeof(DisplayModeRec));
if (mode == NULL)
return NULL;
sprintf(sname, "%dx%d", hactive, vactive);
- mode->name = xnfalloc(strlen(sname) + 1);
- strcpy(mode->name, sname);
+ mode->name = (char *)XNFalloc(strlen(sname) + 1);
+ strcpy((char *)mode->name, sname);
mode->type = M_T_DRIVER | M_T_PREFERRED;
mode->Clock = clock;
diff --git a/src/lx_video.c b/src/lx_video.c
index eb46cb5..a941557 100644
--- a/src/lx_video.c
+++ b/src/lx_video.c
@@ -39,7 +39,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "compiler.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86fbman.h"
#include "regionstr.h"
@@ -85,9 +84,9 @@ static XF86VideoFormatRec Formats[] = {
};
static XF86AttributeRec Attributes[] = {
- {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
- {XvSettable | XvGettable, 0, 1, "XV_FILTER"},
- {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"}
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_FILTER"},
+ {XvSettable | XvGettable, 0, 1, (char *)"XV_COLORKEYMODE"}
};
static XF86ImageRec Images[] = {
@@ -643,14 +642,13 @@ LXResetVideo(ScrnInfoPtr pScrni)
static void
LXVidBlockHandler(BLOCKHANDLER_ARGS_DECL)
{
- SCREEN_PTR(arg);
- ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
+ ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen);
GeodeRec *pGeode = GEODEPTR(pScrni);
GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni);
- pScrn->BlockHandler = pGeode->BlockHandler;
- (*pScrn->BlockHandler) (BLOCKHANDLER_ARGS);
- pScrn->BlockHandler = LXVidBlockHandler;
+ pScreen->BlockHandler = pGeode->BlockHandler;
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
+ pScreen->BlockHandler = LXVidBlockHandler;
if (pPriv->videoStatus & TIMER_MASK) {
Time now = currentTime.milliseconds;
@@ -685,9 +683,9 @@ LXVidBlockHandler(BLOCKHANDLER_ARGS_DECL)
}
static XF86VideoAdaptorPtr
-LXSetupImageVideo(ScreenPtr pScrn)
+LXSetupImageVideo(ScreenPtr pScreen)
{
- ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn);
+ ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen);
GeodeRec *pGeode = GEODEPTR(pScrni);
XF86VideoAdaptorPtr adapt;
GeodePortPrivRec *pPriv;
@@ -741,8 +739,8 @@ LXSetupImageVideo(ScreenPtr pScrn)
pGeode->adaptor = adapt;
- pGeode->BlockHandler = pScrn->BlockHandler;
- pScrn->BlockHandler = LXVidBlockHandler;
+ pGeode->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = LXVidBlockHandler;
xvColorKey = MAKE_ATOM("XV_COLORKEY");
xvColorKeyMode = MAKE_ATOM("XV_COLORKEYMODE");
diff --git a/src/panel/cen9211.c b/src/panel/cen9211.c
index d9cbc42..7a36a56 100644
--- a/src/panel/cen9211.c
+++ b/src/panel/cen9211.c
@@ -730,11 +730,9 @@ CentaurusProgramFRMload(void)
};
unsigned char i;
- unsigned short index;
unsigned long data;
Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0);
- index = CS92xx_FRM_MEMORY_DATA;
for (i = 0; i < 64; i += 2) {
data = CentaurusFRMtable[i];
Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data);
diff --git a/src/panel/platform.c b/src/panel/platform.c
index 3e5afe3..812e762 100644
--- a/src/panel/platform.c
+++ b/src/panel/platform.c
@@ -68,7 +68,7 @@ SYS_BOARD_INFO Sys_board_info_array[] = {
static int Num_sys_board_type = NUM_SYS_BOARD_TYPES;
SYS_BOARD_INFO *Sys_board_array_base = Sys_board_info_array;
-int FindStringInSeg(unsigned int, char *);
+int FindStringInSeg(unsigned int, const char *);
static unsigned char get_sys_board_type(SYS_BOARD_INFO *, SYS_BOARD_INFO *);
/* Detect the Platform */
@@ -81,7 +81,7 @@ Detect_Platform(void)
}
static int
-Strncmp(char *str1, char *str2, int len)
+Strncmp(const char *str1, char *str2, int len)
{
int i;
@@ -99,7 +99,7 @@ Strncmp(char *str1, char *str2, int len)
}
static char *
-Strcpy(char *dst, char *src)
+Strcpy(char *dst, const char *src)
{
int i;
@@ -113,7 +113,7 @@ Strcpy(char *dst, char *src)
}
static int
-Strlen(char *str)
+Strlen(const char *str)
{
int i;
@@ -135,7 +135,7 @@ Strlen(char *str)
************************************************************************
*/
int
-FindStringInSeg(unsigned int segment_address, char *string_ptr)
+FindStringInSeg(unsigned int segment_address, const char *string_ptr)
{
int string_length = Strlen(string_ptr);
char *psegment_buf;
@@ -186,7 +186,7 @@ get_sys_board_type(SYS_BOARD_INFO * sys_info,
SYS_BOARD_INFO * sys_board_array_base)
{
int index;
- char *xpress_rom_string_ptr = "XpressStart";
+ const char *xpress_rom_string_ptr = "XpressStart";
unsigned int segment = LINUX_ROM_SEGMENT;
/* See if XpressStart is present in the BIOS area.
diff --git a/src/z4l.c b/src/z4l.c
index c7b33e8..a20470e 100644
--- a/src/z4l.c
+++ b/src/z4l.c
@@ -83,7 +83,7 @@ int debuglvl = 0;
#define MAX_OVLY_WIDTH 2048
#define MAX_OVLY_HEIGHT 2048
-static char *z4l_dev_paths[] = {
+static const char *z4l_dev_paths[] = {
"/dev/videox", NULL
};
@@ -579,7 +579,7 @@ static int
z4l_ovly_set_encoding(Z4lPortPrivRec * pPriv, int id)
{
int l, n, inp;
- char *cp;
+ const char *cp;
t_std_data *sp;
XF86VideoEncodingPtr enc;
XF86VideoAdaptorPtr adpt;
@@ -992,7 +992,7 @@ Z4lEncodingName(char *ename, int l, char *inp_name, char *std_name, char *fmt)
}
static int
-Z4lAddEncoding(XF86VideoEncodingPtr enc, char *name, int id, int width,
+Z4lAddEncoding(XF86VideoEncodingPtr enc, const char *name, int id, int width,
int height, int numer, int denom, int inp, v4l2_std_id std,
unsigned int fmt)
{
@@ -1273,12 +1273,11 @@ Z4lGetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value,
return Success;
}
-static void (*oldAdjustFrame) (ADJUST_FRAME_ARGS_DECL) = NULL;
+static void (*oldAdjustFrame) (ScrnInfoPtr pScrni, int x, int y) = NULL;
static void
-Z4lAdjustFrame(ADJUST_FRAME_ARGS_DECL)
+Z4lAdjustFrame(ScrnInfoPtr pScrni, int x, int y)
{
- SCRN_INFO_PTR(arg);
int i;
XF86VideoAdaptorPtr adpt;
Z4lPortPrivRec *pPriv;
@@ -1286,7 +1285,7 @@ Z4lAdjustFrame(ADJUST_FRAME_ARGS_DECL)
DBLOG(3, "Z4lAdjustFrame(%d,%d)\n", x, y);
z4l_x_offset = x;
z4l_y_offset = y;
- oldAdjustFrame(ADJUST_FRAME_ARGS(x, y));
+ oldAdjustFrame(pScrni, x, y);
/* xv adjust does not handle putvideo case */
for (i = 0; i < Z4l_nAdaptors; ++i) {
@@ -1315,7 +1314,8 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
XF86VideoEncodingPtr encs, enc;
XF86ImagePtr ip, img, imgs;
Z4lPortPrivRec *pPriv;
- char *dp, *msg;
+ char *dp;
+ const char *msg;
char enc_name[256], attr_name[256];
int attrIds[V4L2_CID_LASTP1 - V4L2_CID_BASE + ATTR_MAX_ID];
struct v4l2_capability capability;
@@ -1500,7 +1500,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
Z4lAttributeName(&attr_name[0], sizeof(attr_name),
- (char *) &queryctrl.name[0]);
+ (char *)&queryctrl.name[0]);
if (Z4lAddAttribute(attr, &attr_name[0],
queryctrl.minimum, queryctrl.maximum,
XvSettable | XvGettable) == 0)
@@ -1509,7 +1509,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
attrIds[nattrs] = ATTR_ENCODING_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_ENCODING);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_ENCODING);
if (Z4lAddAttribute(attr, &attr_name[0], 0, nencs - 1,
XvSettable | XvGettable) == 0)
goto fail;
@@ -1522,14 +1522,14 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
attrIds[nattrs] = ATTR_KEYMODE_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_KEYMODE);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_KEYMODE);
if (Z4lAddAttribute(attr, &attr_name[0], 0, 1,
XvSettable | XvGettable) == 0)
goto fail;
attrIds[nattrs] = ATTR_COLORKEY_ID;
if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL)
goto fail;
- Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_COLORKEY);
+ Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *)ATTR_COLORKEY);
if (Z4lAddAttribute(attr, &attr_name[0], 0, 0xffffff,
XvSettable | XvGettable) == 0)
goto fail;
@@ -1577,11 +1577,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
pPriv->bufsz = -1;
pPriv->last = -1;
pPriv->pixfmt = opixfmt;
-#if defined(REGION_NULL)
REGION_NULL(pScrni->pScreen, &pPriv->clips);
-#else
- REGION_INIT(pScrni->pScreen, &pPriv->clips, NullBox, 0);
-#endif
strncpy(&pPriv->dev_path[0], z4l_dev_paths[dev],
sizeof(pPriv->dev_path));
pPriv->enc = &encs[cenc];
@@ -1618,7 +1614,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if (encs != NULL) {
for (i = 0; i < nencs; ++i) {
if (encs[i].name != NULL)
- free(encs[i].name);
+ free((char *)encs[i].name);
}
free(encs);
}
@@ -1630,7 +1626,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
for (i = 0; i < nadpts; ++i) {
if ((adpt = adpts[i]) != NULL) {
if (adpt->name != NULL)
- free(adpt->name);
+ free((char *)adpt->name);
if ((attrs = adpt->pAttributes) != NULL) {
for (i = 0; i < adpt->nAttributes; ++i)
if (attrs[i].name != NULL)
@@ -1640,7 +1636,7 @@ Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors)
if ((encs = adpt->pEncodings) != NULL) {
for (i = 0; i < adpt->nEncodings; ++i, ++enc)
if (encs[i].name != NULL)
- free(encs[i].name);
+ free((char *)encs[i].name);
free(encs);
}
if ((imgs = adpt->pImages) != NULL)