diff options
-rw-r--r-- | nuttx/arch/arm/src/dm320/dm320_framebuffer.c | 67 | ||||
-rw-r--r-- | nuttx/arch/sim/src/up_framebuffer.c | 37 | ||||
-rw-r--r-- | nuttx/include/nuttx/arch.h | 45 |
3 files changed, 100 insertions, 49 deletions
diff --git a/nuttx/arch/arm/src/dm320/dm320_framebuffer.c b/nuttx/arch/arm/src/dm320/dm320_framebuffer.c index 3535dfe1e..3cd890e5d 100644 --- a/nuttx/arch/arm/src/dm320/dm320_framebuffer.c +++ b/nuttx/arch/arm/src/dm320/dm320_framebuffer.c @@ -1357,6 +1357,10 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcurs /**************************************************************************** * Name: up_fbinitialize + * + * Description: + * Initialize the video hardware + * ****************************************************************************/ int up_fbinitialize(void) @@ -1379,46 +1383,43 @@ int up_fbinitialize(void) } /**************************************************************************** - * Name: up_getvid0vtable - ****************************************************************************/ + * Name: up_fbgetvplane + * + * Description: + * Return a a reference to the framebuffer object for the specified video plane. + * + * Input parameters: + * None + * + * Returned value: + * Reference to the framebuffer object (NULL on failure) + * + ***************************************************************************/ -#ifndef CONFIG_DM320_VID0_DISABLE -FAR struct fb_vtable_s up_getvid0vtable(void) +FAR struct fb_vtable_s *up_fbgetvplane(int vplane) { - return g_vid0vtable; -} + switch (vplane) + { +#ifndef CONFIG_DM320_VID0_DISABLE + case DM320_VIDWIN0: /* VID0 window */ + return &g_vid0vtable; #endif - -/**************************************************************************** - * Name: up_getvid1vtable - ****************************************************************************/ - #ifndef CONFIG_DM320_VID1_DISABLE -FAR struct fb_vtable_s up_getvid1vtable(void) -{ - return g_vid1vtable; -} + case DM320_VIDWIN1: /* VID1 window */ + return &g_vid1vtable; #endif - -/**************************************************************************** - * Name: up_getosd0vtable - ****************************************************************************/ - #ifndef CONFIG_DM320_OSD0_DISABLE -FAR struct fb_vtable_s up_getosd0vtable(void) -{ - return g_osd0vtable; -} + case DM320_OSDWIN0: /* OSD2 window */ + return &g_osd0vtable; #endif - -/**************************************************************************** - * Name: up_getosd1vtable - ****************************************************************************/ - #ifndef CONFIG_DM320_OSD1_DISABLE -FAR struct fb_vtable_s up_getosd1vtable(void) -{ - return g_osd1vtable; + case DM320_OSDWIN1: /* OSD2 window */ + return &g_osd1vtable; +#endif + default: + break; + } + return NULL; } #endif @@ -1426,7 +1427,7 @@ FAR struct fb_vtable_s up_getosd1vtable(void) * Name: up_fbteardown ****************************************************************************/ -void cleanup_module(void) +void fb_teardown(void) { /* Disable the hardware */ diff --git a/nuttx/arch/sim/src/up_framebuffer.c b/nuttx/arch/sim/src/up_framebuffer.c index ae7023b1a..31bb1d459 100644 --- a/nuttx/arch/sim/src/up_framebuffer.c +++ b/nuttx/arch/sim/src/up_framebuffer.c @@ -336,10 +336,23 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable, ****************************************************************************/ /**************************************************************************** - * Name: up_getfbobject + * Name: up_fbinitialize * * Description: - * Get a reference to the framebuffer object + * Initialize the video hardware + * + ****************************************************************************/ + +int up_fbinitialize(void) +{ + return OK; +} + +/**************************************************************************** + * Name: up_fbgetvplane + * + * Description: + * Return a a reference to the framebuffer object for the specified video plane. * * Input parameters: * None @@ -347,9 +360,25 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable, * Returned value: * Reference to the framebuffer object (NULL on failure) * + ***************************************************************************/ + +FAR struct fb_vtable_s *up_fbgetvplane(int vplane) +{ + if (vplane == 0) + { + return &g_fbobject; + } + else + { + return NULL; + } +} + +/**************************************************************************** + * Name: up_fbteardown ****************************************************************************/ -FAR const struct fb_vtable_s *up_getfbobject(void) +void fb_uninitialize(void) { - return &g_fbobject; } + diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index e2e8958ea..b5e33d739 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -433,6 +433,39 @@ EXTERN int up_prioritize_irq(int irq, int priority); #endif /**************************************************************************** + * Name: up_mdelay and up_udelay + * + * Description: + * Some device drivers may require that the plaform-specific logic + * provide these timing loops for short delays. + * + ***************************************************************************/ + +EXTERN void up_mdelay(unsigned int milliseconds); +EXTERN void up_udelay(unsigned int microseconds); + +/**************************************************************************** + * Name: up_fbinitialize, up_fbuninitialize, up_fbgetvplane + * + * Description: + * If an architecture supports a framebuffer, then it must provide APIs + * to access the framebuffer as follows: + * + * up_fbinitialize - Initialize the video hardware + * up_fbgetvplane - Return a a reference to the framebuffer object for + * the specified video plane. Most OSDs support + * multiple planes of video. + * up_fbuninitialize - Unitialize the framebuffer support + * + ***************************************************************************/ + +struct fb_vtable_s; /* See nuttx/fb.h */ + +EXTERN int up_fbinitialize(void); +EXTERN FAR struct fb_vtable_s *up_fbgetvplane(int vplane); +EXTERN void fb_uninitialize(void); + +/**************************************************************************** * These are standard interfaces that are exported by the OS * for use by the architecture specific logic ****************************************************************************/ @@ -464,18 +497,6 @@ EXTERN void sched_process_timer(void); EXTERN void irq_dispatch(int irq, FAR void *context); /**************************************************************************** - * Name: up_mdelay and up_udelay - * - * Description: - * Some device drivers may require that the plaform-specific logic - * provide these timing loops for short delays. - * - ***************************************************************************/ - -EXTERN void up_mdelay(unsigned int milliseconds); -EXTERN void up_udelay(unsigned int microseconds); - -/**************************************************************************** * Debug interfaces exported by the architecture-specific logic ****************************************************************************/ |