summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2007-01-17 21:03:17 +0100
committerTilman Sauerbeck <tilman@code-monkey.de>2007-01-17 21:03:17 +0100
commit125fe441478d2ab1e2a55613cda5fa8cc15031cc (patch)
tree0bfe2d3018e2d495ed7c4843afdb8e97f47c4bba
parent876657e613de6d9dd906c95e05fc590a84d1c322 (diff)
Removed the HAL code.
Chances are good some of the now lost features will be implemented later.
-rw-r--r--README_HALLIB209
-rw-r--r--man/mga.man7
-rw-r--r--src/binding.h254
-rw-r--r--src/client.h68
-rw-r--r--src/clientlx.c832
-rw-r--r--src/mga.h41
-rw-r--r--src/mga_dac3026.c16
-rw-r--r--src/mga_dacG.c78
-rw-r--r--src/mga_driver.c779
-rw-r--r--src/mga_esc.c795
-rw-r--r--src/mga_halmod.c42
-rw-r--r--src/mga_macros.h15
-rw-r--r--src/mga_merge.c40
13 files changed, 66 insertions, 3110 deletions
diff --git a/README_HALLIB b/README_HALLIB
deleted file mode 100644
index 432e42e..0000000
--- a/README_HALLIB
+++ /dev/null
@@ -1,209 +0,0 @@
-HAL Documentation
-
-This documentation provides preliminary explaination of the HAL library, a
-more detailed version of this document is in the process of being written
-and will be released with future driver builds.
-
-------------------------------------------------------------
-MGAOpenLibrary
-
-Description: Link Client functions with HAL Librery
-
-Input:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-LPBARDHANDLElpClient: Pointer to the client stucture
-
-ulClientSize: Size of the client structure
-
-Error:
-return 0 on success
-
--------------------------------------------------------------
-MGAGetHardwareInfo
-
-Description:
-
-Fills MGAWINFO structure.
-
-struct {
-ULONG UlCapsFirstOutput;
-ULONG ulCapsSecondOutput;
-ULONG ulVideoMemory;
-} FAR *LPMGAHWINFO;
-
-#define MGAHWINFOCAPS_CRTC1_DIGITAL (1L << 1)
-#define MGAHWINFOCAPS_CRTC1_TV (1L << 2)
-#define MGAHWINFOCAPS_CRTC2_ANALOG (1L << 3)
-#define MGAHWINFOCAPS_CRTC2_DIGITAL (1L << 4)
-#define MGAHWINFOCAPS_CRTC2_TV (1L << 5)
-#define MGAHWINFOCAPS_OUTPUT_VGA (1L << 6)
-#define MGAHWINFOCAPS_CRTC2 (MGAHWINFOCAPS_CRTC2_ANALOG | MGAHWINFOCAPS_CRTC2_DIGITAL | MGAHWINFOCAPS_CRTC2_TV)
-#define MGAHWINFOCAPS_OUTPUT_ANALOG (MGAHWINFOCAPS_CRTC1_ANALOG | MGAHWINFOCAPS_CRTC2_ANALOG)
-#define MGAHWINFOCAPS_OUTPUT_DIGITAL (MGAHWINFOCAPS_CRTC1_DIGITAL | MGAHWINFOCAPS_CRTC2_DIGITAL)
-#define MGAHWINFOCAPS_OUTPUT_TV (MGAHWINFOCAPS_CRTC1_TV | MGAHWINFOCAPS_CRTC2_TV)
-
-example:
-
-if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_TV )
-{
- ErrorF("TV detected\n");
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV detected\n ");
-}
-if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_DIGITAL)
-{
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Digital Screen detected\n ");
-}
-
-Inputs:
-
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-LPMGAHWINFO pMgaHwInfo: Handle to the board structure containing all
-the information about the specific Board.
-
-Error:
-Returns 0 on success
-------------------------------------------------------------
-MGAValidateMode
-
-Description:
-
-Validates the mode given by client.
-
-Here are the different options for pMgaModeInfo->flOutput:
-
-MGAMODEINFO_FORCE_PITCH
-MGAMODEINFO_FORCE_DISPLAYORG
-MGAMODEINFO_SECOND_CRTC
-MGAMODEINFO_ANALOG1
-MGAMODEINFO_ANALOG2
-MGAMODEINFO_DIGITAL1
-MGAMODEINFO_DIGITAL2
-MGAMODEINFO_TV
-
-These options can be combined together to set different combinations.
-Example:
-
-/*The second crtc outputs to a digital screen*/
-pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC
-| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-- or -
-
-/*The second crtc outputs to an analog screen*/
-pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC
-| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-- or -
-
-/*The second crtc outputs to a tv*/
-pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function).
-
-Error:
-Returns 0 on success
-
--------------------------------------------------------------
-MGASetMode
-
-Description:
-
-Initializes the board.
-
-Here are the different options for pMgaModeInfo->flOutput:
-
-MGAMODEINFO_FORCE_PITCH
-MGAMODEINFO_FORCE_DISPLAYORG
-MGAMODEINFO_SECOND_CRTC
-MGAMODEINFO_ANALOG1
-MGAMODEINFO_ANALOG2
-MGAMODEINFO_DIGITAL1
-MGAMODEINFO_DIGITAL2
-MGAMODEINFO_TV
-
-These options can be combined together to set different combinations.
-Example:
-
-/*The second crtc outputs to a digital screen*/
-pMgaModeInfo->flOutput= MGAMODEINFO_DIGITAL2 | MGAMODEINFO_SECOND_CRTC
-| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-- or -
-
-/*The second crtc outputs to an analog screen*/
-pMgaModeInfo-> flOutput = MGAMODEINFO_ANALOG2| MGAMODEINFO_SECOND_CRTC
-| MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-- or -
-
-/*The second crtc outputs to a tv*/
-pMga->pMgaModeInfo->flOutput = MGAMODEINFO_TV | MGAMODEINFO_SECOND_CRTC | MGAMODEINFO_FORCE_PITCH | MGAMODEINFO_FORCE_DISPLAYORG;
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-LPMGAMODEINFO pMgaModeInfo: Pointer to structure containing information about a specific display mode. (You need to fill the structure except the video parameters part which will be filled by the function).
-
-Error:
-Returns 0 on success
-
-------------------------------------------------------------
-
-MGASetVgaMode
-
-Description:
-
-Switchs the VGA mode
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-Error:
-Returns 0 on success
-
-------------------------------------------------------------
-
-MGARestoreVgaState
-
-Description:
-
-Restores the VGA State
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-Error:
-Returns 0 on success
-
-------------------------------------------------------------
-
-MGASaveVgaState
-
-Description:
-
-Saves the VGA state
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-Error:
-Returns 0 on success
-
-------------------------------------------------------------
-
-MGACloseLibrary
-
-Description:
-
-Closes the library
-
-Inputs:
-LPBOARDHANDLE pBoard: Handle to the board structure containing all the information about the board.
-
-Error:
-Returns 0 on success
diff --git a/man/mga.man b/man/mga.man
index 2ad75bc..abc9ae0 100644
--- a/man/mga.man
+++ b/man/mga.man
@@ -23,11 +23,8 @@ TrueColor. Multi\-card configurations are supported. XVideo is supported
on G200 and newer systems, with either
.B TexturedVideo
or video overlay. The second head of dual\-head cards is supported for the
-G450 and G550. Support for the second head on G400 cards requires a
-binary\-only "mga_hal" module that is available from Matrox
-<http://www.matrox.com>, and may be on the CD supplied with the card. That
-module also provides various other enhancements, and may be necessary to
-use the DVI (digital) output on the G550 (and other cards).
+G450 and G550. The DVI (digital) output on the G450 and the G550 is not
+supported.
.SH "SUPPORTED HARDWARE"
The
.B mga
diff --git a/src/binding.h b/src/binding.h
deleted file mode 100644
index 6dcd1e9..0000000
--- a/src/binding.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/**************************************************************************************
-
- @doc MGA MGA_STRUCT
-
- @module MGA Structures | Structure of The MGA Layer
- @normal Copyright © 1997, Matrox Graphics Inc.
-
- All Rights Reserved.
-
- @head3 MGA Structures |
- @index struct | MGA_STRUCT
-
- @end
-
-***************************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.3 2000/10/24 22:45:08 dawes Exp $ */
-
-#ifndef _BINDING
-#define _BINDING
-
-#ifndef _INTERNALBINDING
-
-#define BINDING_NOERROR 0x00000000
-#define BINDING_ERROR 0x90000000
-#define FAR
-#define DECL
-
-typedef void VOID;
-typedef void FAR *LPVOID;
-typedef void FAR *LPBOARDHANDLE;
-
-typedef long LONG;
-typedef unsigned long ULONG;
-typedef unsigned long FLONG;
-typedef unsigned long FAR *LPULONG;
-
-typedef char CHAR;
-typedef unsigned char UCHAR;
-typedef unsigned char FAR*LPUCHAR;
-
-typedef struct TAGCLIENTTABLE{
- ULONG (DECL *ClientReadConfigSpaceByte )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientReadConfigSpaceDword )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientWriteConfigSpaceByte )(LPVOID , ULONG, UCHAR);
- ULONG (DECL *ClientWriteConfigSpaceDword )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientOpenRegisterBase )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientCloseRegisterBase )(LPVOID );
- ULONG (DECL *ClientReadRegisterByte )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientReadRegisterDword )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientWriteRegisterByte )(LPVOID , ULONG, UCHAR);
- ULONG (DECL *ClientWriteRegisterDword )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientOpenMemoryBase )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientCloseMemoryBase )(LPVOID );
- ULONG (DECL *ClientReadMemoryByte )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientReadMemoryDword )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientWriteMemoryByte )(LPVOID , ULONG, UCHAR);
- ULONG (DECL *ClientWriteMemoryDword )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientOpenSystemDevice )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientCloseSystemDevice )(LPVOID );
- ULONG (DECL *ClientReadSystemDeviceByte )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientReadSystemDeviceDword )(LPVOID , ULONG, LPVOID );
- ULONG (DECL *ClientWriteSystemDeviceByte )(LPVOID , ULONG, UCHAR);
- ULONG (DECL *ClientWriteSystemDeviceDword )(LPVOID , ULONG, ULONG);
- ULONG (DECL *ClientWait )(LPVOID , ULONG);
- ULONG (DECL *ClientGetBiosInfo ) (LPVOID, LPVOID, LPVOID);
- ULONG (DECL *ClientReadDDCEdid ) (LPVOID, LPVOID, ULONG);
-#ifdef DEBUG
- ULONG (DECL *ClientDebug ) (LPVOID, ULONG, LPVOID, ULONG, LPVOID);
-#endif
-} CLIENTTABLE, FAR *LPCLIENTTABLE;
-
-#endif /* _INTERNALBINDING */
-
-/***************************************************************************************************
- MGAHWINFO STRUCTURE
- ***************************************************************************************************
- @struct MGAHWINFO | Public MGA Board Information
- @field OUT ULONG | ulCapsFirstOutput | Capabilities of firts output
- @flag Bit 0 | Analog output supported on primary CRTC
- @flag Bit 1 | Digital output supported on primary CRTC
- @flag Bit 2 | TV output supported on primary CRTC
- @flag Bit 3 | Analog output supported on second CRTC
- @flag Bit 4 | Digital output supported on second CRTC
- @flag Bit 5 | TV output supported on second CRTC
- @flag Bit 6 | VGA output supported
- @field OUT ULONG | ulCapsSecondOutput | Capabilities of second output
- @flag Bit 0 | Analog output supported on primary CRTC
- @flag Bit 1 | Digital output supported on primary CRTC
- @flag Bit 2 | TV output supported on primary CRTC
- @flag Bit 3 | Analog output supported on second CRTC
- @flag Bit 4 | Digital output supported on second CRTC
- @flag Bit 5 | TV output supported on second CRTC
- @flag Bit 6 | VGA output supported
- @field OUT ULONG | ulVideoMemory | Total number of video memory in bytes
- @end
- **************************************************************************************************/
-typedef struct TAGMGAHWINFO {
- ULONG ulCapsFirstOutput;
- ULONG ulCapsSecondOutput;
- ULONG ulVideoMemory;
-} MGAHWINFO, FAR *LPMGAHWINFO;
-
-/***************************************************************************************************
- MGAMODEINFO STRUCTURE
- ***************************************************************************************************
- @struct MGAMODEINFO | Mode Information
- @field IN FLONG | flOutput | Where we want to apply this parameters
- @flag Bit 0 | Use second CRTC
- @flag Bit 1 | Use primary analog output
- @flag Bit 2 | Use secondary analog output
- @flag Bit 3 | Use primary digital output
- @flag Bit 4 | Use secondary digital output
- @flag Bit 5 | Force a particular frame buffer pitch
- @flag Bit 6 | Force a particular display origin
- @flag Bit 7-31 | Reserved
- @field IN ULONG | ulDispWidth | Display Width in pixels
- @field IN ULONG | ulDispHeight | Display Height in pixels
- @field IN ULONG | ulDeskWidth | Desktop Width in pixels
- @field IN ULONG | ulDeskHeight | Desktop Height in pixels
- @field IN OUT ULONG | ulFBPitch | Frame Buffer Pitch in pixel
- @field IN ULONG | ulBpp | Bits Per Pixels and input format
- @flag lower 16 bit | Bits per pixel
- <nl><tab> 8, 15, 16, 24 or 32
- @flag upper 16 bit | Input format
- <nl><tab> 0 RGB
- <nl><tab> 1 RGBA
- <nl><tab> 2 YcbCr 4:2:0 3 Planes
- <nl><tab> 3 YcbCr 4:2:0 4 Planes
- <nl><tab> 4 YcbCr 4:2:2-UYVY
- <nl><tab> 5 YcbCr 4:2:2-YUY2
- <nl><tab> 6-10 none interleave mode
- <nl><tab> 6 NI RGBA
- <nl><tab> 7 NI YcbCr 4:2:0 3 Planes
- <nl><tab> 8 NI YcbCr 4:2:0 4 Planes
- <nl><tab> 9 NI YcbCr 4:2:2-UYVY
- <nl><tab> 10 NI YcbCr 4:2:2-YUY2
- @field IN ULONG | ulZoom | Zoom factor
- @flag 1x (1), 2x (2) or 4x (4)|
- @field IN OUT FLONG | flSignalMode | Signal Mode
- @flag Bit 0 | Interlace (0 : Non-interlace / 1: Interlace)
- @flag Bit 1 | Overscan (0 : No Overscan / 1 : Overscan)
- @flag Bit 2 | Horizontal Sync Polarity (0 : Negative / 1 : Positive)
- @flag Bit 3 | Vertical Sync Polarity (0 : Negative / 1 : Positive)
- @flag Bit 4-7 | Standard TV output
- <nl><tab>000 - PAL B G H
- <nl><tab>001 - NTSC M
- <nl><tab>010..111 - Reserved
- @flag Bit 8-31 | Reserved for future use
- @field IN OUT ULONG | ulRefreshRate | Vertical Refresh Rate in Hz
- @field IN OUT ULONG | ulHorizRate | Horizontal Refresh Rate in KHz
- @field IN OUT ULONG | ulPixClock | Pixel Clock in kHz
- @field IN OUT ULONG | ulHFPorch | Horizontal front porch in pixels
- @field IN OUT ULONG | ulHSync | Horizontal Sync in pixels
- @field IN OUT ULONG | ulHBPorch | Horizontal back porch in pixels
- @field IN OUT ULONG | ulVFPorch | Vertical front porch in lines
- @field IN OUT ULONG | ulVSync | Vertical Sync in lines
- @field IN OUT ULONG | ulVBPorch | Vertical back Porch in lines
- @field IN OUT ULONG | ulDisplayOrg | Origin of the display Offset(pixels)
- @field IN OUT ULONG | ulDstOrg | Origin of the drawing Offset in the frame (pixels)
- @field IN OUT ULONG | ulPanXGran | Panning in X granularity in pixel
- @field IN OUT ULONG | ulPanYGran | Panning in Y granularity in pixel
- @field IN OUT ULONG | ulTVStandard | TV Standard
- @field IN OUT ULONG | ulCableType | Cable Type
- @end
- **************************************************************************************************/
-typedef struct TAGMAGMODEINFO {
- FLONG flOutput; /* Where we want to apply this parameters */
- ULONG ulDispWidth; /* Display Width in pixels */
- ULONG ulDispHeight; /* Display Height in pixels */
- ULONG ulDeskWidth; /* Desktop Width in pixels */
- ULONG ulDeskHeight; /* Desktop Height in pixels */
- ULONG ulFBPitch; /* Frame Buffer Pitch in pixel */
- ULONG ulBpp; /* Bits Per Pixels / input format */
- ULONG ulZoom; /* Zoom factor */
- FLONG flSignalMode; /* Signal Mode */
- ULONG ulRefreshRate; /* Vertical Refresh Rate in Hz */
- ULONG ulHorizRate; /* Horizontal Refresh Rate in KHz */
- ULONG ulPixClock; /* Pixel Clock in kHz */
- ULONG ulHFPorch; /* Horizontal front porch in pixels */
- ULONG ulHSync; /* Horizontal Sync in pixels */
- ULONG ulHBPorch; /* Horizontal back porch in pixels */
- ULONG ulVFPorch; /* Vertical front porch in lines */
- ULONG ulVSync; /* Vertical Sync in lines */
- ULONG ulVBPorch; /* Vertical back Porch in lines */
- ULONG ulDisplayOrg; /* Origin of the display Offset(bytes) */
- ULONG ulDstOrg; /* Origin of the drawing Offset in the frame (bytes) */
- ULONG ulPanXGran; /* Panning in X granularity in pixel */
- ULONG ulPanYGran; /* Panning in Y granularity in pixel */
- ULONG ulTVStandard; /* TV Standard */
- ULONG ulCableType; /* Cable Type */
-} MGAMODEINFO, FAR *LPMGAMODEINFO;
-
-#define MGAHWINFOCAPS_CRTC1_ANALOG 1L
-#define MGAHWINFOCAPS_CRTC1_DIGITAL (1L << 1)
-#define MGAHWINFOCAPS_CRTC1_TV (1L << 2)
-#define MGAHWINFOCAPS_CRTC2_ANALOG (1L << 3)
-#define MGAHWINFOCAPS_CRTC2_DIGITAL (1L << 4)
-#define MGAHWINFOCAPS_CRTC2_TV (1L << 5)
-#define MGAHWINFOCAPS_OUTPUT_VGA (1L << 6)
-#define MGAHWINFOCAPS_CRTC2 (MGAHWINFOCAPS_CRTC2_ANALOG | MGAHWINFOCAPS_CRTC2_DIGITAL | MGAHWINFOCAPS_CRTC2_TV)
-#define MGAHWINFOCAPS_OUTPUT_ANALOG (MGAHWINFOCAPS_CRTC1_ANALOG | MGAHWINFOCAPS_CRTC2_ANALOG)
-#define MGAHWINFOCAPS_OUTPUT_DIGITAL (MGAHWINFOCAPS_CRTC1_DIGITAL | MGAHWINFOCAPS_CRTC2_DIGITAL)
-#define MGAHWINFOCAPS_OUTPUT_TV (MGAHWINFOCAPS_CRTC1_TV | MGAHWINFOCAPS_CRTC2_TV)
-
-#define MGAMODEINFO_SECOND_CRTC 1L
-#define MGAMODEINFO_ANALOG1 (1L << 1)
-#define MGAMODEINFO_ANALOG2 (1L << 2)
-#define MGAMODEINFO_DIGITAL1 (1L << 3)
-#define MGAMODEINFO_DIGITAL2 (1L << 4)
-#define MGAMODEINFO_FORCE_PITCH (1L << 5)
-#define MGAMODEINFO_FORCE_DISPLAYORG (1L << 6)
-#define MGAMODEINFO_TV (1L << 7)
-#define MGAMODEINFO_TESTONLY 0x80000000
-
-/* Cable Type */
-#define TV_YC_COMPOSITE 0
-#define TV_SCART_RGB 1
-#define TV_SCART_COMPOSITE 2
-#define TV_SCART_TYPE2 3
-
-/* TV Standard */
-
-#define TV_PAL 0
-#define TV_NTSC 1
-
-#if defined(__cplusplus)
- extern "C" {
-#endif
-
-ULONG MGACloseLibrary(LPBOARDHANDLE pBoard);
-ULONG MGAValidateMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo);
-ULONG MGAValidateVideoParameters(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo);
-ULONG MGASetMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo);
-ULONG MGASetTVMode(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo);
-ULONG MGASetVgaMode(LPBOARDHANDLE pBoard);
-ULONG MGASaveVgaState(LPBOARDHANDLE pBoard);
-ULONG MGARestoreVgaState(LPBOARDHANDLE pBoard);
-ULONG MGAInitHardware(LPBOARDHANDLE pBoard);
-ULONG MGAGetVideoParameters(LPBOARDHANDLE pBoard, LPMGAMODEINFO pMgaModeInfo, ULONG ulRefresh);
-ULONG MGAGetHardwareInfo(LPBOARDHANDLE pBoard, LPMGAHWINFO pMgaHwInfo);
-LPVOID MGAGetClientPointer(LPBOARDHANDLE pBoard);
-ULONG MGAOpenLibrary(LPBOARDHANDLE pBoard, LPVOID lpClient, ULONG ulClientSize);
-ULONG MGAGetBOARDHANDLESize(void);
-ULONG MGASetTVStandard(LPBOARDHANDLE pBoard, ULONG ulTVStandard);
-ULONG MGASetTVCableType(LPBOARDHANDLE pBoard, ULONG ulCableType);
-ULONG HALSetDisplayStart(LPBOARDHANDLE pBoard, ULONG x, ULONG y, ULONG crtc);
-
-#if defined(__cplusplus)
- }
-#endif
-
-#endif /* _BINDING */
-
-
diff --git a/src/client.h b/src/client.h
deleted file mode 100644
index 8348b64..0000000
--- a/src/client.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef _CLIENT
-#define _CLIENT
-
-#include "binding.h"
-
-#if defined(__cplusplus)
- extern "C" {
-#endif
-
-typedef void* LPBIOSREGS;
-#define ASSERT_HANDLER(pBoard)
-
-typedef struct TAGCLIENTDATA
-{
- ULONG ulFrameBufferBase;
- ULONG ulRegisterBase;
- pointer pMga;
-} CLIENTDATA, *LPCLIENTDATA;
-
-extern ULONG DECL ClientReadConfigSpaceByte(LPBOARDHANDLE, ULONG, LPUCHAR);
-extern ULONG DECL ClientReadConfigSpaceDword(LPBOARDHANDLE , ULONG, LPULONG );
-extern ULONG DECL ClientWriteConfigSpaceByte (LPBOARDHANDLE , ULONG, UCHAR);
-extern ULONG DECL ClientWriteConfigSpaceDword(LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientOpenRegisterBase(LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientCloseRegisterBase (LPBOARDHANDLE );
-extern ULONG DECL ClientReadRegisterByte(LPBOARDHANDLE , ULONG, LPUCHAR );
-extern ULONG DECL ClientReadRegisterDword(LPBOARDHANDLE , ULONG, LPULONG );
-extern ULONG DECL ClientWriteRegisterByte (LPBOARDHANDLE , ULONG, UCHAR);
-extern ULONG DECL ClientWriteRegisterDword(LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientOpenMemoryBase(LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientCloseMemoryBase(LPBOARDHANDLE );
-extern ULONG DECL ClientReadMemoryByte(LPBOARDHANDLE , ULONG, LPUCHAR );
-extern ULONG DECL ClientReadMemoryDword (LPBOARDHANDLE , ULONG, LPULONG );
-extern ULONG DECL ClientWriteMemoryByte(LPBOARDHANDLE , ULONG, UCHAR);
-extern ULONG DECL ClientWriteMemoryDword (LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientOpenSystemDevice (LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientCloseSystemDevice (LPBOARDHANDLE );
-extern ULONG DECL ClientReadSystemDeviceByte(LPBOARDHANDLE , ULONG, LPUCHAR );
-extern ULONG DECL ClientReadSystemDeviceDword(LPBOARDHANDLE , ULONG, LPULONG );
-extern ULONG DECL ClientWriteSystemDeviceByte(LPBOARDHANDLE , ULONG, UCHAR);
-extern ULONG DECL ClientWriteSystemDeviceDword (LPBOARDHANDLE , ULONG, ULONG);
-extern ULONG DECL ClientWait (LPBOARDHANDLE , ULONG);
-extern ULONG DECL ClientLocateFirstTwisterOfQuad(ULONG);
-extern ULONG DECL ClientSearchDevNode(ULONG, UCHAR, UCHAR);
-extern ULONG DECL ClientGetBiosInfo(LPBOARDHANDLE, LPUCHAR, LPULONG );
-extern ULONG DECL ClientDebug (LPBOARDHANDLE , ULONG, LPUCHAR, ULONG, LPVOID);
-extern ULONG DECL ClientCallBiosInt10(LPBOARDHANDLE, LPBIOSREGS);
-extern ULONG DECL ClientReadDDCEdid(LPBOARDHANDLE, LPUCHAR, ULONG);
-extern ULONG DECL ClientCustomCall(LPBOARDHANDLE, ULONG, LPVOID, LPVOID);
-extern ULONG DECL ClientApplyEpromPatch(LPBOARDHANDLE);
-extern ULONG DECL ClientDetectHostInterface(LPBOARDHANDLE, LPULONG);
-extern ULONG DECL ClientHSLPatchFunction(LPBOARDHANDLE, ULONG, ULONG, LPUCHAR);
-extern ULONG DECL InitClientFunctions(LPBOARDHANDLE, ULONG);
-extern ULONG DECL ClientInitTimeBase(LPBOARDHANDLE);
-extern ULONG DECL ClientOpenDMABase(LPBOARDHANDLE, ULONG, ULONG);
-extern ULONG DECL ClientReadDMAByte(LPBOARDHANDLE, ULONG, LPUCHAR);
-extern ULONG DECL ClientReadBIOS(LPBOARDHANDLE, ULONG, ULONG, ULONG, ULONG, LPUCHAR);
-extern ULONG DECL ClientWriteBIOS(LPBOARDHANDLE, ULONG, ULONG, ULONG, ULONG);
-
-#if defined(__cplusplus)
- }
-#endif
-
-#define ESC_CUSTOM_SET_FUNCTION_PTR 0x80000200
-#define ESC_CUSTOM_GET_FUNCTION_PTR 0x80000201
-#define ESC_CUSTOM_PATCH_HSL 0x80000202
-
-#endif
diff --git a/src/clientlx.c b/src/clientlx.c
deleted file mode 100644
index 306d3ed..0000000
--- a/src/clientlx.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/******************************************************************************\
-
- clientlx.c
-
- Copyright © 1997, Matrox Graphics Inc.
-
- All Rights Reserved.
-
-\******************************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "xf86_OSproc.h"
-#include "xf86Pci.h"
-#include "client.h"
-#include "mga.h"
-
-CLIENTTABLE ClientFunctions = {
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadConfigSpaceByte,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadConfigSpaceDword,
- (ULONG (DECL *)(LPVOID,ULONG,UCHAR)) ClientWriteConfigSpaceByte,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientWriteConfigSpaceDword,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientOpenRegisterBase,
- (ULONG (DECL *)(LPVOID)) ClientCloseRegisterBase,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadRegisterByte,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadRegisterDword,
- (ULONG (DECL *)(LPVOID,ULONG,UCHAR)) ClientWriteRegisterByte,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientWriteRegisterDword,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientOpenMemoryBase,
- (ULONG (DECL *)(LPVOID)) ClientCloseMemoryBase,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadMemoryByte,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadMemoryDword,
- (ULONG (DECL *)(LPVOID,ULONG,UCHAR)) ClientWriteMemoryByte,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientWriteMemoryDword,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientOpenSystemDevice,
- (ULONG (DECL *)(LPVOID)) ClientCloseSystemDevice,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadSystemDeviceByte,
- (ULONG (DECL *)(LPVOID,ULONG,LPVOID)) ClientReadSystemDeviceDword,
- (ULONG (DECL *)(LPVOID,ULONG,UCHAR)) ClientWriteSystemDeviceByte,
- (ULONG (DECL *)(LPVOID,ULONG,ULONG)) ClientWriteSystemDeviceDword,
- (ULONG (DECL *)(LPVOID,ULONG)) ClientWait,
- (ULONG (DECL *)(LPVOID,LPVOID,LPVOID)) ClientGetBiosInfo,
- (ULONG (DECL *)(LPVOID,LPVOID,ULONG)) ClientReadDDCEdid
-};
-
-/******************************************************************************\
-
- Function : ClientReadConfigSpaceByte
-
- Description : Read a Byte from the configuration space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specifib board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR *pucByte | pointer to a byte that will receive
- the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadConfigSpaceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR *pucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr)pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- *pucByte = pciReadByte(pMga->PciTag,ulOffset);
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadConfigSpaceDword
-
- Description : Read a Dword from the configuration space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG *pulDword | Dword to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadConfigSpaceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG *pulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr)pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- *pulDword = pciReadLong(pMga->PciTag,ulOffset);
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteConfigSpaceByte
-
- Description : Write a Byte from the configuration space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR ucByte | Byte to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteConfigSpaceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR ucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr)pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- pciWriteByte(pMga->PciTag,ulOffset, ucByte);
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteConfigSpaceDword
-
- Description : Write a Dword from the configuration space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG ulDword | Dword containing the data to be written
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteConfigSpaceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG ulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr)pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- pciWriteLong(pMga->PciTag,ulOffset, ulDword);
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientOpenRegisterBase
-
- Description : Map the register base for future call to ClientReadRegisterX
- and ClientWriteRegisterX.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulAddress | Physical address of the Register aperture
- ULONG ulSize | Size in Byte of the Register Aperture
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientOpenRegisterBase(LPBOARDHANDLE pBoard, ULONG ulAddress, ULONG ulSize)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr)pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- pClientStruct->ulRegisterBase = (ULONG) pMga->IOBase;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientCloseRegisterBase
-
- Description : Unmap the register base address and free resources needed
- to address it.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientCloseRegisterBase(LPBOARDHANDLE pBoard)
-{
- ASSERT_HANDLER(pBoard);
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadRegisterByte
-
- Description : Read a byte from the Register space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure.
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR *pucByte | pointer to the byte that will receive
- the data.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadRegisterByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR *pucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *pucByte = *((UCHAR *)(pClientStruct->ulRegisterBase + ulOffset));
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadRegisterDword
-
- Description : Read a Dword from the Register space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG *pulDword | pointer to the dword that will receive
- the data.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadRegisterDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG *pulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *pulDword = *((ULONG *)(pClientStruct->ulRegisterBase + ulOffset));
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteRegisterByte
-
- Description : Write a Byte from the Register space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR ucByte | CHAR to receive the data.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteRegisterByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR ucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *((UCHAR *)(pClientStruct->ulRegisterBase + ulOffset)) = ucByte;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteRegisterSpaceDword
-
- Description : Write a Dword from the Register space.
-
- I/O Desc. : LPBOARDHANDLE *| pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG ulDword | Dword to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteRegisterDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG ulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *((ULONG *)(pClientStruct->ulRegisterBase + ulOffset)) = ulDword;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientOpenMemoryBase
-
- Description : Map the Memory base for future call to ClientReadMemoryX
- and ClientWriteMemoryX.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulAddress | Physical address of the Register aperture
- ULONG ulSize | Size in Byte of the Register Aperture
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientOpenMemoryBase(LPBOARDHANDLE pBoard, ULONG ulAddress, ULONG ulSize)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
- MGAPtr pMga = (MGAPtr) pClientStruct->pMga;
-
- ASSERT_HANDLER(pBoard);
-
- pClientStruct->ulFrameBufferBase = (ULONG) pMga->FbBase;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientCloseMemoryBase
-
- Description : Unmap the Frame Buffer aperture and free resources
- needed to address it.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientCloseMemoryBase(LPBOARDHANDLE pBoard)
-{
- ASSERT_HANDLER(pBoard);
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadMemoryByte
-
- Description : Read a Byte from the Frame Buffer space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR *ucByte | CHAR to receive the data
-
- Return Val : ULONG
-\******************************************************************************/
-ULONG ClientReadMemoryByte(LPBOARDHANDLE pBoard, ULONG ulOffset, UCHAR *pucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *pucByte = *((UCHAR *)(pClientStruct->ulFrameBufferBase + ulOffset));
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadMemoryDword
-
- Description : Read a Dword from the Frame Buffer Space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG *uDword | Dword to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadMemoryDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG *pulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *pulDword = *((ULONG *)(pClientStruct->ulFrameBufferBase + ulOffset));
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteMemoryByte
-
- Description : Write a Byte from the Frame Buffer space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR ucByte | CHAR to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteMemoryByte(LPBOARDHANDLE pBoard, ULONG ulOffset, UCHAR ucByte)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *((UCHAR *)(pClientStruct->ulFrameBufferBase + ulOffset)) = ucByte;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteMemoryDword
-
- Description : Write a Dword from the Frame Buffer space.
-
- I/O desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG ulDword | Dword to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteMemoryDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG ulDword)
-{
- LPCLIENTDATA pClientStruct = MGAGetClientPointer(pBoard);
-
- ASSERT_HANDLER(pBoard);
-
- *((ULONG *)(pClientStruct->ulFrameBufferBase + ulOffset)) = ulDword;
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientOpenSystemDevice
-
- Description : Map a System device aperture for future call to
- ClientReadSystemDeviceX and ClientWriteSystemDeviceX.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulAddress | Physical address of the Register aperture
- ULONG ulSize | Size in Byte of the Register Aperture
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientOpenSystemDevice(LPBOARDHANDLE pBoard, ULONG ulAddress,
- ULONG ulSize)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientCloseSystemDevice
-
- Description : Unmap the System Device aperture address and free
- resources needed to address it.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientCloseSystemDevice (LPBOARDHANDLE pBoard)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadSystemDeviceByte
-
- Description : Read a Byte from the device Space.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG pucByte | Byte to read the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadSystemDeviceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR *pucByte)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadSystemDeviceDword
-
- Description : Read a Dword from the Frame Buffer Space
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG ulDword | Dword to Read the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadSystemDeviceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG *pulDword)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteSystemByte
-
- Description : Write a Byte from the System Device Aperture
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- UCHAR ucByte | Byte to receive the data
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteSystemDeviceByte(LPBOARDHANDLE pBoard, ULONG ulOffset,
- UCHAR ucByte)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWriteSystemDword
-
- Description : Write a Dword from the System Device Aperture.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulOffset | Offset of the Byte to be read.
- ULONG uDword | Dword to receive the data
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWriteSystemDeviceDword(LPBOARDHANDLE pBoard, ULONG ulOffset,
- ULONG ulDword)
-{
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientWait
-
- Description : Wait for ulDelayus micro-seconds.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- ULONG ulDelayus | Delay in uSec
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientWait (LPBOARDHANDLE pBoard, ULONG ulDelayus)
-{
- int i;
- ULONG ulTmp;
-
- ASSERT_HANDLER(pBoard);
-
- for(i = 0; i < ulDelayus * 3; i++)
- {
- ClientReadRegisterDword(pBoard,0x1e14,&ulTmp);
- }
-
- return 0;
-}
-
-
-/******************************************************************************\
-
- Function : ClientGetBiosInfo
-
- Description : This function will be call if no PINS can be found
- in physical EEPROM.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPUCHAR | Buffer where we copy bios pins.
- ULONG | Bios version
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientGetBiosInfo(LPBOARDHANDLE pBoard, LPUCHAR pucPins,LPULONG pulBIOSVersion)
-{
- Bool bNotFound = TRUE;
- UCHAR ucBIOS[32768];
- UCHAR ucTmpByte;
- UCHAR ucCheckSum;
- UCHAR ucPinsIndex;
- UCHAR ucPinsSize;
- ULONG ulTmpDword;
- ULONG ulPinsOffset = 0;
- ULONG ulPCIINFOffset;
-
- ASSERT_HANDLER(pBoard);
-
- xf86ReadBIOS(0xc0000,0,ucBIOS,32768);
-
- if(ucBIOS[0] == 0x55)
- {
- if(ucBIOS[1] == 0xaa)
- {
- while((ulPinsOffset < 0x10000) && bNotFound)
- {
- ulTmpDword = *(ULONG *)(ucBIOS + ulPinsOffset);
- ucPinsSize = (UCHAR) (ulTmpDword >> 16);
- if(((ulTmpDword & 0x0000ffff) == 0x0000412e)
- && ucPinsSize <= 128)
- {
- ucCheckSum = 0;
- for(ucPinsIndex = 0;ucPinsIndex < ucPinsSize; ucPinsIndex++)
- {
- pucPins[ucPinsIndex] = ucBIOS[ulPinsOffset +
- ucPinsIndex];
- ucCheckSum += pucPins[ucPinsIndex];
- }
- if(ucCheckSum == 0)
- {
- bNotFound = FALSE;
- }
- }
- ulPinsOffset++;
- }
-
- if(bNotFound)
- {
- return 1;
- }
-
- ulPCIINFOffset = *(ULONG *)(ucBIOS + 0x18);
- ulPCIINFOffset &= 0x0000ffff;
- ulTmpDword = *(ULONG *)(ucBIOS + ulPCIINFOffset);
-
- if(ulTmpDword == 0x52494350) /* "PCIR" */
- {
- ulPCIINFOffset += 0x12;
- ulTmpDword = *(ULONG *)(ucBIOS + ulPCIINFOffset);
- *pulBIOSVersion = ((ULONG) ((ulTmpDword & 0xf0) >> 4) << 16) |
- ((ulTmpDword &0xf) << 12) | ((ulTmpDword >> 8)
- & 0xff);
- }
- else
- {
- return 1;
- }
- }
- else
- {
- return 1;
- }
- }
- else
- {
- return 1;
- }
-
- if(!*pulBIOSVersion)
- {
- ucTmpByte = ucBIOS[5];
- *pulBIOSVersion = ((ULONG) (ucTmpByte >> 4) << 16) | ((ULONG)
- (ucTmpByte & 0x0f) << 12);
- }
-
- return 0;
-}
-
-/******************************************************************************\
-
- Function : ClientCallBiosInt10
-
- Description : Call the BIOS Int10h with specified parameters.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPBIOSREGS pBiosRegs | Pointor to the Bios register
- structure.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientCallBiosInt10(LPBOARDHANDLE pBoard, LPBIOSREGS pBiosRegs)
-{
- ASSERT_HANDLER(pBoard);
-
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientReadDDCEdid
-
- Description : Not implemented.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPBIOSREGS pBiosRegs | Pointor to the Bios register
- structure.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientReadDDCEdid(LPBOARDHANDLE pBoard, LPUCHAR pEdid,
- ULONG ulMonitorIndex)
-{
- ASSERT_HANDLER(pBoard);
-
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientCustomCall
-
- Description : Not implemented.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPBIOSREGS pBiosRegs | Pointor to the Bios register
- structure.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientCustomCall(LPBOARDHANDLE pBoard, ULONG ulServiceNumber,
- LPVOID pInData, LPVOID pOutData)
-{
- ASSERT_HANDLER(pBoard);
-
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientApplyEpromPatch
-
- Description : Not implemented.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPBIOSREGS pBiosRegs | Pointor to the Bios register
- structure.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientApplyEpromPatch(LPBOARDHANDLE pBoard)
-{
- ASSERT_HANDLER(pBoard);
-
- return 1;
-}
-
-
-/******************************************************************************\
-
- Function : ClientDetectHostInterface
-
- Description : Not implemented.
-
- I/O Desc. : LPBOARDHANDLE pBoard | Handle to the board structure
- containing all the information about a specific board.
- LPBIOSREGS pBiosRegs | Pointor to the Bios register
- structure.
-
- Return Val : ULONG
-
-\******************************************************************************/
-ULONG ClientDetectHostInterface(LPBOARDHANDLE pBoard, LPULONG pulData)
-{
- ASSERT_HANDLER(pBoard);
-
- return 1;
-}
-
diff --git a/src/mga.h b/src/mga.h
index 61e8729..d0bb8c5 100644
--- a/src/mga.h
+++ b/src/mga.h
@@ -40,10 +40,6 @@
#include "mga_dri.h"
#endif
-#ifdef USEMGAHAL
-#include "client.h"
-#endif
-
typedef enum {
OPTION_SW_CURSOR,
OPTION_HW_CURSOR,
@@ -72,7 +68,6 @@ typedef enum {
OPTION_TVSTANDARD,
OPTION_CABLETYPE,
OPTION_USEIRQZERO,
- OPTION_NOHAL,
OPTION_SWAPPED_HEAD,
OPTION_DRI,
OPTION_MERGEDFB,
@@ -276,11 +271,6 @@ typedef enum {
typedef struct {
int lastInstance;
-#ifdef USEMGAHAL
- LPCLIENTDATA pClientStruct;
- LPBOARDHANDLE pBoard;
- LPMGAHWINFO pMgaHwInfo;
-#endif
int refCount;
CARD32 masterFbAddress;
long masterFbMapSize;
@@ -374,12 +364,6 @@ struct mga_bios_values {
typedef struct {
-#ifdef USEMGAHAL
- LPCLIENTDATA pClientStruct;
- LPBOARDHANDLE pBoard;
- LPMGAMODEINFO pMgaModeInfo;
- LPMGAHWINFO pMgaHwInfo;
-#endif
EntityInfoPtr pEnt;
struct mga_bios_values bios;
CARD8 BiosOutputMode;
@@ -391,7 +375,6 @@ typedef struct {
int is_Gx50:1;
int is_G200SE:1;
- int is_HAL_chipset:1;
Bool Primary;
Bool Interleave;
@@ -537,9 +520,6 @@ typedef struct {
MGAPaletteInfo palinfo[256]; /* G400 hardware bug workaround */
FBLinearPtr LinearScratch;
Bool softbooted;
-#ifdef USEMGAHAL
- Bool HALLoaded;
-#endif
OptionInfoPtr Options;
/* Exa */
@@ -567,7 +547,6 @@ typedef struct {
ScrnInfoPtr pScrn2; /*pointer to second CRTC screeninforec,
if in merged mode */
/* End of Merged Framebuffer Data */
- int HALGranularityOffX, HALGranularityOffY;
} MGARec, *MGAPtr;
extern CARD32 MGAAtype[16];
@@ -694,26 +673,6 @@ void MGAprintDac(ScrnInfoPtr pScrn);
void MGAG200SESaveFonts(ScrnInfoPtr, vgaRegPtr);
void MGAG200SERestoreFonts(ScrnInfoPtr, vgaRegPtr);
-#ifdef USEMGAHAL
-/************ ESC Call Definition ***************/
-typedef struct {
- char *function;
- void (*funcptr)(ScrnInfoPtr pScrn, unsigned long *param, char *out, DisplayModePtr pMode);
-} MGAEscFuncRec, *MGAEscFuncPtr;
-
-typedef struct {
- char function[32];
- unsigned long parameters[32];
-} EscCmdStruct;
-
-extern LPMGAMODEINFO pMgaModeInfo[2];
-extern MGAMODEINFO TmpMgaModeInfo[2];
-
-extern void MGAExecuteEscCmd(ScrnInfoPtr pScrn, char *cmdline , char *sResult, DisplayModePtr pMode);
-void MGAFillDisplayModeStruct(DisplayModePtr pMode, LPMGAMODEINFO pModeInfo);
-/************************************************/
-#endif
-
static __inline__ void
MGA_MARK_SYNC(MGAPtr pMga, ScrnInfoPtr pScrn)
{
diff --git a/src/mga_dac3026.c b/src/mga_dac3026.c
index 1eddefd..80698dc 100644
--- a/src/mga_dac3026.c
+++ b/src/mga_dac3026.c
@@ -711,7 +711,7 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
but that's no big deal since we will Restore right after
this function */
- MGA_NOT_HAL(MGATi3026SetMCLK(pScrn, MGAdac->MemoryClock));
+ MGATi3026SetMCLK(pScrn, MGAdac->MemoryClock);
#ifdef DEBUG
ErrorF("%6ld: %02X %02X %02X %02X %02X %02X %08lX\n", mode->Clock,
@@ -749,7 +749,6 @@ MGA3026Restore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, OPTION_MASK,
mgaReg->Option);
- MGA_NOT_HAL(
/* select pixel clock PLL as clock source */
outTi3026(TVP3026_CLK_SEL, 0, mgaReg->DacRegs[3]);
@@ -757,8 +756,7 @@ MGA3026Restore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
outTi3026(TVP3026_PLL_ADDR, 0, 0x2A);
outTi3026(TVP3026_LOAD_CLK_DATA, 0, 0);
outTi3026(TVP3026_PIX_CLK_DATA, 0, 0);
- ); /* MGA_NOT_HAL */
-
+
/*
* This function handles restoring the generic VGA registers.
*/
@@ -771,7 +769,6 @@ MGA3026Restore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
* goes here.
*/
- MGA_NOT_HAL(
/* program pixel clock PLL */
outTi3026(TVP3026_PLL_ADDR, 0, 0x00);
for (i = 0; i < 3; i++)
@@ -785,20 +782,17 @@ MGA3026Restore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
/* set Q divider for loop clock PLL */
outTi3026(TVP3026_MCLK_CTL, 0, mgaReg->DacRegs[18]);
- ); /* MGA_NOT_HAL */
-
+
/* program loop PLL */
outTi3026(TVP3026_PLL_ADDR, 0, 0x00);
for (i = 3; i < 6; i++)
outTi3026(TVP3026_LOAD_CLK_DATA, 0, mgaReg->DacClk[i]);
- MGA_NOT_HAL(
if ((vgaReg->MiscOutReg & 0x08) && ((mgaReg->DacClk[3] & 0xC0) == 0xC0) ) {
/* poll until loop PLL LOCK bit is set */
outTi3026(TVP3026_PLL_ADDR, 0, 0x3F);
while ( ! (inTi3026(TVP3026_LOAD_CLK_DATA) & 0x40) );
}
- ); /* MGA_NOT_HAL */
/*
* restore other DAC registers
@@ -851,7 +845,6 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
mgaReg->ExtVga[i] = INREG8(0x1FDF);
}
- MGA_NOT_HAL(
outTi3026(TVP3026_PLL_ADDR, 0, 0x00);
for (i = 0; i < 3; i++)
outTi3026(TVP3026_PIX_CLK_DATA, 0, mgaReg->DacClk[i] =
@@ -861,8 +854,7 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
for (i = 3; i < 6; i++)
outTi3026(TVP3026_LOAD_CLK_DATA, 0, mgaReg->DacClk[i] =
inTi3026(TVP3026_LOAD_CLK_DATA));
- ); /* MGA_NOT_HAL */
-
+
for (i = 0; i < DACREGSIZE; i++)
mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]);
diff --git a/src/mga_dacG.c b/src/mga_dacG.c
index 168959b..5a24834 100644
--- a/src/mga_dacG.c
+++ b/src/mga_dacG.c
@@ -311,7 +311,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
BppShift = pMga->BppShifts[(pLayout->bitsPerPixel >> 3) - 1];
- MGA_NOT_HAL(
/* Allocate the DacRegs space if not done already */
if (pReg->DacRegs == NULL) {
pReg->DacRegs = xnfcalloc(DACREGSIZE, 1);
@@ -319,8 +318,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
for (i = 0; i < DACREGSIZE; i++) {
pReg->DacRegs[i] = initDAC[i];
}
- ); /* MGA_NOT_HAL */
-
+
switch(pMga->Chipset)
{
case PCI_CHIP_MGA1064:
@@ -365,9 +363,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
case PCI_CHIP_MGAG400:
case PCI_CHIP_MGAG550:
-#ifdef USEMGAHAL
- MGA_HAL(break;);
-#endif
if (MGAISGx50(pMga))
break;
@@ -410,9 +405,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
-#ifdef USEMGAHAL
- MGA_HAL(break;);
-#endif
pReg->DacRegs[ MGA1064_VREF_CTL ] = 0x03;
pReg->DacRegs[MGA1064_PIX_CLK_CTL] =
MGA1064_PIX_CLK_CTL_SEL_PLL;
@@ -431,9 +423,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
case PCI_CHIP_MGAG200:
case PCI_CHIP_MGAG200_PCI:
default:
-#ifdef USEMGAHAL
- MGA_HAL(break;);
-#endif
if(pMga->OverclockMem) {
/* 143 Mhz */
pReg->DacRegs[ MGA1064_SYS_PLL_M ] = 0x06;
@@ -453,7 +442,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
break;
}
- MGA_NOT_HAL(
/* must always have the pci retries on but rely on
polling to keep them from occuring */
pReg->Option &= ~0x20000000;
@@ -484,8 +472,7 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
default:
FatalError("MGA: unsupported depth\n");
}
- ); /* MGA_NOT_HAL */
-
+
/*
* This will initialize all of the generic VGA registers.
*/
@@ -568,14 +555,12 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pVga->CRTC[22] = (vt + 1) & 0xFF;
pVga->CRTC[24] = vd & 0xFF; /* linecomp */
- MGA_NOT_HAL(pReg->DacRegs[MGA1064_CURSOR_BASE_ADR_LOW] = pMga->FbCursorOffset >> 10);
- MGA_NOT_HAL(pReg->DacRegs[MGA1064_CURSOR_BASE_ADR_HI] = pMga->FbCursorOffset >> 18);
+ pReg->DacRegs[MGA1064_CURSOR_BASE_ADR_LOW] = pMga->FbCursorOffset >> 10;
+ pReg->DacRegs[MGA1064_CURSOR_BASE_ADR_HI] = pMga->FbCursorOffset >> 18;
if (pMga->SyncOnGreen) {
- MGA_NOT_HAL(
- pReg->DacRegs[MGA1064_GEN_CTL] &=
- ~MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS;
- );
+ pReg->DacRegs[MGA1064_GEN_CTL] &=
+ ~MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS;
pReg->ExtVga[3] |= 0x40;
}
@@ -583,7 +568,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* select external clock */
pVga->MiscOutReg |= 0x0C;
- MGA_NOT_HAL(
if (mode->Flags & V_DBLSCAN)
pVga->CRTC[9] |= 0x80;
@@ -592,7 +576,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
MGAGSetPCLK(pScrn, mode->Clock);
- ); /* MGA_NOT_HAL */
/* This disables the VGA memory aperture */
pVga->MiscOutReg &= ~0x02;
@@ -750,7 +733,6 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK;
#endif
-MGA_NOT_HAL(
/*
* Code is needed to get things back to bank zero.
*/
@@ -788,22 +770,7 @@ MGA_NOT_HAL(
pciSetBitsLong(pMga->PciTag, PCI_MGA_OPTION3, OPTION3_MASK,
mgaReg->Option3);
}
-); /* MGA_NOT_HAL */
-#ifdef USEMGAHAL
- /*
- * Work around another bug in HALlib: it doesn't restore the
- * DAC width register correctly. MATROX: hint, hint.
- */
- MGA_HAL(
- outMGAdac(MGA1064_MUL_CTL,mgaReg->DacRegs[0]);
- outMGAdac(MGA1064_MISC_CTL,mgaReg->DacRegs[1]);
- if (!MGAISGx50(pMga)) {
- outMGAdac(MGA1064_PIX_PLLC_M,mgaReg->DacRegs[2]);
- outMGAdac(MGA1064_PIX_PLLC_N,mgaReg->DacRegs[3]);
- outMGAdac(MGA1064_PIX_PLLC_P,mgaReg->DacRegs[4]);
- }
- );
-#endif
+
/* restore CRTCEXT regs */
for (i = 0; i < 6; i++)
OUTREG16(MGAREG_CRTCEXT_INDEX, (mgaReg->ExtVga[i] << 8) | i);
@@ -827,7 +794,6 @@ MGA_NOT_HAL(
/* Second Crtc */
xMODEINFO ModeInfo;
-MGA_NOT_HAL(
/* Enable Dual Head */
MGACRTC2Set(pScrn, &ModeInfo);
MGAEnableSecondOutPut(pScrn, &ModeInfo);
@@ -841,8 +807,6 @@ MGA_NOT_HAL(
}
outMGAdac(i, mgaReg->dac2[ i - 0x80]);
}
-); /* MGA_NOT_HAL */
-
}
#ifdef DEBUG
@@ -893,12 +857,10 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
return;
}
- MGA_NOT_HAL(
/* Allocate the DacRegs space if not done already */
if (mgaReg->DacRegs == NULL) {
mgaReg->DacRegs = xnfcalloc(DACREGSIZE, 1);
}
- ); /* MGA_NOT_HAL */
/*
* Code is needed to get back to bank zero.
@@ -923,25 +885,6 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
* DAC width register correctly.
*/
-#ifdef USEMGAHAL
- /*
- * Work around another bug in HALlib: it doesn't restore the
- * DAC width register correctly (s.o.). MATROX: hint, hint.
- */
- MGA_HAL(
- if (mgaReg->DacRegs == NULL) {
- mgaReg->DacRegs = xnfcalloc(MGAISGx50(pMga) ? 2 : 5, 1);
- }
- mgaReg->DacRegs[0] = inMGAdac(MGA1064_MUL_CTL);
- mgaReg->DacRegs[1] = inMGAdac(MGA1064_MISC_CTL);
- if (!MGAISGx50(pMga)) {
- mgaReg->DacRegs[2] = inMGAdac(MGA1064_PIX_PLLC_M);
- mgaReg->DacRegs[3] = inMGAdac(MGA1064_PIX_PLLC_N);
- mgaReg->DacRegs[4] = inMGAdac(MGA1064_PIX_PLLC_P);
- }
- );
-#endif
- MGA_NOT_HAL(
/*
* The port I/O code necessary to read in the extended registers.
*/
@@ -955,7 +898,6 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg,
mgaReg->Option2 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION2);
if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
mgaReg->Option3 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION3);
- ); /* MGA_NOT_HAL */
for (i = 0; i < 6; i++)
{
@@ -1029,12 +971,6 @@ MGAGSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
x += 64;
y += 64;
-#ifdef USEMGAHAL
- MGA_HAL(
- x += pMga->HALGranularityOffX;
- y += pMga->HALGranularityOffY;
- );
-#endif
/* cursor update must never occurs during a retrace period (pp 4-160) */
while( INREG( MGAREG_Status ) & 0x08 );
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 258e146..6e88df5 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -225,7 +225,6 @@ static const OptionInfoRec MGAOptions[] = {
{ OPTION_TV, "TV", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_TVSTANDARD, "TVStandard", OPTV_ANYSTR, {0}, FALSE },
{ OPTION_CABLETYPE, "CableType", OPTV_ANYSTR, {0}, FALSE },
- { OPTION_NOHAL, "NoHal", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SWAPPED_HEAD, "SwappedHead", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_MERGEDFB, "MergedFB", OPTV_BOOLEAN, {0}, FALSE },
@@ -413,22 +412,6 @@ static const char *fbdevHWSymbols[] = {
NULL
};
-#ifdef USEMGAHAL
-static const char *halSymbols[] = {
- "MGACloseLibrary",
- "MGAGetBOARDHANDLESize",
- "MGAGetHardwareInfo",
- "MGAOpenLibrary",
- "MGARestoreVgaState",
- "MGASaveVgaState",
- "MGASetMode",
- "MGASetVgaMode",
- "MGAValidateMode",
- "MGAValidateVideoParameters",
- "HALSetDisplayStart",
- NULL
-};
-#endif
#ifdef XFree86LOADER
static MODULESETUPPROTO(mgaSetup);
@@ -483,9 +466,6 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin)
#ifdef XF86DRI
drmSymbols, driSymbols,
#endif
-#ifdef USEMGAHAL
- halSymbols,
-#endif
NULL);
/*
@@ -1142,10 +1122,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
int flags24;
MGAEntPtr pMgaEnt = NULL;
Bool Default;
-#ifdef USEMGAHAL
- ULONG status;
- CARD8 MiscCtlReg;
-#endif
/*
* Note: This function is only called once at server startup, and
@@ -1286,51 +1262,14 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
|| (pMga->Chipset == PCI_CHIP_MGAG550);
pMga->is_G200SE = (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI)
|| (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI);
- pMga->is_HAL_chipset = ((pMga->Chipset == PCI_CHIP_MGAG200_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG200) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI) ||
- (pMga->Chipset == PCI_CHIP_MGAG400) ||
- (pMga->Chipset == PCI_CHIP_MGAG550));
-
-#ifdef USEMGAHAL
- if (HAL_CHIPSETS) {
- Bool loadHal = TRUE;
-
- from = X_DEFAULT;
- if (xf86FindOption(pMga->device->options, "NoHal")) {
- loadHal = !xf86SetBoolOption(pMga->device->options,
- "NoHal", !loadHal);
- from = X_CONFIG;
- } else if (xf86FindOption(pMga->device->options, "Hal")) {
- loadHal = xf86SetBoolOption(pMga->device->options,
- "Hal", loadHal);
- from = X_CONFIG;
- }
- if (loadHal && xf86LoadSubModule(pScrn, "mga_hal")) {
- xf86LoaderReqSymLists(halSymbols, NULL);
- xf86DrvMsg(pScrn->scrnIndex, from,"Matrox HAL module used\n");
- pMga->HALLoaded = TRUE;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, from, "Matrox HAL module not loaded "
- "- using builtin mode setup instead\n");
- pMga->HALLoaded = FALSE;
- }
- }
-#endif
pMga->DualHeadEnabled = FALSE;
if (xf86IsEntityShared(pScrn->entityList[0])) {/* dual-head mode requested*/
- if (
-#ifdef USEMGAHAL
- pMga->HALLoaded ||
-#endif
- !MGA_DH_NEEDS_HAL(pMga)) {
+ if (!MGA_DH_NEEDS_HAL(pMga)) {
pMga->DualHeadEnabled = TRUE;
} else if (xf86IsPrimInitDone(pScrn->entityList[0])) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "This card requires the \"mga_hal\" module for dual-head operation\n"
- "\tIt can be found at the Matrox web site <http://www.matrox.com>\n");
+ "Dual-head not supported for this card.\n");
}
}
@@ -1613,39 +1552,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->TexturedVideo = TRUE;
}
if (xf86ReturnOptValBool(pMga->Options, OPTION_MERGEDFB, FALSE)) {
- if(!MGAISGx50(pMga)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "\"Merged Framebuffer\" mode only supported on G450 and G550 boards.\n");
- } else {
-#ifdef USEMGAHAL
- if(pMga->HALLoaded)
- {
- pMga->MergedFB = TRUE;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
- "Using \"Merged Framebuffer\" mode.\n");
- /*
- * a few options that won't work well together
- */
- if(pMga->HWCursor) /*Should we give the choice? */
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- " -- Hardware Cursor disabled.\n");
- pMga->HWCursor = FALSE;
- if(pMga->ShadowFB)
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- " -- Shadow Framebuffer disabled.\n");
- pMga->ShadowFB = FALSE;
- if(pMga->FBDev)
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- " -- Framebuffer device disabled.\n");
- pMga->FBDev = FALSE;
- } /* MGA_HAL */
- else
-#endif
- {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "HALLib not loaded! NOT using \"Merged Framebuffer\" mode.\n");
- } /* MGA_NOT_HAL */
- } /* ISMGAGx50() */
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "\"Merged Framebuffer\" mode not supported.\n");
}
if (pMga->FBDev) {
/* check for linux framebuffer device */
@@ -2033,10 +1941,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->clockIndex = -1; /* programmable */
clockRanges->interlaceAllowed = TRUE;
clockRanges->doubleScanAllowed = TRUE;
-#ifdef USEMGAHAL
- MGA_HAL(clockRanges->interlaceAllowed = FALSE);
- MGA_HAL(clockRanges->doubleScanAllowed = FALSE);
-#endif
+
if (pMga->SecondCrtc == TRUE)
clockRanges->interlaceAllowed = FALSE;
@@ -2135,80 +2040,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
MGAFreeRec(pScrn);
return FALSE;
}
-#ifdef USEMGAHAL
- MGA_HAL(
-
- if(pMga->SecondCrtc == FALSE) {
-
- pMga->pBoard = xalloc(sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize());
- pMga->pClientStruct = xalloc(sizeof(CLIENTDATA));
- pMga->pClientStruct->pMga = (MGAPtr) pMga;
-
- MGAMapMem(pScrn);
- /*
- * For some reason the MGAOPM_DMA_BLIT bit needs to be set
- * on G200 before opening the HALlib. I don't know why.
- * MATROX: hint, hint.
- */
- /*if (pMga->Chipset == PCI_CHIP_MGAG200 ||
- pMga->Chipset == PCI_CHIP_MGAG200_PCI) */{
- CARD32 opmode;
- opmode = INREG(MGAREG_OPMODE);
- OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | opmode);
- }
- /* wrapping OpenLibrary to fix broken registers. MATROX: hint, hint. */
- MiscCtlReg = inMGAdac(MGA1064_MISC_CTL);
- MGAOpenLibrary(pMga->pBoard,pMga->pClientStruct,sizeof(CLIENTDATA));
- outMGAdac(MGA1064_MISC_CTL,MiscCtlReg);
- MGAUnmapMem(pScrn);
- pMga->pMgaHwInfo = xalloc(sizeof(MGAHWINFO));
- MGAGetHardwareInfo(pMga->pBoard,pMga->pMgaHwInfo);
-
- /* copy the board handles */
- if (pMga->DualHeadEnabled) {
- pMgaEnt->pClientStruct = pMga->pClientStruct;
- pMgaEnt->pBoard = pMga->pBoard;
- pMgaEnt->pMgaHwInfo = pMga->pMgaHwInfo;
- }
-
- } else { /* Second CRTC && entity is shared */
- pMga->pBoard = pMgaEnt->pBoard;
- pMga->pClientStruct = pMgaEnt->pClientStruct;
- pMga->pMgaHwInfo = pMgaEnt->pMgaHwInfo;
-
- }
-
- MGAFillModeInfoStruct(pScrn,NULL);
- /* Fields usually handled by MGAFillModeInfoStruct, but are unavailable
- * because no mode is given
- */
- pMga->pMgaModeInfo->ulDispWidth = pScrn->virtualX;
- pMga->pMgaModeInfo->ulDispHeight = pScrn->virtualY;
-
-
- if (ISDIGITAL1(pMga))
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Digital screen detected on first head.\n");
- if (ISTV1(pMga))
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "TV detected on first head.\n");
- if (ISDIGITAL2(pMga))
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Digital screen detected on second head.\n");
- if (ISTV2(pMga))
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "TV detected on second head.\n");
-
-
- if((status = MGAValidateMode(pMga->pBoard,pMga->pMgaModeInfo)) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGAValidateMode from HALlib found the mode to be invalid.\n"
- "\tError: 0x%lx\n", status);
- return FALSE;
- }
- pScrn->displayWidth = pMga->pMgaModeInfo->ulFBPitch;
- ); /* MGA_HAL */
-#endif
if (pMga->HasSDRAM) { /* don't bother checking */ }
else if ((pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SD) ||
@@ -2217,16 +2048,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
(pMga->PciInfo->subsysCard == PCI_CARD_PROD_G100_SD)) {
pMga->HasSDRAM = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n");
- }
- /*
- * Can we trust HALlib to set the memory configuration
- * registers correctly?
- */
- else if ((pMga->softbooted || pMga->Primary
-#ifdef USEMGAHAL
- /*|| pMga->HALLoaded*/
-#endif
- ) &&
+ } else if ((pMga->softbooted || pMga->Primary) &&
(pMga->Chipset != PCI_CHIP_MGA2064) &&
(pMga->Chipset != PCI_CHIP_MGA2164) &&
(pMga->Chipset != PCI_CHIP_MGA2164_AGP)) {
@@ -2245,10 +2067,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
* driver and if the driver doesn't provide code to set them. They
* are not pre-initialised at all.
*/
-#ifdef USEMGAHAL
- MGA_HAL(xf86SetCrtcForModes(pScrn, 0));
-#endif
- MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V));
+ xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;
@@ -2433,47 +2252,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
MGAPreInitMergedFB(pScrn,flags);
};
-
-#ifdef USEMGAHAL
- MGA_HAL(
- /* Close the library after preinit */
- /* This needs to only happen after this board has completed preinit
- * both times
- */
-
- if(pMga->DualHeadEnabled) {
- /* Entity is shared make sure refcount == 2 */
- /* If ref count is 2 then reset it to 0 */
- if(pMgaEnt->refCount == 2) {
- /* Both boards have done there initialization */
- MGACloseLibrary(pMga->pBoard);
-
- if (pMga->pBoard)
- xfree(pMga->pBoard);
- if (pMga->pClientStruct)
- xfree(pMga->pClientStruct);
- if (pMga->pMgaModeInfo)
- xfree(pMga->pMgaModeInfo);
- if (pMga->pMgaHwInfo)
- xfree(pMga->pMgaHwInfo);
- pMgaEnt->refCount = 0;
- }
- } else {
- MGACloseLibrary(pMga->pBoard);
-
- if (pMga->pBoard)
- xfree(pMga->pBoard);
- if (pMga->pClientStruct)
- xfree(pMga->pClientStruct);
- if (pMga->pMgaModeInfo)
- xfree(pMga->pMgaModeInfo);
- if (pMga->pMgaHwInfo)
- xfree(pMga->pMgaHwInfo);
- }
-
- ); /* MGA_HAL */
-#endif
-
xf86SetPrimInitDone(pScrn->entityList[0]);
return TRUE;
@@ -2614,9 +2392,6 @@ MGASave(ScrnInfoPtr pScrn)
MGARegPtr mgaReg = &pMga->SavedReg;
if(pMga->SecondCrtc == TRUE) return;
-#ifdef USEMGAHAL
- MGA_HAL(if (pMga->pBoard != NULL) MGASaveVgaState(pMga->pBoard));
-#endif
/* I need to save the registers for the second head also */
/* Save the register for 0x80 to 0xa0 */
@@ -2626,135 +2401,6 @@ MGASave(ScrnInfoPtr pScrn)
(*pMga->Save)(pScrn, vgaReg, mgaReg, pMga->Primary);
}
-#ifdef USEMGAHAL
-/* Convert DisplayModeRec parameters in MGAMODEINFO parameters.
-* mode parameter optionnal. */
-void
-MGAFillModeInfoStruct(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- const char *s;
- MGAPtr pMga = MGAPTR(pScrn);
-
- Bool digital1 = FALSE;
- Bool digital2 = FALSE;
- Bool tv1 = FALSE;
- Bool tv2 = FALSE;
- Bool swap_head
- = xf86ReturnOptValBool(pMga->Options, OPTION_SWAPPED_HEAD, FALSE);
-
- if(pMga->MergedFB && mode && mode->Private && (mode->PrivSize == 0)) {
- mode = pMga->SecondCrtc ?
- ((MergedDisplayModePtr)mode->Private)->Monitor2
- : ((MergedDisplayModePtr)mode->Private)->Monitor1;
- }
-
-
- if (pMga->pMgaHwInfo)
- {
- digital1 = ISDIGITAL1(pMga);
- digital2 = ISDIGITAL2(pMga);
- tv1 = ISTV1(pMga);
- tv2 = ISTV2(pMga);
- }
-
- /*FIXME: causes segfault elsewhere if not commented*/
- /*if(!pMga->pMgaModeInfo)*/ pMga->pMgaModeInfo = xalloc(sizeof(MGAMODEINFO));
- pMga->pMgaModeInfo->flOutput = 0;
- pMga->pMgaModeInfo->ulDeskWidth = pScrn->virtualX;
- pMga->pMgaModeInfo->ulDeskHeight = pScrn->virtualY;
- pMga->pMgaModeInfo->ulFBPitch = 0;
- pMga->pMgaModeInfo->ulBpp = pScrn->bitsPerPixel;
- pMga->pMgaModeInfo->ulZoom = 1;
- pMga->pMgaModeInfo->flSignalMode = 0x10;
-
- /* Set TV standard */
- if ((s = xf86GetOptValString(pMga->Options, OPTION_TVSTANDARD))) {
- if (!xf86NameCmp(s, "PAL")) {
- pMga->pMgaModeInfo->flSignalMode = 0x00;
- pMga->pMgaModeInfo->ulRefreshRate = 50;
- pMga->pMgaModeInfo->ulTVStandard = TV_PAL;
- } else {
- pMga->pMgaModeInfo->ulRefreshRate = 60;
- pMga->pMgaModeInfo->ulTVStandard = TV_NTSC;
- }
- } else {
- pMga->pMgaModeInfo->ulRefreshRate = 0;
- pMga->pMgaModeInfo->ulTVStandard = TV_NTSC;
- }
-
- /* Set Cable Type */
- if ((s = xf86GetOptValString(pMga->Options, OPTION_CABLETYPE))) {
- if (!xf86NameCmp(s, "SCART_RGB")) {
- pMga->pMgaModeInfo->ulCableType = TV_SCART_RGB;
- } else if (!xf86NameCmp(s, "SCART_COMPOSITE")) {
- pMga->pMgaModeInfo->ulCableType = TV_SCART_COMPOSITE;
- } else if (!xf86NameCmp(s, "SCART_TYPE2")) {
- pMga->pMgaModeInfo->ulCableType = TV_SCART_TYPE2;
- } else {
- pMga->pMgaModeInfo->ulCableType = TV_YC_COMPOSITE;
- }
- } else {
- pMga->pMgaModeInfo->ulCableType = TV_YC_COMPOSITE;
- }
-
- if(mode) {
- pMga->pMgaModeInfo->ulHorizRate = 0;
- pMga->pMgaModeInfo->ulDispWidth = mode->HDisplay;
- pMga->pMgaModeInfo->ulDispHeight = mode->VDisplay;
- pMga->pMgaModeInfo->ulPixClock = mode->Clock;
- pMga->pMgaModeInfo->ulHFPorch = mode->HSyncStart - mode->HDisplay;
- pMga->pMgaModeInfo->ulHSync = mode->HSyncEnd - mode->HSyncStart;
- pMga->pMgaModeInfo->ulHBPorch = mode->HTotal - mode->HSyncEnd;
- pMga->pMgaModeInfo->ulVFPorch = mode->VSyncStart - mode->VDisplay;
- pMga->pMgaModeInfo->ulVSync = mode->VSyncEnd - mode->VSyncStart;
- pMga->pMgaModeInfo->ulVBPorch = mode->VTotal - mode->VSyncEnd;
- }
- /* Use DstOrg directly */
- /* This is an offset in pixels not memory */
- pMga->pMgaModeInfo->ulDstOrg = pMga->DstOrg / (pScrn->bitsPerPixel / 8);
- pMga->pMgaModeInfo->ulDisplayOrg = pMga->DstOrg / (pScrn->bitsPerPixel / 8);
- pMga->pMgaModeInfo->ulPanXGran = 0;
- pMga->pMgaModeInfo->ulPanYGran = 0;
-
- if(pMga->SecondCrtc == TRUE) {
- pMga->pMgaModeInfo->flOutput = MGAMODEINFO_SECOND_CRTC |
- MGAMODEINFO_FORCE_PITCH |
- MGAMODEINFO_FORCE_DISPLAYORG;
- if (digital2) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_DIGITAL2;
- } else if (tv2) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_TV;
- } else {
- if (!swap_head) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_ANALOG2;
- } else {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_ANALOG1;
- }
- }
- } else {
- pMga->pMgaModeInfo->flOutput = MGAMODEINFO_FORCE_PITCH;
- if (digital1) {
- if ((pMga->Chipset == PCI_CHIP_MGAG200) ||
- (pMga->Chipset == PCI_CHIP_MGAG200_PCI)) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_FLATPANEL1;
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_DIGITAL2;
- } else {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_DIGITAL1;
- }
- } else if (tv1) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_TV;
- } else {
- if (!swap_head) {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_ANALOG1;
- } else {
- pMga->pMgaModeInfo->flOutput |= MGAMODEINFO_ANALOG2;
- }
- }
- }
- pMga->pMgaModeInfo->ulFBPitch = pScrn->displayWidth;
-}
-#endif
-
/*
* Initialise a new mode. This is currently still using the old
* "initialise struct, restore/write struct to HW" model. That could
@@ -2769,9 +2415,6 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
MGAPtr pMga = MGAPTR(pScrn);
MGARegPtr mgaReg;
-#ifdef USEMGAHAL
- ULONG status;
-#endif
vgaHWUnlock(hwp);
/* if(pMga->MergedFB && mode && mode->Private && (mode->PrivSize == 0)) {
@@ -2790,56 +2433,6 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaHWProtect(pScrn, TRUE);
vgaReg = &hwp->ModeReg;
mgaReg = &pMga->ModeReg;
-#ifdef USEMGAHAL
- MGA_HAL(
- MGAFillModeInfoStruct(pScrn,mode);
-
- /* Validate the parameters */
- if ((status = MGAValidateMode(pMga->pBoard, pMga->pMgaModeInfo)) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGAValidateMode from HALlib found the mode to be invalid.\n"
- "\tError: %lx\n", status);
- return FALSE;
- }
-
- /*
- * Find mode for second head.
- */
- if(pMga->MergedFB) {
-
- MGAFillModeInfoStruct(pMga->pScrn2,mode);
- /* Validates the Video parameters */
- if ((status = MGAValidateVideoParameters(pMga->pBoard, MGAPTR(pMga->pScrn2)->pMgaModeInfo))
- != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGAValidateVideoParameters from HALlib found the mode to be invalid.\n\tError: %lx\n", status);
- return FALSE;
- }
- }
- ); /*MGA_HAL */
-
-#endif
-
-#ifdef USEMGAHAL
-MGA_HAL(
-
- /*************************** ESC *****************************/
- TmpMgaModeInfo[0] = *pMga->pMgaModeInfo;
-
- if(pMga->SecondCrtc == TRUE)
- pMgaModeInfo[1] = pMga->pMgaModeInfo;
- else
- pMgaModeInfo[0] = pMga->pMgaModeInfo;
-
- TmpMgaModeInfo[0].ulDispWidth = 0;
-
- if(!pMga->MergedFB) /* FIXME: Must deal with this once PowerDesk & MergedFB
- compatibility will exist */
- MGAFillDisplayModeStruct(mode, pMga->pMgaModeInfo);
- /*************************************************************/
-
-); /* MGA_HAL */
-#endif
#ifdef XF86DRI
if (pMga->directRenderingEnabled) {
@@ -2847,58 +2440,7 @@ MGA_HAL(
}
#endif
-#ifdef USEMGAHAL
- MGA_HAL(
- /* Initialize the board */
- if(MGASetMode(pMga->pBoard,pMga->pMgaModeInfo) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGASetMode returned an error."
- " Make sure to validate the mode before.\n");
- return FALSE;
- }
- if(pMga->MergedFB
- && MGASetMode(pMga->pBoard,MGAPTR(pMga->pScrn2)->pMgaModeInfo) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGASetMode returned an error."
- " Make sure to validate the mode before.\n");
- }
-
- ); /* MGA_HAL */
-
- /* getting around bugs in the HAL lib. MATROX: hint, hint. */
- MGA_HAL(
- switch (pMga->Chipset) {
- case PCI_CHIP_MGA1064:
- case PCI_CHIP_MGAG100:
- case PCI_CHIP_MGAG100_PCI:
- case PCI_CHIP_MGAG200:
- case PCI_CHIP_MGAG200_PCI:
- case PCI_CHIP_MGAG200_SE_A_PCI:
- case PCI_CHIP_MGAG200_SE_B_PCI:
- case PCI_CHIP_MGAG400:
- case PCI_CHIP_MGAG550:
- if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) {
- outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW,
- pMga->FbCursorOffset >> 10);
- outMGAdac(MGA1064_CURSOR_BASE_ADR_HI,
- pMga->FbCursorOffset >> 18);
- outMGAdac(MGA1064_CURSOR_CTL, 0x00);
- }
- if (pMga->Overlay8Plus24 == TRUE) {
- outMGAdac(MGA1064_MUL_CTL, MGA1064_MUL_CTL_32bits);
- outMGAdac(MGA1064_COL_KEY_MSK_LSB,0xFF);
- outMGAdac(MGA1064_COL_KEY_LSB,pMga->colorKey);
- outMGAdac(MGA1064_COL_KEY_MSK_MSB,0xFF);
- outMGAdac(MGA1064_COL_KEY_MSB,0xFF);
- }
- break;
- default:
- break;
- }
- ); /* MGA_HAL */
-#endif
-
- MGA_NOT_HAL((*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE));
+ (*pMga->Restore)(pScrn, vgaReg, mgaReg, FALSE);
MGAStormSync(pScrn);
MGAStormEngineInit(pScrn);
@@ -3010,14 +2552,6 @@ MGARestore(ScrnInfoPtr pScrn)
/* Only restore text mode fonts/text for the primary card */
vgaHWProtect(pScrn, TRUE);
if (pMga->Primary) {
-#ifdef USEMGAHAL
- MGA_HAL(
- if(pMga->pBoard != NULL) {
- MGASetVgaMode(pMga->pBoard);
- MGARestoreVgaState(pMga->pBoard);
- }
- ); /* MGA_HAL */
-#endif
(*pMga->Restore)(pScrn, vgaReg, mgaReg, TRUE);
} else {
vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE);
@@ -3104,81 +2638,12 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pPriv = xf86GetEntityPrivate(pScrn->entityList[0], MGAEntityIndex);
pMgaEnt = pPriv->ptr;
pMgaEnt->refCount++;
-#ifdef USEMGAHAL
- MGA_HAL(
- if(pMgaEnt->refCount == 1) {
- CARD8 MiscCtlReg;
- pMga->pBoard = xalloc(sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize());
- pMga->pClientStruct = xalloc(sizeof(CLIENTDATA));
- pMga->pClientStruct->pMga = (MGAPtr) pMga;
-
- /* wrapping OpenLibrary to fix broken registers. MATROX: hint,hint.*/
- MiscCtlReg = inMGAdac(MGA1064_MISC_CTL);
- MGAOpenLibrary(pMga->pBoard,pMga->pClientStruct,sizeof(CLIENTDATA));
- outMGAdac(MGA1064_MISC_CTL,MiscCtlReg);
- pMga->pMgaHwInfo = xalloc(sizeof(MGAHWINFO));
- MGAGetHardwareInfo(pMga->pBoard,pMga->pMgaHwInfo);
-
- /* Detecting for type of display */
- if (pMga->pMgaHwInfo->ulCapsSecondOutput & MGAHWINFOCAPS_OUTPUT_TV) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "TV detected\n");
- }
- if (pMga->pMgaHwInfo->ulCapsFirstOutput &
- MGAHWINFOCAPS_OUTPUT_DIGITAL) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Digital Screen detected\n");
- }
- if (pMga->pMgaHwInfo->ulCapsSecondOutput &
- MGAHWINFOCAPS_OUTPUT_DIGITAL) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Digital Screen detected\n");
- }
-
- /* Now copy these to the entitystructure */
- pMgaEnt->pClientStruct = pMga->pClientStruct;
- pMgaEnt->pBoard = pMga->pBoard;
- pMgaEnt->pMgaHwInfo = pMga->pMgaHwInfo;
- } else { /* Ref count is 2 */
- pMga->pClientStruct = pMgaEnt->pClientStruct;
- pMga->pBoard = pMgaEnt->pBoard;
- pMga->pMgaHwInfo = pMgaEnt->pMgaHwInfo;
- }
- ); /* MGA_HAL */
-#endif
- } else {
-#ifdef USEMGAHAL
- CARD8 MiscCtlReg;
-
- MGA_HAL(
- pMga->pBoard = xalloc(sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize());
- pMga->pClientStruct = xalloc(sizeof(CLIENTDATA));
- pMga->pClientStruct->pMga = (MGAPtr) pMga;
-
- MiscCtlReg = inMGAdac(MGA1064_MISC_CTL);
- /* wrapping OpenLibrary to fix broken registers. MATROX: hint,hint.*/
- MGAOpenLibrary(pMga->pBoard,pMga->pClientStruct,sizeof(CLIENTDATA));
- outMGAdac(MGA1064_MISC_CTL,MiscCtlReg);
- pMga->pMgaHwInfo = xalloc(sizeof(MGAHWINFO));
- MGAGetHardwareInfo(pMga->pBoard,pMga->pMgaHwInfo);
- ); /* MGA_HAL */
-#endif
}
+
if (pMga->is_G200SE) {
pScrn->videoRam = VRTemp;
pMga->FbMapSize = FBTemp;
}
-#ifdef USEMGAHAL
- MGA_HAL(
- /* There is a problem in the HALlib: set soft reset bit */
- /* MATROX: hint, hint. */
- if (!pMga->Primary && !pMga->FBDev &&
- (pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SG) ) {
- OUTREG(MGAREG_Reset, 1);
- usleep(200);
- OUTREG(MGAREG_Reset, 0);
- }
- ); /* MGA_HAL */
-#endif
/* Initialise the MMIO vgahw functions */
vgaHWSetMmioFuncs(hwp, pMga->IOBase, PORT_OFFSET);
@@ -3537,101 +3002,11 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Bool
MGASwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
-#ifdef USEMGAHAL
- char sCmdIn[256];
- char sCmdOut[256];
- FILE* fdIn;
-# ifdef MATROX_WRITEBACK
- FILE* fdOut;
-# endif
-#endif
-
if (mode->Flags & 0x80000000) {
-#ifdef USEMGAHAL
-
-# ifdef MATROX_WRITEBACK
-# define MWB(x) { x; }
-# define MWB_COND(x) x
-# else
-# define MWB(x)
-# define MWB_COND(x) 1
-# endif
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
- MGA_HAL(
- fdIn = fopen("/tmp/mgaDriverIn", "rt");
- MWB(fdOut = fopen("/tmp/mgaDriverOut", "wt"))
-
- if(fdIn && MWB_COND(fdOut))
- {
-
- fgets(sCmdIn, 255, fdIn);
-
- if(sCmdIn)
- {
-
- MGAExecuteEscCmd(xf86Screens[scrnIndex], sCmdIn, sCmdOut, mode);
-
- /* Remove file and close file descriptor */
- remove("/tmp/mgaDriverIn");
- fclose(fdIn);
- MWB(
- /* Write output data to output file for
- calling application */
- fputs(sCmdOut, fdOut);
- fclose(fdOut);
- )
- mode->Flags &= 0x7FFFFFFF;
- return TRUE;
- }
- else
- {
- mode->Flags &= 0x7FFFFFFF;
- return FALSE;
- }
- }
- else
- {
- mode->Flags &= 0x7FFFFFFF;
- return FALSE;
- }
- )
-#endif
- return FALSE;
+ return FALSE;
} else
return MGAModeInit(xf86Screens[scrnIndex], mode);
}
-
- /* Adjusts coordinates to match Panning granularity.
- * does nothing if the HALlib is not loaded
- */
-void
-MGAAdjustGranularity(ScrnInfoPtr pScrn, int* x, int* y)
-{
-#ifdef USEMGAHAL
- MGA_HAL(
- MGAPtr pMga = MGAPTR(pScrn);
- MGAPtr pMga2;
- int xg = 1;
- int yg = 1;
- if(pMga->pMgaModeInfo && pMga->pMgaModeInfo->ulPanXGran && pMga->pMgaModeInfo->ulPanYGran) {
- xg = pMga->pMgaModeInfo->ulPanXGran;
- yg = pMga->pMgaModeInfo->ulPanYGran;
- }
- if(pMga->pScrn2 && (pMga2 = MGAPTR(pMga->pScrn2)) ) {
-
- if(pMga2->pMgaModeInfo && pMga2->pMgaModeInfo->ulPanXGran && pMga2->pMgaModeInfo->ulPanYGran) {
- xg = max(xg,pMga2->pMgaModeInfo->ulPanXGran);
- yg = max(yg,pMga2->pMgaModeInfo->ulPanYGran);
- }
- }
- xg=16; /*ncoder: temporary */
- *x -= *x % xg;
- *y -= *y % yg;
- );
-#endif
-}
-
/*
* This function is used to initialize the Start Address - the first
@@ -3652,45 +3027,34 @@ MGAAdjustFrame(int scrnIndex, int x, int y, int flags)
pMga = MGAPTR(pScrn);
pLayout = &pMga->CurrentLayout;
- /* wanted to improve panning granularity problems without risking
- * compatibility issues. Existing code looked hardware dependent.
- */
-#ifdef USEMGAHAL
- MGA_HAL(
- pMga->HALGranularityOffX = x;
- pMga->HALGranularityOffY = y;
- MGAAdjustGranularity(pScrn,&x,&y);
- pMga->HALGranularityOffX = pMga->HALGranularityOffX - x;
- pMga->HALGranularityOffY = pMga->HALGranularityOffY - y;
- HALSetDisplayStart(pMga->pBoard,x,y,0);
- );
-#endif
- MGA_NOT_HAL(
- if(pMga->ShowCache && y && pScrn->vtSema)
- y += pScrn->virtualY - 1;
-
- Base = (y * pLayout->displayWidth + x + pMga->YDstOrg) >>
- (3 - pMga->BppShifts[(pLayout->bitsPerPixel >> 3) - 1]);
+ /* wanted to improve panning granularity problems without risking
+ * compatibility issues. Existing code looked hardware dependent.
+ */
+ if (pMga->ShowCache && y && pScrn->vtSema)
+ y += pScrn->virtualY - 1;
+
+ Base = (y * pLayout->displayWidth + x + pMga->YDstOrg) >>
+ (3 - pMga->BppShifts[(pLayout->bitsPerPixel >> 3) - 1]);
- if (pLayout->bitsPerPixel == 24) {
- if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
+ if (pLayout->bitsPerPixel == 24) {
+ if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550)
Base &= ~1; /*1 Not sure why */
- Base *= 3;
- }
- /* find start of retrace */
- while (INREG8(0x1FDA) & 0x08);
- while (!(INREG8(0x1FDA) & 0x08));
- /* wait until we're past the start (fixseg.c in the DDK) */
- count = INREG(MGAREG_VCOUNT) + 2;
- while(INREG(MGAREG_VCOUNT) < count);
+ Base *= 3;
+ }
+
+ /* find start of retrace */
+ while (INREG8(0x1FDA) & 0x08);
+ while (!(INREG8(0x1FDA) & 0x08));
+ /* wait until we're past the start (fixseg.c in the DDK) */
+ count = INREG(MGAREG_VCOUNT) + 2;
+ while (INREG(MGAREG_VCOUNT) < count);
- OUTREG16(MGAREG_CRTC_INDEX, (Base & 0x00FF00) | 0x0C);
- OUTREG16(MGAREG_CRTC_INDEX, ((Base & 0x0000FF) << 8) | 0x0D);
- OUTREG8(MGAREG_CRTCEXT_INDEX, 0x00);
- tmp = INREG8(MGAREG_CRTCEXT_DATA);
- OUTREG8(MGAREG_CRTCEXT_DATA, (tmp & 0xF0) | ((Base & 0x0F0000) >> 16));
- );
+ OUTREG16(MGAREG_CRTC_INDEX, (Base & 0x00FF00) | 0x0C);
+ OUTREG16(MGAREG_CRTC_INDEX, ((Base & 0x0000FF) << 8) | 0x0D);
+ OUTREG8(MGAREG_CRTCEXT_INDEX, 0x00);
+ tmp = INREG8(MGAREG_CRTCEXT_DATA);
+ OUTREG8(MGAREG_CRTCEXT_DATA, (tmp & 0xF0) | ((Base & 0x0F0000) >> 16));
}
@@ -3705,26 +3069,14 @@ MGAAdjustFrameCrtc2(int scrnIndex, int x, int y, int flags)
pScrn = xf86Screens[scrnIndex];
pMga = MGAPTR(pScrn);
pLayout = &pMga->CurrentLayout;
-#ifdef USEMGAHAL
- MGA_HAL(
- MGAAdjustGranularity(pScrn,&x,&y);
- HALSetDisplayStart(pMga->pBoard,x,y,1);
- );
-#endif
- MGA_NOT_HAL(
- if(pMga->ShowCache && y && pScrn->vtSema)
- y += pScrn->virtualY - 1;
-
- /* 3-85 c2offset
- * 3-93 c2startadd0
- * 3-96 c2vcount
- */
-
- Base = (y * pLayout->displayWidth + x) * pLayout->bitsPerPixel >> 3;
- Base += pMga->DstOrg;
- Base &= 0x01ffffc0;
- OUTREG(MGAREG_C2STARTADD0, Base);
- );
+
+ if (pMga->ShowCache && y && pScrn->vtSema)
+ y += pScrn->virtualY - 1;
+
+ Base = (y * pLayout->displayWidth + x) * pLayout->bitsPerPixel >> 3;
+ Base += pMga->DstOrg;
+ Base &= 0x01ffffc0;
+ OUTREG(MGAREG_C2STARTADD0, Base);
}
/*
@@ -3824,9 +3176,11 @@ MGALeaveVT(int scrnIndex, int flags)
DRILock(pScreen, 0);
}
#endif
-#ifdef USEMGAHAL
- MGA_HAL( RESTORE_TEXTMODE_ON_DVI(pMga); );
-#endif
+
+ /* FIXME:
+ *
+ * RESTORE_TEXTMODE_ON_DVI(pMga)
+ */
}
@@ -3846,9 +3200,11 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
MGAPtr pMga = MGAPTR(pScrn);
MGAEntPtr pMgaEnt = NULL;
-#ifdef USEMGAHAL
- MGA_HAL( RESTORE_TEXTMODE_ON_DVI(pMga); );
-#endif
+ /* FIXME:
+ *
+ * RESTORE_TEXTMODE_ON_DVI(pMga);
+ */
+
if (pMga->MergedFB)
MGACloseScreenMerged(scrnIndex, pScreen);
@@ -3877,37 +3233,6 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
pMgaEnt->refCount--;
}
-#ifdef USEMGAHAL
- MGA_HAL(
- if(pMga->DualHeadEnabled) {
- if(pMgaEnt->refCount == 0) {
- /* Both boards have closed there screen */
- MGACloseLibrary(pMga->pBoard);
-
- if (pMga->pBoard)
- xfree(pMga->pBoard);
- if (pMga->pClientStruct)
- xfree(pMga->pClientStruct);
- if (pMga->pMgaModeInfo)
- xfree(pMga->pMgaModeInfo);
- if (pMga->pMgaHwInfo)
- xfree(pMga->pMgaHwInfo);
- }
- } else {
- MGACloseLibrary(pMga->pBoard);
-
- if (pMga->pBoard)
- xfree(pMga->pBoard);
- if (pMga->pClientStruct)
- xfree(pMga->pClientStruct);
- if (pMga->pMgaModeInfo)
- xfree(pMga->pMgaModeInfo);
- if (pMga->pMgaHwInfo)
- xfree(pMga->pMgaHwInfo);
- }
- ); /* MGA_HAL */
-#endif
-
#ifdef USE_XAA
if (pMga->AccelInfoRec)
XAADestroyInfoRec(pMga->AccelInfoRec);
diff --git a/src/mga_esc.c b/src/mga_esc.c
deleted file mode 100644
index 8beffa8..0000000
--- a/src/mga_esc.c
+++ /dev/null
@@ -1,795 +0,0 @@
-/* $XFree86$ */
-/****************************************************************************
-* mga_esc.c
-*
-* ESC call implementation
-*
-* (C) Matrox Graphics, Inc.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef USEMGAHAL
-
-/* All drivers should typically include these */
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-
-/* All drivers need this */
-
-#include "compiler.h"
-
-/* Drivers for PCI hardware need this */
-#include "xf86PciInfo.h"
-
-/* Drivers that need to access the PCI config space directly need this */
-#include "xf86Pci.h"
-
-/* All drivers initialising the SW cursor need this */
-#include "mipointer.h"
-
-/* All drivers implementing backing store need this */
-#include "mibstore.h"
-
-#include "micmap.h"
-
-#include "xf86DDC.h"
-#include "xf86RAC.h"
-#include "vbe.h"
-
-#include "fb.h"
-#include "cfb8_32.h"
-#include "dixstruct.h"
-
-#include "mga_reg.h"
-#include "mga.h"
-#include "mga_macros.h"
-
-/* ESC */
-LPMGAMODEINFO pMgaModeInfo[2] = {NULL};
-MGAMODEINFO TmpMgaModeInfo[2] = {{0}};
-
-/* ESC Implementation */
-static void EscHLeft(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscHRight(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscVUp(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscVDown(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscHLarger(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscHSmaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscVTaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscVSmaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscRefresh(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscRestoreVidParm(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscRead(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscWrite(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscHal(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscTest(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-static void EscMerged(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode);
-
-static LPMGAMODEINFO GetModeInfoPtr(ULONG ulScreen);
-static void GetVideoParameterStr(LPMGAMODEINFO pModeInfo, char *sResult);
-static Bool convertNumber(unsigned long *pulNumber, char *sNumber);
-
-
-static MGAEscFuncRec FunctionTable[] = {
- {"hal", EscHal},
- {"test", EscTest},
- {"read", EscRead},
- {"write", EscWrite},
- {"left", EscHLeft},
- {"right", EscHRight},
- {"down", EscVDown},
- {"up", EscVUp},
- {"h+", EscHLarger},
- {"h-", EscHSmaller},
- {"v+", EscVTaller},
- {"v-", EscVSmaller},
- {"refresh", EscRefresh},
- {"undo", EscRestoreVidParm},
- {"merged", EscMerged},
- {NULL,NULL}
-};
-
-
-void MGAFillDisplayModeStruct(DisplayModePtr pMode, LPMGAMODEINFO pModeInfo)
-{
- pMode->Clock = pModeInfo->ulPixClock;
-
- pMode->HDisplay = pModeInfo->ulDispWidth;
- pMode->HSyncStart = pModeInfo->ulDispWidth
- + pModeInfo->ulHFPorch;
- pMode->HSyncEnd = pModeInfo->ulDispWidth
- + pModeInfo->ulHFPorch
- + pModeInfo->ulHSync;
- pMode->HTotal = pModeInfo->ulDispWidth
- + pModeInfo->ulHFPorch
- + pModeInfo->ulHSync
- + pModeInfo->ulHBPorch;
-
- pMode->VDisplay = pModeInfo->ulDispHeight;
- pMode->VSyncStart = pModeInfo->ulDispHeight
- + pModeInfo->ulVFPorch;
- pMode->VSyncEnd = pModeInfo->ulDispHeight
- + pModeInfo->ulVFPorch
- + pModeInfo->ulVSync;
- pMode->VTotal = pModeInfo->ulDispHeight
- + pModeInfo->ulVFPorch
- + pModeInfo->ulVSync
- + pModeInfo->ulVBPorch;
-
- pMode->VRefresh = pModeInfo->ulRefreshRate;
-}
-
-static LPMGAMODEINFO GetModeInfoPtr(ULONG ulScreen)
-{
-
- if ( !TmpMgaModeInfo[ulScreen].ulDispWidth )
- {
- TmpMgaModeInfo[ulScreen] = *pMgaModeInfo[ulScreen];
- }
-
- return &TmpMgaModeInfo[ulScreen];
-}
-
-
-static void GetVideoParameterStr(LPMGAMODEINFO pModeInfo, char *sResult)
-{
- sprintf(sResult, "%d %d %d %d %d %d %d %d %d %d %d",
- pModeInfo->ulDispWidth,
- pModeInfo->ulDispHeight,
- pModeInfo->ulBpp,
- pModeInfo->ulPixClock,
- pModeInfo->ulHFPorch,
- pModeInfo->ulHSync,
- pModeInfo->ulHBPorch,
- pModeInfo->ulVFPorch,
- pModeInfo->ulVSync,
- pModeInfo->ulVBPorch,
- pModeInfo->flSignalMode);
-}
-
-
-static float GetVRefresh(LPMGAMODEINFO pModeInfo)
-{
- ULONG ulHTotal;
- ULONG ulVTotal;
-
- ulHTotal =
- pModeInfo->ulDispWidth +
- pModeInfo->ulHFPorch +
- pModeInfo->ulHSync +
- pModeInfo->ulHBPorch;
-
- ulVTotal =
- pModeInfo->ulDispHeight +
- pModeInfo->ulVFPorch +
- pModeInfo->ulVSync +
- pModeInfo->ulVBPorch;
-
- return ((float)pModeInfo->ulPixClock * 1000.0) / (ulHTotal * ulVTotal);
-}
-
-static void EscHal(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMGA = MGAPTR(pScrn);
-
- if(pMGA->HALLoaded)
- strcpy(sResult, "YES");
- else
- strcpy(sResult, "NO");
-
-}
-
-static void EscTest(ScrnInfoPtr pScrn, unsigned long *param, char
-*sResult, DisplayModePtr pMode)
-{
- strcpy(sResult, "YES");
-}
-
-static void EscMerged(ScrnInfoPtr pScrn, unsigned long *param, char
-*sResult, DisplayModePtr pMode)
-{
- strcpy(sResult, "YES");
-}
-
-static void EscRead(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- ULONG ulSource, ulAddr, ulData;
- UCHAR ucIndex;
-
- if ( (param[0] & 0xffff) < 2 )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
-
- ulSource = param[1] >> 16;
- ulAddr = param[1] & 0xffff;
-
-
- switch( ulSource )
- {
- case 0:
- ulData = INREG(ulAddr);
- sprintf(sResult, "MGA[%04X] = 0x%08X", ulAddr, ulData);
- break;
- case 1:
- ucIndex = INREG8(0x3c00);
- OUTREG8(0x3c00, (UCHAR)ulAddr);
- ulData = (ULONG)INREG8(0x3c0a);
- OUTREG8(0x3c00, ucIndex);
- sprintf(sResult, "DAC[%02X] = 0x%02X", ulAddr, ulData);
- break;
- case 2:
- ucIndex = INREG8(0x1fd4);
- OUTREG8(0x1fd4, (UCHAR)ulAddr);
- ulData = (ULONG)INREG8(0x1fd5);
- OUTREG8(0x1fd4, ucIndex);
- sprintf(sResult, "CRTC[%02X] = 0x%02X", ulAddr, ulData);
- break;
- case 3:
- ucIndex = INREG8(0x1fde);
- OUTREG8(0x1fde, (UCHAR)ulAddr);
- ulData = (ULONG)INREG8(0x1fdf);
- OUTREG8(0x1fde, ucIndex);
- sprintf(sResult, "CRTCEXT[%02X] = 0x%02X", ulAddr, ulData);
- break;
- default:
- strcpy(sResult, "ERROR# 2");
- break;
- }
-}
-
-static void EscWrite(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- ULONG ulSource, ulAddr, ulData;
- UCHAR ucIndex;
-
- if ( (param[0] & 0xffff) < 3 )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- ulSource = param[1] >> 16;
- ulAddr = param[1] & 0xffff;
- ulData = param[2];
-
-
- switch( ulSource )
- {
- case 0:
- OUTREG(ulAddr, ulData);
- strcpy(sResult, "OK");
- break;
- case 1:
- ucIndex = INREG8(0x3c00);
- OUTREG8(0x3c00, (UCHAR)ulAddr);
- OUTREG8(0x3c0a, (UCHAR)ulData);
- OUTREG8(0x3c00, ucIndex);
- strcpy(sResult, "OK");
- break;
- case 2:
- ucIndex = INREG8(0x1fd4);
- OUTREG8(0x1fd4, (UCHAR)ulAddr);
- OUTREG8(0x1fd5, (UCHAR)ulData);
- OUTREG8(0x1fd4, ucIndex);
- strcpy(sResult, "OK");
- break;
- case 3:
- ucIndex = INREG8(0x1fde);
- OUTREG8(0x1fde, (UCHAR)ulAddr);
- OUTREG8(0x1fdf, (UCHAR)ulData);
- OUTREG8(0x1fde, ucIndex);
- strcpy(sResult, "OK");
- break;
- default:
- strcpy(sResult, "ERROR# 2");
- break;
- }
-}
-
-static void EscHLeft(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
-
- if (pModeInfo->ulHBPorch > (8 * param[1]) )
- {
- pModeInfo->ulHBPorch -=8 * param[1];
- pModeInfo->ulHFPorch +=8 * param[1];
- MGASetMode(pMga->pBoard, pModeInfo);
- }
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-static void EscHRight(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if (pModeInfo->ulHFPorch > (8 * param[1]) )
- {
- pModeInfo->ulHFPorch -=8 * param[1];
- pModeInfo->ulHBPorch +=8 * param[1];
- MGASetMode(pMga->pBoard, pModeInfo);
- }
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-
-static void EscVUp(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if (pModeInfo->ulVBPorch > (param[1]) )
- {
- pModeInfo->ulVBPorch -= param[1];
- pModeInfo->ulVFPorch += param[1];
- MGASetMode(pMga->pBoard, pModeInfo);
- }
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-static void EscVDown(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if (pModeInfo->ulVFPorch >= (param[1]) )
- {
- pModeInfo->ulVFPorch -= param[1];
- pModeInfo->ulVBPorch += param[1];
- MGASetMode(pMga->pBoard, pModeInfo);
- }
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-static void EscHLarger(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
- float fRefresh, fPixelClock;
- ULONG ulStep;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if ((param[0] & 0xffff) > 1)
- {
-
- ulStep = param[1] * 8;
- }
- else
- {
-
- ulStep = 8;
- }
-
- fRefresh = GetVRefresh(pModeInfo);
- fPixelClock = (float)pModeInfo->ulPixClock;
- if (pModeInfo->ulHBPorch >= ulStep )
- {
- pModeInfo->ulHBPorch -= ulStep;
- }
- else
- {
- pModeInfo->ulHBPorch = 0;
- }
- pModeInfo->ulPixClock = (ULONG)( (fRefresh * fPixelClock) / GetVRefresh(pModeInfo));
- MGASetMode(pMga->pBoard, pModeInfo);
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-static void EscHSmaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
- float fRefresh, fPixelClock;
- ULONG ulStep;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if ((param[0] & 0xffff) > 1)
- {
-
- ulStep = param[1] * 8;
- }
- else
- {
-
- ulStep = 8;
- }
-
-
- fRefresh = GetVRefresh(pModeInfo);
- fPixelClock = (float)pModeInfo->ulPixClock;
- pModeInfo->ulHBPorch += ulStep;
- pModeInfo->ulPixClock = (ULONG)( (fRefresh * fPixelClock) / GetVRefresh(pModeInfo));
-
- MGASetMode(pMga->pBoard, pModeInfo);
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-static void EscVTaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
- float fRefresh, fPixelClock;
- ULONG ulStep;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if ((param[0] & 0xffff) > 1)
- {
-
- ulStep = param[1];
- }
- else
- {
-
- ulStep = 1;
- }
-
- fRefresh = GetVRefresh(pModeInfo);
- fPixelClock = (float)pModeInfo->ulPixClock;
-
- if (pModeInfo->ulVBPorch >= ulStep )
- {
- pModeInfo->ulVBPorch -= ulStep;
- }
- else
- {
- pModeInfo->ulVBPorch = 0;
- }
-
- pModeInfo->ulPixClock = (ULONG)( (fRefresh * fPixelClock) / GetVRefresh(pModeInfo));
- MGASetMode(pMga->pBoard, pModeInfo);
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-static void EscVSmaller(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
- float fRefresh, fPixelClock;
- ULONG ulStep;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if ((param[0] & 0xffff) > 1)
- {
-
- ulStep = param[1];
- }
- else
- {
-
- ulStep = 1;
- }
-
-
- fRefresh = GetVRefresh(pModeInfo);
- fPixelClock = (float)pModeInfo->ulPixClock;
- pModeInfo->ulVFPorch += ulStep;
- pModeInfo->ulPixClock = (ULONG)( (fRefresh * fPixelClock) / GetVRefresh(pModeInfo));
- MGASetMode(pMga->pBoard, pModeInfo);
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-
-static void EscRefresh(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
- LPMGAMODEINFO pModeInfo;
- float fRefresh, fPixelClock;
-
- pModeInfo = GetModeInfoPtr(param[0] >> 16);
-
- if ( !pMgaModeInfo )
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- if ((param[0] & 0xffff) < 2)
- {
- strcpy(sResult, "#error 1");
- return;
- }
-
- fRefresh = GetVRefresh(pModeInfo);
-
- fPixelClock = (float)pModeInfo->ulPixClock;
- pModeInfo->ulPixClock = (ULONG)( ((float)param[1] * fPixelClock) / fRefresh);
-
- pModeInfo->ulRefreshRate = param[1];
-
- MGASetMode(pMga->pBoard, pModeInfo);
-
- MGAFillDisplayModeStruct(pMode, pModeInfo);
-
- GetVideoParameterStr(pModeInfo, sResult);
-}
-
-static void EscRestoreVidParm(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, DisplayModePtr pMode)
-{
- MGAPtr pMga = MGAPTR(pScrn);
-
- TmpMgaModeInfo[param[0] >> 16].ulDispWidth = 0;
- MGASetMode(pMga->pBoard, pMgaModeInfo[param[0] >> 16]);
-
- MGAFillDisplayModeStruct(pMode, pMgaModeInfo[param[0] >> 16]);
-
- GetVideoParameterStr(pMgaModeInfo[param[0] >> 16], sResult);
-}
-
-static Bool convertNumber(unsigned long *pulNumber, char *sNumber)
-{
- unsigned long i, ulDigit, shiftHex;
- Bool bResult = TRUE;
-
- if (sNumber == NULL)
- {
- return FALSE;
- }
-
-
- /* Convert number */
- if ( (sNumber[0] == '0') && (sNumber[1] == 'x') )
- {
- shiftHex = 0;
- *pulNumber = 0;
-
- for (i = strlen(sNumber) - 1; i > 1; i--)
- {
- if (shiftHex > 28)
- {
- bResult = FALSE;
- break;
- }
-
- if ( !isxdigit(sNumber[i]) )
- {
- bResult = FALSE;
- break;
- }
-
- ulDigit = toupper(sNumber[i]) - '0';
- if (ulDigit > 9)
- {
- ulDigit -= 7;
- }
- *pulNumber += ulDigit << shiftHex;
- shiftHex += 4;
- }
- }
- else
- {
- for (i = 0; i < strlen(sNumber); i++)
- {
- if ( !isdigit(sNumber[i]) )
- {
- bResult = FALSE;
- break;
- }
- }
- *pulNumber = atoi(sNumber);
- }
-
- return bResult;
-}
-
-static Bool GetEscCommand(char *cmdline, EscCmdStruct *escCmd)
-{
- unsigned long i, paramIndex, ulHI;
- Bool bResult;
- char *pParameter, *function;
-
- bResult = TRUE; /* success */
-
- function = strtok(cmdline, " \t\n,");
-
-
- escCmd->parameters[0] = 0;
- if (function)
- {
- /* Find Screen */
- if (function[1] == ':' )
- {
- escCmd->parameters[0] = (unsigned long)(function[0] - '0') << 16;
- strncpy(escCmd->function, function+2, 32);
- }
- else
- {
- strncpy(escCmd->function, function, 32);
- }
-
- }
- else
- {
- strcpy(escCmd->function, "#ERROR -1");
- escCmd->parameters[0] = 0;
- return FALSE;
- }
-
- paramIndex = 1;
- while ( (pParameter = strtok(NULL, " \t\n,")) != NULL )
- {
- if (paramIndex > 31)
- {
- /* 32 parameters supported */
- break;
- }
-
- i = 0;
- while(pParameter[i] && pParameter[i] != ':')
- {
- i++;
- }
-
- if ( pParameter[i] )
- {
- pParameter[i] = '\0';
- bResult = convertNumber(&escCmd->parameters[paramIndex], &pParameter[i+1]);
- bResult |= convertNumber(&ulHI, pParameter);
- escCmd->parameters[paramIndex] &= 0xffff;
- escCmd->parameters[paramIndex] += ulHI << 16;
- pParameter[i] = ':';
- }
- else
- {
- bResult = convertNumber(&escCmd->parameters[paramIndex], pParameter);
- }
-
-
- if (!bResult)
- {
- break;
- }
- paramIndex++;
- }
-
- escCmd->parameters[0] += paramIndex;
- return bResult;
-
-}
-
-void MGAExecuteEscCmd(ScrnInfoPtr pScrn, char *cmdline , char *sResult, DisplayModePtr pMode)
-{
- int i = 0;
- int ulScreen = 0;
- MGAPtr pMga = MGAPTR(pScrn);
- EscCmdStruct EscCmd;
-
- if (pMga->SecondCrtc)
- {
- ulScreen = 1;
- }
- else
- {
- ulScreen = 0;
- }
-
-
- if (FunctionTable[0].function && GetEscCommand(cmdline, &EscCmd) )
- {
- i = 0;
-
- while ( FunctionTable[i].function && strcmp(FunctionTable[i].function, EscCmd.function) )
- {
- i++;
- }
-
- if (FunctionTable[i].function)
- {
- EscCmd.parameters[0] &= 0xffff;
- EscCmd.parameters[0] |= ulScreen << 16;
-
- FunctionTable[i].funcptr(pScrn, EscCmd.parameters, sResult, pMode);
- }
- else
- {
- strcpy(sResult, "error# -1");
- }
- }
- else
- {
- strcpy(sResult, "error# -1");
- }
-}
-#else
-int mga_foo;
-#endif
diff --git a/src/mga_halmod.c b/src/mga_halmod.c
deleted file mode 100644
index 94e1f18..0000000
--- a/src/mga_halmod.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $XFree86$ */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "xf86Module.h"
-
-#ifdef XFree86LOADER
-
-#define HAL_MAJOR_VERSION 1
-#define HAL_MINOR_VERSION 0
-#define HAL_PATCHLEVEL 0
-
-static MODULESETUPPROTO(halSetup);
-
-static XF86ModuleVersionInfo halVersRec =
-{
- "mga_hal",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- HAL_MAJOR_VERSION, HAL_MINOR_VERSION, HAL_PATCHLEVEL,
- ABI_CLASS_VIDEODRV, /* This is a video driver */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-/*
- * This is the module init data.
- * Its name has to be the driver name followed by ModuleData.
- */
-_X_EXPORT XF86ModuleData mga_halModuleData = { &halVersRec, halSetup, NULL };
-
-static pointer
-halSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- return (pointer)1;
-}
-
-#endif /* XFree86LOADER */
diff --git a/src/mga_macros.h b/src/mga_macros.h
index 8a3221d..36690d1 100644
--- a/src/mga_macros.h
+++ b/src/mga_macros.h
@@ -62,21 +62,6 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \
#define CHECK_DMA_QUIESCENT(pMGA, pScrn)
#endif
-#ifdef USEMGAHAL
-#define HAL_CHIPSETS (pMga->is_HAL_chipset)
-
-#define MGA_HAL(x) { \
- MGAPtr pMga = MGAPTR(pScrn); \
- if (pMga->HALLoaded && HAL_CHIPSETS) { x; } \
-}
-#define MGA_NOT_HAL(x) { \
- MGAPtr pMga = MGAPTR(pScrn); \
- if (!pMga->HALLoaded || !HAL_CHIPSETS) { x; } \
-}
-#else
-#define MGA_NOT_HAL(x) { x; }
-#endif
-
#define MGAISGx50(x) ((x)->is_Gx50)
#define MGA_DH_NEEDS_HAL(x) (((x)->Chipset == PCI_CHIP_MGAG400) && \
diff --git a/src/mga_merge.c b/src/mga_merge.c
index aa14dbe..727d28b 100644
--- a/src/mga_merge.c
+++ b/src/mga_merge.c
@@ -239,9 +239,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
int i;
char* s;
ClockRangePtr clockRanges;
-#ifdef USEMGAHAL
- ULONG status;
-#endif
MgaScrn2Rel Monitor2Pos;
xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "==== Start of second screen initialization ====\n");
@@ -255,9 +252,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
}
pMga = MGAPTR(pScrn);
-#ifdef USEMGAHAL
- pMga->pMgaModeInfo = NULL; /*will be allocated later if NULL*/
-#endif
pMga1 = MGAPTR(pScrn1);
pMga1->pScrn2 = pScrn;
@@ -452,12 +446,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
clockRanges->minClock = pMga->MinClock;
clockRanges->maxClock = pMga->MaxClock;
clockRanges->clockIndex = -1; /* programmable */
- clockRanges->interlaceAllowed = TRUE;
clockRanges->doubleScanAllowed = TRUE;
-#ifdef USEMGAHAL
- MGA_HAL(clockRanges->interlaceAllowed = FALSE);
- MGA_HAL(clockRanges->doubleScanAllowed = FALSE);
-#endif
clockRanges->interlaceAllowed = FALSE; /*no interlace on CRTC2 */
clockRanges->ClockMulFactor = 1;
@@ -556,30 +545,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
MGAFreeRec(pScrn);
return FALSE;
}
-#ifdef USEMGAHAL
- MGA_HAL(
-
- pMga->pBoard = pMga1->pBoard;
- pMga->pClientStruct = pMga1->pClientStruct;
- pMga->pMgaHwInfo = pMga1->pMgaHwInfo;
-
-
- MGAFillModeInfoStruct(pScrn,NULL);
- /* Fields usually handled by MGAFillModeInfoStruct, but are unavailable
- * because no mode is given
- */
- pMga->pMgaModeInfo->ulDispWidth = pScrn->virtualX;
- pMga->pMgaModeInfo->ulDispHeight = pScrn->virtualY;
-
- if((status = MGAValidateMode(pMga->pBoard,pMga->pMgaModeInfo)) != 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "MGAValidateMode from HALlib found the mode to be invalid.\n"
- "\tError: 0x%lx\n", status);
- return FALSE;
- }
- pScrn->displayWidth = pMga->pMgaModeInfo->ulFBPitch;
- ); /* MGA_HAL */
-#endif
/*
* Set the CRTC parameters for all of the modes based on the type
@@ -589,10 +554,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
* driver and if the driver doesn't provide code to set them. They
* are not pre-initialised at all.
*/
-#ifdef USEMGAHAL
- MGA_HAL(xf86SetCrtcForModes(pScrn, 0));
-#endif
- MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V));
+ xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;