/**
 * @file hv_drv_Osd.c
 * @brief Osd Driver entrance c file.
 * @details This file provides the following functions: \n
 *          (1) Osd initialization functions \n
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2022-08-31
 * @copyright Copyright(c),2022-8, Hiview Software. All rights reserved.
 * @par History:
 * <table>
 * <tr><th>Author         <th>Date        <th>Change Description
 * <tr><td>OSD Group      <td>2022-08-31   <td>create
 * </table>
*/

#include "hv_drv_Osd.h"
#include "hv_cal_Osd.h"


VOID Hv_Drv_OsdTest(VOID)
{
#ifdef SDK_WITH_OSD_TEST
    Hv_Test_OsdTest();
#endif
}

VOID Hv_Drv_OsdSetPanelHtotal(USHORT16 usHTotal)
{
    Hv_Cal_OsdTmg_SetPanelHtotal(usHTotal);
}

VOID Hv_Drv_OsdInit(VOID)
{
    OSD_DRV_LOG_DEBUG("Osd driver init begin...");

    Hv_Cal_OsdInit();

    /* set ddr start of driver data structures*/
    Hv_Drv_OsdMemory_Init();

    /* select osd draw path */
    Hv_Drv_OsdDataPath_Init();

    /* set default blend options */
    Hv_Drv_OsdBlend_Init();

    /* init DMA data structures */
    Hv_Drv_OsdDMA_Init();

    /* init resource structures */
    Hv_Drv_OsdResource_Init();

    /* init index structures */
    Hv_Drv_OsdIndex_Init();

    /* init palette */
    Hv_Drv_OsdPalette_Init();

    /* init font management data structures */
    Hv_Drv_OsdFont_Init();

    /* init graphic path */
    Hv_Drv_OsdGraphic_Init();

    /* init shift structure */
    Hv_Drv_OsdShift_Init();

    OSD_DRIVER_LOG_STATIC_MEMORY_USAGE();

    /* sync */
    Hv_Drv_OsdFrame_SetSync();
    OSD_DRV_LOG_DEBUG("Osd driver init finished...");
    return;
}
