Graphic.h 7.51 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

#ifndef GRAPHIC_H__
#define GRAPHIC_H__

#define   GFX_VO_NONE                       (0x00U)
#define   GFX_VO_SINGLE_RGB888              (0x01U)
#define   GFX_VO_SINGLE_RGB666              (0x02U)
#define   GFX_VO_SINGLE_OPENLDI             (0x03U)
/*
--- Reserved output mode for future expansion ---
#define   GFX_VO_SINGLE_SERRGB              (0x04U)
#define   GFX_VO_DUAL_OPENLDI_SERRGB        (0x05U)
#define   GFX_VO_DUAL_VODDR                 (0x06U)
*/

#define   GFX_VI_NONE                       (0x00U)
#define   GFX_VI_ITU656                     (0x10U)
/*
--- Reserved input mode for future expansion ---
#define   GFX_VI_RGB666                     (0x20U)
*/

#define   GFX_DHD_UNIT                      (0U)
#define   GFX_DHD_ALIGN(ADDR,BLOCK)         ((ADDR+(BLOCK-1)) & ~(BLOCK-1))
#define   GFX_DHD_USER_INSTANCES            (1U)
#define   GFX_DHD_JOB_SIZE                  (512U)    /* Jobsize: Number of bytes in one job buffer */
#define   GFX_DHD_JOB_COUNT                 (8U)      /* Jobcount: Recommended number of jobs in flight per client */
#define   GFX_DHD_RING_SIZE                 (1024U)   /* Ringsize: Number of bytes in ringbuffer, needs to be a power of two */
#define   GFX_DHD_USE_PC                    (1U)      /* Use performance counters: Set to 1 to reserve memory for performance counters */
#define   GFX_DHD_STATE_STORAGE             (480U)    /* one DHD context with a config with 2 tex units, 3 color unit passes and 4 const colors */

hu's avatar
hu committed
32 33
/* CAUTION: you have to adapt this when using dhd_alloc* manually, when using
 * DHD performance counter or when using DHD command list feature!
hu's avatar
hu committed
34 35 36 37
 *
 * Example: Each of the 4 available performance counters requires allocation of 4 bytes.
            Allocation is aligned to 128 bytes, thus for four PC's 512 additional bytes are required.
 */
hu's avatar
hu committed
38
#define   GFX_DHD_RING_SIZE_ALLOC           GFX_DHD_ALIGN(GFX_DHD_RING_SIZE + 4U, 128U)
hu's avatar
hu committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
#define   GFX_DHD_STATE_STORAGE_ALLOC       GFX_DHD_ALIGN(GFX_DHD_STATE_STORAGE, 128U)
#define   GFX_DHD_PC_ALLOC                  GFX_DHD_ALIGN(GFX_DHD_USE_PC * 4U * 128U, 128U)
#define   GFX_DHD_MEMORY_SIZE               (GFX_DHD_RING_SIZE_ALLOC + \
                                             GFX_DHD_USER_INSTANCES * (GFX_DHD_STATE_STORAGE_ALLOC + GFX_DHD_JOB_COUNT * GFX_DHD_JOB_SIZE) + \
                                             GFX_DHD_PC_ALLOC)

#define   GFX_VRAM0                         (0x3FD9C000)
#define   GFX_VRAM1                         (0x3FECE000)
#define   GFX_DHD_BASE                      GFX_VRAM0
#define   GFX_VO0_BASE                      (GFX_DHD_BASE + GFX_DHD_MEMORY_SIZE)
#define   GFX_VID_FB_BASE                   (GFX_VO0_BASE)
#define   GFX_SDRAM_FB_BASE                 (0x40000000)

#define   GFX_VRAM0_SIZE                    (0x132000)                   /* 1.195 MB */
#define   GFX_VRAM1_SIZE                    (0x132000)                   /* 1.195 MB */
#define   GFX_SDRAM_SIZE                    (32u  * 1024u * 1024u)       /*  32 MB */

#define   GFX_VIDMEM_SIZE                   (GFX_VRAM0_SIZE + GFX_VRAM1_SIZE - GFX_DHD_MEMORY_SIZE)
#define   GFX_VID_HP_BLOCK_SIZE             (4 * 1024)
#define   GFX_VID_HP_BLOCK_NB               (GFX_VIDMEM_SIZE / GFX_VID_HP_BLOCK_SIZE)
#define   GFX_SDRAM_HP_BLOCK_SIZE           (8 * 1024)
#define   GFX_SDRAM_HP_BLOCK_NB             (GFX_SDRAM_SIZE / GFX_SDRAM_HP_BLOCK_SIZE)

#define   GFX_CPU_HP_BLOCK_NB               (0x600UL) /* Number of blocks the CPU heap is divided into */
#define   GFX_CPU_HP_BLOCK_SIZE             (0x100UL)  /* Size of one CPU heap block  */
#define   GFX_HEAP_SIZE                     (GFX_CPU_HP_BLOCK_NB * GFX_CPU_HP_BLOCK_SIZE)




#define   GFX_WM_UNIT                       (0U)
#define   GFX_WM_MSG_QUEUE_LEN              (512U)

