forked from Imagelibrary/rtems
arm/raspberrypi: framebuffer driver checks for initialization and tries runtime init if required.
Code works but there is problem how to setup caching for the regions (arm_cp15_set_translation_table_entries arguments). If ARMV7_MMU_DATA_READ_WRITE_CACHED is used then CPU accesses are noncoherent with VideoCore and some part of image update are not visible until pushed from cache by other activities. If ARMV7_MMU_DATA_READ_WRITE is used then access is extremely slow. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
This commit is contained in:
@@ -319,10 +319,20 @@ rtems_device_driver frame_buffer_open(
|
||||
{
|
||||
if ( _Atomic_Flag_test_and_set( &driver_mutex,
|
||||
ATOMIC_ORDER_ACQUIRE ) != 0 ) {
|
||||
printk( "FB_CIRRUS could not lock driver_mutex\n" );
|
||||
printk( "RaspberryPi framebuffer could not lock driver_mutex\n" );
|
||||
return RTEMS_UNSATISFIED;
|
||||
}
|
||||
|
||||
if ( fb_fix_info.smem_start == NULL ) {
|
||||
int res;
|
||||
res = rpi_fb_init();
|
||||
if ( (res < RPI_FB_INIT_OK) || (fb_fix_info.smem_start == NULL) ) {
|
||||
_Atomic_Flag_clear( &driver_mutex, ATOMIC_ORDER_RELEASE );
|
||||
printk( "RaspberryPi framebuffer initialization failed\n" );
|
||||
return RTEMS_UNSATISFIED;
|
||||
}
|
||||
}
|
||||
|
||||
memset( (void *) fb_fix_info.smem_start, 0, fb_fix_info.smem_len );
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user