drivers/Kconfig: Global configuration variable CONFIG_FB_CMAP is only defined in architecture-specific Kconfig files and then multiple times. Add the single global definition in drivers/Kconfig. arch/arm/src/stm32 and stm32f7: Rename the architecture-specific variables appropriately. Selecting the architecture-specific version will also select the global version.
This commit is contained in:
parent
5d6e6d66e2
commit
ba53219821
9 changed files with 119 additions and 110 deletions
|
|
@ -8197,35 +8197,35 @@ choice
|
|||
|
||||
config STM32_LTDC_L1_L8
|
||||
bool "8 bpp L8 (8-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_AL44
|
||||
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_AL88
|
||||
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_RGB565
|
||||
bool "16 bpp RGB 565"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_ARGB4444
|
||||
bool "16 bpp ARGB 4444"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_ARGB1555
|
||||
bool "16 bpp ARGB 1555"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_RGB888
|
||||
bool "24 bpp RGB 888"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32_FB_CMAP
|
||||
|
||||
config STM32_LTDC_L1_ARGB8888
|
||||
bool "32 bpp ARGB 8888"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32_FB_CMAP
|
||||
|
||||
endchoice # Layer 1 color format
|
||||
|
||||
|
|
@ -8287,18 +8287,19 @@ endchoice # Layer 2 color format
|
|||
|
||||
endif # STM32_LTDC_L2
|
||||
|
||||
config FB_CMAP
|
||||
config STM32_FB_CMAP
|
||||
bool "Enable color map support"
|
||||
default y
|
||||
select FB_CMAP
|
||||
---help---
|
||||
Enabling color map support is neccessary for ltdc L8 format.
|
||||
Enabling color map support is necessary for LTDC L8 format.
|
||||
|
||||
config FB_TRANSPARENCY
|
||||
bool "Enable transparency color map support"
|
||||
depends on FB_CMAP
|
||||
depends on STM32_FB_CMAP
|
||||
default y
|
||||
---help---
|
||||
Enabling transparency color map support is neccessary for ltdc L8 format.
|
||||
Enabling transparency color map support is necessary for LTDC L8 format.
|
||||
|
||||
config STM32_LTDC_REGDEBUG
|
||||
bool "LTDC Register level debug"
|
||||
|
|
@ -8354,17 +8355,17 @@ config STM32_DMA2D_FB_SIZE
|
|||
menu "Supported pixel format"
|
||||
|
||||
config STM32_DMA2D_L8
|
||||
depends on FB_CMAP && STM32_LTDC_L1_L8
|
||||
depends on STM32_FB_CMAP && STM32_LTDC_L1_L8
|
||||
bool "8 bpp L8 (8-bit CLUT)"
|
||||
default y
|
||||
|
||||
config STM32_DMA2D_AL44
|
||||
depends on FB_CMAP && STM32_LTDC_L1_AL44
|
||||
depends on STM32_FB_CMAP && STM32_LTDC_L1_AL44
|
||||
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
|
||||
default y
|
||||
|
||||
config STM32_DMA2D_AL88
|
||||
depends on FB_CMAP && STM32_LTDC_L1_AL88
|
||||
depends on STM32_FB_CMAP && STM32_LTDC_L1_AL88
|
||||
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
|
||||
default y
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ struct stm32_dma2d_s
|
|||
{
|
||||
struct dma2d_layer_s dma2d; /* Public dma2d interface */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
uint32_t *clut; /* Color lookup table */
|
||||
#endif
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ static const uintptr_t stm32_color_layer_t[DMA2D_NLAYERS] =
|
|||
|
||||
/* DMA2D clut memory address register */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static const uintptr_t stm32_cmar_layer_t[DMA2D_NLAYERS - 1] =
|
||||
{
|
||||
STM32_DMA2D_FGCMAR,
|
||||
|
|
@ -204,7 +204,7 @@ static void stm32_dma2d_control(uint32_t setbits, uint32_t clrbits);
|
|||
static int stm32_dma2dirq(int irq, void *context, FAR void *arg);
|
||||
static int stm32_dma2d_waitforirq(void);
|
||||
static int stm32_dma2d_start(void);
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static int stm32_dma2d_loadclut(uintptr_t reg);
|
||||
#endif
|
||||
static uint32_t stm32_dma2d_memaddress(FAR struct stm32_dma2d_overlay_s *oinfo,
|
||||
|
|
@ -222,7 +222,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
/* Public functions */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap);
|
||||
#endif
|
||||
static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
|
||||
|
|
@ -249,7 +249,7 @@ static bool g_initialized;
|
|||
|
||||
/* Allocate clut */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static uint32_t g_clut[STM32_DMA2D_NCLUT *
|
||||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
4
|
||||
|
|
@ -257,7 +257,7 @@ static uint32_t g_clut[STM32_DMA2D_NCLUT *
|
|||
3
|
||||
# endif
|
||||
/ 4 ];
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/* The DMA2D semaphore that enforces mutually exclusive access */
|
||||
|
||||
|
|
@ -280,14 +280,14 @@ static struct stm32_dma2d_s g_dma2ddev =
|
|||
{
|
||||
.dma2d =
|
||||
{
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
.setclut = stm32_dma2d_setclut,
|
||||
#endif
|
||||
.fillcolor = stm32_dma2d_fillcolor,
|
||||
.blit = stm32_dma2d_blit,
|
||||
.blend = stm32_dma2d_blend
|
||||
},
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
.clut = g_clut,
|
||||
#endif
|
||||
.lock = &g_lock
|
||||
|
|
@ -686,7 +686,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
pfccrreg = DMA2D_xGPFCCR_CM(fmt);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
if (fmt == DMA2D_PF_L8)
|
||||
{
|
||||
FAR struct stm32_dma2d_s * layer = &g_dma2ddev;
|
||||
|
|
@ -713,7 +713,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
stm32_dma2d_loadclut(stm32_pfccr_layer_t[lid]);
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/* Set alpha blend mode */
|
||||
|
||||
|
|
@ -750,7 +750,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
|
||||
{
|
||||
int n;
|
||||
|
|
@ -796,7 +796,7 @@ static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
|
|||
|
||||
return OK;
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_dma2d_fillcolor
|
||||
|
|
@ -828,7 +828,7 @@ static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
|
|||
|
||||
lcdinfo("oinfo=%p, argb=%08x\n", oinfo, argb);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
if (oinfo->fmt == DMA2D_PF_L8)
|
||||
{
|
||||
/* CLUT output not supported */
|
||||
|
|
@ -1010,7 +1010,7 @@ static int stm32_dma2d_blend(FAR struct stm32_dma2d_overlay_s *doverlay,
|
|||
"barea.h=%d\n", doverlay, destxpos, destypos, foverlay, forexpos,
|
||||
foreypos, boverlay, barea, barea->x, barea->y, barea->w, barea->h);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
if (doverlay->fmt == DMA2D_PF_L8)
|
||||
{
|
||||
/* CLUT output not supported */
|
||||
|
|
@ -1113,7 +1113,7 @@ int stm32_dma2dinitialize(void)
|
|||
nxsem_init(g_interrupt.sem, 0, 0);
|
||||
nxsem_setprotocol(g_interrupt.sem, SEM_PRIO_NONE);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
/* Enable dma2d transfer and clut loading interrupts only */
|
||||
|
||||
stm32_dma2d_control(DMA2D_CR_TCIE | DMA2D_CR_CTCIE, DMA2D_CR_TEIE |
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ struct dma2d_layer_s
|
|||
* On error - -EINVAL
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
int (*setclut)(FAR const struct fb_cmap_s * cmap);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@
|
|||
|
||||
/* Calculate the size of the layers clut table */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
# if defined(CONFIG_STM32_DMA2D) && !defined(CONFIG_STM32_DMA2D_L8)
|
||||
# error "DMA2D must also support L8 CLUT pixel format if supported by LTDC"
|
||||
# endif
|
||||
|
|
@ -484,7 +484,7 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_FB_CMAP
|
||||
#ifndef CONFIG_STM32_FB_CMAP
|
||||
# if defined(STM32_LTDC_L1CMAP) || defined(STM32_LTDC_L2CMAP)
|
||||
# undef STM32_LTDC_L1CMAP
|
||||
# undef STM32_LTDC_L2CMAP
|
||||
|
|
@ -543,20 +543,20 @@
|
|||
|
||||
#ifdef CONFIG_STM32_DMA2D
|
||||
# ifdef CONFIG_FB_OVERLAY_BLIT
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32_FB_CMAP
|
||||
# define LTDC_BLIT_ACCL FB_ACCL_BLIT
|
||||
# else
|
||||
# define LTDC_BLIT_ACCL FB_ACCL_BLIT | FB_ACCL_BLEND
|
||||
# endif /* CONFIG_FB_CMAP */
|
||||
# endif /* CONFIG_STM32_FB_CMAP */
|
||||
# else
|
||||
# define LTDC_BLIT_ACCL 0
|
||||
# endif /* CONFIG_FB_OVERLAY_BLIT */
|
||||
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32_FB_CMAP
|
||||
# define LTDC_DMA2D_ACCL LTDC_BLIT_ACCL
|
||||
# else
|
||||
# define LTDC_DMA2D_ACCL FB_ACCL_COLOR | LTDC_BLIT_ACCL
|
||||
# endif /* CONFIG_FB_CMAP */
|
||||
# endif /* CONFIG_STM32_FB_CMAP */
|
||||
#else
|
||||
# define LTDC_DMA2D_ACCL 0
|
||||
#endif /* CONFIG_STM32_DMA2D */
|
||||
|
|
@ -568,7 +568,7 @@
|
|||
|
||||
/* Acceleration support for DMA2D overlays */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
# ifdef CONFIG_FB_OVERLAY_BLIT
|
||||
# define DMA2D_ACCL FB_ACCL_BLIT | FB_ACCL_AREA
|
||||
# else
|
||||
|
|
@ -652,7 +652,7 @@ struct stm32_ltdcdev_s
|
|||
|
||||
/* Cmap information */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
struct fb_cmap_s cmap;
|
||||
#endif
|
||||
|
||||
|
|
@ -716,7 +716,7 @@ static bool stm32_ltdc_lvalidate(FAR const struct stm32_ltdc_s *layer,
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static void stm32_ltdc_lputclut(FAR struct stm32_ltdc_s * layer,
|
||||
FAR const struct fb_cmap_s *cmap);
|
||||
static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
|
||||
|
|
@ -739,7 +739,7 @@ static int stm32_getplaneinfo(FAR struct fb_vtable_s *vtable,
|
|||
* mapping
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static int stm32_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap);
|
||||
static int stm32_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
|
|
@ -809,7 +809,7 @@ static const uint32_t g_ltdcpins[] =
|
|||
|
||||
#define STM32_LTDC_NPINCONFIGS (sizeof(g_ltdcpins) / sizeof(uint32_t))
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
/* The layers clut table entries */
|
||||
|
||||
static uint8_t g_redclut[STM32_LTDC_NCLUT];
|
||||
|
|
@ -818,7 +818,7 @@ static uint8_t g_blueclut[STM32_LTDC_NCLUT];
|
|||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
static uint8_t g_transpclut[STM32_LTDC_NCLUT];
|
||||
# endif
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/* The LTDC semaphore that enforces mutually exclusive access */
|
||||
|
||||
|
|
@ -850,7 +850,7 @@ static struct stm32_ltdcdev_s g_vtable =
|
|||
.waitforvsync = stm32_waitforvsync
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
,
|
||||
.getcmap = stm32_getcmap,
|
||||
.putcmap = stm32_putcmap
|
||||
|
|
@ -911,7 +911,7 @@ static struct stm32_ltdcdev_s g_vtable =
|
|||
}
|
||||
#endif /* CONFIG_STM32_LTDC_L2 */
|
||||
,
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
.cmap =
|
||||
{
|
||||
.first = 0,
|
||||
|
|
@ -1230,7 +1230,7 @@ static const uintptr_t stm32_cfblnr_layer_t[LTDC_NLAYERS] =
|
|||
|
||||
/* LTDC_LxCLUTWR */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static const uintptr_t stm32_clutwr_layer_t[LTDC_NLAYERS] =
|
||||
{
|
||||
STM32_LTDC_L1CLUTWR
|
||||
|
|
@ -1238,7 +1238,7 @@ static const uintptr_t stm32_clutwr_layer_t[LTDC_NLAYERS] =
|
|||
, STM32_LTDC_L2CLUTWR
|
||||
# endif
|
||||
};
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/* The initialized state of the driver */
|
||||
|
||||
|
|
@ -1938,7 +1938,7 @@ static void stm32_ltdc_lchromakey(FAR struct stm32_ltdc_s *layer,
|
|||
|
||||
/* Set chromakey */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
uint8_t r = g_vtable.cmap.red[chroma];
|
||||
uint8_t g = g_vtable.cmap.green[chroma];
|
||||
uint8_t b = g_vtable.cmap.blue[chroma];
|
||||
|
|
@ -2008,7 +2008,7 @@ static void stm32_ltdc_lchromakeyenable(FAR struct stm32_ltdc_s *layer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static void stm32_ltdc_lclutenable(FAR struct stm32_ltdc_s *layer, bool enable)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -2128,7 +2128,7 @@ static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
|
|||
cmap->blue[n]);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_ltdc_lclear
|
||||
|
|
@ -2231,7 +2231,7 @@ static void stm32_ltdc_linit(uint8_t overlay)
|
|||
|
||||
stm32_ltdc_lchromakeyenable(layer, stm32_chromakeyen_layer_t[overlay]);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
/* Disable clut by default */
|
||||
|
||||
if (dev->vinfo.fmt == FB_FMT_RGB8)
|
||||
|
|
@ -2394,7 +2394,7 @@ static int stm32_getplaneinfo(struct fb_vtable_s *vtable, int planeno,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
static int stm32_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap)
|
||||
{
|
||||
|
|
@ -2525,7 +2525,7 @@ static int stm32_putcmap(struct fb_vtable_s *vtable,
|
|||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/***************************************************************************
|
||||
* Name: stm32_ioctl_waitforvsync
|
||||
|
|
@ -2665,7 +2665,7 @@ static int stm32_setchromakey(FAR struct fb_vtable_s *vtable,
|
|||
# endif
|
||||
|
||||
nxsem_wait(layer->lock);
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32_FB_CMAP
|
||||
if (oinfo->chromakey >= g_vtable.cmap.len)
|
||||
{
|
||||
lcderr("ERROR: Clut index %d is out of range\n", oinfo->chromakey);
|
||||
|
|
@ -3023,7 +3023,7 @@ int stm32_ltdcinitialize(void)
|
|||
DEBUGASSERT(g_vtable.dma2d != NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
/* Cleanup clut */
|
||||
|
||||
memset(&g_redclut, 0, STM32_LTDC_NCLUT);
|
||||
|
|
@ -3032,7 +3032,7 @@ int stm32_ltdcinitialize(void)
|
|||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
memset(&g_transpclut, 0, STM32_LTDC_NCLUT);
|
||||
# endif
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32_FB_CMAP */
|
||||
|
||||
/* Initialize ltdc layer */
|
||||
|
||||
|
|
|
|||
|
|
@ -4969,35 +4969,35 @@ choice
|
|||
|
||||
config STM32F7_LTDC_L1_L8
|
||||
bool "8 bpp L8 (8-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_AL44
|
||||
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_AL88
|
||||
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
|
||||
depends on FB_CMAP
|
||||
depends on STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_RGB565
|
||||
bool "16 bpp RGB 565"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_ARGB4444
|
||||
bool "16 bpp ARGB 4444"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_ARGB1555
|
||||
bool "16 bpp ARGB 1555"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_RGB888
|
||||
bool "24 bpp RGB 888"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32F7_FB_CMAP
|
||||
|
||||
config STM32F7_LTDC_L1_ARGB8888
|
||||
bool "32 bpp ARGB 8888"
|
||||
depends on !FB_CMAP
|
||||
depends on !STM32F7_FB_CMAP
|
||||
|
||||
endchoice # Layer 1 color format
|
||||
|
||||
|
|
@ -5059,16 +5059,17 @@ endchoice # Layer 2 color format
|
|||
|
||||
endif # STM32F7_LTDC_L2
|
||||
|
||||
config FB_CMAP
|
||||
config STM32F7_FB_CMAP
|
||||
bool "Enable color map support"
|
||||
default y
|
||||
select FB_CMAP
|
||||
---help---
|
||||
Enabling color map support is neccessary for ltdc L8 format.
|
||||
|
||||
config FB_TRANSPARENCY
|
||||
bool "Enable transparency color map support"
|
||||
default y
|
||||
depends on FB_CMAP
|
||||
depends on STM32F7_FB_CMAP
|
||||
---help---
|
||||
Enabling transparency color map support is neccessary for
|
||||
ltdc L8 format.
|
||||
|
|
@ -5129,17 +5130,17 @@ config STM32F7_DMA2D_FB_SIZE
|
|||
menu "Supported pixel format"
|
||||
|
||||
config STM32F7_DMA2D_L8
|
||||
depends on FB_CMAP && STM32F7_LTDC_L1_L8
|
||||
depends on STM32F7_FB_CMAP && STM32F7_LTDC_L1_L8
|
||||
bool "8 bpp L8 (8-bit CLUT)"
|
||||
default y
|
||||
|
||||
config STM32F7_DMA2D_AL44
|
||||
depends on FB_CMAP && STM32F7_LTDC_L1_AL44
|
||||
depends on STM32F7_FB_CMAP && STM32F7_LTDC_L1_AL44
|
||||
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
|
||||
default y
|
||||
|
||||
config STM32F7_DMA2D_AL88
|
||||
depends on FB_CMAP && STM32F7_LTDC_L1_AL88
|
||||
depends on STM32F7_FB_CMAP && STM32F7_LTDC_L1_AL88
|
||||
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
|
||||
default y
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ struct stm32_dma2d_s
|
|||
{
|
||||
struct dma2d_layer_s dma2d; /* Public dma2d interface */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
uint32_t *clut; /* Color lookup table */
|
||||
#endif
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ static const uintptr_t stm32_color_layer_t[DMA2D_NLAYERS] =
|
|||
STM32_DMA2D_OCOLR
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
/* DMA2D clut memory address register */
|
||||
|
||||
static const uintptr_t stm32_cmar_layer_t[DMA2D_NLAYERS - 1] =
|
||||
|
|
@ -205,7 +205,7 @@ static void stm32_dma2d_control(uint32_t setbits, uint32_t clrbits);
|
|||
static int stm32_dma2dirq(int irq, void *context, FAR void *arg);
|
||||
static int stm32_dma2d_waitforirq(void);
|
||||
static int stm32_dma2d_start(void);
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static int stm32_dma2d_loadclut(uintptr_t reg);
|
||||
#endif
|
||||
static uint32_t stm32_dma2d_memaddress(FAR struct stm32_dma2d_overlay_s *oinfo,
|
||||
|
|
@ -223,7 +223,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
/* Public functions */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap);
|
||||
#endif
|
||||
static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
|
||||
|
|
@ -250,7 +250,7 @@ static bool g_initialized;
|
|||
|
||||
/* Allocate clut */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static uint32_t g_clut[STM32_DMA2D_NCLUT *
|
||||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
4
|
||||
|
|
@ -258,7 +258,7 @@ static uint32_t g_clut[STM32_DMA2D_NCLUT *
|
|||
3
|
||||
# endif
|
||||
/ 4 ];
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/* The DMA2D semaphore that enforces mutually exclusive access */
|
||||
|
||||
|
|
@ -281,14 +281,14 @@ static struct stm32_dma2d_s g_dma2ddev =
|
|||
{
|
||||
.dma2d =
|
||||
{
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
.setclut = stm32_dma2d_setclut,
|
||||
#endif
|
||||
.fillcolor = stm32_dma2d_fillcolor,
|
||||
.blit = stm32_dma2d_blit,
|
||||
.blend = stm32_dma2d_blend
|
||||
},
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
.clut = g_clut,
|
||||
#endif
|
||||
.lock = &g_lock
|
||||
|
|
@ -687,7 +687,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
pfccrreg = DMA2D_xGPFCCR_CM(fmt);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
if (fmt == DMA2D_PF_L8)
|
||||
{
|
||||
FAR struct stm32_dma2d_s * layer = &g_dma2ddev;
|
||||
|
|
@ -714,7 +714,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
|
||||
stm32_dma2d_loadclut(stm32_pfccr_layer_t[lid]);
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/* Set alpha blend mode */
|
||||
|
||||
|
|
@ -751,7 +751,7 @@ static void stm32_dma2d_lpfc(int lid, uint32_t blendmode, uint8_t alpha,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
|
||||
{
|
||||
int n;
|
||||
|
|
@ -797,7 +797,7 @@ static int stm32_dma2d_setclut(FAR const struct fb_cmap_s *cmap)
|
|||
|
||||
return OK;
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_dma2d_fillcolor
|
||||
|
|
@ -829,7 +829,7 @@ static int stm32_dma2d_fillcolor(FAR struct stm32_dma2d_overlay_s *oinfo,
|
|||
|
||||
lcdinfo("oinfo=%p, argb=%08x\n", oinfo, argb);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
if (oinfo->fmt == DMA2D_PF_L8)
|
||||
{
|
||||
/* CLUT output not supported */
|
||||
|
|
@ -1011,7 +1011,7 @@ static int stm32_dma2d_blend(FAR struct stm32_dma2d_overlay_s *doverlay,
|
|||
"barea.h=%d\n", doverlay, destxpos, destypos, foverlay, forexpos,
|
||||
foreypos, boverlay, barea, barea->x, barea->y, barea->w, barea->h);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
if (doverlay->fmt == DMA2D_PF_L8)
|
||||
{
|
||||
/* CLUT output not supported */
|
||||
|
|
@ -1114,7 +1114,7 @@ int stm32_dma2dinitialize(void)
|
|||
nxsem_init(g_interrupt.sem, 0, 0);
|
||||
nxsem_setprotocol(g_interrupt.sem, SEM_PRIO_NONE);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
/* Enable dma2d transfer and clut loading interrupts only */
|
||||
|
||||
stm32_dma2d_control(DMA2D_CR_TCIE | DMA2D_CR_CTCIE, DMA2D_CR_TEIE |
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ struct dma2d_layer_s
|
|||
* On error - -EINVAL
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
int (*setclut)(FAR const struct fb_cmap_s * cmap);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@
|
|||
|
||||
/* Calculate the size of the layers clut table */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
# if defined(CONFIG_STM32F7_DMA2D) && !defined(CONFIG_STM32F7_DMA2D_L8)
|
||||
# error "DMA2D must also support L8 CLUT pixel format if supported by LTDC"
|
||||
# endif
|
||||
|
|
@ -486,7 +486,7 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_FB_CMAP
|
||||
#ifndef CONFIG_STM32F7_FB_CMAP
|
||||
# if defined(STM32_LTDC_L1CMAP) || defined(STM32_LTDC_L2CMAP)
|
||||
# undef STM32_LTDC_L1CMAP
|
||||
# undef STM32_LTDC_L2CMAP
|
||||
|
|
@ -545,20 +545,20 @@
|
|||
|
||||
#ifdef CONFIG_STM32F7_DMA2D
|
||||
# ifdef CONFIG_FB_OVERLAY_BLIT
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32F7_FB_CMAP
|
||||
# define LTDC_BLIT_ACCL FB_ACCL_BLIT
|
||||
# else
|
||||
# define LTDC_BLIT_ACCL FB_ACCL_BLIT | FB_ACCL_BLEND
|
||||
# endif /* CONFIG_FB_CMAP */
|
||||
# endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
# else
|
||||
# define LTDC_BLIT_ACCL 0
|
||||
# endif /* CONFIG_FB_OVERLAY_BLIT */
|
||||
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32F7_FB_CMAP
|
||||
# define LTDC_DMA2D_ACCL LTDC_BLIT_ACCL
|
||||
# else
|
||||
# define LTDC_DMA2D_ACCL FB_ACCL_COLOR | LTDC_BLIT_ACCL
|
||||
# endif /* CONFIG_FB_CMAP */
|
||||
# endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
#else
|
||||
# define LTDC_DMA2D_ACCL 0
|
||||
#endif /* CONFIG_STM32F7_DMA2D */
|
||||
|
|
@ -570,7 +570,7 @@
|
|||
|
||||
/* Acceleration support for DMA2D overlays */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
# ifdef CONFIG_FB_OVERLAY_BLIT
|
||||
# define DMA2D_ACCL FB_ACCL_BLIT | FB_ACCL_AREA
|
||||
# else
|
||||
|
|
@ -654,7 +654,7 @@ struct stm32_ltdcdev_s
|
|||
|
||||
/* Cmap information */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
struct fb_cmap_s cmap;
|
||||
#endif
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ static bool stm32_ltdc_lvalidate(FAR const struct stm32_ltdc_s *layer,
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static void stm32_ltdc_lputclut(FAR struct stm32_ltdc_s * layer,
|
||||
FAR const struct fb_cmap_s *cmap);
|
||||
static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
|
||||
|
|
@ -741,7 +741,7 @@ static int stm32_getplaneinfo(FAR struct fb_vtable_s *vtable,
|
|||
* mapping
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static int stm32_getcmap(FAR struct fb_vtable_s *vtable,
|
||||
FAR struct fb_cmap_s *cmap);
|
||||
static int stm32_putcmap(FAR struct fb_vtable_s *vtable,
|
||||
|
|
@ -811,7 +811,7 @@ static const uint32_t g_ltdcpins[] =
|
|||
|
||||
#define STM32_LTDC_NPINCONFIGS (sizeof(g_ltdcpins) / sizeof(uint32_t))
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
/* The layers clut table entries */
|
||||
|
||||
static uint8_t g_redclut[STM32_LTDC_NCLUT];
|
||||
|
|
@ -820,7 +820,7 @@ static uint8_t g_blueclut[STM32_LTDC_NCLUT];
|
|||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
static uint8_t g_transpclut[STM32_LTDC_NCLUT];
|
||||
# endif
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/* The LTDC semaphore that enforces mutually exclusive access */
|
||||
|
||||
|
|
@ -852,7 +852,7 @@ static struct stm32_ltdcdev_s g_vtable =
|
|||
.waitforvsync = stm32_waitforvsync
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
,
|
||||
.getcmap = stm32_getcmap,
|
||||
.putcmap = stm32_putcmap
|
||||
|
|
@ -913,7 +913,7 @@ static struct stm32_ltdcdev_s g_vtable =
|
|||
}
|
||||
#endif /* CONFIG_STM32F7_LTDC_L2 */
|
||||
,
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
.cmap =
|
||||
{
|
||||
.first = 0,
|
||||
|
|
@ -1232,7 +1232,7 @@ static const uintptr_t stm32_cfblnr_layer_t[LTDC_NLAYERS] =
|
|||
|
||||
/* LTDC_LxCLUTWR */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static const uintptr_t stm32_clutwr_layer_t[LTDC_NLAYERS] =
|
||||
{
|
||||
STM32_LTDC_L1CLUTWR
|
||||
|
|
@ -1240,7 +1240,7 @@ static const uintptr_t stm32_clutwr_layer_t[LTDC_NLAYERS] =
|
|||
, STM32_LTDC_L2CLUTWR
|
||||
# endif
|
||||
};
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/* The initialized state of the driver */
|
||||
|
||||
|
|
@ -1940,7 +1940,7 @@ static void stm32_ltdc_lchromakey(FAR struct stm32_ltdc_s *layer,
|
|||
|
||||
/* Set chromakey */
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
uint8_t r = g_vtable.cmap.red[chroma];
|
||||
uint8_t g = g_vtable.cmap.green[chroma];
|
||||
uint8_t b = g_vtable.cmap.blue[chroma];
|
||||
|
|
@ -2010,7 +2010,7 @@ static void stm32_ltdc_lchromakeyenable(FAR struct stm32_ltdc_s *layer,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static void stm32_ltdc_lclutenable(FAR struct stm32_ltdc_s *layer, bool enable)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
|
@ -2130,7 +2130,7 @@ static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
|
|||
cmap->blue[n]);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_ltdc_lclear
|
||||
|
|
@ -2233,7 +2233,7 @@ static void stm32_ltdc_linit(uint8_t overlay)
|
|||
|
||||
stm32_ltdc_lchromakeyenable(layer, stm32_chromakeyen_layer_t[overlay]);
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
/* Disable clut by default */
|
||||
|
||||
if (dev->vinfo.fmt == FB_FMT_RGB8)
|
||||
|
|
@ -2396,7 +2396,7 @@ static int stm32_getplaneinfo(struct fb_vtable_s *vtable, int planeno,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
static int stm32_getcmap(struct fb_vtable_s *vtable,
|
||||
struct fb_cmap_s *cmap)
|
||||
{
|
||||
|
|
@ -2527,7 +2527,7 @@ static int stm32_putcmap(struct fb_vtable_s *vtable,
|
|||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/***************************************************************************
|
||||
* Name: stm32_ioctl_waitforvsync
|
||||
|
|
@ -2667,7 +2667,7 @@ static int stm32_setchromakey(FAR struct fb_vtable_s *vtable,
|
|||
# endif
|
||||
|
||||
nxsem_wait(layer->lock);
|
||||
# ifdef CONFIG_FB_CMAP
|
||||
# ifdef CONFIG_STM32F7_FB_CMAP
|
||||
if (oinfo->chromakey >= g_vtable.cmap.len)
|
||||
{
|
||||
lcderr("ERROR: Clut index %d is out of range\n", oinfo->chromakey);
|
||||
|
|
@ -3025,7 +3025,7 @@ int stm32_ltdcinitialize(void)
|
|||
DEBUGASSERT(g_vtable.dma2d != NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_CMAP
|
||||
#ifdef CONFIG_STM32F7_FB_CMAP
|
||||
/* Cleanup clut */
|
||||
|
||||
memset(&g_redclut, 0, STM32_LTDC_NCLUT);
|
||||
|
|
@ -3034,7 +3034,7 @@ int stm32_ltdcinitialize(void)
|
|||
# ifdef CONFIG_FB_TRANSPARENCY
|
||||
memset(&g_transpclut, 0, STM32_LTDC_NCLUT);
|
||||
# endif
|
||||
#endif /* CONFIG_FB_CMAP */
|
||||
#endif /* CONFIG_STM32F7_FB_CMAP */
|
||||
|
||||
/* Initialize ltdc layer */
|
||||
|
||||
|
|
|
|||
|
|
@ -270,6 +270,13 @@ if DRIVERS_AUDIO
|
|||
source drivers/audio/Kconfig
|
||||
endif # DRIVERS_AUDIO
|
||||
|
||||
config FB_CMAP
|
||||
bool
|
||||
default n
|
||||
---help---
|
||||
Set by driver-specific configuration to indicate support for color
|
||||
mapping. Not directly user selectable.
|
||||
|
||||
menuconfig DRIVERS_VIDEO
|
||||
bool "Video Device Support"
|
||||
default n
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue