This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM648 VICP problem with function CPIS_updateSrcDstPtr

Hello,

I have a problem with the VICP function "CPIS_updateSrcDstPtr".

In my application i use the "Affine transform" funtion and it works great.
Now i need to update the source and destination pointer, but when i call "CPIS_updateSrcDstPtr",
the next call to CPIS_start never returns...

So to eliminate all error, i come back with the example project of the VICPlib  "affineTransform_DM648" wich works great when i launch it.
When i just insert two line (update and reset see below) for CPIS_updateSrcDstPtr (i don't write a new value in CPIS_BaseParms, base→srcBuf[0] and ptr and base→dstBuf[0].ptr) It never returns when i call "CPIS_start": 

        /*
            Call the module in asynchronous mode. This means only setup of 
            hardware is done. Execution will have to be triggered by CPIS_start
        */
        if (CPIS_affineTransform(
            &handle,
            &base,
            &params,
            CPIS_ASYNC
            )== -1) {
            printf("\nCPIS_affineTransform() error %d\n", CPIS_errno);
            exit(-1);
        };
        timerEnd= timerReadEnd ();
        setupTimerDiff= timerEnd-timerStart;

        /* Benchmark the actual processing */
        timerStart= timerReadStart ();
        //PROBLEM HERE
        CPIS_updateSrcDstPtr(handle,&base);
        CPIS_reset(handle);
    
        /* Trigger the start of processing */
        CPIS_start(handle);
        CPIS_wait(handle);//NEVER RETURN

Do you have any idea about the problem?

Thank you

Max.

  • Hi,

    I checked at the implementation of CPIS_updateSrcDstPtr() and realized that it won't work with CPIS_affineTransform(). In your use case, do you need to change the source or destination pointer ?

    If it is just the destination pointer, you can implement a CPIS_updateDstPtr() function in _imgproclib.c as follow:

    Int32 CPIS_updateDstPtr(CPIS_IpRun *ipRun, CPIS_BaseParms *base){

    Int32 dmaIdx;
    IP_run *ipRunObj;
    ipRunObj= &ipRun->ipRunObj;

    for (dmaIdx=0; dmaIdx<ipRunObj->numDmaOut; dmaIdx++)

    ipRunObj->dmaOut[dmaIdx].ddrAddr= (Uint32)base->dstBuf[dmaIdx].ptr;

    return 0;
    }

    If you need to change the source pointer, it will be more tricky ...

    regards,


    Victor

  • Hello Victor,

    Thank you for your help,

    I need to change the source and the destination pointer together...
    Do you have a solution for update the source pointer?

    I will try your solution for the destination pointer tomorrow....

    Max.

  • Hello,

    I tried your solution to change the Destination pointer and it works well.
    But now, i really need to change the source pointer too...

    For the moment to do that i need to Delete function, change pointer and then put back the function in VICP...
    It takes a lot of time to do that and it's not acceptable.

    Do you have a solution?

    Thank you.

    Max 

  • Please add the following function in _affineTransform.c and then try to use it :

    Int32 _CPIS_setAffineTransformSrcAddr(
    CPIS_BaseParms *base,
    Int32 newSrcBufPtr, /* new srcPtr value */
    Int32 oldSrcBufPtr, /* need to pass old srcPtr value */
    void *p) {

    CPIS_AffineTransformParms *params;
    _CPIS_AffineTransformPrivate* privateVars;
    TferParamEntry* inTferParamTable;

    Int16 x, y, incX, incY;
    Uint32 index;

    incX= base->procBlockSize.width;
    incY= base->procBlockSize.height;

    params= (CPIS_AffineTransformParms *)p;
    privateVars= (_CPIS_AffineTransformPrivate*)params->privateVars;
    inTferParamTable= (TferParamEntry*)params->scratch;

    index=0;

    for (y=privateVars->outerRoi_yul; y >= privateVars->outerRoi_ylr; y-= incY)
      for (x=privateVars->outerRoi_xul; x <= privateVars->outerRoi_xlr; x+= incX) {

      inTferParamTable[index].in.ddrAddr= inTferParamTable[index].in.ddrAddr - oldSrcBufPtr + newSrcBufPtr;

      index++;
    }

    return 0;

    }

  • Hello Victor,

    Thank you a lot for your attention and your speed,
    all seem to works great!


    For reader of this thread: don't forget to put the right flag in the handle before reset:

    h->resetFlag= IP_RUN_RESET_OUTPUT_ADDR|IP_RUN_RESET_INPUT_ADDR;

    If you forget it, you can have some dirty data transferred and it makes a sort of noise on the screen.


    Max.