Changes between Version 126 and Version 127 of library_stdio
- Timestamp:
- Oct 6, 2015, 11:41:10 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_stdio
v126 v127 403 403 == __Frame Buffer related system calls__ == 404 404 405 To display images, an user thread can access the frame buffer through a memcpy() or through the ''Chained Buffer DMA'' controller (called CMA). 406 The four first functions use a private CMA channel that is registered in the thread context. The Two last functions use a memcpy(). 407 408 === 1) void '''giet_fbf_cma_alloc'''() 405 To display images, an user application must get the frame buffer ownership, and check the frame buffer size (width and height). 406 Then, it can access the frame buffer through a (software) memcpy() or through the (hardware) ''Chained Buffer DMA'' controller (called CMA). 407 408 === 1) void '''giet_fbf_size'''( unsigned int* width , unsigned int* height) === 409 This function returns in the <width> and <height> arguments the number of pixels per line, and the number of lines of the frame buffer 410 411 === 2) void '''giet_fbf_alloc'''() === 412 This blocking function allows the calling thread to get exclusive ownership of the shared FBF peripheral. It returns only when the lock has been taken. 413 This lock is released when the thread completes execution, after a giet_pthread_exit(), or a get_pthread_kill(). 414 415 === 3) void '''giet_fbf_cma_alloc'''() 409 416 This function allocates a private CMA channel to the calling thread, and registers the channel index 410 417 in the thread context. 411 418 The threadthread exit if no CMA channel available 412 419 413 === 2) void '''giet_fbf_cma_init_buf'''( void* buf0_vbase , void* buf1_vbase , void* sts0_vaddr , void* sts1_vaddr ) ===420 === 4) void '''giet_fbf_cma_init_buf'''( void* buf0_vbase , void* buf1_vbase , void* sts0_vaddr , void* sts1_vaddr ) === 414 421 This function initializes the chained buffer descriptors for the two source buffers and the frame buffer. 415 422 The buf0 and buf1 user buffers must be large enough to store a complete image, and must be aligned on a 64 bytes boundary. … … 420 427 * '''sts1_vaddr''' : virtual address of the second buffer status. 421 428 422 === 3) void '''giet_fbf_cma_start'''( unsigned int length ) ===429 === 5) void '''giet_fbf_cma_start'''( unsigned int length ) === 423 430 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. 424 431 * '''length''' is the size of the image (bytes). 425 432 426 === 4) void '''giet_fbf_cma_display'''( unsigned int buffer ) ===433 === 6) void '''giet_fbf_cma_display'''( unsigned int buffer ) === 427 434 This function enables the transfer of the specified buffer. 428 435 * '''buffer''' is the buffer index (0 or 1). 429 436 430 === 5) void '''giet_fbf_cma_stop'''( ) ===437 === 7) void '''giet_fbf_cma_stop'''( ) === 431 438 This function desactivates the CMA channel allocated to the calling thread. 432 439 433 === 6) void '''giet_fbf_sync_read'''( unsigned int offset , void* buffer , unsigned int length ) ===440 === 8) void '''giet_fbf_sync_read'''( unsigned int offset , void* buffer , unsigned int length ) === 434 441 This blocking function use a memcopy strategy to transfer data from the frame buffer to an user buffer. 435 442 * '''offset''' defines the offset (in bytes) in the frame buffer, … … 437 444 * '''length''' is the number of bytes to be transfered. 438 445 439 === 7) void '''giet_fbf_sync_write'''( unsigned int offset , void* buffer , unsigned int length ) ===446 === 9) void '''giet_fbf_sync_write'''( unsigned int offset , void* buffer , unsigned int length ) === 440 447 This blocking function use a memcopy strategy to transfer data from an user buffer to the frame buffer. 441 448 * '''offset''' defines the offset (in bytes) in the frame buffer,