diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-09-22 18:15:21 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-09-22 18:15:21 -0300 |
commit | 1014ffe0a2c55119d6bfbcf632f3d4ebe77af212 (patch) | |
tree | c3eb0cdcb3ab1e53eabf4844ab2971903ec4b4b1 /src | |
parent | 6b5c22d8680573c8a6b259d78ba3c8435514fde9 (diff) |
Simplify hw cursor and sw cursor option handling.
Also rename SMIRec field hwcursor to HwCursor, as there are few usages,
and this way, match the case usage for other field names.
Diffstat (limited to 'src')
-rw-r--r-- | src/smi.h | 2 | ||||
-rw-r--r-- | src/smi_driver.c | 30 |
2 files changed, 15 insertions, 17 deletions
@@ -175,7 +175,7 @@ typedef struct Bool fifo_aggressive; /* Adjust fifo for acceleration? */ Bool NoAccel; /* Disable Acceleration */ - Bool hwcursor; /* hardware cursor enabled */ + Bool HwCursor; /* hardware cursor enabled */ Bool ShowCache; /* Debugging option */ Bool useBIOS; /* Use BIOS for mode sets */ Bool zoomOnLCD; /* Zoom on LCD */ diff --git a/src/smi_driver.c b/src/smi_driver.c index e469fc2..9a3e979 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -729,21 +729,19 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } from = X_DEFAULT; - pSmi->hwcursor = TRUE; - if (xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->hwcursor)) { + pSmi->HwCursor = TRUE; + /* SWCursor overrides HWCusor if both specified */ + if (xf86GetOptValBool(pSmi->Options, OPTION_SWCURSOR, &pSmi->HwCursor) || + xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->HwCursor)) from = X_CONFIG; + + if (pSmi->HwCursor && pSmi->randrRotation) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "RandRRotation enabled: Disabling hardware cursor.\n"); + pSmi->HwCursor = FALSE; } - if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE)) { - pSmi->hwcursor = FALSE; - from = X_CONFIG; - } - if(pSmi->hwcursor && pSmi->randrRotation){ - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "RandRRotation enabled: Disabling hardware cursor.\n"); - pSmi->hwcursor = FALSE; - }else{ - xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n", - pSmi->hwcursor ? "Hardware" : "Software"); - } + xf86DrvMsg(pScrn->scrnIndex, from, "Using %sware Cursor\n", + pSmi->HwCursor ? "Hard" : "Soft"); if (xf86GetOptValBool(pSmi->Options, OPTION_SHADOW_FB, &pSmi->shadowFB)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", @@ -928,7 +926,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (pSmi->Dualhead) { pSmi->useBIOS = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UseBIOS disabled in dualhead mode\n"); - pSmi->hwcursor = FALSE; + pSmi->HwCursor = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No hardware cursor in dualhead mode\n"); if (pScrn->bitsPerPixel != 16) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Dualhead only supported at " @@ -1141,7 +1139,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } /* Load ramdac if needed */ - if (pSmi->hwcursor) { + if (pSmi->HwCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { SMI_FreeRec(pScrn); RETURN(FALSE); @@ -2325,7 +2323,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Initialize HW cursor layer. Must follow software cursor * initialization. */ - if (pSmi->hwcursor) { + if (pSmi->HwCursor) { if (!SMI_HWCursorInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor " "initialization failed\n"); |