prop.crop.width = width;
prop.crop.height = height;
- secCvtEnsureSize (NULL, &prop);
+ if (!secCvtEnsureSize (NULL, &prop))
+ return FALSE;
privPixmap->bo = secRenderBoCreate(pScrn, prop.width, prop.height);
if (!privPixmap->bo)
void _g2dBoxMerge (struct xorg_list *l, struct xorg_list* b, struct xorg_list* t)
{
- ExaBox *b1, *b2;
- ExaBox* r=NULL;
+ ExaBox *b1 = NULL, *b2 = NULL;
+ ExaBox* r = NULL;
xorg_list_for_each_entry (b1, b, link)
{
void _g2dBoxMove (struct xorg_list* l, int tx, int ty)
{
- ExaBox *b;
+ ExaBox *b = NULL;
xorg_list_for_each_entry (b, l, link)
{
void _g2dBoxRemoveAll (struct xorg_list* l)
{
- ExaBox *ref, *next;
+ ExaBox *ref = NULL, *next = NULL;
xorg_list_for_each_entry_safe (ref, next, l, link)
{
void _g2dBoxPrint (ExaBox* sb1, const char* name)
{
- ExaBox *b;
+ ExaBox *b = NULL;
xorg_list_for_each_entry (b, &sb1->link, link)
{
void
_g2dDoDraw (struct xorg_list *l, DoDrawProcPtrEx do_draw, void* data)
{
- ExaBox *box;
+ ExaBox *box = NULL;
xorg_list_for_each_entry (box, l, link)
{
do_draw (box, data);
ExaBox* _swBoxAdd (struct xorg_list *l, BoxPtr b1, BoxPtr b2)
{
- ExaBox* rgn;
+ ExaBox* rgn = NULL;
rgn = calloc (1, sizeof (ExaBox));
rgn->state = secUtilBoxIntersect (&rgn->box, b1, b2);
void _swBoxMerge (struct xorg_list *l, struct xorg_list* b, struct xorg_list* t)
{
- ExaBox *b1, *b2;
+ ExaBox *b1 = NULL, *b2 = NULL;
ExaBox* r=NULL;
xorg_list_for_each_entry (b1, b, link)
void _swBoxMove (struct xorg_list* l, int tx, int ty)
{
- ExaBox *b;
+ ExaBox *b = NULL;
xorg_list_for_each_entry (b, l, link)
{
void _swBoxRemoveAll (struct xorg_list* l)
{
- ExaBox *ref, *next;
+ ExaBox *ref = NULL, *next = NULL;
xorg_list_for_each_entry_safe (ref, next, l, link)
{
void _swBoxPrint (ExaBox* sb1, const char* name)
{
- ExaBox *b;
+ ExaBox *b = NULL;
xorg_list_for_each_entry (b, &sb1->link, link)
{
if (num_bo == 0)
{
num_bo = 1;
- bos = (tbm_bo *)calloc(1, sizeof(tbm_bo *));
+ bos = (tbm_bo *)calloc(1, sizeof(tbm_bo));
bos[0] = pSec->pFb->default_bo;
}
#endif //NO_CRTC_MODE
void
_swDoDraw (struct xorg_list *l, DoDrawProcPtrEx do_draw, void* data)
{
- ExaBox *box;
+ ExaBox *box = NULL;
xorg_list_for_each_entry (box, l, link)
{
do_draw (box, data);
secCrtcCursorEnable (ScrnInfoPtr pScrn, Bool enable)
{
SECModePtr pSecMode = (SECModePtr) SECPTR (pScrn)->pSecMode;
- SECCrtcPrivPtr pCur, pNext;
+ SECCrtcPrivPtr pCur = NULL, pNext;
xorg_list_for_each_entry_safe (pCur, pNext, &pSecMode->crtcs, link)
{
xf86CrtcDestroy (pCrtc);
}
- SECOutputPrivPtr output_ref, output_next;
+ SECOutputPrivPtr output_ref = NULL, output_next = NULL;
xorg_list_for_each_entry_safe (output_ref, output_next, &pSecMode->outputs, link)
{
pOutput = output_ref->pOutput;
xf86OutputDestroy (pOutput);
}
- SECPlanePrivPtr plane_ref, plane_next;
+ SECPlanePrivPtr plane_ref = NULL, plane_next = NULL;
xorg_list_for_each_entry_safe (plane_ref, plane_next, &pSecMode->planes, link)
{
secPlaneDeinit (pScrn, plane_ref);
return TRUE;
}
}
- SECOutputPrivPtr output_ref, output_next;
+ SECOutputPrivPtr output_ref = NULL, output_next = NULL;
/* Priority LVDS > HDMI > Virtual */
xorg_list_for_each_entry_safe (output_ref, output_next, &pSecMode->outputs, link)
{
{
if (pCur->is_dummy == FALSE && pCur->mode_output->connection == DRM_MODE_CONNECTED)
{
- return XF86OutputStatusDisconnected;
-/* TODO: Need to change flag useAsyncSwap not here */
+ /* TODO: Need to change flag useAsyncSwap not here */
pSec->useAsyncSwap = FALSE;
+ return XF86OutputStatusDisconnected;
}
}
pSec->useAsyncSwap = TRUE;
{
XDBG_DEBUG(MDOUT,"\n");
SECOutputPrivPtr pOutputPriv = pOutput->driver_private;
+
if (pOutputPriv == NULL)
return;
SECPtr pSec = SECPTR (pOutput->scrn);
TimerFree (pSec->resume_timer);
pSec->resume_timer = NULL;
}
- if (pOutputPriv->mode_output->modes)
- free(pOutputPriv->mode_output->modes);
+
if (pOutputPriv->mode_output)
- free(pOutputPriv->mode_output);
- if (pOutputPriv->mode_encoder)
- free(pOutputPriv->mode_encoder);
+ {
+ if (pOutputPriv->mode_output->modes)
+ free (pOutputPriv->mode_output->modes);
+ free (pOutputPriv->mode_output);
+ }
+ if (pOutputPriv->mode_encoder)
+ free (pOutputPriv->mode_encoder);
(pSec->pSecMode->num_dummy_output)--;
xorg_list_del (&pOutputPriv->link);
ret = TRUE;
#endif
SECOutputPrivPtr pOutputPriv = NULL;
- SECOutputPrivPtr pCur, pNext;
+ SECOutputPrivPtr pCur = NULL, pNext = NULL;
drmModeConnectorPtr koutput;
drmModeEncoderPtr kencoder;
char *conn_str[] = {"connected", "disconnected", "unknow"};
for (i = 0; i < pSecMode->mode_res->count_connectors; i++)
{
- SECOutputPrivPtr pCur, pNext;
+ SECOutputPrivPtr pCur = NULL, pNext = NULL;
xorg_list_for_each_entry_safe (pCur, pNext, &pSecMode->outputs, link)
{
buf.buf_id = i;
if (wb->dst_buf[i])
- for (j = 0; j < EXYNOS_DRM_PLANAR_MAX && j < PLANAR_CNT; j++)
+ for (j = 0; j < EXYNOS_DRM_PLANAR_MAX; j++)
buf.handle[j] = wb->dst_buf[i]->handles[j];
- secDrmIppQueueBuf (wb->pScrn, &buf);
+ secDrmIppQueueBuf (wb->pScrn, &buf);
+
+ wb->queued[i] = FALSE;
- wb->queued[i] = FALSE;
}
CLEAR (ctrl);
if (!is_dir)
{
DIR *dp;
- mkdir (dir, 0755);
+ if(mkdir (dir, 0755))
+ return;
+
if (!(dp = opendir (dir)))
{
ErrorF ("failed: open'%s'\n", dir);
return list;
data = malloc (sizeof (ListData));
+ XDBG_RETURN_VAL_IF_FAIL (data != NULL, NULL);
+
data->key = key;
data->data = user_data;
XDBG_TRACE (MVA, "done. \n");
}
-static Bool
-secCaptureConvertImage (SECPortPrivPtr pPort, SECVideoBuf *inbuf, int csc_range)
+static Bool secCaptureConvertImage(SECPortPrivPtr pPort, SECVideoBuf *inbuf, int csc_range)
{
- SECCvtProp src_prop = {0,}, dst_prop = {0,};
- SECVideoBuf *outbuf = NULL;
-
- pPort->secure=0;
+ SECCvtProp src_prop = { 0, }, dst_prop = { 0, };
+ SECVideoBuf *outbuf = NULL;
- src_prop.id = inbuf->id;
- src_prop.width = inbuf->width;
- src_prop.height = inbuf->height;
- src_prop.crop = inbuf->crop;
+ pPort->secure = 0;
- dst_prop.id = FOURCC_RGB32;
- dst_prop.width = inbuf->width;
- dst_prop.height = inbuf->height;
- dst_prop.crop = inbuf->crop;
+ src_prop.id = inbuf->id;
+ src_prop.width = inbuf->width;
+ src_prop.height = inbuf->height;
+ src_prop.crop = inbuf->crop;
- dst_prop.degree = 0;
- dst_prop.hflip = 0;
- dst_prop.vflip = 0;
- dst_prop.secure = pPort->secure;
- dst_prop.csc_range = 0;// pPort->csc_range;
+ dst_prop.id = FOURCC_RGB32;
+ dst_prop.width = inbuf->width;
+ dst_prop.height = inbuf->height;
+ dst_prop.crop = inbuf->crop;
- if (!secCvtEnsureSize (&src_prop, &dst_prop))
- goto fail_to_convert;
+ dst_prop.degree = 0;
+ dst_prop.hflip = 0;
+ dst_prop.vflip = 0;
+ dst_prop.secure = pPort->secure;
+ dst_prop.csc_range = 0;// pPort->csc_range;
- outbuf = pPort->capture_dstbuf;
- if (outbuf == NULL)
- {
- outbuf = secUtilAllocVideoBuffer (pPort->pScrn, FOURCC_RGB32,
- dst_prop.width, dst_prop.height,
- FALSE, FALSE, pPort->secure);
- outbuf->crop = dst_prop.crop;
- }
- XDBG_GOTO_IF_FAIL (outbuf != NULL, fail_to_convert);
+ if (!secCvtEnsureSize(&src_prop, &dst_prop))
+ goto fail_to_convert;
- if (!outbuf)
- return FALSE;
+ XDBG_GOTO_IF_FAIL(pPort != NULL, fail_to_convert);
- _secCaptureEnsureConverter (pPort);
- XDBG_GOTO_IF_FAIL (pPort->cvt2 != NULL, fail_to_convert);
+ outbuf = pPort->capture_dstbuf;
+ if (outbuf == NULL)
+ {
+ outbuf = secUtilAllocVideoBuffer (pPort->pScrn, FOURCC_RGB32,
+ dst_prop.width, dst_prop.height,
+ FALSE, FALSE, pPort->secure);
+ outbuf->crop = dst_prop.crop;
+ }
+ XDBG_GOTO_IF_FAIL(outbuf != NULL, fail_to_convert);
- if (!secCvtSetProperpty (pPort->cvt2, &src_prop, &dst_prop))
- goto fail_to_convert;
+ _secCaptureEnsureConverter(pPort);
+ XDBG_GOTO_IF_FAIL(pPort->cvt2 != NULL, fail_to_convert);
- if (!secCvtConvert (pPort->cvt2, inbuf, outbuf))
- goto fail_to_convert;
+ if (!secCvtSetProperpty(pPort->cvt2, &src_prop, &dst_prop))
+ goto fail_to_convert;
+ if (!secCvtConvert(pPort->cvt2, inbuf, outbuf))
+ goto fail_to_convert;
- secUtilVideoBufferUnref (outbuf);
+ secUtilVideoBufferUnref (outbuf);
- return TRUE;
+ return TRUE;
fail_to_convert:
- if (outbuf)
- secUtilVideoBufferUnref (outbuf);
+ if (outbuf)
+ secUtilVideoBufferUnref (outbuf);
- _secCaptureCloseConverter (pPort);
+ _secCaptureCloseConverter(pPort);
- return FALSE;
- }
+ return FALSE;
+}