summaryrefslogtreecommitdiff
path: root/src/smi501_crtc.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@gmail.com>2008-12-21 16:02:57 +0100
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-21 18:50:59 -0200
commit068de9c0a302aba21e4d6a27eb6d330375ff2d2f (patch)
tree4475b33593ef230682888ff6fc38ff637d282e31 /src/smi501_crtc.c
parent373440667636d4e3214028710e33ac89d8f18ff1 (diff)
Allocate crtc->funcs and output->funcs in the heap.
Diffstat (limited to 'src/smi501_crtc.c')
-rw-r--r--src/smi501_crtc.c61
1 files changed, 28 insertions, 33 deletions
diff --git a/src/smi501_crtc.c b/src/smi501_crtc.c
index 6175f62..d71d738 100644
--- a/src/smi501_crtc.c
+++ b/src/smi501_crtc.c
@@ -619,63 +619,58 @@ SMI501_CrtcLoadCursorArgb(xf86CrtcPtr crtc, CARD32 *image)
}
#endif
-static xf86CrtcFuncsRec SMI501_Crtc0Funcs;
-static SMICrtcPrivateRec SMI501_Crtc0Priv;
-static xf86CrtcFuncsRec SMI501_Crtc1Funcs;
-static SMICrtcPrivateRec SMI501_Crtc1Priv;
-
Bool
SMI501_CrtcPreInit(ScrnInfoPtr pScrn)
{
SMIPtr pSmi = SMIPTR(pScrn);
- xf86CrtcPtr crtc0, crtc1;
+ xf86CrtcPtr crtc;
+ xf86CrtcFuncsPtr crtcFuncs;
+ SMICrtcPrivatePtr crtcPriv;
ENTER();
/* CRTC0 is LCD */
- SMI_CrtcFuncsInit_base(&SMI501_Crtc0Funcs, &SMI501_Crtc0Priv);
- SMI501_Crtc0Funcs.mode_set = SMI501_CrtcModeSet_lcd;
- SMI501_Crtc0Priv.adjust_frame = SMI501_CrtcAdjustFrame;
- SMI501_Crtc0Priv.video_init = SMI501_CrtcVideoInit_lcd;
- SMI501_Crtc0Priv.load_lut = SMI501_CrtcLoadLUT;
+ SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
+ crtcFuncs->mode_set = SMI501_CrtcModeSet_lcd;
+ crtcPriv->adjust_frame = SMI501_CrtcAdjustFrame;
+ crtcPriv->video_init = SMI501_CrtcVideoInit_lcd;
+ crtcPriv->load_lut = SMI501_CrtcLoadLUT;
if (pSmi->HwCursor) {
- SMI501_Crtc0Funcs.set_cursor_colors = SMI501_CrtcSetCursorColors;
- SMI501_Crtc0Funcs.set_cursor_position = SMI501_CrtcSetCursorPosition;
- SMI501_Crtc0Funcs.show_cursor = SMI501_CrtcShowCursor;
- SMI501_Crtc0Funcs.hide_cursor = SMI501_CrtcHideCursor;
- SMI501_Crtc0Funcs.load_cursor_image = SMI501_CrtcLoadCursorImage;
+ crtcFuncs->set_cursor_colors = SMI501_CrtcSetCursorColors;
+ crtcFuncs->set_cursor_position = SMI501_CrtcSetCursorPosition;
+ crtcFuncs->show_cursor = SMI501_CrtcShowCursor;
+ crtcFuncs->hide_cursor = SMI501_CrtcHideCursor;
+ crtcFuncs->load_cursor_image = SMI501_CrtcLoadCursorImage;
#if SMI_CURSOR_ALPHA_PLANE
if (!pSmi->Dualhead)
- SMI501_Crtc0Funcs.load_cursor_argb = SMI501_CrtcLoadCursorArgb;
+ crtcFuncs->load_cursor_argb = SMI501_CrtcLoadCursorArgb;
#endif
}
- crtc0 = xf86CrtcCreate(pScrn, &SMI501_Crtc0Funcs);
- if (!crtc0)
+ if (! (crtc = xf86CrtcCreate(pScrn, crtcFuncs)))
LEAVE(FALSE);
- crtc0->driver_private = &SMI501_Crtc0Priv;
+ crtc->driver_private = crtcPriv;
/* CRTC1 is CRT */
if (pSmi->Dualhead) {
- SMI_CrtcFuncsInit_base(&SMI501_Crtc1Funcs, &SMI501_Crtc1Priv);
- SMI501_Crtc1Funcs.mode_set = SMI501_CrtcModeSet_crt;
- SMI501_Crtc1Priv.adjust_frame = SMI501_CrtcAdjustFrame;
- SMI501_Crtc1Priv.video_init = SMI501_CrtcVideoInit_crt;
- SMI501_Crtc1Priv.load_lut = SMI501_CrtcLoadLUT;
+ SMI_CrtcFuncsInit_base(&crtcFuncs, &crtcPriv);
+ crtcFuncs->mode_set = SMI501_CrtcModeSet_crt;
+ crtcPriv->adjust_frame = SMI501_CrtcAdjustFrame;
+ crtcPriv->video_init = SMI501_CrtcVideoInit_crt;
+ crtcPriv->load_lut = SMI501_CrtcLoadLUT;
if (pSmi->HwCursor) {
- SMI501_Crtc1Funcs.set_cursor_colors = SMI501_CrtcSetCursorColors;
- SMI501_Crtc1Funcs.set_cursor_position = SMI501_CrtcSetCursorPosition;
- SMI501_Crtc1Funcs.show_cursor = SMI501_CrtcShowCursor;
- SMI501_Crtc1Funcs.hide_cursor = SMI501_CrtcHideCursor;
- SMI501_Crtc1Funcs.load_cursor_image = SMI501_CrtcLoadCursorImage;
+ crtcFuncs->set_cursor_colors = SMI501_CrtcSetCursorColors;
+ crtcFuncs->set_cursor_position = SMI501_CrtcSetCursorPosition;
+ crtcFuncs->show_cursor = SMI501_CrtcShowCursor;
+ crtcFuncs->hide_cursor = SMI501_CrtcHideCursor;
+ crtcFuncs->load_cursor_image = SMI501_CrtcLoadCursorImage;
}
- crtc1 = xf86CrtcCreate(pScrn, &SMI501_Crtc1Funcs);
- if (!crtc1)
+ if (! (crtc = xf86CrtcCreate(pScrn, crtcFuncs)))
LEAVE(FALSE);
- crtc1->driver_private = &SMI501_Crtc1Priv;
+ crtc->driver_private = crtcPriv;
}
LEAVE(TRUE);