nengel@2: #include nengel@2: #include "h264_dma.h" nengel@2: nengel@2: DECLARE_ALIGNED_16(dma_list_elem_t, put_list_buf[2*(52+26+26)]); nengel@2: dma_list_elem_t* put_list; nengel@2: nengel@2: DECLARE_ALIGNED_16(dma_list_elem_t, get_list_buf[16*(4+5 + 2*3)]); nengel@2: dma_list_elem_t* get_list; nengel@2: nengel@2: inline void spu_dma_get(void *ls, unsigned ea, int size, int tag){ nengel@2: mfc_get(ls, ea, size, tag, 0, 0); nengel@2: } nengel@2: nengel@2: inline void spu_dma_put(void *ls, unsigned ea, int size, int tag){ nengel@2: mfc_put(ls, ea, size, tag, 0, 0); nengel@2: } nengel@2: nengel@2: inline void spu_dma_barrier_put(void *ls, unsigned ea, int size, int tag){ nengel@2: mfc_putb(ls, ea, size, tag, 0, 0); nengel@2: } nengel@2: nengel@2: // Function that wait to finish a DMA transfer with especific id nengel@2: inline void wait_dma_id(int id){ nengel@2: spu_writech(MFC_WrTagMask, 1<< id); nengel@2: (void)spu_mfcstat(MFC_TAG_UPDATE_ALL); nengel@2: } nengel@2: nengel@2: // Functions to get/put a block from/to main memory nengel@2: void get_dma_list(void *dst, void* ea, unsigned int w, unsigned int h, unsigned int stride, unsigned int tag, int barrier) nengel@2: { nengel@2: unsigned int i = 0; nengel@2: unsigned int listsize; nengel@2: unsigned int ea_low; nengel@2: nengel@2: dma_list_elem_t* list = get_list; nengel@2: get_list+=h; nengel@2: nengel@2: ea_low=(uint32_t) mfc_ea2l(ea); nengel@2: nengel@2: /* Create the list, size of each list id the "width" parameter defined by the user */ nengel@2: for ( i=0; i