summaryrefslogtreecommitdiff
path: root/src/smi_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/smi_crtc.c
parent373440667636d4e3214028710e33ac89d8f18ff1 (diff)
Allocate crtc->funcs and output->funcs in the heap.
Diffstat (limited to 'src/smi_crtc.c')
-rw-r--r--src/smi_crtc.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/smi_crtc.c b/src/smi_crtc.c
index 0ff4390..080473e 100644
--- a/src/smi_crtc.c
+++ b/src/smi_crtc.c
@@ -173,7 +173,8 @@ SMI_CrtcDestroy (xf86CrtcPtr crtc)
{
ENTER();
- /* Nothing */
+ xfree(SMICRTC(crtc));
+ xfree(crtc->funcs);
LEAVE();
}
@@ -240,21 +241,21 @@ SMI_CrtcConfigResize(ScrnInfoPtr pScrn,
}
void
-SMI_CrtcFuncsInit_base(xf86CrtcFuncsPtr crtcFuncs, SMICrtcPrivatePtr crtcPriv){
- memset(crtcFuncs,0,sizeof(xf86CrtcFuncsRec));
- memset(crtcPriv,0,sizeof(SMICrtcPrivatePtr));
-
- crtcFuncs->dpms = SMI_CrtcDPMS;
- crtcFuncs->lock = SMI_CrtcLock;
- crtcFuncs->unlock = SMI_CrtcUnlock;
- crtcFuncs->mode_fixup = SMI_CrtcModeFixup;
- crtcFuncs->prepare = SMI_CrtcPrepare;
- crtcFuncs->commit = SMI_CrtcCommit;
- crtcFuncs->gamma_set = SMI_CrtcGammaSet;
- crtcFuncs->shadow_allocate = SMI_CrtcShadowAllocate;
- crtcFuncs->shadow_create = SMI_CrtcShadowCreate;
- crtcFuncs->shadow_destroy = SMI_CrtcShadowDestroy;
- crtcFuncs->destroy = SMI_CrtcDestroy;
+SMI_CrtcFuncsInit_base(xf86CrtcFuncsPtr* crtcFuncs, SMICrtcPrivatePtr* crtcPriv){
+ *crtcFuncs = xnfcalloc(sizeof(xf86CrtcFuncsRec), 1);
+ *crtcPriv = xnfcalloc(sizeof(SMICrtcPrivateRec), 1);
+
+ (*crtcFuncs)->dpms = SMI_CrtcDPMS;
+ (*crtcFuncs)->lock = SMI_CrtcLock;
+ (*crtcFuncs)->unlock = SMI_CrtcUnlock;
+ (*crtcFuncs)->mode_fixup = SMI_CrtcModeFixup;
+ (*crtcFuncs)->prepare = SMI_CrtcPrepare;
+ (*crtcFuncs)->commit = SMI_CrtcCommit;
+ (*crtcFuncs)->gamma_set = SMI_CrtcGammaSet;
+ (*crtcFuncs)->shadow_allocate = SMI_CrtcShadowAllocate;
+ (*crtcFuncs)->shadow_create = SMI_CrtcShadowCreate;
+ (*crtcFuncs)->shadow_destroy = SMI_CrtcShadowDestroy;
+ (*crtcFuncs)->destroy = SMI_CrtcDestroy;
}
static xf86CrtcConfigFuncsRec SMI_CrtcConfigFuncs = {