diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-13 04:20:20 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-13 04:20:20 -0200 |
commit | 695a6066cfe7ad0e568edc596b8704bb9bf8754f (patch) | |
tree | 2b71110c23ab5af3aed913e4aa965cecb6c6a633 | |
parent | 191cbd3f8419cc5b428f262607d7a8594e574f67 (diff) |
Janitor/maintenance patches.
o Define HAVE_XMODES in config.h.
o Correct the LEAVE() macro declaration when SMI_DEBUG is defined.
o Remove prototype for SMI_DGAInit() if HAVE_XMODES is not defined.
o Properly scale value read from sm501 CURRENT_CLOCK register, to
print an appropriate message on startup.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/smi.h | 7 | ||||
-rw-r--r-- | src/smi501_output.c | 2 | ||||
-rw-r--r-- | src/smi_crtc.c | 10 | ||||
-rw-r--r-- | src/smi_driver.c | 19 |
5 files changed, 15 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac index a42c14a..c157792 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,7 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) AM_CONDITIONAL(XMODES, test "x$XMODES" = xyes) if test "x$XMODES" = xyes; then - XORG_CFLAGS="$XORG_CFLAGS -DHAVE_XMODES" + AC_DEFINE(HAVE_XMODES, 1, [X server has new mode code]) fi AC_SUBST([XORG_CFLAGS]) @@ -275,7 +275,7 @@ extern int smi_indent; # define VERBLEV 1 # define ENTER() xf86ErrorFVerb(VERBLEV, "%*c %s\n",\ smi_indent++, '>', __FUNCTION__) -# define LEAVE(value) \ +# define LEAVE(...) \ do { \ xf86ErrorFVerb(VERBLEV, "%*c %s\n", \ --smi_indent, '<', __FUNCTION__); \ @@ -373,11 +373,6 @@ void SMI_LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, xf86MonPtr SMI_ddc1(ScrnInfoPtr pScrn); void SMI_PrintRegs(ScrnInfoPtr pScrn); -#ifndef HAVE_XMODES -/* smi_dga.c */ -Bool SMI_DGAInit(ScreenPtr pScrn); -#endif - /* smi_video.c */ void SMI_InitVideo(ScreenPtr pScreen); CARD32 SMI_AllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size); diff --git a/src/smi501_output.c b/src/smi501_output.c index ee310d8..1d065fb 100644 --- a/src/smi501_output.c +++ b/src/smi501_output.c @@ -61,7 +61,7 @@ SMI501_OutputDPMS_lcd(xf86OutputPtr output, int dpms) LEAVE(); } -void +static void SMI501_OutputDPMS_crt(xf86OutputPtr output, int dpms) { ScrnInfoPtr pScrn = output->scrn; diff --git a/src/smi_crtc.c b/src/smi_crtc.c index c84e4c2..49354ea 100644 --- a/src/smi_crtc.c +++ b/src/smi_crtc.c @@ -77,22 +77,14 @@ SMI_CrtcModeFixup(xf86CrtcPtr crtc, static void SMI_CrtcPrepare(xf86CrtcPtr crtc) { - ScrnInfoPtr pScrn = crtc->scrn; - SMIPtr pSmi = SMIPTR(pScrn); - ENTER(); - LEAVE(); } static void SMI_CrtcCommit(xf86CrtcPtr crtc) { - ScrnInfoPtr pScrn = crtc->scrn; - SMIPtr pSmi = SMIPTR(pScrn); - ENTER(); - LEAVE(); } @@ -123,7 +115,7 @@ SMI_CrtcShadowAllocate (xf86CrtcPtr crtc, int width, int height) SMIPtr pSmi = SMIPTR(pScrn); SMICrtcPrivatePtr crtcPriv = SMICRTC(crtc); int offset, size; - char *result = NULL; + unsigned char *result = NULL; ENTER(); diff --git a/src/smi_driver.c b/src/smi_driver.c index b36fc7f..0f39436 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1215,15 +1215,18 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn) if (IS_MSOC(pSmi)) { clock.value = READ_SCR(pSmi, CURRENT_CLOCK); - if (xf86GetOptValFreq(pSmi->Options, OPTION_MXCLK, OPTUNITS_MHZ, &real)) + if (xf86GetOptValFreq(pSmi->Options, OPTION_MXCLK, + OPTUNITS_MHZ, &real)) { pSmi->MXCLK = (int)(real * 1000.0); - mxclk = pSmi->MXCLK; + mxclk = pSmi->MXCLK; + } } if (pSmi->MCLK == 0) { if (IS_MSOC(pSmi)) - mclk = (clock.f.m_select ? 336 : 288) / - ((clock.f.m_divider ? 3 : 1) << (unsigned)clock.f.m_shift); + mclk = ((clock.f.m_select ? 336 : 288) / + ((clock.f.m_divider ? 3 : 1) << + (unsigned)clock.f.m_shift)) * 1000; else { unsigned char shift, m, n; @@ -1248,10 +1251,10 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MCLK = %1.3f\n", mclk / 1000.0); if (IS_MSOC(pSmi)) { if (pSmi->MXCLK == 0) - mxclk = (clock.f.m1_select ? 336 : 288) / - ((clock.f.m1_divider ? 3 : 1) << (unsigned)clock.f.m1_shift); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MXCLK = %1.3f\n", - mxclk / 1000.0); + mxclk = ((clock.f.m1_select ? 336 : 288) / + ((clock.f.m1_divider ? 3 : 1) << + (unsigned)clock.f.m1_shift)) * 1000; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MXCLK = %1.3f\n", mxclk / 1000.0); } } |