⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compo_rect.c

📁 COMPO source code for reference
💻 C
📖 第 1 页 / 共 5 页
字号:
Description : Perform the CommitScreenComposition operation in a specific fieldParameters  :Assumptions : In frame mode, IsTopField is not usedLimitations :Returns     :*******************************************************************************/static ST_ErrorCode_t stcompo_CommitScreenCompositionField(STCOMPO_Handle_t CompoHandle, BOOL IsTopField){    ST_ErrorCode_t     Err = ST_NO_ERROR;    stcompo_Device_t*   Device_p = (stcompo_Device_t*)CompoHandle;    BOOL                UpdateExecution, DumpScreenList = FALSE;    STCOMPO_QueueUsed_t QueueUsed;    if ((Device_p->HalComposeScreen) == HALCOMPO_ComposeScreenCQ)    {            QueueUsed = STCOMPO_MAIN;    }    else    {            QueueUsed = STCOMPO_AUX;    }    /* Enter protected area */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);   /* or Semaphore wait time out immediate ??? */#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);    /* or Semaphore wait time out immediate ??? */#endif    if ( (Device_p->CompositionType == STCOMPO_COMPOSITION_FIELD_COMBINED) ||         (Device_p->CompositionType == STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM))    {    /* Commit composition data structures */#ifndef COMPO_DEBUG_CHECK_ERROR        CommitComposition(Device_p);#else /* COMPO_DEBUG_CHECK_ERROR */        Err = CommitComposition(Device_p);        if ( Err != ST_NO_ERROR)        {            /* Data structure Protection */#ifdef ST_OS21            semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20            semaphore_signal (&Device_p->AccessControlSemaphore);#endif            return Err;        }#endif /* COMPO_DEBUG_CHECK_ERROR */    }#ifndef DONT_USE_STATIC_BASE_ADDRESS    if (!Device_p->StartAnticipation)    {        /* Muti-instance support */        if ((((stcompo_Device_t *)CompoHandle)->HalComposeScreen) == HALCOMPO_ComposeScreenCQ)        {            /* Update static base address (Src + Target).            + The Source address update can not be done during the Update parameters phase because it would be,in that case, taken into account                for the wrong list execution                    - In STi5100 Cut 1.0 : SSBA registers are double buffered on trig event => This operation can be done before or after "Blitter GO".                    - In STi5100 Cut 2.0 : SSBA registers are not double buffered on trig event => This operation can be done only before "Blitter GO".            + The Target address update is done in the same way as Source address.                            |____     |____     |____     |____     |____     |____     |____     |                            |    |    |    |    |    |    |    |    |    |    |    |    |    |    |                            |    |____|    |____|    |____|    |____|    |____|    |____|    |____|                            |         |         |         |         |         |         |         |                            | Update  |         |         |         |         |         |         |                            | Params2 |         |         |         |         |         |         |                            |         |         |         |         |         |         |         |                            | Generate| Generate|         |         |         |         |         |                            |  List1  |  List2  |         |         |         |         |         |                            |         |         |         |         |         |         |         |                            | Execute | Execute | Execute |         |         |         |         |                            |  List0  |  List1  |  List2  |         |         |         |         |                            |         |         |                            |         |         |                            \/        \/        \/                            Trig      Trig       Trig                            Event0    Event1     Event2            */            HALCOMPO_SetStaticBaseAddress(Device_p->HalCompoHandle, QueueUsed);        }    }#endif /* DONT_USE_STATIC_BASE_ADDRESS */    UpdateExecution = Device_p->UpdateExecution;    Device_p->StartExecution = Device_p->UpdateExecution;    if ( Device_p->CompositionType == STCOMPO_COMPOSITION_FRAME ) /* Frame based composition mode */    {    /* Commit composition data structures */#ifndef COMPO_DEBUG_CHECK_ERROR        CommitComposition(Device_p);#else /* COMPO_DEBUG_CHECK_ERROR */        Err = CommitComposition(Device_p);        if ( Err != ST_NO_ERROR)        {            /* Data structure Protection */#ifdef ST_OS21            semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20            semaphore_signal (&Device_p->AccessControlSemaphore);#endif            return Err;        }#endif /* COMPO_DEBUG_CHECK_ERROR */    }    else /* Field based composition mode */    {        /*         * As first implementation, in field composition mode, commit operation is performed only in top field         */        if ( (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED) &&             (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM))        {            /* Commit composition data structures */#ifndef COMPO_DEBUG_CHECK_ERROR            if ( IsTopField )            {                CommitComposition(Device_p);            }#else /* COMPO_DEBUG_CHECK_ERROR */            if ( IsTopField )            {                Err = CommitComposition(Device_p);                if ( Err != ST_NO_ERROR)                {                    /* Data structure Protection */#ifdef ST_OS21                    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20                    semaphore_signal (&Device_p->AccessControlSemaphore);#endif                    return Err;                }            }#endif /* COMPO_DEBUG_CHECK_ERROR */        }    } /* ( Device_p->CompositionType == STCOMPO_COMPOSITION_FRAME ) */    if (Device_p->UpdateComposition == TRUE)    {        Device_p->UpdateCompositionCommitted = TRUE;        Device_p->UpdateComposition          = FALSE;    }    /* UpdateExecution = TRUE if Execution active for this device */    if ( Device_p->CompositionType == STCOMPO_COMPOSITION_FRAME ) /* Frame based composition mode */    {        Device_p->UpdateExecution = Device_p->ExecutionOn;    }    if ( (Device_p->CompositionType == STCOMPO_COMPOSITION_FIELD_COMBINED) ||         (Device_p->CompositionType == STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM)) /* Field based composition combined mode */    {        /* Call Nodes Generation function in the same vsynch than BLITTER GO */        stcompo_UpdateScreenCompositionField((STCOMPO_Handle_t)Device_p, IsTopField);        UpdateExecution = Device_p->UpdateExecution;        Device_p->StartExecution = Device_p->UpdateExecution;    }    /* Execution related (Trig event)*/    if ( (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED) &&         (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM)) /* Field based composition combined mode */    {        if (UpdateExecution == TRUE)        {            /* Perform the list of operations for the screen composition on the next vsync (BLITTER GO)*/            Device_p->HalComposeScreen(Device_p->HalCompoHandle);        }    }    if ( DumpScreenList )    {        DumpScreenRectList(Device_p);    }    /* Release access */#ifdef ST_OS21    semaphore_signal(Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal(&Device_p->AccessControlSemaphore);#endif    return(Err);}/*******************************************************************************Name        : stcompo_UpdateScreenCompositionDescription : Compose call to initiate an update of the output bitmap in a specific fieldParameters  :Assumptions : In frame mode, IsTopField is not usedLimitations :Returns     :*******************************************************************************/static ST_ErrorCode_t stcompo_UpdateScreenCompositionField(STCOMPO_Handle_t CompoHandle, BOOL IsTopField){    stcompo_Device_t*   Device_p            = (stcompo_Device_t*)CompoHandle;    BOOL                UpdateComposition   = FALSE, DumpScreenList = FALSE;    BOOL                PerformNonRecListComposition;if ( (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED) &&     (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM)) /* Field based composition combined mode */{    /* Enter protected area */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);    /* or Semaphore wait time out immediate ??? */#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);    /* or Semaphore wait time out immediate ??? */#endif}    if ( Device_p->CompositionType == STCOMPO_COMPOSITION_FRAME ) /* Frame based composition mode */    {        if (Device_p->UpdateCompositionCommitted == TRUE)        {            UpdateComposition = TRUE;        }        Device_p->UpdateCompositionCommitted = FALSE;    }    else /* Field based composition mode */    {        /*         * As first implementation, in field composition mode, top field is always composed before bottom field.         */        if (Device_p->UpdateCompositionCommitted == TRUE)        {            Device_p->UpdateTopFieldComposition = TRUE;        }        Device_p->UpdateCompositionCommitted = FALSE;        if ( IsTopField && Device_p->UpdateTopFieldComposition )        {            Device_p->UpdateTopFieldComposition = FALSE;            Device_p->UpdateBottomFieldComposition = TRUE;            UpdateComposition = TRUE;            Device_p->UpdateExecution = TRUE;        }        if ( !IsTopField && Device_p->UpdateBottomFieldComposition )        {            Device_p->UpdateBottomFieldComposition = FALSE;            UpdateComposition = TRUE;        }    } /* ( Device_p->CompositionType == STCOMPO_COMPOSITION_FRAME ) */if ( (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED) &&     (Device_p->CompositionType != STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM)) /* Field based composition combined mode */{#ifdef ST_OS21    semaphore_signal(Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal(&Device_p->AccessControlSemaphore);#endif}    if ( DumpScreenList )    {        DumpScreenRectList(Device_p);        DumpScreenList = FALSE;    }    /* Recurrence composition management */    PerformNonRecListComposition = HALCOMPO_ProcessNonRecurrentList(Device_p->HalCompoHandle);    if (PerformNonRecListComposition)    {        /* Compose both video and graphics related to the generation list */        HALCOMPO_PerformNonRecurrentListComposition(Device_p->HalCompoHandle, TRUE);        /* Compose both video and graphics related to the execution list */        HALCOMPO_PerformNonRecurrentListComposition(Device_p->HalCompoHandle, FALSE);    }    /* Generation related */    if (UpdateComposition == TRUE)    {        STGXOBJ_Rectangle_t BaseClip;        /* Free previous list of rectangle */        FreeScreenRectList(Device_p);        /* Analyse screen and break it into rectangles */        BaseClip.PositionX          = 0;        BaseClip.PositionY          = 0;        BaseClip.Width              = Device_p->ReadParams.ScreenWidth;        BaseClip.Height             = Device_p->ReadParams.ScreenHeight;        CreateScreenRectList(Device_p->ReadParams.Front_p, &BaseClip, 0);        if ( DumpScreenList )        {            DumpScreenRectList(Device_p);        }        /* Overwrite support */        /* Arrange and sort Screen rectangles list to take in consideration that source is divided in slices */        if (Device_p->CompositionType == STCOMPO_COMPOSITION_FIELD_COMBINED_SDRAM)   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -