[rtems commit] arm/raspberrypi: framebuffer driver checks for initialization and tries runtime init if required.
Pavel Pisa
ppisa at rtems.org
Sun Jul 31 11:10:44 UTC 2016
Module: rtems
Branch: master
Commit: 912a1a90ce2f40a56f174b4dac5716bb6951178d
Changeset: http://git.rtems.org/rtems/commit/?id=912a1a90ce2f40a56f174b4dac5716bb6951178d
Author: Pavel Pisa <pisa at cmp.felk.cvut.cz>
Date: Sun Jul 31 13:10:28 2016 +0200
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 at cmp.felk.cvut.cz>
---
c/src/lib/libbsp/arm/raspberrypi/console/fb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/c/src/lib/libbsp/arm/raspberrypi/console/fb.c b/c/src/lib/libbsp/arm/raspberrypi/console/fb.c
index 1900a06..815d17e 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;
}
More information about the vc
mailing list