This change ports in Marco Krahl's STM32F4 framebuffer overlays for the LTDC and DMA2D into the STM32F7. That driver was same as the STM32F4 driver. I am unable to verify the update because I do not have the STM32F76x hardware. So this commit very likely breaks the LTDC/DMA2D. However, it was probably not left in a functional state anyway so I do not think that there is any loss.

Squashed commit of the following:

    arch/arm/src/stm32f7:  Some minor changes for clean compilation of LTDC.
    arch/arm/src/stm32f7:  Add overly support for LTDC driver header file.
    arch/arm/src/stm32f7:  Add overly support for LTDC driver file.
    arch/arm/src/stm32f7:  Add overly support for DMA2D driver header file.
    arch/arm/src/stm32f7:  Finishes overly support for DMA2D driver.
    arch/arm/src/stm32f7:  Partial overly support in DMA2D driver (a lot more to be donw)
    arch/arm/src/stm32f7/chip:  Clone overlay DMA2D register definitions from F4
    arch/arm/src/stm32f7:  Clone overlay configuration from stm32 F4
This commit is contained in:
Gregory Nutt
2018-06-15 13:13:12 -06:00
parent 5b899b76c4
commit 6dcce0430c
9 changed files with 2427 additions and 4711 deletions
+2 -2
View File
@@ -8176,8 +8176,8 @@ config STM32_LTDC_FB_BASE
config STM32_LTDC_FB_SIZE
int "Framebuffer memory size (bytes)"
default 0
---help---
Must be the whole size of the active LTDC layer.
---help---
Must be the whole size of the active LTDC layer.
config STM32_LTDC_L1_CHROMAKEYEN
bool "Enable chromakey support for layer 1"
-16
View File
@@ -49,22 +49,6 @@
#include <nuttx/video/fb.h>
#include <nuttx/nx/nxglib.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Inline Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
+102 -21
View File
@@ -1317,6 +1317,8 @@ config STM32F7_DSIHOST
config STM32F7_DMA2D
bool "DMA2D"
default n
select FB
select FB_OVERLAY
depends on STM32F7_HAVE_DMA2D
---help---
The STM32 DMA2D is an Chrom-Art Accelerator for image manipulation
@@ -1379,6 +1381,7 @@ config STM32F7_LPTIM1
config STM32F7_LTDC
bool "LTDC"
default n
select FB
depends on STM32F7_HAVE_LTDC
---help---
The STM32 LTDC is an LCD-TFT Display Controller available on
@@ -4881,12 +4884,6 @@ if STM32F7_LTDC
menu "LTDC Configuration"
config STM32F7_LTDC_INTERFACE
bool "LTDC interface support"
default n
---help---
Enable the ltdc interface to support ltdc layer control.
config STM32F7_LTDC_USE_DSI
bool "Use DSI as display connection"
default n
@@ -4942,6 +4939,7 @@ config STM32F7_LTDC_DITHER_BLUE
config STM32F7_LTDC_FB_BASE
hex "Framebuffer memory start address"
default 0
---help---
If you are using the LTDC, then you must provide the address
of the start of the framebuffer. This address will typically
@@ -4950,6 +4948,20 @@ config STM32F7_LTDC_FB_BASE
config STM32F7_LTDC_FB_SIZE
int "Framebuffer memory size (bytes)"
default 0
---help---
Must be the whole size of the active LTDC layer.
config STM32F7_LTDC_L1_CHROMAKEYEN
bool "Enable chromakey support for layer 1"
default y
config STM32F7_LTDC_L1_CHROMAKEY
hex "Layer L1 initial chroma key"
default 0x00000000
config STM32F7_LTDC_L1_COLOR
hex "Layer L1 default color"
default 0x00000000
choice
prompt "Layer 1 color format"
@@ -4957,27 +4969,35 @@ choice
config STM32F7_LTDC_L1_L8
bool "8 bpp L8 (8-bit CLUT)"
depends on FB_CMAP
config STM32F7_LTDC_L1_AL44
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
depends on FB_CMAP
config STM32F7_LTDC_L1_AL88
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
depends on FB_CMAP
config STM32F7_LTDC_L1_RGB565
bool "16 bpp RGB 565"
depends on !FB_CMAP
config STM32F7_LTDC_L1_ARGB4444
bool "16 bpp ARGB 4444"
depends on !FB_CMAP
config STM32F7_LTDC_L1_ARGB1555
bool "16 bpp ARGB 1555"
depends on !FB_CMAP
config STM32F7_LTDC_L1_RGB888
bool "24 bpp RGB 888"
depends on !FB_CMAP
config STM32F7_LTDC_L1_ARGB8888
bool "32 bpp ARGB 8888"
depends on !FB_CMAP
endchoice # Layer 1 color format
@@ -4987,40 +5007,58 @@ config STM32F7_LTDC_L2
if STM32F7_LTDC_L2
config STM32F7_LTDC_L2_COLOR
hex "Layer L2 default color"
default 0x00000000
config STM32F7_LTDC_L2_CHROMAKEYEN
bool "Enable chromakey support for layer 2"
default y
config STM32F7_LTDC_L2_CHROMAKEY
hex "Layer L2 initial chroma key"
default 0x00000000
choice
prompt "Layer 2 (top layer) color format"
default STM32F7_LTDC_L2_RGB565
config STM32F7_LTDC_L2_L8
depends on STM32F7_LTDC_L1_L8
bool "8 bpp L8 (8-bit CLUT)"
config STM32F7_LTDC_L2_AL44
depends on STM32F7_LTDC_L1_AL44
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
config STM32F7_LTDC_L2_AL88
depends on STM32F7_LTDC_L1_AL88
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
config STM32F7_LTDC_L2_RGB565
depends on STM32F7_LTDC_L1_RGB565
bool "16 bpp RGB 565"
config STM32F7_LTDC_L2_ARGB4444
depends on STM32F7_LTDC_L1_ARGB4444
bool "16 bpp ARGB 4444"
config STM32F7_LTDC_L2_ARGB1555
depends on STM32F7_LTDC_L1_ARGB1555
bool "16 bpp ARGB 1555"
config STM32F7_LTDC_L2_RGB888
depends on STM32F7_LTDC_L1_RGB888
bool "24 bpp RGB 888"
config STM32F7_LTDC_L2_ARGB8888
depends on STM32F7_LTDC_L1_ARGB8888
bool "32 bpp ARGB 8888"
endchoice # Layer 2 color format
endif # STM32F7_LTDC_L2
if STM32F7_LTDC_L1_L8 || STM32F7_LTDC_L2_L8
config FB_CMAP
bool "Enable color map support"
default y
@@ -5030,12 +5068,11 @@ config FB_CMAP
config FB_TRANSPARENCY
bool "Enable transparency color map support"
default y
depends on FB_CMAP
---help---
Enabling transparency color map support is neccessary for
ltdc L8 format.
endif
config STM32F7_LTDC_REGDEBUG
bool "Enable LTDC register value debug messages"
default n
@@ -5053,49 +5090,93 @@ if STM32F7_DMA2D
menu "DMA2D Configuration"
config STM32F7_DMA2D_NLAYERS
int "Number DMA2D layers"
default 2
int "Number DMA2D overlays"
default 1
range 1 256
---help---
Number of allocatable DMA2D layers except the LTDC layer.
Number of supported DMA2D layer.
config STM32F7_DMA2D_LAYER_SHARED
bool "Overlays shared memory region"
default n
---help---
Several overlays can share the same memory region.
Setup a whole memory area (usually multiple size of the visible screen)
allows image preprocessing before they become visible by blit operation.
config STM32F7_DMA2D_LAYER_PPLINE
int "Pixel per line"
default 1
range 1 65535
---help---
If you are using the DMA2D, then you must provide the pixel per line or
width of the overlay.
config STM32F7_DMA2D_FB_BASE
hex "Framebuffer memory start address"
default 0
---help---
If you are using the DMA2D, then you must provide the address
of the start of the DMA2D overlays framebuffer. This address will typically
be in the SRAM or SDRAM memory region of the FSMC.
config STM32F7_DMA2D_FB_SIZE
int "Framebuffer memory size (bytes)"
default 0
---help---
Must be the whole size of all DMA2D overlays.
menu "Supported pixel format"
config STM32F7_DMA2D_L8
depends on FB_CMAP
depends on FB_CMAP && STM32F7_LTDC_L1_L8
bool "8 bpp L8 (8-bit CLUT)"
default y
config STM32F7_DMA2D_AL44
depends on FB_CMAP
depends on FB_CMAP && STM32F7_LTDC_L1_AL44
bool "8 bpp AL44 (4-bit alpha + 4-bit CLUT)"
default n
default y
config STM32F7_DMA2D_AL88
depends on FB_CMAP
depends on FB_CMAP && STM32F7_LTDC_L1_AL88
bool "16 bpp AL88 (8-bit alpha + 8-bit CLUT)"
default n
default y
config STM32F7_DMA2D_RGB565
bool "16 bpp RGB 565"
depends on STM32F7_LTDC_L1_RGB565
default y
config STM32F7_DMA2D_ARGB4444
bool "16 bpp ARGB 4444"
default n
depends on STM32F7_LTDC_L1_ARGB4444
default y
config STM32F7_DMA2D_ARGB1555
bool "16 bpp ARGB 1555"
default n
depends on STM32F7_LTDC_L1_ARGB15555
default y
config STM32F7_DMA2D_RGB888
bool "24 bpp RGB 888"
depends on STM32F7_LTDC_L1_RGB888
default y
config STM32F7_DMA2D_ARGB8888
bool "32 bpp ARGB 8888"
default n
depends on STM32F7_LTDC_L1_ARGB8888
default y
endmenu
config STM32F7_DMA2D_REGDEBUG
bool "DMA2D Register level debug"
depends on DEBUG_INFO && DEBUG_LCD
default n
---help---
Output detailed register-level DMA2D device debug information.
endmenu
endif # STM32F7_DMA2D
+44 -24
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/stm32/chip/stm32_dma2d.h
* arch/arm/src/stm32f7/chip/stm32_dma2d.h
*
* Copyright (C) 2014-2015 Marco Krahl. All rights reserved.
* Author: Marco Krahl <ocram.lhark@gmail.com>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H
#define __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H
#ifndef __ARCH_ARM_SRC_STM32F7_CHIP_STM32_DMA2D_H
#define __ARCH_ARM_SRC_STM32F7_CHIP_STM32_DMA2D_H
/****************************************************************************
* Included Files
@@ -70,29 +70,29 @@
#define STM32_DMA2D_OOR_OFFSET 0x0040 /* DMA2D Output Offset Register */
#define STM32_DMA2D_NLR_OFFSET 0x0044 /* DMA2D Number Of Line Register */
#define STM32_DMA2D_LWR_OFFSET 0x0048 /* DMA2D Line Watermark Register */
#define STM32_DMA2D_AMTCR_OFFSET 0x004C /* DMA2D AHB Master Time Configuration Register */
#define STM32_DMA2D_AMTCR_OFFSET 0x004c /* DMA2D AHB Master Time Configuration Register */
/* DMA2D Register Addresses **************************************************/
#define STM32_DMA2D_CR (STM32_DMA2D_BASE+STM32_DMA2D_CR_OFFSET)
#define STM32_DMA2D_ISR (STM32_DMA2D_BASE+STM32_DMA2D_ISR_OFFSET)
#define STM32_DMA2D_IFCR (STM32_DMA2D_BASE+STM32_DMA2D_IFCR_OFFSET)
#define STM32_DMA2D_FGMAR (STM32_DMA2D_BASE+STM32_DMA2D_FGMAR_OFFSET)
#define STM32_DMA2D_FGOR (STM32_DMA2D_BASE+STM32_DMA2D_FGOR_OFFSET)
#define STM32_DMA2D_BGMAR (STM32_DMA2D_BASE+STM32_DMA2D_BGMAR_OFFSET)
#define STM32_DMA2D_BGOR (STM32_DMA2D_BASE+STM32_DMA2D_BGOR_OFFSET)
#define STM32_DMA2D_FGPFCCR (STM32_DMA2D_BASE+STM32_DMA2D_FGPFCCR_OFFSET)
#define STM32_DMA2D_FGCOLR (STM32_DMA2D_BASE+STM32_DMA2D_FGCOLR_OFFSET)
#define STM32_DMA2D_BGPFCCR (STM32_DMA2D_BASE+STM32_DMA2D_BGPFCCR_OFFSET)
#define STM32_DMA2D_BGCOLR (STM32_DMA2D_BASE+STM32_DMA2D_BGCOLR_OFFSET)
#define STM32_DMA2D_FGCMAR (STM32_DMA2D_BASE+STM32_DMA2D_FGCMAR_OFFSET)
#define STM32_DMA2D_BGCMAR (STM32_DMA2D_BASE+STM32_DMA2D_BGCMAR_OFFSET)
#define STM32_DMA2D_OPFCCR (STM32_DMA2D_BASE+STM32_DMA2D_OPFCCR_OFFSET)
#define STM32_DMA2D_OCOLR (STM32_DMA2D_BASE+STM32_DMA2D_OCOLR_OFFSET)
#define STM32_DMA2D_OMAR (STM32_DMA2D_BASE+STM32_DMA2D_OMAR_OFFSET)
#define STM32_DMA2D_OOR (STM32_DMA2D_BASE+STM32_DMA2D_OOR_OFFSET)
#define STM32_DMA2D_NLR (STM32_DMA2D_BASE+STM32_DMA2D_NLR_OFFSET)
#define STM32_DMA2D_LWR (STM32_DMA2D_BASE+STM32_DMA2D_LWR_OFFSET)
#define STM32_DMA2D_CR (STM32_DMA2D_BASE + STM32_DMA2D_CR_OFFSET)
#define STM32_DMA2D_ISR (STM32_DMA2D_BASE + STM32_DMA2D_ISR_OFFSET)
#define STM32_DMA2D_IFCR (STM32_DMA2D_BASE + STM32_DMA2D_IFCR_OFFSET)
#define STM32_DMA2D_FGMAR (STM32_DMA2D_BASE + STM32_DMA2D_FGMAR_OFFSET)
#define STM32_DMA2D_FGOR (STM32_DMA2D_BASE + STM32_DMA2D_FGOR_OFFSET)
#define STM32_DMA2D_BGMAR (STM32_DMA2D_BASE + STM32_DMA2D_BGMAR_OFFSET)
#define STM32_DMA2D_BGOR (STM32_DMA2D_BASE + STM32_DMA2D_BGOR_OFFSET)
#define STM32_DMA2D_FGPFCCR (STM32_DMA2D_BASE + STM32_DMA2D_FGPFCCR_OFFSET)
#define STM32_DMA2D_FGCOLR (STM32_DMA2D_BASE + STM32_DMA2D_FGCOLR_OFFSET)
#define STM32_DMA2D_BGPFCCR (STM32_DMA2D_BASE + STM32_DMA2D_BGPFCCR_OFFSET)
#define STM32_DMA2D_BGCOLR (STM32_DMA2D_BASE + STM32_DMA2D_BGCOLR_OFFSET)
#define STM32_DMA2D_FGCMAR (STM32_DMA2D_BASE + STM32_DMA2D_FGCMAR_OFFSET)
#define STM32_DMA2D_BGCMAR (STM32_DMA2D_BASE + STM32_DMA2D_BGCMAR_OFFSET)
#define STM32_DMA2D_OPFCCR (STM32_DMA2D_BASE + STM32_DMA2D_OPFCCR_OFFSET)
#define STM32_DMA2D_OCOLR (STM32_DMA2D_BASE + STM32_DMA2D_OCOLR_OFFSET)
#define STM32_DMA2D_OMAR (STM32_DMA2D_BASE + STM32_DMA2D_OMAR_OFFSET)
#define STM32_DMA2D_OOR (STM32_DMA2D_BASE + STM32_DMA2D_OOR_OFFSET)
#define STM32_DMA2D_NLR (STM32_DMA2D_BASE + STM32_DMA2D_NLR_OFFSET)
#define STM32_DMA2D_LWR (STM32_DMA2D_BASE + STM32_DMA2D_LWR_OFFSET)
/* DMA2D Register Bit Definitions ********************************************/
@@ -156,6 +156,12 @@
#define DMA2D_xGPFCCR_ALPHA_MASK (0xFF << DMA2D_xGPFCCR_ALPHA_SHIFT)
#define DMA2D_xGPFCCR_ALPHA(n) ((uint32_t)(n) << DMA2D_xGPFCCR_ALPHA_SHIFT)
/* DMA2D PFC alpha mode */
#define STM32_DMA2D_PFCCR_AM_NONE 0
#define STM32_DMA2D_PFCCR_AM_CONST 1
#define STM32_DMA2D_PFCCR_AM_PIXEL 2
/* DMA2D Foreground/Background Color Register */
#define DMA2D_xGCOLR_BLUE_SHIFT (0) /* Bits 0-7 Blue Value */
@@ -178,6 +184,20 @@
#define DMA2D_OPFCCR_CM_MASK (7 << DMA2D_OPFCCR_CM_SHIFT)
#define DMA2D_OPFCCR_CM(n) ((uint32_t)(n) << DMA2D_OPFCCR_CM_SHIFT)
/* DMA2D PFC Pixel Format */
#define DMA2D_PF_ARGB8888 0
#define DMA2D_PF_RGB888 1
#define DMA2D_PF_RGB565 2
#define DMA2D_PF_ARGB1555 3
#define DMA2D_PF_ARGB14444 4
#define DMA2D_PF_L8 5
#define DMA2D_PF_AL44 6
#define DMA2D_PF_AL88 7
#define DMA2D_PF_L4 8
#define DMA2D_PF_A8 9
#define DMA2D_PF_A4 10
/* DMA2D Output Color Register */
#define DMA2D_OCOLR_BLUE_SHIFT (0) /* Bits 0-7 Blue Value */
@@ -227,4 +247,4 @@
* Public Types
****************************************************************************/
#endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_DMA2D_H */
#endif /* __ARCH_ARM_SRC_STM32F7_CHIP_STM32_DMA2D_H */
+1 -1
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* arch/arm/src/stm32/chip/stm32_ltdc.h
* arch/arm/src/stm32f7/chip/stm32_ltdc.h
*
* Copyright (C) 2013 Ken Pettit. All rights reserved.
* Author: Ken Pettit <pettitkd@gmail.com>
File diff suppressed because it is too large Load Diff
+70 -299
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/stm32/stm32_dma2d.h
* arch/arm/src/stm32f7/stm32_dma2d.h
*
* Copyright (C) 2014-2015 Marco Krahl. All rights reserved.
* Copyright (C) 2014-2015, 2018 Marco Krahl. All rights reserved.
* Author: Marco Krahl <ocram.lhark@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@@ -44,374 +44,145 @@
#include <nuttx/video/fb.h>
#include "stm32_ltdc.h"
#ifdef CONFIG_STM32F7_DMA2D
#ifdef CONFIG_FB_OVERLAY
/****************************************************************************
* Public Types
****************************************************************************/
struct ltdc_area_s; /* see arch/arm/src/stm32f7/stm32_ltdc.h */
/* This structure describes DMA2D overlay information */
/* Blend mode definitions */
enum dma2d_blend_e
struct stm32_dma2d_overlay_s
{
DMA2D_BLEND_NONE = 0, /* Disable all blend operation */
DMA2D_BLEND_ALPHA = 0x1, /* Enable alpha blending */
DMA2D_BLEND_PIXELALPHA = 0x2, /* Enable alpha blending from pixel color */
uint8_t fmt; /* DMA2D pixel format */
uint8_t transp_mode; /* DMA2D transparency mode */
fb_coord_t xres; /* X-resolution overlay */
fb_coord_t yres; /* Y-resolution overlay */
FAR struct fb_overlayinfo_s *oinfo; /* Framebuffer overlay information */
};
/* The layer is controlled through the following structure */
/* DMA2D is controlled by the following interface */
struct dma2d_layer_s
{
/* Name: getvideoinfo
*
* Description:
* Get video information about the layer
*
* Parameter:
* layer - Reference to the layer control structure
* vinfo - Reference to the video info structure
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getvideoinfo)(FAR struct dma2d_layer_s *layer,
FAR struct fb_videoinfo_s *vinfo);
/* Name: getplaneinfo
*
* Description:
* Get plane information about the layer
*
* Parameter:
* layer - Reference to the layer control structure
* planeno - Number of the plane
* pinfo - Reference to the plane info structure
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getplaneinfo)(FAR struct dma2d_layer_s *layer, int planeno,
FAR struct fb_planeinfo_s *pinfo);
/* Name: getlid
*
* Description:
* Get a specific layer identifier.
*
* Parameter:
* layer - Reference to the layer structure
* lid - Reference to store the layer id
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getlid)(FAR struct dma2d_layer_s *layer, int *lid);
#ifdef CONFIG_STM32F7_DMA2D_L8
/* Name: setclut
*
* Description:
* Configure layer clut (color lookup table).
* Non clut is defined during initializing.
* Set the cmap table for both foreground and background layer.
* Up to 256 colors supported.
*
* Parameter:
* layer - Reference to the layer structure
* cmap - color lookup table with up the 256 entries
* cmap - Reference to the cmap table
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*setclut)(FAR struct dma2d_layer_s *layer,
const FAR struct fb_cmap_s *cmap);
/* Name: getclut
*
* Description:
* Get configured layer clut (color lookup table).
*
* Parameter:
* layer - Reference to the layer structure
* cmap - Reference to valid color lookup table accept up the 256 color
* entries
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getclut)(FAR struct dma2d_layer_s *layer, FAR struct fb_cmap_s *cmap);
#ifdef CONFIG_FB_CMAP
int (*setclut)(FAR const struct fb_cmap_s * cmap);
#endif
/* Name: setalpha
/* Name: fillcolor
*
* Description:
* Configure layer alpha value factor into blend operation.
* During the layer blend operation the source alpha value is multiplied
* with this alpha value. If the source color format doesn't support alpha
* channel (e.g. non ARGB8888) this alpha value will be used as constant
* alpha value for blend operation.
* Default value during initializing: 0xff
* Fill a specific memory region with a color.
* The caller must ensure that the memory region (area) is within the entire
* overlay.
*
* Parameter:
* layer - Reference to the layer structure
* alpha - Alpha value
* oinfo - Reference to overlay information
* area - Reference to the area to fill
* argb - argb8888 color
*
* Returned Value:
* On success - OK
* On error - -EINVAL
* On error - -EINVAL
*/
int (*setalpha)(FAR struct dma2d_layer_s *layer, uint8_t alpha);
/* Name: getalpha
*
* Description:
* Get configured layer alpha value factor for blend operation.
*
* Parameter:
* layer - Reference to the layer structure
* alpha - Reference to store the alpha value
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getalpha)(FAR struct dma2d_layer_s *layer, uint8_t *alpha);
/* Name: setblendmode
*
* Description:
* Configure blend mode of the layer.
* Default mode during initializing: DMA2D_BLEND_NONE
* Blendmode is active after next update.
*
* Parameter:
* layer - Reference to the layer structure
* mode - Blend mode (see DMA2D_BLEND_*)
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*
* Procedure information:
* DMA2D_BLEND_NONE:
* Informs the driver to disable all blend operation for the given layer.
* That means the layer is opaque.
*
* DMA2D_BLEND_ALPHA:
* Informs the driver to enable alpha blending for the given layer.
*
* DMA2D_BLEND_PIXELALPHA:
* Informs the driver to use the pixel alpha value of the layer instead
* the constant alpha value. This is only useful for ARGB8888
* color format.
*/
int (*setblendmode)(FAR struct dma2d_layer_s *layer, uint32_t mode);
/* Name: getblendmode
*
* Description:
* Get configured blend mode of the layer.
*
* Parameter:
* layer - Reference to the layer structure
* mode - Reference to store the blend mode
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*/
int (*getblendmode)(FAR struct dma2d_layer_s *layer, uint32_t *mode);
int (*fillcolor)(FAR struct stm32_dma2d_overlay_s *oinfo,
FAR const struct fb_area_s *area, uint32_t argb);
/* Name: blit
*
* Description:
* Copy selected area from a source layer to selected position of the
* destination layer.
* Copies memory from a source overlay (defined by sarea) to destination
* overlay position (defined by destxpos and destypos) without pixelformat
* conversion. The caller must ensure that the memory region (area) is
* within the entire overlay.
*
* Parameter:
* dest - Reference to the destination layer
* destxpos - Selected x target position of the destination layer
* destypos - Selected y target position of the destination layer
* src - Reference to the source layer
* srcarea - Reference to the selected area of the source layer
* doverlay - Reference destination overlay
* destxpos - x-Offset destination overlay
* destypos - y-Offset destination overlay
* soverlay - Reference source overlay
* sarea - Reference source area
*
* Returned Value:
* OK - On success
* -EINVAL - If one of the parameter invalid or if the size of the
* selected source area outside the visible area of the
* destination layer. (The visible area usually represents the
* display size)
* -ECANCELED - Operation cancelled, something goes wrong.
* On success - OK
* On error - -EINVAL
*/
int (*blit)(FAR struct dma2d_layer_s *dest,
fb_coord_t destxpos, fb_coord_t destypos,
FAR const struct dma2d_layer_s *src,
FAR const struct ltdc_area_s *srcarea);
int (*blit)(FAR struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *soverlay,
FAR const struct fb_area_s *sarea);
/* Name: blend
*
* Description:
* Blends the selected area from a background layer with selected position
* of the foreground layer. Copies the result to the selected position of
* the destination layer. Note! The content of the foreground and background
* layer keeps unchanged as long destination layer is unequal to the
* foreground and background layer.
* Blends two source memory areas to a destination memory area with
* pixelformat conversion if necessary. The caller must ensure that the
* memory region (area) is within the entire overlays.
*
* Parameter:
* dest - Reference to the destination layer
* fore - Reference to the foreground layer
* forexpos - Selected x target position of the foreground layer
* foreypos - Selected y target position of the foreground layer
* back - Reference to the background layer
* backarea - Reference to the selected area of the background layer
* doverlay - Destination overlay
* destxpos - x-Offset destination overlay
* destypos - y-Offset destination overlay
* foverlay - Foreground overlay
* forexpos - x-Offset foreground overlay
* foreypos - y-Offset foreground overlay
* boverlay - Background overlay
* barea - x-Offset, y-Offset, x-resolution and y-resolution of
* background overlay
*
* Returned Value:
* OK - On success
* -EINVAL - If one of the parameter invalid or if the size of the
* selected source area outside the visible area of the
* destination layer. (The visible area usually represents the
* display size)
* -ECANCELED - Operation cancelled, something goes wrong.
* On success - OK
* On error - -EINVAL or -ECANCELED
*/
int (*blend)(FAR struct dma2d_layer_s *dest,
fb_coord_t destxpos, fb_coord_t destypos,
FAR const struct dma2d_layer_s *fore,
fb_coord_t forexpos, fb_coord_t foreypos,
FAR const struct dma2d_layer_s *back,
FAR const struct ltdc_area_s *backarea);
/* Name: fillarea
*
* Description:
* Fill the selected area of the whole layer with a specific color.
*
* Parameter:
* layer - Reference to the layer structure
* area - Reference to the valid area structure select the area
* color - Color to fill the selected area. Color must be formatted
* according to the layer pixel format.
*
* Returned Value:
* OK - On success
* -EINVAL - If one of the parameter invalid or if the size of the
* selected area outside the visible area of the layer.
* -ECANCELED - Operation cancelled, something goes wrong.
*/
int (*fillarea)(FAR struct dma2d_layer_s *layer,
FAR const struct ltdc_area_s *area,
uint32_t color);
int (*blend)(FAR struct stm32_dma2d_overlay_s *doverlay,
uint32_t destxpos, uint32_t destypos,
FAR struct stm32_dma2d_overlay_s *foverlay,
uint32_t forexpos, uint32_t foreypos,
FAR struct stm32_dma2d_overlay_s *boverlay,
FAR const struct fb_area_s *barea);
};
/****************************************************************************
* Public Functions
****************************************************************************/
struct stm32_ltdc_s; /* Forward declaration */
/****************************************************************************
* Name: stm32_dma2dinitltdc
* Name: stm32_dma2ddev
*
* Description:
* Get a reference to the dma2d layer coupled with the ltdc layer.
* It not intends to use this function by user space applications.
* It resolves the following requirements:
* 1. Share the color lookup table
* 2. Share the planeinfo information
* 3. Share the videoinfo information
*
* Input Parameters:
* layer - a valid reference to the low level ltdc layer structure
* Get a reference to the DMA2D controller.
*
* Returned Value:
* On success - A valid dma2d layer reference
* On success - A valid DMA2D controller reference
* On error - NULL and errno is set to
* -EINVAL if one of the parameter is invalid
*
****************************************************************************/
FAR struct dma2d_layer_s *stm32_dma2dinitltdc(FAR struct stm32_ltdc_s *layer);
/****************************************************************************
* Name: up_dma2dgetlayer
*
* Description:
* Get a dma2d layer structure by the layer identifier
*
* Input Parameters:
* lid - Layer identifier
*
* Returned Value:
* Reference to the dma2d layer control structure on success or Null if no
* related exist.
*
****************************************************************************/
FAR struct dma2d_layer_s *up_dma2dgetlayer(int lid);
/****************************************************************************
* Name: up_dma2dcreatelayer
*
* Description:
* Create a new dma2d layer object to interact with the dma2d controller
*
* Input Parameters:
* width - Layer width
* height - Layer height
* fmt - Pixel format of the layer
*
* Returned Value:
* On success - A valid dma2d layer reference
* On error - NULL and errno is set to
* -EINVAL if one of the parameter is invalid
* -ENOMEM if no memory available or exceeds
* CONFIG_STM32F7_DMA2D_NLAYERS
*
****************************************************************************/
FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width,
fb_coord_t height,
uint8_t fmt);
/****************************************************************************
* Name: up_dma2dremovelayer
*
* Description:
* Remove and deallocate the dma2d layer
*
* Input Parameters:
* layer - Reference to the layer to remove
*
* Returned Value:
* On success - OK
* On error - -EINVAL
*
****************************************************************************/
int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer);
FAR struct dma2d_layer_s *stm32_dma2ddev(void);
/****************************************************************************
* Name: up_dma2dinitialize
*
* Description:
* Initialize the dma2d controller
* Initialize the DMA2D controller
*
* Returned Value:
* OK - On success
@@ -419,17 +190,17 @@ int up_dma2dremovelayer(FAR struct dma2d_layer_s *layer);
*
****************************************************************************/
int up_dma2dinitialize(void);
int stm32_dma2dinitialize(void);
/****************************************************************************
* Name: up_dma2duninitialize
*
* Description:
* Uninitialize the dma2d controller
* Uninitialize the DMA2D controller
*
****************************************************************************/
void up_dma2duninitialize(void);
void stm32_dma2duninitialize(void);
#endif /* CONFIG_STM32F7_DMA2D */
#endif /* CONFIG_FB_OVERLAY */
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_DMA2D_H */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff