summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2016-07-31 13:10:28 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2016-07-31 13:10:28 +0200
commit912a1a90ce2f40a56f174b4dac5716bb6951178d (patch)
tree0ee56b1e93a5063e8b75410d73a5ea33c9016081
parentarm/raspberrypi: VideoCore access corrections in cache operation and more err... (diff)
downloadrtems-912a1a90ce2f40a56f174b4dac5716bb6951178d.tar.bz2
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>
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/console/fb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/console/fb.c b/c/src/lib/libbsp/arm/raspberrypi/console/fb.c
index 1900a06eab..815d17e8ca 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/console/fb.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/console/fb.c
@@ -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;
}