416 | | === 3) void '''giet_fbf_cma_alloc'''() |
417 | | This function allocates a private CMA channel to the calling thread, and registers the channel index |
418 | | in the thread context. |
419 | | The threadthread exit if no CMA channel available |
420 | | |
421 | | === 4) void '''giet_fbf_cma_init_buf'''( void* buf0_vbase , void* buf1_vbase , void* sts0_vaddr , void* sts1_vaddr ) === |
422 | | This function initializes the chained buffer descriptors for the two source buffers and the frame buffer. |
423 | | The buf0 and buf1 user buffers must be large enough to store a complete image, and must be aligned on a 64 bytes boundary. |
424 | | The sts0 and sts1 user buffers contain just a Boolean, but they must be large enough to store 64 bytes, and must be aligned on a 64 bytes boundary. |
425 | | * '''buf0_vbase''' : virtual address of the first data buffer. |
426 | | * '''buf1_vbase''' : virtual address of the second data buffer, |
427 | | * '''sts0_vaddr''' : virtual address of the first buffer status. |
428 | | * '''sts1_vaddr''' : virtual address of the second buffer status. |
429 | | |
430 | | === 5) void '''giet_fbf_cma_start'''( unsigned int length ) === |
431 | | This function activates the transfer of a stream of images from two user buffers to the frame buffer. It must be used in conjunction with the giet_fbf_cma_display() function. The chained buffer descriptors should have been initialized by the giet_fbf_cma_init_buf() function. |
432 | | * '''length''' is the size of the image (bytes). |
433 | | |
434 | | === 6) void '''giet_fbf_cma_display'''( unsigned int buffer ) === |
435 | | This function enables the transfer of the specified buffer. |
436 | | * '''buffer''' is the buffer index (0 or 1). |
| 417 | === 3) void '''giet_fbf_cma_alloc'''( unsigned int nbufs ) |
| 418 | This function allocates a private CMA channel to the calling thread, and registers the channel index in the thread context. |
| 419 | The <nbufs> argument define the total number of chained user buffers. |
| 420 | As each user buffer contains one image, the buffer size must be FBUF_X_SIZE * FBUF_Y_SIZE. |
| 421 | The user buffers can be distributed (one buffer per cluster) or not (all buffers in same cluster). |
| 422 | This function initializes the chained buffer descriptor for the frame buffer (one single buffer). |
| 423 | The thread exit if no CMA channel available. |
| 424 | |
| 425 | === 4) void '''giet_fbf_cma_init_buf'''( unsigned int index void* buf_vaddr , void* sts_vaddr ) === |
| 426 | This function initializes the chained buffer descriptor for one user buffer identified by the <index> argument. |
| 427 | This <index> argument must be smaller than the <nbufs> argument in giet_fbf_cma_alloc() above. |
| 428 | The set of user buffers will be transferred by the CMA peripheral in the order of increasing indexes. |
| 429 | This function must be called <nbufs> times, to initialize the <nbufs> chained buffers descriptors. |
| 430 | Each user buffer must be large enough to store a complete image, and must be aligned on a 64 bytes boundary. |
| 431 | The buffer status contain just a Boolean, but it must occupy 64 bytes, and must be aligned on a 64 bytes boundary. |
| 432 | For a given user buffer, the buffer and the associated status must be in the same cluster. |
| 433 | * '''index''' : buffer index |
| 434 | * '''buf_vaddr''' : virtual address of the user buffer. |
| 435 | * '''sts_vaddr''' : virtual address of the buffer status. |
| 436 | The thread exit if buffers are not aligned, index too large, or buffer and status in different clusters. |
| 437 | |
| 438 | === 5) void '''giet_fbf_cma_start'''() === |
| 439 | This function activates the transfer of a stream of images from a set of chained user buffers to the frame buffer. It must be used in conjunction with the giet_fbf_cma_display() function. The chained buffer descriptors should have been initialized by the giet_fbf_cma_init_buf() function. |
| 440 | |
| 441 | === 6) void '''giet_fbf_cma_display'''( unsigned int index ) === |
| 442 | This function enables the transfer of the buffer identified by the <index> argument. |
| 443 | For each user buffer, the buffer status must be used as a SET/RESET synchronisation flip-flop, that is set by the application |
| 444 | and reset by the CMA peripheral. |