summaryrefslogtreecommitdiff
path: root/src/legacy
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-23 08:31:52 +0100
committerDave Airlie <airlied@redhat.com>2012-05-23 08:31:52 +0100
commit70ee0f84f5b9c6c13a0338f8b2757e587c849c14 (patch)
tree85351d3bc6faa452155461f68339f00daeba5a12 /src/legacy
parent3410db008c6c20dc6590a89c05b40a0c6de6744a (diff)
legacy/i810: rename pScrn->scrn
This is need to make the compat api stuff easier to implement. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/legacy')
-rw-r--r--src/legacy/i810/i810_driver.c558
1 files changed, 279 insertions, 279 deletions
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 02da5744..76f36f27 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -77,7 +77,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "../legacy.h"
-static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
+static Bool I810PreInit(ScrnInfoPtr scrn, int flags);
static Bool I810ScreenInit(int Index, ScreenPtr pScreen, int argc,
char **argv);
static Bool I810EnterVT(int scrnIndex, int flags);
@@ -85,7 +85,7 @@ static void I810LeaveVT(int scrnIndex, int flags);
static Bool I810CloseScreen(int scrnIndex, ScreenPtr pScreen);
static Bool I810SaveScreen(ScreenPtr pScreen, Bool unblank);
static void I810FreeScreen(int scrnIndex, int flags);
-static void I810DisplayPowerManagementSet(ScrnInfoPtr pScrn,
+static void I810DisplayPowerManagementSet(ScrnInfoPtr scrn,
int PowerManagermentMode,
int flags);
static ModeStatus I810ValidMode(int scrnIndex, DisplayModePtr mode,
@@ -152,24 +152,24 @@ int I830EntityIndex = -1;
*
*/
static Bool
-I810GetRec(ScrnInfoPtr pScrn)
+I810GetRec(ScrnInfoPtr scrn)
{
- if (pScrn->driverPrivate)
+ if (scrn->driverPrivate)
return TRUE;
- pScrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
+ scrn->driverPrivate = xnfcalloc(sizeof(I810Rec), 1);
return TRUE;
}
static void
-I810FreeRec(ScrnInfoPtr pScrn)
+I810FreeRec(ScrnInfoPtr scrn)
{
- if (!pScrn)
+ if (!scrn)
return;
- if (!pScrn->driverPrivate)
+ if (!scrn->driverPrivate)
return;
- free(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
+ free(scrn->driverPrivate);
+ scrn->driverPrivate = NULL;
}
struct pci_device *
@@ -188,11 +188,11 @@ intel_host_bridge (void)
}
static void
-I810ProbeDDC(ScrnInfoPtr pScrn, int index)
+I810ProbeDDC(ScrnInfoPtr scrn, int index)
{
vbeInfoPtr pVbe;
- if (xf86LoadSubModule(pScrn, "vbe")) {
+ if (xf86LoadSubModule(scrn, "vbe")) {
pVbe = VBEInit(NULL, index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
vbeFree(pVbe);
@@ -200,24 +200,24 @@ I810ProbeDDC(ScrnInfoPtr pScrn, int index)
}
static xf86MonPtr
-I810DoDDC(ScrnInfoPtr pScrn, int index)
+I810DoDDC(ScrnInfoPtr scrn, int index)
{
vbeInfoPtr pVbe;
xf86MonPtr MonInfo = NULL;
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
/* Honour Option "noDDC" */
if (xf86ReturnOptValBool(pI810->Options, OPTION_NO_DDC, FALSE)) {
return MonInfo;
}
- if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, index))) {
+ if (xf86LoadSubModule(scrn, "vbe") && (pVbe = VBEInit(NULL, index))) {
MonInfo = vbeDoEDID(pVbe, NULL);
xf86PrintEDID(MonInfo);
- xf86SetDDCproperties(pScrn, MonInfo);
+ xf86SetDDCproperties(scrn, MonInfo);
vbeFree(pVbe);
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
"this driver cannot do DDC without VBE\n");
}
@@ -232,7 +232,7 @@ I810DoDDC(ScrnInfoPtr pScrn, int index)
*
*/
static Bool
-I810PreInit(ScrnInfoPtr pScrn, int flags)
+I810PreInit(ScrnInfoPtr scrn, int flags)
{
I810Ptr pI810;
ClockRangePtr clockRanges;
@@ -244,89 +244,89 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
Bool enable;
struct intel_chipset chipset;
- if (pScrn->numEntities != 1)
+ if (scrn->numEntities != 1)
return FALSE;
/* Allocate driverPrivate */
- if (!I810GetRec(pScrn))
+ if (!I810GetRec(scrn))
return FALSE;
- pI810 = I810PTR(pScrn);
+ pI810 = I810PTR(scrn);
- pI810->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
+ pI810->pEnt = xf86GetEntityInfo(scrn->entityList[0]);
if (pI810->pEnt->location.type != BUS_PCI)
return FALSE;
if (flags & PROBE_DETECT) {
- I810ProbeDDC(pScrn, pI810->pEnt->index);
+ I810ProbeDDC(scrn, pI810->pEnt->index);
return TRUE;
}
/* The vgahw module should be loaded here when needed */
- if (!xf86LoadSubModule(pScrn, "vgahw"))
+ if (!xf86LoadSubModule(scrn, "vgahw"))
return FALSE;
/* Allocate a vgaHWRec */
- if (!vgaHWGetHWRec(pScrn))
+ if (!vgaHWGetHWRec(scrn))
return FALSE;
pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
- /* Set pScrn->monitor */
- pScrn->monitor = pScrn->confScreen->monitor;
+ /* Set scrn->monitor */
+ scrn->monitor = scrn->confScreen->monitor;
flags24 = Support24bppFb | PreferConvert32to24 | SupportConvert32to24;
- if (!xf86SetDepthBpp(pScrn, 16, 0, 16, flags24)) {
+ if (!xf86SetDepthBpp(scrn, 16, 0, 16, flags24)) {
return FALSE;
} else {
- switch (pScrn->depth) {
+ switch (scrn->depth) {
case 8:
case 15:
case 16:
case 24:
break;
default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Given depth (%d) is not supported by i810 driver\n",
- pScrn->depth);
+ scrn->depth);
return FALSE;
}
}
- xf86PrintDepthBpp(pScrn);
+ xf86PrintDepthBpp(scrn);
- switch (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
case 16:
case 24:
break;
default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Given bpp (%d) is not supported by i810 driver\n",
- pScrn->bitsPerPixel);
+ scrn->bitsPerPixel);
return FALSE;
}
- if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
+ if (!xf86SetWeight(scrn, defaultWeight, defaultWeight))
return FALSE;
- if (!xf86SetDefaultVisual(pScrn, -1))
+ if (!xf86SetDefaultVisual(scrn, -1))
return FALSE;
/* We use a programmable clock */
- pScrn->progClock = TRUE;
+ scrn->progClock = TRUE;
- pI810->cpp = pScrn->bitsPerPixel / 8;
+ pI810->cpp = scrn->bitsPerPixel / 8;
/* Process the options */
- xf86CollectOptions(pScrn, NULL);
+ xf86CollectOptions(scrn, NULL);
if (!(pI810->Options = malloc(sizeof(I810Options))))
return FALSE;
memcpy(pI810->Options, I810Options, sizeof(I810Options));
- xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI810->Options);
+ xf86ProcessOptions(scrn->scrnIndex, scrn->options, pI810->Options);
- pScrn->rgbBits = 8;
+ scrn->rgbBits = 8;
if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE))
- pScrn->rgbBits = 6;
+ scrn->rgbBits = 6;
if (xf86ReturnOptValBool(pI810->Options, OPTION_SHOW_CACHE, FALSE))
pI810->showCache = TRUE;
@@ -335,7 +335,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
/* 6-BIT dac isn't reasonable for modes with > 8bpp */
if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE) &&
- pScrn->bitsPerPixel > 8) {
+ scrn->bitsPerPixel > 8) {
OptionInfoPtr ptr;
ptr = xf86TokenToOptinfo(pI810->Options, OPTION_DAC_6BIT);
@@ -346,8 +346,8 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
pI810->noAccel = TRUE;
if (!pI810->noAccel) {
- if (!xf86LoadSubModule(pScrn, "xaa")) {
- I810FreeRec(pScrn);
+ if (!xf86LoadSubModule(scrn, "xaa")) {
+ I810FreeRec(scrn);
return FALSE;
}
}
@@ -358,11 +358,11 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
if (!pI810->directRenderingDisabled) {
if (pI810->noAccel) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DRI is disabled because it "
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "DRI is disabled because it "
"needs 2D acceleration.\n");
pI810->directRenderingDisabled=TRUE;
- } else if (pScrn->depth!=16) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DRI is disabled because it "
+ } else if (scrn->depth!=16) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "DRI is disabled because it "
"runs only at 16-bit depth.\n");
pI810->directRenderingDisabled=TRUE;
}
@@ -373,49 +373,49 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
/* after xf86ProcessOptions,
* because it is controlled by options [no]vbe and [no]ddc
*/
- I810DoDDC(pScrn, pI810->pEnt->index);
+ I810DoDDC(scrn, pI810->pEnt->index);
- intel_detect_chipset(pScrn, pI810->PciInfo, &chipset);
+ intel_detect_chipset(scrn, pI810->PciInfo, &chipset);
/*
* Set the Chipset and ChipRev, allowing config file entries to
* override.
*/
if (pI810->pEnt->device->chipset && *pI810->pEnt->device->chipset) {
- pScrn->chipset = pI810->pEnt->device->chipset;
+ scrn->chipset = pI810->pEnt->device->chipset;
from = X_CONFIG;
} else if (pI810->pEnt->device->chipID >= 0) {
- pScrn->chipset = (char *)xf86TokenToString(intel_chipsets,
+ scrn->chipset = (char *)xf86TokenToString(intel_chipsets,
pI810->pEnt->device->chipID);
from = X_CONFIG;
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n",
pI810->pEnt->device->chipID);
} else {
from = X_PROBED;
- pScrn->chipset = (char *)xf86TokenToString(intel_chipsets,
+ scrn->chipset = (char *)xf86TokenToString(intel_chipsets,
DEVICE_ID(pI810->PciInfo));
}
if (pI810->pEnt->device->chipRev >= 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n",
pI810->pEnt->device->chipRev);
}
- xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n",
- (pScrn->chipset != NULL) ? pScrn->chipset : "Unknown i810");
+ xf86DrvMsg(scrn->scrnIndex, from, "Chipset: \"%s\"\n",
+ (scrn->chipset != NULL) ? scrn->chipset : "Unknown i810");
pI810->LinearAddr = pI810->PciInfo->regions[0].base_addr;
- xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
+ xf86DrvMsg(scrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
(unsigned long)pI810->LinearAddr);
pI810->MMIOAddr = pI810->PciInfo->regions[1].base_addr;
- xf86DrvMsg(pScrn->scrnIndex, from, "IO registers at addr 0x%lX\n",
+ xf86DrvMsg(scrn->scrnIndex, from, "IO registers at addr 0x%lX\n",
(unsigned long)pI810->MMIOAddr);
/* AGP GART support is required. Don't proceed any further if it isn't
* present.
*/
if (!xf86AgpGARTSupported()) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"AGP GART support is not available. Make sure your kernel has\n"
"\tagpgart support or that the agpgart kernel module is loaded.\n");
return FALSE;
@@ -442,40 +442,40 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
*
* Changed to 8 Meg so we can have acceleration by default (Mark).
*/
- mem = I810CheckAvailableMemory(pScrn);
+ mem = I810CheckAvailableMemory(scrn);
if (pI810->directRenderingDisabled || mem < 131072) /* < 128 MB */
- pScrn->videoRam = 8192;
+ scrn->videoRam = 8192;
else if (mem < 196608)
- pScrn->videoRam = 16384; /* < 192 MB */
+ scrn->videoRam = 16384; /* < 192 MB */
else
- pScrn->videoRam = 24576;
+ scrn->videoRam = 24576;
from = X_DEFAULT;
if (pI810->pEnt->device->videoRam) {
- pScrn->videoRam = pI810->pEnt->device->videoRam;
+ scrn->videoRam = pI810->pEnt->device->videoRam;
from = X_CONFIG;
}
- if (mem > 0 && mem < pScrn->videoRam) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%dk of memory was requested,"
+ if (mem > 0 && mem < scrn->videoRam) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%dk of memory was requested,"
" but the\n\t maximum AGP memory available is %dk.\n",
- pScrn->videoRam, mem);
+ scrn->videoRam, mem);
from = X_PROBED;
if (mem > (6 * 1024)) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Reducing video memory to 4MB\n");
- pScrn->videoRam = 4096;
+ scrn->videoRam = 4096;
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Less than 6MB of AGP memory"
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Less than 6MB of AGP memory"
" is available. Cannot proceed.\n");
- I810FreeRec(pScrn);
+ I810FreeRec(scrn);
return FALSE;
}
}
- xf86DrvMsg(pScrn->scrnIndex, from,
- "Will alloc AGP framebuffer: %d kByte\n", pScrn->videoRam);
+ xf86DrvMsg(scrn->scrnIndex, from,
+ "Will alloc AGP framebuffer: %d kByte\n", scrn->videoRam);
/* Calculate Fixed Offsets depending on graphics aperture size */
{
@@ -502,14 +502,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
{
Gamma zeros = { 0.0, 0.0, 0.0 };
- if (!xf86SetGamma(pScrn, zeros)) {
+ if (!xf86SetGamma(scrn, zeros)) {
return FALSE;
}
}
pI810->MaxClock = 0;
if (pI810->pEnt->device->dacSpeeds[0]) {
- switch (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
pI810->MaxClock = pI810->pEnt->device->dacSpeeds[DAC_BPP8];
break;
@@ -526,7 +526,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
if (!pI810->MaxClock)
pI810->MaxClock = pI810->pEnt->device->dacSpeeds[0];
} else {
- switch (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
pI810->MaxClock = 203000;
break;
@@ -549,59 +549,59 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->interlaceAllowed = TRUE;
clockRanges->doubleScanAllowed = FALSE;
- i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
- pScrn->display->modes, clockRanges,
+ i = xf86ValidateModes(scrn, scrn->monitor->Modes,
+ scrn->display->modes, clockRanges,
#ifndef HAVE_DRI1
- 0, 320, 1600, 64 * pScrn->bitsPerPixel,
+ 0, 320, 1600, 64 * scrn->bitsPerPixel,
#else
- i810_pitches, 0, 0, 64 * pScrn->bitsPerPixel,
+ i810_pitches, 0, 0, 64 * scrn->bitsPerPixel,
#endif
200, 1200,
- pScrn->display->virtualX, pScrn->display->virtualY,
- pScrn->videoRam * 1024, LOOKUP_BEST_REFRESH);
+ scrn->display->virtualX, scrn->display->virtualY,
+ scrn->videoRam * 1024, LOOKUP_BEST_REFRESH);
if (i == -1) {
- I810FreeRec(pScrn);
+ I810FreeRec(scrn);
return FALSE;
}
- xf86PruneDriverModes(pScrn);
+ xf86PruneDriverModes(scrn);
- if (!i || !pScrn->modes) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
- I810FreeRec(pScrn);
+ if (!i || !scrn->modes) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR, "No valid modes found\n");
+ I810FreeRec(scrn);
return FALSE;
}
- xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
+ xf86SetCrtcForModes(scrn, INTERLACE_HALVE_V);
- pScrn->currentMode = pScrn->modes;
+ scrn->currentMode = scrn->modes;
- xf86PrintModes(pScrn);
+ xf86PrintModes(scrn);
- xf86SetDpi(pScrn, 0, 0);
+ xf86SetDpi(scrn, 0, 0);
- if (!xf86LoadSubModule(pScrn, "fb")) {
- I810FreeRec(pScrn);
+ if (!xf86LoadSubModule(scrn, "fb")) {
+ I810FreeRec(scrn);
return FALSE;
}
if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) {
- if (!xf86LoadSubModule(pScrn, "ramdac")) {
- I810FreeRec(pScrn);
+ if (!xf86LoadSubModule(scrn, "ramdac")) {
+ I810FreeRec(scrn);
return FALSE;
}
}
if (xf86GetOptValInteger
(pI810->Options, OPTION_COLOR_KEY, &(pI810->colorKey))) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG,
"video overlay key set to 0x%x\n", pI810->colorKey);
} else {
- pI810->colorKey = (1 << pScrn->offset.red) |
- (1 << pScrn->offset.green) |
- (((pScrn->mask.blue >> pScrn->offset.blue) -
- 1) << pScrn->offset.blue);
+ pI810->colorKey = (1 << scrn->offset.red) |
+ (1 << scrn->offset.green) |
+ (((scrn->mask.blue >> scrn->offset.blue) -
+ 1) << scrn->offset.blue);
}
pI810->allowPageFlip=FALSE;
@@ -612,14 +612,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
pI810->allowPageFlip = enable;
if (pI810->allowPageFlip == TRUE)
{
- if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+ if (!xf86LoadSubModule(scrn, "shadowfb")) {
pI810->allowPageFlip = 0;
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Couldn't load shadowfb module:\n");
}
}
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "page flipping %s\n",
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "page flipping %s\n",
enable ? "enabled" : "disabled");
}
@@ -627,20 +627,20 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
if (xf86GetOptValInteger(pI810->Options, OPTION_XVMC_SURFACES,
&(pI810->numSurfaces))) {
- xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "%d XvMC Surfaces Requested.\n",
+ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "%d XvMC Surfaces Requested.\n",
pI810->numSurfaces);
if (pI810->numSurfaces > 7) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ xf86DrvMsg(scrn->scrnIndex, X_PROBED,
"Using 7 XvMC Surfaces (Maximum Allowed).\n");
pI810->numSurfaces = 7;
}
if (pI810->numSurfaces < 6) {
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ xf86DrvMsg(scrn->scrnIndex, X_PROBED,
"Using 6 XvMC Surfaces (Minimum Allowed).\n");
pI810->numSurfaces = 6;
}
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
"XvMC is Disabled: use XvMCSurfaces config option to enable.\n");
pI810->numSurfaces = 0;
}
@@ -648,7 +648,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
#ifdef HAVE_DRI1
/* Load the dri module if requested. */
if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) {
- xf86LoadSubModule(pScrn, "dri");
+ xf86LoadSubModule(scrn, "dri");
}
#endif
@@ -656,9 +656,9 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
}
static Bool
-I810MapMMIO(ScrnInfoPtr pScrn)
+I810MapMMIO(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
struct pci_device *const device = pI810->PciInfo;
int err;
@@ -669,7 +669,7 @@ I810MapMMIO(ScrnInfoPtr pScrn)
(void **) &pI810->MMIOBase);
if (err)
{
- xf86DrvMsg (pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
"Unable to map mmio BAR. %s (%d)\n",
strerror (err), err);
return FALSE;
@@ -678,13 +678,13 @@ I810MapMMIO(ScrnInfoPtr pScrn)
}
static Bool
-I810MapMem(ScrnInfoPtr pScrn)
+I810MapMem(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
struct pci_device *const device = pI810->PciInfo;
int err;
- if (!I810MapMMIO(pScrn))
+ if (!I810MapMMIO(scrn))
return FALSE;
err = pci_device_map_range (device,
@@ -694,7 +694,7 @@ I810MapMem(ScrnInfoPtr pScrn)
(void **) &pI810->FbBase);
if (err)
{
- xf86DrvMsg (pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
"Unable to map frame buffer BAR. %s (%d)\n",
strerror (err), err);
return FALSE;
@@ -706,31 +706,31 @@ I810MapMem(ScrnInfoPtr pScrn)
}
static void
-I810UnmapMMIO(ScrnInfoPtr pScrn)
+I810UnmapMMIO(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
pci_device_unmap_range (pI810->PciInfo, pI810->MMIOBase, I810_REG_SIZE);
pI810->MMIOBase = NULL;
}
static Bool
-I810UnmapMem(ScrnInfoPtr pScrn)
+I810UnmapMem(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
pci_device_unmap_range (pI810->PciInfo, pI810->FbBase, pI810->FbMapSize);
pI810->FbBase = NULL;
- I810UnmapMMIO(pScrn);
+ I810UnmapMMIO(scrn);
return TRUE;
}
/* Famous last words
*/
void
-I810PrintErrorState(ScrnInfoPtr pScrn)
+I810PrintErrorState(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
ErrorF("pgetbl_ctl: 0x%lx pgetbl_err: 0x%lx\n",
(unsigned long) INREG(PGETBL_CTL), (unsigned long) INREG(PGE_ERR));
@@ -764,24 +764,24 @@ I810PrintErrorState(ScrnInfoPtr pScrn)
* mask out bits here - just read the registers.
*/
static void
-DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
+DoSave(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
Bool saveFonts)
{
I810Ptr pI810;
vgaHWPtr hwp;
int i;
- pI810 = I810PTR(pScrn);
- hwp = VGAHWPTR(pScrn);
+ pI810 = I810PTR(scrn);
+ hwp = VGAHWPTR(scrn);
/*
* This function will handle creating the data structure and filling
* in the generic VGA portion.
*/
if (saveFonts)
- vgaHWSave(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP);
+ vgaHWSave(scrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP);
else
- vgaHWSave(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
+ vgaHWSave(scrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
/*
* The port I/O code necessary to read in the extended registers
@@ -819,21 +819,21 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
if ((i810Reg->LprbTail & TAIL_ADDR) != (i810Reg->LprbHead & HEAD_ADDR) &&
i810Reg->LprbLen & RING_VALID) {
- I810PrintErrorState(pScrn);
+ I810PrintErrorState(scrn);
FatalError("Active ring not flushed\n");
}
}
static void
-I810Save(ScrnInfoPtr pScrn)
+I810Save(ScrnInfoPtr scrn)
{
vgaHWPtr hwp;
I810Ptr pI810;
uint32_t temp;
- hwp = VGAHWPTR(pScrn);
- pI810 = I810PTR(pScrn);
- DoSave(pScrn, &hwp->SavedReg, &pI810->SavedReg, TRUE);
+ hwp = VGAHWPTR(scrn);
+ pI810 = I810PTR(scrn);
+ DoSave(scrn, &hwp->SavedReg, &pI810->SavedReg, TRUE);
temp = INREG(MEMMODE);
temp |= 4;
@@ -905,7 +905,7 @@ i810PrintMode(vgaRegPtr vgaReg, I810RegPtr mode)
}
static void
-DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
+DoRestore(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
Bool restoreFonts)
{
I810Ptr pI810;
@@ -914,15 +914,15 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
unsigned int itemp;
int i;
- pI810 = I810PTR(pScrn);
- hwp = VGAHWPTR(pScrn);
+ pI810 = I810PTR(scrn);
+ hwp = VGAHWPTR(scrn);
if (I810_DEBUG & DEBUG_VERBOSE_VGA) {
ErrorF("Setting mode in I810Restore:\n");
i810PrintMode(vgaReg, i810Reg);
}
- vgaHWProtect(pScrn, TRUE);
+ vgaHWProtect(scrn, TRUE);
usleep(50000);
@@ -966,9 +966,9 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
* restore clock-select bits.
*/
if (restoreFonts)
- vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS | VGA_SR_MODE | VGA_SR_CMAP);
+ vgaHWRestore(scrn, vgaReg, VGA_SR_FONTS | VGA_SR_MODE | VGA_SR_CMAP);
else
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
+ vgaHWRestore(scrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
hwp->writeCrtc(hwp, EXT_VERT_TOTAL, i810Reg->ExtVertTotal);
hwp->writeCrtc(hwp, EXT_VERT_DISPLAY, i810Reg->ExtVertDispEnd);
@@ -1081,13 +1081,13 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
if (!(vgaReg->Attribute[0x10] & 0x1)) {
usleep(50000);
if (restoreFonts)
- vgaHWRestore(pScrn, vgaReg,
+ vgaHWRestore(scrn, vgaReg,
VGA_SR_FONTS | VGA_SR_MODE | VGA_SR_CMAP);
else
- vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
+ vgaHWRestore(scrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
}
- vgaHWProtect(pScrn, FALSE);
+ vgaHWProtect(scrn, FALSE);
temp = hwp->readCrtc(hwp, IO_CTNL);
temp &= ~(EXTENDED_ATTR_CNTL | EXTENDED_CRTC_CNTL);
@@ -1096,10 +1096,10 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
}
static void
-I810SetRingRegs(ScrnInfoPtr pScrn)
+I810SetRingRegs(ScrnInfoPtr scrn)
{
unsigned int itemp;
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
OUTREG(LP_RING + RING_TAIL, 0);
OUTREG(LP_RING + RING_HEAD, 0);
@@ -1116,15 +1116,15 @@ I810SetRingRegs(ScrnInfoPtr pScrn)
}
static void
-I810Restore(ScrnInfoPtr pScrn)
+I810Restore(ScrnInfoPtr scrn)
{
vgaHWPtr hwp;
I810Ptr pI810;
- hwp = VGAHWPTR(pScrn);
- pI810 = I810PTR(pScrn);
+ hwp = VGAHWPTR(scrn);
+ pI810 = I810PTR(scrn);
- DoRestore(pScrn, &hwp->SavedReg, &pI810->SavedReg, TRUE);
+ DoRestore(scrn, &hwp->SavedReg, &pI810->SavedReg, TRUE);
}
/*
@@ -1141,9 +1141,9 @@ I810Restore(ScrnInfoPtr pScrn)
(double)m / ((double)n * (1 << p)) * 4 * REF_FREQ
static void
-I810CalcVCLK(ScrnInfoPtr pScrn, double freq)
+I810CalcVCLK(ScrnInfoPtr scrn, double freq)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
I810RegPtr i810Reg = &pI810->ModeReg;
int m, n, p;
double f_out;
@@ -1188,7 +1188,7 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq)
i810Reg->VideoClk2_N = (n_best - 2) & 0x3FF;
i810Reg->VideoClk2_DivisorSel = (p_best << 4);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
+ xf86DrvMsgVerb(scrn->scrnIndex, X_INFO, 3,
"Setting dot clock to %.1f MHz " "[ 0x%x 0x%x 0x%x ] "
"[ %d %d %d ]\n", CALC_VCLK(m_best, n_best, p_best),
i810Reg->VideoClk2_M, i810Reg->VideoClk2_N,
@@ -1196,36 +1196,36 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq)
}
static Bool
-I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
+I810SetMode(ScrnInfoPtr scrn, DisplayModePtr mode)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
I810RegPtr i810Reg = &pI810->ModeReg;
- vgaRegPtr pVga = &VGAHWPTR(pScrn)->ModeReg;
+ vgaRegPtr pVga = &VGAHWPTR(scrn)->ModeReg;
double dclk = mode->Clock / 1000.0;
- switch (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
- pVga->CRTC[0x13] = pScrn->displayWidth >> 3;
- i810Reg->ExtOffset = pScrn->displayWidth >> 11;
+ pVga->CRTC[0x13] = scrn->displayWidth >> 3;
+ i810Reg->ExtOffset = scrn->displayWidth >> 11;
i810Reg->PixelPipeCfg1 = DISPLAY_8BPP_MODE;
i810Reg->BitBLTControl = COLEXP_8BPP;
break;
case 16:
- if (pScrn->weight.green == 5) {
+ if (scrn->weight.green == 5) {
i810Reg->PixelPipeCfg1 = DISPLAY_15BPP_MODE;
} else {
i810Reg->PixelPipeCfg1 = DISPLAY_16BPP_MODE;
}
- pVga->CRTC[0x13] = pScrn->displayWidth >> 2;
- i810Reg->ExtOffset = pScrn->displayWidth >> 10;
+ pVga->CRTC[0x13] = scrn->displayWidth >> 2;
+ i810Reg->ExtOffset = scrn->displayWidth >> 10;
i810Reg->BitBLTControl = COLEXP_16BPP;
/* Enable Palette Programming for Direct Color visuals. -jens */
i810Reg->PixelPipeCfg2 = DISPLAY_GAMMA_ENABLE;
break;
case 24:
- pVga->CRTC[0x13] = (pScrn->displayWidth * 3) >> 3;
- i810Reg->ExtOffset = (pScrn->displayWidth * 3) >> 11;
+ pVga->CRTC[0x13] = (scrn->displayWidth * 3) >> 3;
+ i810Reg->ExtOffset = (scrn->displayWidth * 3) >> 11;
i810Reg->PixelPipeCfg1 = DISPLAY_24BPP_MODE;
i810Reg->BitBLTControl = COLEXP_24BPP;
@@ -1310,13 +1310,13 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
* Calculate the VCLK that most closely matches the requested dot
* clock.
*/
- I810CalcVCLK(pScrn, dclk);
+ I810CalcVCLK(scrn, dclk);
/* Since we program the clocks ourselves, always use VCLK2. */
pVga->MiscOutReg |= 0x0C;
/* Calculate the FIFO Watermark and Burst Length. */
- i810Reg->LMI_FIFO_Watermark = I810CalcWatermark(pScrn, dclk, FALSE);
+ i810Reg->LMI_FIFO_Watermark = I810CalcWatermark(scrn, dclk, FALSE);
/* Setup the ring buffer */
i810Reg->LprbTail = 0;
@@ -1333,36 +1333,36 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
static Bool
-I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+I810ModeInit(ScrnInfoPtr scrn, DisplayModePtr mode)
{
vgaHWPtr hwp;
I810Ptr pI810;
- hwp = VGAHWPTR(pScrn);
- pI810 = I810PTR(pScrn);
+ hwp = VGAHWPTR(scrn);
+ pI810 = I810PTR(scrn);
vgaHWUnlock(hwp);
- if (!vgaHWInit(pScrn, mode))
+ if (!vgaHWInit(scrn, mode))
return FALSE;
- pScrn->vtSema = TRUE;
+ scrn->vtSema = TRUE;
- if (!I810SetMode(pScrn, mode))
+ if (!I810SetMode(scrn, mode))
return FALSE;
#ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
+ DRILock(screenInfo.screens[scrn->scrnIndex], 0);
pI810->LockHeld = 1;
}
#endif
- DoRestore(pScrn, &hwp->ModeReg, &pI810->ModeReg, FALSE);
+ DoRestore(scrn, &hwp->ModeReg, &pI810->ModeReg, FALSE);
#ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
+ DRIUnlock(screenInfo.screens[scrn->scrnIndex]);
pI810->LockHeld = 0;
}
#endif
@@ -1371,14 +1371,14 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
static void
-I810LoadPalette15(ScrnInfoPtr pScrn, int numColors, int *indices,
+I810LoadPalette15(ScrnInfoPtr scrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
{
vgaHWPtr hwp;
int i, j, index;
unsigned char r, g, b;
- hwp = VGAHWPTR(pScrn);
+ hwp = VGAHWPTR(scrn);
for (i = 0; i < numColors; i++) {
index = indices[i];
@@ -1395,14 +1395,14 @@ I810LoadPalette15(ScrnInfoPtr pScrn, int numColors, int *indices,
}
static void
-I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
+I810LoadPalette16(ScrnInfoPtr scrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
{
vgaHWPtr hwp;
int i, index;
unsigned char r, g, b;
- hwp = VGAHWPTR(pScrn);
+ hwp = VGAHWPTR(scrn);
/* Load all four entries in each of the 64 color ranges. -jens */
for (i = 0; i < numColors; i++) {
@@ -1459,14 +1459,14 @@ I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
}
static void
-I810LoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices,
+I810LoadPalette24(ScrnInfoPtr scrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
{
vgaHWPtr hwp;
int i, index;
unsigned char r, g, b;
- hwp = VGAHWPTR(pScrn);
+ hwp = VGAHWPTR(scrn);
for (i = 0; i < numColors; i++) {
index = indices[i];
@@ -1481,9 +1481,9 @@ I810LoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices,
}
Bool
-I810AllocateFront(ScrnInfoPtr pScrn)
+I810AllocateFront(ScrnInfoPtr scrn)
{
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
int cache_lines = -1;
if (pI810->DoneFrontAlloc)
@@ -1492,16 +1492,16 @@ I810AllocateFront(ScrnInfoPtr pScrn)
memset(&(pI810->FbMemBox), 0, sizeof(BoxRec));
/* Alloc FrontBuffer/Ring/Accel memory */
pI810->FbMemBox.x1 = 0;
- pI810->FbMemBox.x2 = pScrn->displayWidth;
+ pI810->FbMemBox.x2 = scrn->displayWidth;
pI810->FbMemBox.y1 = 0;
- pI810->FbMemBox.y2 = pScrn->virtualY;
+ pI810->FbMemBox.y2 = scrn->virtualY;
xf86GetOptValInteger(pI810->Options, OPTION_CACHE_LINES, &cache_lines);
if (cache_lines < 0) {
/* make sure there is enough for two DVD sized YUV buffers */
- cache_lines = (pScrn->depth == 24) ? 256 : 384;
- if (pScrn->displayWidth <= 1024)
+ cache_lines = (scrn->depth == 24) ? 256 : 384;
+ if (scrn->displayWidth <= 1024)
cache_lines *= 2;
}
/* Make sure there's enough space for cache_lines.
@@ -1517,9 +1517,9 @@ I810AllocateFront(ScrnInfoPtr pScrn)
{
int maxCacheLines;
- maxCacheLines = (pScrn->videoRam * 1024 /
- (pScrn->bitsPerPixel / 8) /
- pScrn->displayWidth) - pScrn->virtualY;
+ maxCacheLines = (scrn->videoRam * 1024 /
+ (scrn->bitsPerPixel / 8) /
+ scrn->displayWidth) - scrn->virtualY;
if (maxCacheLines < 0)
maxCacheLines = 0;
if (cache_lines > maxCacheLines)
@@ -1527,7 +1527,7 @@ I810AllocateFront(ScrnInfoPtr pScrn)
}
pI810->FbMemBox.y2 += cache_lines;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Adding %i scanlines for pixmap caching\n", cache_lines);
/* Reserve room for the framebuffer and pixcache. Put at the top
@@ -1538,7 +1538,7 @@ I810AllocateFront(ScrnInfoPtr pScrn)
if (!I810AllocLow(&(pI810->FrontBuffer),
&(pI810->SysMem),
ALIGN((pI810->FbMemBox.x2 * pI810->FbMemBox.y2 * pI810->cpp), 4096))) {
- xf86DrvMsg(pScrn->scrnIndex,
+ xf86DrvMsg(scrn->scrnIndex,
X_WARNING, "Framebuffer allocation failed\n");
return FALSE;
}
@@ -1551,16 +1551,16 @@ I810AllocateFront(ScrnInfoPtr pScrn)
pI810->LpRing->tail = 0;
pI810->LpRing->space = 0;
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Ring buffer allocation failed\n");
return (FALSE);
}
if (I810AllocLow(&pI810->Scratch, &(pI810->SysMem), 64 * 1024) ||
I810AllocLow(&pI810->Scratch, &(pI810->SysMem), 16 * 1024)) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocated Scratch Memory\n");
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allocated Scratch Memory\n");
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Scratch memory allocation failed\n");
return (FALSE);
}
@@ -1572,18 +1572,18 @@ I810AllocateFront(ScrnInfoPtr pScrn)
static Bool
I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
{
- ScrnInfoPtr pScrn;
+ ScrnInfoPtr scrn;
vgaHWPtr hwp;
I810Ptr pI810;
VisualPtr visual;
- pScrn = xf86Screens[pScreen->myNum];
- pI810 = I810PTR(pScrn);
- hwp = VGAHWPTR(pScrn);
+ scrn = xf86Screens[pScreen->myNum];
+ pI810 = I810PTR(scrn);
+ hwp = VGAHWPTR(scrn);
pI810->LpRing = calloc(sizeof(I810RingBuffer),1);
if (!pI810->LpRing) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Could not allocate lpring data structure.\n");
return FALSE;
}
@@ -1591,8 +1591,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
miClearVisualTypes();
/* Re-implemented Direct Color support, -jens */
- if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
- pScrn->rgbBits, pScrn->defaultVisual))
+ if (!miSetVisualTypes(scrn->depth, miGetDefaultVisualMask(scrn->depth),
+ scrn->rgbBits, scrn->defaultVisual))
return FALSE;
if (!miSetPixmapDepths())
@@ -1627,47 +1627,47 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#else
pI810->directRenderingEnabled = FALSE;
- if (!I810AllocateGARTMemory(pScrn))
+ if (!I810AllocateGARTMemory(scrn))
return FALSE;
- if (!I810AllocateFront(pScrn))
+ if (!I810AllocateFront(scrn))
return FALSE;
#endif
- if (!I810MapMem(pScrn))
+ if (!I810MapMem(scrn))
return FALSE;
- pScrn->memPhysBase = (unsigned long)pI810->LinearAddr;
- pScrn->fbOffset = 0;
+ scrn->memPhysBase = (unsigned long)pI810->LinearAddr;
+ scrn->fbOffset = 0;
vgaHWSetMmioFuncs(hwp, pI810->MMIOBase, 0);
vgaHWGetIOBase(hwp);
- if (!vgaHWMapMem(pScrn))
+ if (!vgaHWMapMem(scrn))
return FALSE;
- I810Save(pScrn);
- if (!I810ModeInit(pScrn, pScrn->currentMode))
+ I810Save(scrn);
+ if (!I810ModeInit(scrn, scrn->currentMode))
return FALSE;
I810SaveScreen(pScreen, FALSE);
- I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ I810AdjustFrame(scrnIndex, scrn->frameX0, scrn->frameY0, 0);
- if (!fbScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
- pScrn->virtualX, pScrn->virtualY,
- pScrn->xDpi, pScrn->yDpi,
- pScrn->displayWidth, pScrn->bitsPerPixel))
+ if (!fbScreenInit(pScreen, pI810->FbBase + scrn->fbOffset,
+ scrn->virtualX, scrn->virtualY,
+ scrn->xDpi, scrn->yDpi,
+ scrn->displayWidth, scrn->bitsPerPixel))
return FALSE;
- if (pScrn->bitsPerPixel > 8) {
+ if (scrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
visual = pScreen->visuals + pScreen->numVisuals;
while (--visual >= pScreen->visuals) {
if ((visual->class | DynamicClass) == DirectColor) {
- visual->offsetRed = pScrn->offset.red;
- visual->offsetGreen = pScrn->offset.green;
- visual->offsetBlue = pScrn->offset.blue;
- visual->redMask = pScrn->mask.red;
- visual->greenMask = pScrn->mask.green;
- visual->blueMask = pScrn->mask.blue;
+ visual->offsetRed = scrn->offset.red;
+ visual->offsetGreen = scrn->offset.green;
+ visual->offsetBlue = scrn->offset.blue;
+ visual->redMask = scrn->mask.red;
+ visual->greenMask = scrn->mask.green;
+ visual->blueMask = scrn->mask.blue;
}
}
}
@@ -1684,9 +1684,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!pI810->directRenderingEnabled) {
pI810->DoneFrontAlloc = FALSE;
- if (!I810AllocateGARTMemory(pScrn))
+ if (!I810AllocateGARTMemory(scrn))
return FALSE;
- if (!I810AllocateFront(pScrn))
+ if (!I810AllocateFront(scrn))
return FALSE;
}
#endif
@@ -1696,20 +1696,20 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#endif
if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to init memory manager\n");
return FALSE;
}
if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
if (pI810->LpRing->mem.Size != 0) {
- I810SetRingRegs(pScrn);
+ I810SetRingRegs(scrn);
if (!I810AccelInit(pScreen)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Hardware acceleration initialization failed\n");
} else /* PK added 16.02.2004 */
- I810EmitFlush(pScrn);
+ I810EmitFlush(scrn);
}
}
@@ -1721,7 +1721,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) {
if (!I810CursorInit(pScreen)) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
}
}
@@ -1730,8 +1730,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
/* Use driver specific palette load routines for Direct Color support. -jens */
- if (pScrn->bitsPerPixel == 16) {
- if (pScrn->depth == 15) {
+ if (scrn->bitsPerPixel == 16) {
+ if (scrn->depth == 15) {
if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette15, NULL,
CMAP_PALETTED_TRUECOLOR |
CMAP_RELOAD_ON_MODE_SWITCH))
@@ -1769,9 +1769,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#endif
if (pI810->directRenderingEnabled) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Direct rendering enabled\n");
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "Direct rendering enabled\n");
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Direct rendering disabled\n");
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Direct rendering disabled\n");
}
pScreen->SaveScreen = I810SaveScreen;
@@ -1779,7 +1779,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pScreen->CloseScreen = I810CloseScreen;
if (serverGeneration == 1)
- xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+ xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options);
return TRUE;
}
@@ -1787,9 +1787,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Bool
I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
#if 0
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
#endif
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
ErrorF("I810SwitchMode %p %x\n", (void *)mode, flags);
@@ -1812,17 +1812,17 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
# endif
if (pI810->AccelInfoRec != NULL) {
- I810RefreshRing(pScrn);
- I810Sync(pScrn);
+ I810RefreshRing(scrn);
+ I810Sync(scrn);
pI810->AccelInfoRec->NeedToSync = FALSE;
}
- I810Restore(pScrn);
+ I810Restore(scrn);
# ifdef HAVE_DRI1
if (pI810->directRenderingEnabled) {
- if (!I810DRILeave(pScrn))
+ if (!I810DRILeave(scrn))
return FALSE;
- if (!I810DRIEnter(pScrn))
+ if (!I810DRIEnter(scrn))
return FALSE;
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
@@ -1832,33 +1832,33 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
# endif
#endif
- return I810ModeInit(pScrn, mode);
+ return I810ModeInit(scrn, mode);
}
void
I810AdjustFrame(int scrnIndex, int x, int y, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- I810Ptr pI810 = I810PTR(pScrn);
- vgaHWPtr hwp = VGAHWPTR(pScrn);
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ I810Ptr pI810 = I810PTR(scrn);
+ vgaHWPtr hwp = VGAHWPTR(scrn);
int Base;
#if 1
if (pI810->showCache) {
int lastline = pI810->FbMapSize /
- ((pScrn->displayWidth * pScrn->bitsPerPixel) / 8);
- lastline -= pScrn->currentMode->VDisplay;
+ ((scrn->displayWidth * scrn->bitsPerPixel) / 8);
+ lastline -= scrn->currentMode->VDisplay;
if (y > 0)
- y += pScrn->currentMode->VDisplay;
+ y += scrn->currentMode->VDisplay;
if (y > lastline) y = lastline;
}
#endif
- Base = (y * pScrn->displayWidth + x) >> 2;
+ Base = (y * scrn->displayWidth + x) >> 2;
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
ErrorF("I810AdjustFrame %d,%d %x\n", x, y, flags);
- switch (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
break;
case 16:
@@ -1890,20 +1890,20 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
static Bool
I810EnterVT(int scrnIndex, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
#ifdef HAVE_DRI1
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
#endif
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("\n\nENTER VT\n");
- if (!I810BindGARTMemory(pScrn)) {
+ if (!I810BindGARTMemory(scrn)) {
return FALSE;
}
#ifdef HAVE_DRI1
- if (!I810DRIEnter(pScrn)) {
+ if (!I810DRIEnter(scrn)) {
return FALSE;
}
if (pI810->directRenderingEnabled) {
@@ -1914,18 +1914,18 @@ I810EnterVT(int scrnIndex, int flags)
}
#endif
- if (!I810ModeInit(pScrn, pScrn->currentMode))
+ if (!I810ModeInit(scrn, scrn->currentMode))
return FALSE;
- I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ I810AdjustFrame(scrnIndex, scrn->frameX0, scrn->frameY0, 0);
return TRUE;
}
static void
I810LeaveVT(int scrnIndex, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- I810Ptr pI810 = I810PTR(pScrn);
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ vgaHWPtr hwp = VGAHWPTR(scrn);
+ I810Ptr pI810 = I810PTR(scrn);
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("\n\n\nLeave VT\n");
@@ -1940,16 +1940,16 @@ I810LeaveVT(int scrnIndex, int flags)
#endif
if (pI810->AccelInfoRec != NULL) {
- I810RefreshRing(pScrn);
- I810Sync(pScrn);
+ I810RefreshRing(scrn);
+ I810Sync(scrn);
pI810->AccelInfoRec->NeedToSync = FALSE;
}
- I810Restore(pScrn);
+ I810Restore(scrn);
- if (!I810UnbindGARTMemory(pScrn))
+ if (!I810UnbindGARTMemory(scrn))
return;
#ifdef HAVE_DRI1
- if (!I810DRILeave(pScrn))
+ if (!I810DRILeave(scrn))
return;
#endif
@@ -1959,18 +1959,18 @@ I810LeaveVT(int scrnIndex, int flags)
static Bool
I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- I810Ptr pI810 = I810PTR(pScrn);
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ vgaHWPtr hwp = VGAHWPTR(scrn);
+ I810Ptr pI810 = I810PTR(scrn);
XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
- if (pScrn->vtSema == TRUE) {
+ if (scrn->vtSema == TRUE) {
if (pI810->AccelInfoRec != NULL) {
- I810RefreshRing(pScrn);
- I810Sync(pScrn);
+ I810RefreshRing(scrn);
+ I810Sync(scrn);
pI810->AccelInfoRec->NeedToSync = FALSE;
}
- I810Restore(pScrn);
+ I810Restore(scrn);
vgaHWLock(hwp);
}
#ifdef HAVE_DRI1
@@ -1980,14 +1980,14 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
}
#endif
- if (pScrn->vtSema == TRUE) {
- I810UnbindGARTMemory(pScrn);
- I810Restore(pScrn);
+ if (scrn->vtSema == TRUE) {
+ I810UnbindGARTMemory(scrn);
+ I810Restore(scrn);
vgaHWLock(hwp);
}
- I810UnmapMem(pScrn);
- vgaHWUnmapMem(pScrn);
+ I810UnmapMem(scrn);
+ vgaHWUnmapMem(scrn);
if (pI810->ScanlineColorExpandBuffers) {
free(pI810->ScanlineColorExpandBuffers);
@@ -2020,7 +2020,7 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
free(pI810->LpRing);
pI810->LpRing = NULL;
- pScrn->vtSema = FALSE;
+ scrn->vtSema = FALSE;
pScreen->CloseScreen = pI810->CloseScreen;
return (*pScreen->CloseScreen) (scrnIndex, pScreen);
}
@@ -2053,7 +2053,7 @@ I810SaveScreen(ScreenPtr pScreen, Bool unblack)
}
static void
-I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
+I810DisplayPowerManagementSet(ScrnInfoPtr scrn, int PowerManagementMode,
int flags)
{
I810Ptr pI810;
@@ -2061,7 +2061,7 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
int DPMSSyncSelect = 0;
vgaHWPtr hwp;
- pI810 = I810PTR(pScrn);
+ pI810 = I810PTR(scrn);
switch (PowerManagementMode) {
case DPMSModeOn:
/* Screen: On; HSync: On, VSync: On */
@@ -2085,7 +2085,7 @@ I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
break;
}
- hwp = VGAHWPTR(pScrn);
+ hwp = VGAHWPTR(scrn);
/* Turn the screen on/off */
SEQ01 |= hwp->readSeq(hwp, 0x01) & ~0x20;