diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/smi.h | 9 | ||||
-rw-r--r-- | src/smi501_crtc.c | 6 | ||||
-rw-r--r-- | src/smi501_output.c | 8 | ||||
-rw-r--r-- | src/smi_crtc.c | 16 | ||||
-rw-r--r-- | src/smi_dga.c | 10 | ||||
-rw-r--r-- | src/smi_driver.c | 112 | ||||
-rw-r--r-- | src/smi_exa.c | 30 | ||||
-rw-r--r-- | src/smi_output.c | 22 | ||||
-rw-r--r-- | src/smi_video.c | 74 | ||||
-rw-r--r-- | src/smi_xaa.c | 4 | ||||
-rw-r--r-- | src/smilynx_crtc.c | 11 | ||||
-rw-r--r-- | src/smilynx_hw.c | 6 | ||||
-rw-r--r-- | src/smilynx_output.c | 22 |
13 files changed, 162 insertions, 168 deletions
@@ -291,20 +291,17 @@ extern int smi_indent; # define VERBLEV 1 # define ENTER() xf86ErrorFVerb(VERBLEV, "%*c %s\n",\ smi_indent++, '>', __FUNCTION__) -# define LEAVE() xf86ErrorFVerb(VERBLEV, "%*c %s\n",\ - --smi_indent, '<', __FUNCTION__) -# define RETURN(value) \ +# define LEAVE(value) \ do { \ xf86ErrorFVerb(VERBLEV, "%*c %s\n", \ --smi_indent, '<', __FUNCTION__); \ - return (value); \ + return __VA_ARGS__; \ } while (0) # define DEBUG(...) xf86ErrorFVerb(VERBLEV, __VA_ARGS__) #else # define VERBLEV 4 # define ENTER() /**/ -# define LEAVE() /**/ -# define RETURN(value) return (value) +# define LEAVE(...) return __VA_ARGS__ # define DEBUG(...) /**/ #endif diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c index 70f3b12..6175f62 100644 --- a/src/smi501_crtc.c +++ b/src/smi501_crtc.c @@ -653,7 +653,7 @@ SMI501_CrtcPreInit(ScrnInfoPtr pScrn) crtc0 = xf86CrtcCreate(pScrn, &SMI501_Crtc0Funcs); if (!crtc0) - RETURN(FALSE); + LEAVE(FALSE); crtc0->driver_private = &SMI501_Crtc0Priv; /* CRTC1 is CRT */ @@ -674,10 +674,10 @@ SMI501_CrtcPreInit(ScrnInfoPtr pScrn) crtc1 = xf86CrtcCreate(pScrn, &SMI501_Crtc1Funcs); if (!crtc1) - RETURN(FALSE); + LEAVE(FALSE); crtc1->driver_private = &SMI501_Crtc1Priv; } - RETURN(TRUE); + LEAVE(TRUE); } diff --git a/src/smi501_output.c b/src/smi501_output.c index 475c2d2..ee310d8 100644 --- a/src/smi501_output.c +++ b/src/smi501_output.c @@ -124,7 +124,7 @@ SMI501_OutputDetect_crt(xf86OutputPtr output) WRITE_SCR(pSmi, CRT_DETECT, mode->crt_detect.value); SMI501_WaitVSync(pSmi, 1); - RETURN(status); + LEAVE(status); } #endif @@ -147,7 +147,7 @@ SMI501_OutputPreInit(ScrnInfoPtr pScrn) output0 = xf86OutputCreate(pScrn, &SMI501_Output0Funcs, "LVDS"); if (!output0) - RETURN(FALSE); + LEAVE(FALSE); output0->possible_crtcs = 1 << 0; output0->possible_clones = 0; @@ -165,7 +165,7 @@ SMI501_OutputPreInit(ScrnInfoPtr pScrn) output1 = xf86OutputCreate(pScrn, &SMI501_Output1Funcs, "VGA"); if (!output1) - RETURN(FALSE); + LEAVE(FALSE); output1->possible_crtcs = 1 << 1; output1->possible_clones = 0; @@ -173,5 +173,5 @@ SMI501_OutputPreInit(ScrnInfoPtr pScrn) output1->doubleScanAllowed = FALSE; } - RETURN(TRUE); + LEAVE(TRUE); } diff --git a/src/smi_crtc.c b/src/smi_crtc.c index fa2b097..c84e4c2 100644 --- a/src/smi_crtc.c +++ b/src/smi_crtc.c @@ -49,7 +49,7 @@ SMI_CrtcLock (xf86CrtcPtr crtc) WaitIdle(); - RETURN(FALSE); + LEAVE(FALSE); } static void @@ -71,7 +71,7 @@ SMI_CrtcModeFixup(xf86CrtcPtr crtc, /* Nothing */ - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -138,7 +138,7 @@ SMI_CrtcShadowAllocate (xf86CrtcPtr crtc, int width, int height) result += offset * pSmi->Bpp; } - RETURN(result); + LEAVE(result); } static PixmapPtr @@ -152,7 +152,7 @@ SMI_CrtcShadowCreate (xf86CrtcPtr crtc, void *data, int width, int height) aligned_pitch = (width * pSmi->Bpp + 15) & ~15; - RETURN(GetScratchPixmapHeader(pScrn->pScreen,width,height,pScrn->depth, + LEAVE(GetScratchPixmapHeader(pScrn->pScreen,width,height,pScrn->depth, pScrn->bitsPerPixel,aligned_pitch,data)); } @@ -207,7 +207,7 @@ SMI_CrtcConfigResize(ScrnInfoPtr pScrn, if(!fbArea){ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "SMI_CrtcConfigResize: Not enough memory to resize the framebuffer\n"); - RETURN(FALSE); + LEAVE(FALSE); } if(pSmi->fbArea) @@ -243,7 +243,7 @@ SMI_CrtcConfigResize(ScrnInfoPtr pScrn, SMICRTC(crtc)->adjust_frame(crtc,crtc->x,crtc->y); } - RETURN(TRUE); + LEAVE(TRUE); } void @@ -280,8 +280,8 @@ SMI_CrtcPreInit(ScrnInfoPtr pScrn) xf86CrtcSetSizeRange(pScrn,128,128,4096,4096); if(SMI_MSOC_SERIES(pSmi->Chipset)){ - RETURN( SMI501_CrtcPreInit(pScrn) ); + LEAVE( SMI501_CrtcPreInit(pScrn) ); }else{ - RETURN( SMILynx_CrtcPreInit(pScrn) ); + LEAVE( SMILynx_CrtcPreInit(pScrn) ); } } diff --git a/src/smi_dga.c b/src/smi_dga.c index 32e6824..e0758ca 100644 --- a/src/smi_dga.c +++ b/src/smi_dga.c @@ -84,7 +84,7 @@ SMI_DGAInit(ScreenPtr pScreen) newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec)); if (newmodes == NULL) { xfree(modes); - RETURN(FALSE); + LEAVE(FALSE); } modes = newmodes; @@ -144,7 +144,7 @@ SMI_DGAInit(ScreenPtr pScreen) ret = DGAInit(pScreen, &SMI_DGAFuncs, modes, num); - RETURN(ret); + LEAVE(ret); } static Bool @@ -177,7 +177,7 @@ SMI_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) SMI_SwitchMode(index, pMode->mode, 0); } - RETURN(TRUE); + LEAVE(TRUE); } @@ -188,7 +188,7 @@ SMI_GetViewport(ScrnInfoPtr pScrn) ENTER(); - RETURN(pSmi->DGAViewportStatus); + LEAVE(pSmi->DGAViewportStatus); } static void @@ -274,6 +274,6 @@ SMI_OpenFramebuffer(ScrnInfoPtr pScrn, char **name, unsigned char **mem, *offset = 0; *flags = DGA_NEED_ROOT; - RETURN(TRUE); + LEAVE(TRUE); } diff --git a/src/smi_driver.c b/src/smi_driver.c index d8ba8ab..9a42bc3 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -370,7 +370,7 @@ SMI_GetRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = xnfcalloc(sizeof(SMIRec), 1); } - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -395,7 +395,7 @@ SMI_AvailableOptions(int chipid, int busid) { ENTER(); - RETURN(SMIOptions); + LEAVE(SMIOptions); } static void @@ -426,11 +426,11 @@ SMI_Probe(DriverPtr drv, int flags) if (numDevSections <= 0) /* There's no matching device section in the config file, so quit now. */ - RETURN(FALSE); + LEAVE(FALSE); #ifndef XSERVER_LIBPCIACCESS if (xf86GetPciVideoInfo() == NULL) - RETURN(FALSE); + LEAVE(FALSE); #endif numUsed = xf86MatchPciInstances(SILICONMOTION_NAME, PCI_SMI_VENDOR_ID, @@ -440,7 +440,7 @@ SMI_Probe(DriverPtr drv, int flags) /* Free it since we don't need that list after this */ xfree(devSections); if (numUsed <= 0) - RETURN(FALSE); + LEAVE(FALSE); if (flags & PROBE_DETECT) foundScreen = TRUE; @@ -473,7 +473,7 @@ SMI_Probe(DriverPtr drv, int flags) } xfree(usedChips); - RETURN(foundScreen); + LEAVE(foundScreen); } static Bool @@ -491,11 +491,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) * are supported. */ if (pScrn->numEntities > 1) - RETURN(FALSE); + LEAVE(FALSE); /* Allocate the SMIRec driverPrivate */ if (!SMI_GetRec(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); pSmi = SMIPTR(pScrn); /* Find the PCI slot for this screen */ @@ -518,13 +518,13 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (flags & PROBE_DETECT) { if (!IS_MSOC(pSmi)) SMI_ProbeDDC(pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index); - RETURN(TRUE); + LEAVE(TRUE); } if (pEnt->location.type != BUS_PCI || pEnt->resources) { xfree(pEnt); SMI_FreeRec(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index); @@ -534,7 +534,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (!IS_MSOC(pSmi)) { /* The vgahw module should be loaded here when needed */ if (!xf86LoadSubModule(pScrn, "vgahw")) - RETURN(FALSE); + LEAVE(FALSE); xf86LoaderReqSymLists(vgahwSymbols, NULL); @@ -542,21 +542,21 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) * Allocate a vgaHWRec */ if (!vgaHWGetHWRec(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); } /* * The first thing we should figure out is the depth, bpp, etc. */ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) - RETURN(FALSE); + LEAVE(FALSE); /* Check that the returned depth is one we support */ if (pScrn->depth != 8 && pScrn->depth != 16 && pScrn->depth != 24) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by this driver\n", pScrn->depth); - RETURN(FALSE); + LEAVE(FALSE); } @@ -565,7 +565,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given bpp (%d) is not supported by this driver\n", pScrn->bitsPerPixel); - RETURN(FALSE); + LEAVE(FALSE); } xf86PrintDepthBpp(pScrn); @@ -584,18 +584,18 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) #endif if (!xf86SetWeight(pScrn, zeros, masks)) - RETURN(FALSE); + LEAVE(FALSE); } if (!xf86SetDefaultVisual(pScrn, -1)) - RETURN(FALSE); + LEAVE(FALSE); /* We don't currently support DirectColor at > 8bpp */ if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual (%s) " "is not supported at depth %d\n", xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - RETURN(FALSE); + LEAVE(FALSE); } /* We use a programmable clock */ @@ -614,7 +614,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) /* Process the options */ if (!(pSmi->Options = xalloc(sizeof(SMIOptions)))) - RETURN(FALSE); + LEAVE(FALSE); memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options); @@ -759,13 +759,13 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->chipset == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not " "recognised\n", pSmi->Chipset); - RETURN(FALSE); + LEAVE(FALSE); } if (pSmi->Chipset < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not " "recognised\n", pScrn->chipset); - RETURN(FALSE); + LEAVE(FALSE); } xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); @@ -813,7 +813,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->bitsPerPixel != 16) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Dualhead only supported at " "depth 16\n"); - RETURN(FALSE); + LEAVE(FALSE); } } @@ -892,7 +892,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetGamma(pScrn, zeros)) { SMI_EnableVideo(pScrn); SMI_UnmapMem(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } } @@ -917,15 +917,15 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->clockRange.doubleScanAllowed = FALSE; if(!SMI_CrtcPreInit(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); if(!SMI_OutputPreInit(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); /* Only allow growing the screen dimensions if EXA is being used */ if (!xf86InitialConfiguration (pScrn, !pSmi->NoAccel && pSmi->useEXA)){ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); - RETURN(FALSE); + LEAVE(FALSE); } @@ -944,7 +944,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (xf86LoadSubModule(pScrn, "fb") == NULL) { SMI_FreeRec(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } xf86LoaderReqSymLists(fbSymbols, NULL); @@ -954,7 +954,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (!pSmi->useEXA) { if (!xf86LoadSubModule(pScrn, "xaa")) { SMI_FreeRec(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } xf86LoaderReqSymLists(xaaSymbols, NULL); } else { @@ -969,7 +969,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) &req, &errmaj, &errmin)) { LoaderErrorMsg(NULL, "exa", errmaj, errmin); SMI_FreeRec(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } xf86LoaderReqSymLists(exaSymbols, NULL); } @@ -979,11 +979,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (pSmi->HwCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { SMI_FreeRec(pScrn); - RETURN(FALSE); + LEAVE(FALSE); } } - RETURN(TRUE); + LEAVE(TRUE); } /* @@ -1011,17 +1011,17 @@ SMI_EnterVT(int scrnIndex, int flags) /* Do the CRTC independent initialization */ if(!SMI_HWInit(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); /* Initialize the chosen modes */ if (!xf86SetDesiredModes(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); /* Reset the grapics engine */ if (!pSmi->NoAccel) SMI_EngineReset(pScrn); - RETURN(TRUE); + LEAVE(TRUE); } /* @@ -1429,7 +1429,7 @@ SMI_MapMem(ScrnInfoPtr pScrn) ENTER(); if (pSmi->MapBase == NULL && SMI_MapMmio(pScrn) == FALSE) - RETURN(FALSE); + LEAVE(FALSE); pScrn->memPhysBase = PCI_REGION_BASE(pSmi->PciInfo, 0, REGION_MEM); @@ -1464,14 +1464,14 @@ SMI_MapMem(ScrnInfoPtr pScrn) result); if (err) - RETURN(FALSE); + LEAVE(FALSE); } #endif if (pSmi->FBBase == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: could not map framebuffer.\n"); - RETURN(FALSE); + LEAVE(FALSE); } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, @@ -1523,7 +1523,7 @@ SMI_MapMem(ScrnInfoPtr pScrn) if (xf86IsPrimaryPci(pSmi->PciInfo)) { hwp->MapSize = 0x10000; if (!vgaHWMapMem(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); pSmi->PrimaryVidMapped = TRUE; } } @@ -1531,7 +1531,7 @@ SMI_MapMem(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved: %08lX\n", (unsigned long)pSmi->FBReserved); - RETURN(TRUE); + LEAVE(TRUE); } /* UnMapMem - contains half of pre-4.0 EnterLeave function. The EnterLeave @@ -1591,7 +1591,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Map MMIO regs and framebuffer */ if (!SMI_MapMem(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); pEnt = xf86GetEntityInfo(pScrn->entityList[0]); @@ -1637,10 +1637,10 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) - RETURN(FALSE); + LEAVE(FALSE); if (!miSetPixmapDepths ()) - RETURN(FALSE); + LEAVE(FALSE); /* * Call the framebuffer layer's ScreenInit function @@ -1650,7 +1650,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pSmi->FBBase, pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth); if(!fbScreenInit(pScreen, pSmi->FBBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) - RETURN(FALSE); + LEAVE(FALSE); xf86SetBlackWhitePixels(pScreen); @@ -1675,7 +1675,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Do the CRTC independent initialization */ if(!SMI_HWInit(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); /* Unless using EXA, regardless or using XAA or not, needs offscreen * management at least for video. */ @@ -1700,14 +1700,14 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Initialize acceleration layer */ if (!pSmi->NoAccel) { if (pSmi->useEXA && !SMI_EXAInit(pScreen)) - RETURN(FALSE); + LEAVE(FALSE); else if (!pSmi->useEXA && !SMI_XAAInit(pScreen)) - RETURN(FALSE); + LEAVE(FALSE); } /* Initialize the chosen modes */ if (!xf86SetDesiredModes(pScrn)) - RETURN(FALSE); + LEAVE(FALSE); SMI_PrintRegs(pScrn); @@ -1756,14 +1756,14 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Initialise default colormap */ if (!miCreateDefColormap(pScreen)) - RETURN(FALSE); + LEAVE(FALSE); /* Initialize colormap layer. Must follow initialization of the default * colormap. And SetGamma call, else it will load palette with solid white. */ if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,SMI_LoadPalette, NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) - RETURN(FALSE); + LEAVE(FALSE); pScreen->SaveScreen = SMI_SaveScreen; pSmi->CloseScreen = pScreen->CloseScreen; @@ -1778,14 +1778,14 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) SMI_InitVideo(pScreen); if(!xf86CrtcScreenInit(pScreen)) - RETURN(FALSE); + LEAVE(FALSE); /* Report any unused options (only for the first generation) */ if (serverGeneration == 1) { xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } - RETURN(TRUE); + LEAVE(TRUE); } /* @@ -1848,7 +1848,7 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen) pScreen->CloseScreen = pSmi->CloseScreen; ret = (*pScreen->CloseScreen)(scrnIndex, pScreen); - RETURN(ret); + LEAVE(ret); } static void @@ -1870,7 +1870,7 @@ SMI_SaveScreen(ScreenPtr pScreen, int mode) pScrn->DPMSSet(pScrn, DPMSModeOff, 0); } - RETURN(TRUE); + LEAVE(TRUE); } void @@ -1900,7 +1900,7 @@ SMI_SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) if (!pSmi->NoAccel) SMI_EngineReset(pScrn); - RETURN(ret); + LEAVE(ret); } void @@ -2054,9 +2054,9 @@ SMI_HWInit(ScrnInfoPtr pScrn) ENTER(); if(IS_MSOC(pSmi)) - RETURN(SMI501_HWInit(pScrn)); + LEAVE(SMI501_HWInit(pScrn)); else - RETURN(SMILynx_HWInit(pScrn)); + LEAVE(SMILynx_HWInit(pScrn)); } void diff --git a/src/smi_exa.c b/src/smi_exa.c index c77ac7f..aeed606 100644 --- a/src/smi_exa.c +++ b/src/smi_exa.c @@ -88,7 +88,7 @@ SMI_EXAInit(ScreenPtr pScreen) if (!(pSmi->EXADriverPtr = exaDriverAlloc())) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate EXADriverRec.\n"); - RETURN(FALSE); + LEAVE(FALSE); } /* Require 2.1 semantics: @@ -166,13 +166,13 @@ SMI_EXAInit(ScreenPtr pScreen) if(!exaDriverInit(pScreen, pSmi->EXADriverPtr)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "exaDriverInit failed.\n"); - RETURN(FALSE); + LEAVE(FALSE); } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EXA Acceleration enabled.\n"); - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -224,7 +224,7 @@ SMI_PrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, /* Bit Mask not supported > 16 bpp */ if ((pSrcPixmap->drawable.bitsPerPixel > 16) && (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))) - RETURN(FALSE); + LEAVE(FALSE); /* calculate pitch in pixel unit */ src_pitch = exaGetPixmapPitch(pSrcPixmap) / (pSrcPixmap->drawable.bitsPerPixel >> 3); @@ -267,7 +267,7 @@ SMI_PrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd); - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -355,12 +355,12 @@ SMI_PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) /* HW ignores alpha */ if (pPixmap->drawable.bitsPerPixel == 32) - RETURN(FALSE); + LEAVE(FALSE); /* Bit Mask not supported > 16 bpp */ if ((pPixmap->drawable.bitsPerPixel > 16) && (!EXA_PM_IS_SOLID(&pPixmap->drawable, planemask))) - RETURN(FALSE); + LEAVE(FALSE); /* calculate pitch in pixel unit */ dst_pitch = exaGetPixmapPitch(pPixmap) / (pPixmap->drawable.bitsPerPixel >> 3); @@ -402,7 +402,7 @@ SMI_PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd); - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -466,7 +466,7 @@ SMI_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, dst += dst_pitch; } - RETURN(TRUE); + LEAVE(TRUE); } Bool @@ -539,7 +539,7 @@ SMI_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, exaWaitSync(pDst->drawable.pScreen); - RETURN(TRUE); + LEAVE(TRUE); } /* --------------------------------------- EXA Composite ---------------------------------------- */ @@ -562,16 +562,16 @@ SMI_CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, Pict if(op!=PictOpSrc || pMaskPicture || pSrcPicture->repeatType || !pSrcPicture->transform) - RETURN(FALSE); + LEAVE(FALSE); if(!SMI_ISROTATION_90(pSrcPicture->transform) && !SMI_ISROTATION_270(pSrcPicture->transform)) - RETURN(FALSE); + LEAVE(FALSE); if(PICT_FORMAT_BPP(pSrcPicture->format) == 24) - RETURN(FALSE); + LEAVE(FALSE); - RETURN(TRUE); + LEAVE(TRUE); } static Bool @@ -613,7 +613,7 @@ SMI_PrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, Pi pSmi->renderTransform = pSrcPicture->transform; - RETURN(TRUE); + LEAVE(TRUE); } static void diff --git a/src/smi_output.c b/src/smi_output.c index 8487db0..5ddbcc8 100644 --- a/src/smi_output.c +++ b/src/smi_output.c @@ -61,7 +61,7 @@ SMI_OutputModeValid(xf86OutputPtr output, DisplayModePtr mode) * their own centering. */ if (output->name && strcmp(output->name, "LVDS") == 0 && (mode->HDisplay != pSmi->lcdWidth || mode->VDisplay != pSmi->lcdHeight)) - RETURN(MODE_PANEL); + LEAVE(MODE_PANEL); /* The driver is actually programming modes, instead of loading registers * state from static tables. But still, only accept modes that should @@ -69,17 +69,17 @@ SMI_OutputModeValid(xf86OutputPtr output, DisplayModePtr mode) * the crt can be programmed to different resolution modes. */ if (mode->HDisplay & 15) - RETURN(MODE_BAD_WIDTH); + LEAVE(MODE_BAD_WIDTH); if((mode->Clock < pSmi->clockRange.minClock) || (mode->Clock > pSmi->clockRange.maxClock) || ((mode->Flags & V_INTERLACE) && !pSmi->clockRange.interlaceAllowed) || ((mode->Flags & V_DBLSCAN) && (mode->VScan > 1) && !pSmi->clockRange.doubleScanAllowed)){ - RETURN(MODE_CLOCK_RANGE); + LEAVE(MODE_CLOCK_RANGE); } - RETURN(MODE_OK); + LEAVE(MODE_OK); } static Bool @@ -89,7 +89,7 @@ SMI_OutputModeFixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr ad /* Nothing */ - RETURN(TRUE); + LEAVE(TRUE); } static void @@ -127,7 +127,7 @@ SMI_OutputDetect(xf86OutputPtr output) { ENTER(); - RETURN(XF86OutputStatusUnknown); + LEAVE(XF86OutputStatusUnknown); } xf86OutputStatus @@ -135,7 +135,7 @@ SMI_OutputDetect_lcd(xf86OutputPtr output) { ENTER(); - RETURN(XF86OutputStatusConnected); + LEAVE(XF86OutputStatusConnected); } DisplayModePtr @@ -145,9 +145,9 @@ SMI_OutputGetModes_native(xf86OutputPtr output) ENTER(); #ifdef HAVE_XMODES - RETURN(xf86CVTMode(pSmi->lcdWidth, pSmi->lcdHeight, 60.0f, FALSE, FALSE)); + LEAVE(xf86CVTMode(pSmi->lcdWidth, pSmi->lcdHeight, 60.0f, FALSE, FALSE)); #else - RETURN(NULL); + LEAVE(NULL); #endif } @@ -185,9 +185,9 @@ SMI_OutputPreInit(ScrnInfoPtr pScrn) ENTER(); if(SMI_MSOC_SERIES(pSmi->Chipset)){ - RETURN( SMI501_OutputPreInit(pScrn) ); + LEAVE( SMI501_OutputPreInit(pScrn) ); }else{ - RETURN( SMILynx_OutputPreInit(pScrn) ); + LEAVE( SMILynx_OutputPreInit(pScrn) ); } } diff --git a/src/smi_video.c b/src/smi_video.c index 6346cfd..18cb0c2 100644 --- a/src/smi_video.c +++ b/src/smi_video.c @@ -524,14 +524,14 @@ SMI_AddEncoding(XF86VideoEncodingPtr enc, int i, strlen(input_string) + strlen(channel_string)+3); if (NULL == enc[i].name) - RETURN(-1); + LEAVE(-1); enc[i].width = VideoNorms[norm].Wa; enc[i].height = VideoNorms[norm].Ha; enc[i].rate = VideoNorms[norm].rate; sprintf(enc[i].name,"%s-%s-%s", norm_string, input_string, channel_string); - RETURN(0); + LEAVE(0); } @@ -588,7 +588,6 @@ SMI_BuildEncodings(SMI_PortPtr p) } } LEAVE(); - return; fail: if (p->input) xfree(p->input); @@ -828,7 +827,7 @@ SMI_SetupVideo(ScreenPtr pScreen) ptrAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(DevUnion) + sizeof(SMI_PortRec)); if (ptrAdaptor == NULL) - RETURN(NULL); + LEAVE(NULL); ptrAdaptor->type = XvInputMask #if SMI_USE_CAPTURE @@ -907,7 +906,7 @@ SMI_SetupVideo(ScreenPtr pScreen) #if 0 /* aaa does not work ? */ if (xf86I2CProbeAddress(pSmi->I2C, SAA7111)) - RETURN(NULL); + LEAVE(NULL); DEBUG("SAA7111 detected\n"); #endif @@ -950,7 +949,7 @@ SMI_SetupVideo(ScreenPtr pScreen) SMI_ResetVideo(pScrn); - RETURN(ptrAdaptor); + LEAVE(ptrAdaptor); } @@ -1059,10 +1058,10 @@ SMI_PutVideo( dstBox.y2 = drw_y + drw_h; if(!xf86_crtc_clip_video_helper(pScrn, &crtc, NULL, &dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) - RETURN(Success); + LEAVE(Success); if(pSmi->Dualhead && crtc == crtcConf->crtc[0]) - RETURN(Success); + LEAVE(Success); /* Transform dstBox to the CRTC coordinates */ dstBox.x1 -= crtc->x; @@ -1211,7 +1210,7 @@ SMI_PutVideo( cpr00 ^= 0x00030000; } else { DEBUG("allocate error\n"); - RETURN(BadAlloc); + LEAVE(BadAlloc); } } } @@ -1303,7 +1302,7 @@ SMI_PutVideo( pPort->videoStatus = CLIENT_VIDEO_ON; DEBUG("SMI_PutVideo success\n"); - RETURN(Success); + LEAVE(Success); } #endif @@ -1406,7 +1405,7 @@ SMI_SetPortAttribute( res = BadMatch; } - RETURN(res); + LEAVE(res); } @@ -1436,9 +1435,9 @@ SMI_GetPortAttribute( else if (attribute == xvColorKey) *value = pPort->Attribute[XV_COLORKEY]; else - RETURN(BadMatch); + LEAVE(BadMatch); - RETURN(Success); + LEAVE(Success); } @@ -1514,13 +1513,13 @@ SMI_PutImage( if (pSmi->CSCVideo) { if (!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) - RETURN(Success); + LEAVE(Success); } else { if (!xf86_crtc_clip_video_helper(pScrn, &crtc, NULL, &dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) - RETURN(Success); + LEAVE(Success); /* Transform dstBox to the CRTC coordinates */ dstBox.x1 -= crtc->x; @@ -1573,7 +1572,7 @@ SMI_PutImage( size = dstPitch * height; pPort->video_offset = SMI_AllocateMemory(pScrn, &pPort->video_memory, size); if (pPort->video_memory == NULL) - RETURN(BadAlloc); + LEAVE(BadAlloc); top = y1 >> 16; left = (x1 >> 16) & ~1; @@ -1647,7 +1646,7 @@ SMI_PutImage( } pPort->videoStatus = CLIENT_VIDEO_ON; - RETURN(Success); + LEAVE(Success); } @@ -1728,7 +1727,7 @@ SMI_QueryImageAttributes( break; } - RETURN(size); + LEAVE(size); } @@ -2123,11 +2122,11 @@ SMI_SendI2C( ENTER(); if (pSmi->I2C == NULL) - RETURN(BadAlloc); + LEAVE(BadAlloc); dev = xf86CreateI2CDevRec(); if (dev == NULL) - RETURN(BadAlloc); + LEAVE(BadAlloc); dev->DevName = devName; dev->SlaveAddr = device; @@ -2147,7 +2146,7 @@ SMI_SendI2C( xf86DestroyI2CDevRec(dev, TRUE); - RETURN(status); + LEAVE(status); } #endif @@ -2172,7 +2171,6 @@ SMI_InitOffscreenImages( offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)); if (offscreenImages == NULL) { LEAVE(); - return; } offscreenImages->image = SMI_VideoImages; @@ -2228,7 +2226,7 @@ SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size) if (area != NULL) { if (area->size >= size) - RETURN(area->offset); + LEAVE(area->offset); exaOffscreenFree(pScrn->pScreen, area); } @@ -2250,10 +2248,10 @@ SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size) if (linear) { if (linear->size >= size) - RETURN(linear->offset * pSmi->Bpp); + LEAVE(linear->offset * pSmi->Bpp); if (xf86ResizeOffscreenLinear(linear, size)) - RETURN(linear->offset * pSmi->Bpp); + LEAVE(linear->offset * pSmi->Bpp); xf86FreeOffscreenLinear(linear); } @@ -2263,7 +2261,7 @@ SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size) xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, PRIORITY_EXTREME); if (max_size < size) - RETURN(0); + LEAVE(0); xf86PurgeUnlockedOffscreenAreas(pScreen); } @@ -2276,7 +2274,7 @@ SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size) DEBUG("offset = %p\n", offset); } - RETURN(offset); + LEAVE(offset); } void @@ -2355,7 +2353,7 @@ SMI_AllocSurface( ENTER(); if (width > pSmi->lcdWidth || height > pSmi->lcdHeight) - RETURN(BadAlloc); + LEAVE(BadAlloc); switch (id) { case FOURCC_YV12: @@ -2372,7 +2370,7 @@ SMI_AllocSurface( bpp = 4; break; default: - RETURN(BadAlloc); + LEAVE(BadAlloc); } width = (width + 1) & ~1; @@ -2381,18 +2379,18 @@ SMI_AllocSurface( offset = SMI_AllocateMemory(pScrn, &surface_memory, size); if (offset == 0) - RETURN(BadAlloc); + LEAVE(BadAlloc); surface->pitches = xalloc(sizeof(int)); if (surface->pitches == NULL) { SMI_FreeMemory(pScrn, surface_memory); - RETURN(BadAlloc); + LEAVE(BadAlloc); } surface->offsets = xalloc(sizeof(int)); if (surface->offsets == NULL) { xfree(surface->pitches); SMI_FreeMemory(pScrn, surface_memory); - RETURN(BadAlloc); + LEAVE(BadAlloc); } ptrOffscreen = xalloc(sizeof(SMI_OffscreenRec)); @@ -2400,7 +2398,7 @@ SMI_AllocSurface( xfree(surface->offsets); xfree(surface->pitches); SMI_FreeMemory(pScrn, surface_memory); - RETURN(BadAlloc); + LEAVE(BadAlloc); } surface->pScrn = pScrn; @@ -2414,7 +2412,7 @@ SMI_AllocSurface( ptrOffscreen->surface_memory = surface_memory; ptrOffscreen->isOn = FALSE; - RETURN(Success); + LEAVE(Success); } static int @@ -2436,7 +2434,7 @@ SMI_FreeSurface( xfree(surface->offsets); xfree(surface->devPrivate.ptr); - RETURN(Success); + LEAVE(Success); } static int @@ -2475,7 +2473,7 @@ SMI_DisplaySurface( if(!xf86_crtc_clip_video_helper(surface->pScrn, &crtc, NULL, &dstBox, &x1, &x2, &y1, &y2, clipBoxes, surface->width, surface->height)) - RETURN(Success); + LEAVE(Success); /* Transform dstBox to the CRTC coordinates */ dstBox.x1 -= crtc->x; @@ -2511,7 +2509,7 @@ SMI_DisplaySurface( pPort->freeTime = currentTime.milliseconds + FREE_DELAY; } - RETURN(Success); + LEAVE(Success); } static int @@ -2534,7 +2532,7 @@ SMI_StopSurface( ptrOffscreen->isOn = FALSE; } - RETURN(Success); + LEAVE(Success); } static int diff --git a/src/smi_xaa.c b/src/smi_xaa.c index 31790bf..5b9e32d 100644 --- a/src/smi_xaa.c +++ b/src/smi_xaa.c @@ -80,7 +80,7 @@ SMI_XAAInit(ScreenPtr pScreen) pSmi->XAAInfoRec = infoPtr = XAACreateInfoRec(); if (infoPtr == NULL) - RETURN(FALSE); + LEAVE(FALSE); infoPtr->Flags = PIXMAP_CACHE | LINEAR_FRAMEBUFFER @@ -190,7 +190,7 @@ SMI_XAAInit(ScreenPtr pScreen) ret = XAAInit(pScreen, infoPtr); - RETURN(ret); + LEAVE(ret); } /******************************************************************************/ diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c index 4dd5719..f56fd2e 100644 --- a/src/smilynx_crtc.c +++ b/src/smilynx_crtc.c @@ -250,7 +250,6 @@ SMILynx_CrtcModeSet_vga(xf86CrtcPtr crtc, if (!vgaHWInit(pScrn, mode)) { LEAVE(); - return; } if ((mode->HDisplay == 640) && SMI_LYNXM_SERIES(pSmi->Chipset)) { @@ -710,7 +709,7 @@ SMILynx_CrtcPreInit(ScrnInfoPtr pScrn) crtc0=xf86CrtcCreate(pScrn,&SMILynx_Crtc0Funcs); if(!crtc0) - RETURN(FALSE); + LEAVE(FALSE); crtc0->driver_private = &SMILynx_Crtc0Priv; }else{ if(pSmi->Dualhead){ @@ -723,7 +722,7 @@ SMILynx_CrtcPreInit(ScrnInfoPtr pScrn) crtc0=xf86CrtcCreate(pScrn,&SMILynx_Crtc0Funcs); if(!crtc0) - RETURN(FALSE); + LEAVE(FALSE); crtc0->driver_private = &SMILynx_Crtc0Priv; /* CRTC1 is CRT */ @@ -735,7 +734,7 @@ SMILynx_CrtcPreInit(ScrnInfoPtr pScrn) crtc1=xf86CrtcCreate(pScrn,&SMILynx_Crtc1Funcs); if(!crtc1) - RETURN(FALSE); + LEAVE(FALSE); crtc1->driver_private = &SMILynx_Crtc1Priv; }else{ @@ -757,11 +756,11 @@ SMILynx_CrtcPreInit(ScrnInfoPtr pScrn) crtc0=xf86CrtcCreate(pScrn,&SMILynx_Crtc0Funcs); if(!crtc0) - RETURN(FALSE); + LEAVE(FALSE); crtc0->driver_private = &SMILynx_Crtc0Priv; } } - RETURN(TRUE); + LEAVE(TRUE); } diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c index d909531..4b6c121 100644 --- a/src/smilynx_hw.c +++ b/src/smilynx_hw.c @@ -151,7 +151,7 @@ SMILynx_HWInit(ScrnInfoPtr pScrn) VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33, 0x00); VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A, 0x00); - RETURN(TRUE); + LEAVE(TRUE); } /* @@ -603,7 +603,7 @@ SMILynx_ddc1Read(ScrnInfoPtr pScrn) ret = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72) & 0x08; - RETURN(ret); + LEAVE(ret); } xf86MonPtr @@ -623,7 +623,7 @@ SMILynx_ddc1(ScrnInfoPtr pScrn) SMILynx_ddc1Read)); VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, tmp); - RETURN(pMon); + LEAVE(pMon); } diff --git a/src/smilynx_output.c b/src/smilynx_output.c index d55d808..40fe710 100644 --- a/src/smilynx_output.c +++ b/src/smilynx_output.c @@ -150,7 +150,7 @@ SMILynx_OutputGetModes_crt(xf86OutputPtr output) (pMon->rawData[6] == 0xFF) && (pMon->rawData[7] == 0x00)) { xf86OutputSetEDID(output,pMon); - RETURN(xf86OutputGetEDIDModes(output)); + LEAVE(xf86OutputGetEDIDModes(output)); } } @@ -158,7 +158,7 @@ SMILynx_OutputGetModes_crt(xf86OutputPtr output) pMon=SMILynx_ddc1(pScrn); if(pMon){ xf86OutputSetEDID(output,pMon); - RETURN(xf86OutputGetEDIDModes(output)); + LEAVE(xf86OutputGetEDIDModes(output)); } /* Try DDC2 */ @@ -166,12 +166,12 @@ SMILynx_OutputGetModes_crt(xf86OutputPtr output) pMon=xf86OutputGetEDID(output,pSmi->I2C); if(pMon){ xf86OutputSetEDID(output,pMon); - RETURN(xf86OutputGetEDIDModes(output)); + LEAVE(xf86OutputGetEDIDModes(output)); } } } - RETURN(NULL); + LEAVE(NULL); } static xf86OutputStatus @@ -202,9 +202,9 @@ SMILynx_OutputDetect_crt(xf86OutputPtr output) VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x7D, SR7D); if(status) - RETURN(XF86OutputStatusConnected); + LEAVE(XF86OutputStatusConnected); else - RETURN(XF86OutputStatusDisconnected); + LEAVE(XF86OutputStatusDisconnected); } static xf86OutputFuncsRec SMILynx_Output0Funcs; @@ -228,7 +228,7 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output0=xf86OutputCreate(pScrn,&SMILynx_Output0Funcs,"LVDS"); if(!output0) - RETURN(FALSE); + LEAVE(FALSE); output0->possible_crtcs = 1 << 0; output0->possible_clones = 0; @@ -244,7 +244,7 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output0=xf86OutputCreate(pScrn,&SMILynx_Output0Funcs,"LVDS"); if(!output0) - RETURN(FALSE); + LEAVE(FALSE); output0->possible_crtcs = 1 << 0; output0->possible_clones = 0; @@ -259,7 +259,7 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output1=xf86OutputCreate(pScrn,&SMILynx_Output1Funcs,"VGA"); if(!output1) - RETURN(FALSE); + LEAVE(FALSE); output1->possible_crtcs = 1 << 1; output1->possible_clones = 0; @@ -274,7 +274,7 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) output0=xf86OutputCreate(pScrn,&SMILynx_Output0Funcs,"LVDS"); if(!output0) - RETURN(FALSE); + LEAVE(FALSE); output0->possible_crtcs = 1 << 0; output0->possible_clones = 0; @@ -283,6 +283,6 @@ SMILynx_OutputPreInit(ScrnInfoPtr pScrn) } } - RETURN(TRUE); + LEAVE(TRUE); } |