xaa: use xf86ReturnOptValBool instead of xf86IsOptionSet

The latter doesn't return the option's value, just whether it's present
in the configuration.
This commit is contained in:
Julien Cristau 2008-03-22 17:31:08 +01:00
parent 6b9d2bb1f7
commit 4217ba0cf0

View File

@ -181,7 +181,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForScreenToScreenCopy && if(infoRec->SetupForScreenToScreenCopy &&
infoRec->SubsequentScreenToScreenCopy && infoRec->SubsequentScreenToScreenCopy &&
!xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COPY)) { !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COPY, FALSE)) {
HaveScreenToScreenCopy = TRUE; HaveScreenToScreenCopy = TRUE;
} else { } else {
infoRec->ScreenToScreenCopyFlags = 0; infoRec->ScreenToScreenCopyFlags = 0;
@ -192,10 +192,10 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
/**** Solid Filled Rects ****/ /**** Solid Filled Rects ****/
if(infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect && if(infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect &&
!xf86IsOptionSet(options, XAAOPT_SOLID_FILL_RECT)) { !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_RECT, FALSE)) {
HaveSolidFillRect = TRUE; HaveSolidFillRect = TRUE;
if(infoRec->SubsequentSolidFillTrap && if(infoRec->SubsequentSolidFillTrap &&
!xf86IsOptionSet(options, XAAOPT_SOLID_FILL_TRAP)) !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_TRAP, FALSE))
HaveSolidFillTrap = TRUE; HaveSolidFillTrap = TRUE;
else else
infoRec->SubsequentSolidFillTrap = NULL; infoRec->SubsequentSolidFillTrap = NULL;
@ -210,10 +210,11 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForSolidLine) { if(infoRec->SetupForSolidLine) {
if(infoRec->SubsequentSolidTwoPointLine && if(infoRec->SubsequentSolidTwoPointLine &&
!xf86IsOptionSet(options, XAAOPT_SOLID_TWO_POINT_LINE)) !xf86ReturnOptValBool(options,
XAAOPT_SOLID_TWO_POINT_LINE, FALSE))
HaveSolidTwoPointLine = TRUE; HaveSolidTwoPointLine = TRUE;
if(infoRec->SubsequentSolidBresenhamLine && if(infoRec->SubsequentSolidBresenhamLine &&
!xf86IsOptionSet(options, XAAOPT_SOLID_BRESENHAM_LINE)) { !xf86ReturnOptValBool(options, XAAOPT_SOLID_BRESENHAM_LINE, FALSE)) {
HaveSolidBresenhamLine = TRUE; HaveSolidBresenhamLine = TRUE;
if(infoRec->SolidBresenhamLineErrorTermBits) if(infoRec->SolidBresenhamLineErrorTermBits)
@ -222,7 +223,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
} }
if(infoRec->SubsequentSolidHorVertLine && if(infoRec->SubsequentSolidHorVertLine &&
!xf86IsOptionSet(options, XAAOPT_SOLID_HORVERT_LINE)) !xf86ReturnOptValBool(options,
XAAOPT_SOLID_HORVERT_LINE, FALSE))
HaveSolidHorVertLine = TRUE; HaveSolidHorVertLine = TRUE;
else if(HaveSolidTwoPointLine) { else if(HaveSolidTwoPointLine) {
infoRec->SubsequentSolidHorVertLine = infoRec->SubsequentSolidHorVertLine =
@ -265,10 +267,14 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForMono8x8PatternFill && if(infoRec->SetupForMono8x8PatternFill &&
infoRec->SubsequentMono8x8PatternFillRect && infoRec->SubsequentMono8x8PatternFillRect &&
!xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_RECT)) { !xf86ReturnOptValBool(options,
XAAOPT_MONO_8x8_PATTERN_FILL_RECT,
FALSE)) {
HaveMono8x8PatternFillRect = TRUE; HaveMono8x8PatternFillRect = TRUE;
if(infoRec->SubsequentMono8x8PatternFillTrap && if(infoRec->SubsequentMono8x8PatternFillTrap &&
!xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_TRAP)) !xf86ReturnOptValBool(options,
XAAOPT_MONO_8x8_PATTERN_FILL_TRAP,
FALSE))
HaveMono8x8PatternFillTrap = TRUE; HaveMono8x8PatternFillTrap = TRUE;
if(infoRec->Mono8x8PatternFillFlags & if(infoRec->Mono8x8PatternFillFlags &
@ -318,10 +324,12 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) { if(infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) {
if(infoRec->SubsequentDashedTwoPointLine && if(infoRec->SubsequentDashedTwoPointLine &&
!xf86IsOptionSet(options, XAAOPT_DASHED_TWO_POINT_LINE)) !xf86ReturnOptValBool(options, XAAOPT_DASHED_TWO_POINT_LINE,
FALSE))
HaveDashedTwoPointLine = TRUE; HaveDashedTwoPointLine = TRUE;
if(infoRec->SubsequentDashedBresenhamLine && if(infoRec->SubsequentDashedBresenhamLine &&
!xf86IsOptionSet(options, XAAOPT_DASHED_BRESENHAM_LINE)) { !xf86ReturnOptValBool(options, XAAOPT_DASHED_BRESENHAM_LINE,
FALSE)) {
HaveDashedBresenhamLine = TRUE; HaveDashedBresenhamLine = TRUE;
if(infoRec->DashedBresenhamLineErrorTermBits) if(infoRec->DashedBresenhamLineErrorTermBits)
@ -345,10 +353,11 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForColor8x8PatternFill && if(infoRec->SetupForColor8x8PatternFill &&
infoRec->SubsequentColor8x8PatternFillRect && infoRec->SubsequentColor8x8PatternFillRect &&
!xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT)) { !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT, FALSE)) {
HaveColor8x8PatternFillRect = TRUE; HaveColor8x8PatternFillRect = TRUE;
if(infoRec->SubsequentColor8x8PatternFillTrap && if(infoRec->SubsequentColor8x8PatternFillTrap &&
!xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP)) !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP,
FALSE))
HaveColor8x8PatternFillTrap = TRUE; HaveColor8x8PatternFillTrap = TRUE;
else else
infoRec->SubsequentColor8x8PatternFillTrap = NULL; infoRec->SubsequentColor8x8PatternFillTrap = NULL;
@ -381,7 +390,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForCPUToScreenColorExpandFill && if(infoRec->SetupForCPUToScreenColorExpandFill &&
infoRec->ColorExpandBase && infoRec->ColorExpandBase &&
infoRec->SubsequentCPUToScreenColorExpandFill && infoRec->SubsequentCPUToScreenColorExpandFill &&
!xf86IsOptionSet(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL)) { !xf86ReturnOptValBool(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL,
FALSE)) {
int dwordsNeeded = pScrn->virtualX; int dwordsNeeded = pScrn->virtualX;
infoRec->ColorExpandRange >>= 2; /* convert to DWORDS */ infoRec->ColorExpandRange >>= 2; /* convert to DWORDS */
@ -406,7 +416,9 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
infoRec->SubsequentColorExpandScanline && infoRec->SubsequentColorExpandScanline &&
infoRec->ScanlineColorExpandBuffers && infoRec->ScanlineColorExpandBuffers &&
(infoRec->NumScanlineColorExpandBuffers > 0) && (infoRec->NumScanlineColorExpandBuffers > 0) &&
!xf86IsOptionSet(options, XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL)) { !xf86ReturnOptValBool(options,
XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
FALSE)) {
HaveScanlineColorExpansion = TRUE; HaveScanlineColorExpansion = TRUE;
} else { } else {
infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0; infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0;
@ -419,7 +431,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForScreenToScreenColorExpandFill && if(infoRec->SetupForScreenToScreenColorExpandFill &&
infoRec->SubsequentScreenToScreenColorExpandFill && infoRec->SubsequentScreenToScreenColorExpandFill &&
!xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL)) { !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL,
FALSE)) {
HaveScreenToScreenColorExpandFill = TRUE; HaveScreenToScreenColorExpandFill = TRUE;
if (!infoRec->CacheColorExpandDensity) if (!infoRec->CacheColorExpandDensity)
infoRec->CacheColorExpandDensity = 1; infoRec->CacheColorExpandDensity = 1;
@ -433,7 +446,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
if(infoRec->SetupForImageWrite && infoRec->ImageWriteBase && if(infoRec->SetupForImageWrite && infoRec->ImageWriteBase &&
infoRec->SubsequentImageWriteRect && infoRec->SubsequentImageWriteRect &&
!xf86IsOptionSet(options, XAAOPT_IMAGE_WRITE_RECT)) { !xf86ReturnOptValBool(options, XAAOPT_IMAGE_WRITE_RECT, FALSE)) {
infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */ infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */
if(infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED) if(infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED)
@ -452,7 +465,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
infoRec->SubsequentImageWriteScanline && infoRec->SubsequentImageWriteScanline &&
infoRec->ScanlineImageWriteBuffers && infoRec->ScanlineImageWriteBuffers &&
(infoRec->NumScanlineImageWriteBuffers > 0) && (infoRec->NumScanlineImageWriteBuffers > 0) &&
!xf86IsOptionSet(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT)) { !xf86ReturnOptValBool(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT,
FALSE)) {
HaveScanlineImageWriteRect = TRUE; HaveScanlineImageWriteRect = TRUE;
} else { } else {
infoRec->ScanlineImageWriteFlags = 0; infoRec->ScanlineImageWriteFlags = 0;
@ -518,7 +532,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0) #define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0)
if((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy && if((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy &&
!xf86IsOptionSet(options, XAAOPT_OFFSCREEN_PIXMAPS)) { !xf86ReturnOptValBool(options, XAAOPT_OFFSCREEN_PIXMAPS,
FALSE)) {
XAAMSG("\tOffscreen Pixmaps\n"); XAAMSG("\tOffscreen Pixmaps\n");
} else { } else {
infoRec->Flags &= ~OFFSCREEN_PIXMAPS; infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
@ -800,7 +815,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
/**** WriteBitmap ****/ /**** WriteBitmap ****/
if(infoRec->WriteBitmap && if(infoRec->WriteBitmap &&
!xf86IsOptionSet(options, XAAOPT_WRITE_BITMAP)) { !xf86ReturnOptValBool(options, XAAOPT_WRITE_BITMAP, FALSE)) {
XAAMSG("\tDriver provided WriteBitmap replacement\n"); XAAMSG("\tDriver provided WriteBitmap replacement\n");
} else if(HaveColorExpansion) { } else if(HaveColorExpansion) {
if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) { if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
@ -959,7 +974,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
/**** WritePixmap ****/ /**** WritePixmap ****/
if(infoRec->WritePixmap && if(infoRec->WritePixmap &&
!xf86IsOptionSet(options, XAAOPT_WRITE_PIXMAP)) { !xf86ReturnOptValBool(options, XAAOPT_WRITE_PIXMAP, FALSE)) {
XAAMSG("\tDriver provided WritePixmap replacement\n"); XAAMSG("\tDriver provided WritePixmap replacement\n");
} else if(HaveImageWriteRect) { } else if(HaveImageWriteRect) {
infoRec->WritePixmap = XAAWritePixmap; infoRec->WritePixmap = XAAWritePixmap;
@ -1433,7 +1448,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
else else
infoRec->Flags &= ~PIXMAP_CACHE; infoRec->Flags &= ~PIXMAP_CACHE;
if (xf86IsOptionSet(options, XAAOPT_PIXMAP_CACHE)) if (xf86ReturnOptValBool(options, XAAOPT_PIXMAP_CACHE, FALSE))
infoRec->Flags &= ~PIXMAP_CACHE; infoRec->Flags &= ~PIXMAP_CACHE;
if(infoRec->WriteMono8x8PatternToCache) {} if(infoRec->WriteMono8x8PatternToCache) {}