#define   GFX_DISPLAY_NAME                  "AUO_C070VAN02_7_800x480"
//#define   GFX_DISPLAY_NAME                  "AUO_C103VAN01_1_1280x480"




#define   GFX_USE_INTERNAL_VRAM             (0U)
#define   GFX_VRAM_SIZE_IN_SDRAM            (32UL * 1024UL * 1024UL)

// #define   GFX_VID_HP_BLOCK_SIZE             (0x400UL)











#define   GFX_USE_VOWE                      (0U)
/* VOWE DL buffer(x2) is allocated in bottom of VRAM */
#define   GFX_VOWE_DL_BUF_SIZE              (0x00010000UL)
#define   GFX_VOWE_WORK_BUFF_SIZE           (0x00020000UL)

#if 0
#define   GFX_USE_INTERNAL_VRAM             (0U)
#define   GFX_VRAM_SIZE_IN_SDRAM            (32UL * 1024UL * 1024UL)
#define   GFX_CPU_HP_BLOCK_NB               (0x800UL) /* Number of blocks the CPU heap is divided into */
#define   GFX_CPU_HP_BLOCK_SIZE             (0x40UL)  /* Size of one CPU heap block  */
#define   GFX_VID_HP_BLOCK_SIZE             (0x400UL)

#define   GFX_USE_VOWE                      (1U)
/* VOWE DL buffer(x2) is allocated in bottom of VRAM */
#define   GFX_VOWE_DL_BUF_SIZE              (0x00010000UL)
#define   GFX_VOWE_WORK_BUFF_SIZE           (0x00020000UL)


#define   GFX_DHD_UNIT                      (0U)
#define   GFX_DHD_ALIGN(ADDR,BLOCK)         ((ADDR+(BLOCK-1)) & ~(BLOCK-1))
#define   GFX_DHD_USER_INSTANCES            (1U)
#define   GFX_DHD_JOB_SIZE                  (512U)    /* Jobsize: Number of bytes in one job buffer */
#define   GFX_DHD_JOB_COUNT                 (8U)      /* Jobcount: Recommended number of jobs in flight per client */
#define   GFX_DHD_RING_SIZE                 (1024U)   /* Ringsize: Number of bytes in ringbuffer, needs to be a power of two */
hu's avatar
hu committed
117
#define   GFX_DHD_USE_PC                    (1U)       Use performance counters: Set to 1 to reserve memory for performance counters
hu's avatar
hu committed
118 119
#define   GFX_DHD_STATE_STORAGE             (480U)    /* one DHD context with a config with 2 tex units, 3 color unit passes and 4 const colors */

hu's avatar
hu committed
120 121
/* CAUTION: you have to adapt this when using dhd_alloc* manually, when using
 * DHD performance counter or when using DHD command list feature!
hu's avatar
hu committed
122 123 124 125
 *
 * Example: Each of the 4 available performance counters requires allocation of 4 bytes.
            Allocation is aligned to 128 bytes, thus for four PC's 512 additional bytes are required.
 */
hu's avatar
hu committed
126
#define   GFX_DHD_RING_SIZE_ALLOC           GFX_DHD_ALIGN(GFX_DHD_RING_SIZE + 4U, 128U)
hu's avatar
hu committed
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
#define   GFX_DHD_STATE_STORAGE_ALLOC       GFX_DHD_ALIGN(GFX_DHD_STATE_STORAGE, 128U)
#define   GFX_DHD_PC_ALLOC                  GFX_DHD_ALIGN(GFX_DHD_USE_PC * 4U * 128U, 128U)
#define   GFX_DHD_MEMORY_SIZE               (GFX_DHD_RING_SIZE_ALLOC + \
                                             GFX_DHD_USER_INSTANCES * (GFX_DHD_STATE_STORAGE_ALLOC + GFX_DHD_JOB_COUNT * GFX_DHD_JOB_SIZE) + \
                                             GFX_DHD_PC_ALLOC)

#define   GFX_WM_UNIT                       (0U)
#define   GFX_WM_MSG_QUEUE_LEN              (512U)

#define   GFX_DISPLAY_NAME                  "AUO_C070VAN02_7_800x480"
//#define   GFX_DISPLAY_NAME                  "AUO_C103VAN01_1_1280x480"








#endif







extern void Gfx_Init(uint8_t u8Mode);
extern void Gfx_Sys_Start(void);
extern void Gfx_Sys_Stop(void);
extern void Gfx_Create_Window(r_wm_WinMode_t      enMode,
hu's avatar
hu committed
158 159 160 161 162 163 164 165 166 167 168
                              uint32_t            u32PosX,
                              uint32_t            u32PosY,
                              uint32_t            u32PosZ,
                              uint32_t            u32Width,
                              uint32_t            u32Height,
                              uint32_t            u32Pitch,
                              uint32_t            u32Bnumber,
                              r_wm_WinColorFmt_t  enColorFmt,
                              r_wm_Window_t*      pstWindow);

void Loc_Display_Red(uint8_t ColorR, uint8_t ColorG, uint8_t ColorB);
hu's avatar
hu committed
169 170
#endif /* GRAPHIC_H__ */