You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/25 06:31:48 UTC

[incubator-nuttx] 05/28: arch/arm/src/stm32/stm32_ltdc.c: Appease nxstyle

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit efc09bf3e0a87129b77f882976f6217649dea80d
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Nov 24 08:25:05 2020 +0900

    arch/arm/src/stm32/stm32_ltdc.c: Appease nxstyle
    
    The following nxstyle errors are intentionally left.
    They are "Lx" constants shared among multiple files.
    
    arch/arm/src/stm32/stm32_ltdc.c:1774:10: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1775:10: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1779:11: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1780:11: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1784:11: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1785:11: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1804:10: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1805:10: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1806:10: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1845:16: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1849:17: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1903:11: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1903:34: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1907:12: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1907:35: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1987:16: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:1991:17: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:2027:16: error: Mixed case identifier found
    arch/arm/src/stm32/stm32_ltdc.c:2031:17: error: Mixed case identifier found
---
 arch/arm/src/stm32/stm32_ltdc.c | 110 ++++++++++++++++++++++------------------
 1 file changed, 62 insertions(+), 48 deletions(-)

diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c
index c2f4e92..4ca91ce 100644
--- a/arch/arm/src/stm32/stm32_ltdc.c
+++ b/arch/arm/src/stm32/stm32_ltdc.c
@@ -277,8 +277,8 @@
 /* Preallocated LTDC framebuffers */
 
 /* Position the framebuffer memory in the center of the memory set aside.  We
- * will use any skirts before or after the framebuffer memory as a guard against
- * wild framebuffer writes.
+ * will use any skirts before or after the framebuffer memory as a guard
+ * against wild framebuffer writes.
  */
 
 #define STM32_LTDC_BUFFER_SIZE      CONFIG_STM32_LTDC_FB_SIZE
@@ -343,7 +343,6 @@
 #    error "DMA2D pixel format not supported"
 #  endif
 
-
 #  ifdef CONFIG_STM32_DMA2D_LAYER_SHARED
 #    define STM32_DMA2D_FBSIZE      CONFIG_STM32_DMA2D_FB_SIZE
 #    define STM32_DMA2D_LAYER_SIZE  0
@@ -699,7 +698,8 @@ static void stm32_ltdc_lframebuffer(FAR struct stm32_ltdc_s *layer);
 static void stm32_ltdc_lenable(FAR struct stm32_ltdc_s *layer, bool enable);
 static void stm32_ltdc_ldefaultcolor(FAR struct stm32_ltdc_s * layer,
                                      uint32_t rgb);
-static void stm32_ltdc_ltransp(FAR struct stm32_ltdc_s *layer, uint8_t transp,
+static void stm32_ltdc_ltransp(FAR struct stm32_ltdc_s *layer,
+                               uint8_t transp,
                                uint32_t mode);
 static void stm32_ltdc_lchromakey(FAR struct stm32_ltdc_s *layer,
                                   uint32_t chromakey);
@@ -771,8 +771,8 @@ static int stm32_setblank(FAR struct fb_vtable_s *vtable,
 static int stm32_setarea(FAR struct fb_vtable_s *vtable,
                          FAR const struct fb_overlayinfo_s *oinfo);
 
-/* The following is provided only if the video hardware supports blit and blend
- * operation
+/* The following is provided only if the video hardware supports blit and
+ * blend operation
  */
 
 #  ifdef CONFIG_FB_OVERLAY_BLIT
@@ -1734,7 +1734,8 @@ static void stm32_ltdc_lpixelformat(FAR struct stm32_ltdc_s *layer)
 
   /* Configure PFCR register */
 
-  reginfo("set LTDC_L%dPFCR=%08x\n", overlay + 1, stm32_fmt_layer_t[overlay]);
+  reginfo("set LTDC_L%dPFCR=%08x\n", overlay + 1,
+          stm32_fmt_layer_t[overlay]);
   putreg32(stm32_fmt_layer_t[overlay], stm32_pfcr_layer_t[overlay]);
 
   /* Reload shadow register */
@@ -1809,7 +1810,8 @@ static void stm32_ltdc_lframebuffer(FAR struct stm32_ltdc_s *layer)
 
   /* Configure LxCFBLNR register */
 
-  reginfo("set LTDC_L%dCFBLNR=%08x\n", layerno + 1, stm32_height_layer_t[layerno]);
+  reginfo("set LTDC_L%dCFBLNR=%08x\n", layerno + 1,
+          stm32_height_layer_t[layerno]);
   putreg32(stm32_height_layer_t[layerno], stm32_cfblnr_layer_t[layerno]);
 
   /* Reload shadow register */
@@ -1872,7 +1874,8 @@ static void stm32_ltdc_lenable(FAR struct stm32_ltdc_s *layer, bool enable)
  *
  ****************************************************************************/
 
-static void stm32_ltdc_ltransp(FAR struct stm32_ltdc_s *layer, uint8_t transp,
+static void stm32_ltdc_ltransp(FAR struct stm32_ltdc_s *layer,
+                               uint8_t transp,
                                uint32_t mode)
 {
   uint32_t bf1;
@@ -1942,7 +1945,7 @@ static void stm32_ltdc_lchromakey(FAR struct stm32_ltdc_s *layer,
   uint8_t r = g_vtable.cmap.red[chroma];
   uint8_t g = g_vtable.cmap.green[chroma];
   uint8_t b = g_vtable.cmap.blue[chroma];
-  rgb = ((r << 16)|(g << 8)|b);
+  rgb = ((r << 16) | (g << 8) | b);
 #else
   rgb = ARGB8888(chroma);
 #endif
@@ -2009,7 +2012,8 @@ static void stm32_ltdc_lchromakeyenable(FAR struct stm32_ltdc_s *layer,
  ****************************************************************************/
 
 #ifdef CONFIG_STM32_FB_CMAP
-static void stm32_ltdc_lclutenable(FAR struct stm32_ltdc_s *layer, bool enable)
+static void stm32_ltdc_lclutenable(FAR struct stm32_ltdc_s *layer,
+                                   bool enable)
 {
   uint32_t    regval;
 
@@ -2111,7 +2115,6 @@ static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
 
   for (n = cmap->first; n < cmap->len && n < STM32_LTDC_NCLUT; n++)
     {
-
 #  ifdef CONFIG_STM32_FB_TRANSPARENCY
       cmap->transp[n] = priv_cmap->transp[n];
 #  endif
@@ -2119,7 +2122,8 @@ static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
       cmap->green[n]  = priv_cmap->green[n];
       cmap->blue[n]   = priv_cmap->blue[n];
 
-      reginfo("color = %d, transp=%02x, red=%02x, green=%02x, blue=%02x\n", n,
+      reginfo("color = %d, transp=%02x, red=%02x, green=%02x, blue=%02x\n",
+              n,
 #  ifdef CONFIG_STM32_FB_TRANSPARENCY
               cmap->transp[n],
 #  endif
@@ -2143,7 +2147,7 @@ static void stm32_ltdc_lgetclut(FAR struct stm32_ltdc_s * layer,
 
 static void stm32_ltdc_lclear(uint8_t overlayno)
 {
-  memset((uint8_t*)stm32_fbmem_layer_t[overlayno], 0,
+  memset((uint8_t *)stm32_fbmem_layer_t[overlayno], 0,
         stm32_fblen_layer_t[overlayno]);
 }
 
@@ -2166,8 +2170,8 @@ static bool stm32_ltdc_lvalidate(FAR const struct stm32_ltdc_s *layer,
 {
   uint32_t offset;
 
-  offset = (area->y + area->h - 1) * layer->oinfo.stride + (area->x + area->w) *
-      layer->oinfo.bpp / 8;
+  offset = (area->y + area->h - 1) * layer->oinfo.stride +
+           (area->x + area->w) * layer->oinfo.bpp / 8;
 
   return (offset <= layer->oinfo.fblen && area->w > 0 && area->h > 0);
 }
@@ -2203,7 +2207,7 @@ static void stm32_ltdc_linit(uint8_t overlay)
 
   stm32_ltdc_lenable(layer, false);
 
-    /* Clear the layer framebuffer */
+  /* Clear the layer framebuffer */
 
   stm32_ltdc_lclear(overlay);
 
@@ -2513,6 +2517,7 @@ static int stm32_putcmap(struct fb_vtable_s *vtable,
           FAR struct stm32_ltdc_s * layer = &priv->layer[n];
           stm32_ltdc_lputclut(layer, priv_cmap);
         }
+
 #  ifdef CONFIG_STM32_DMA2D
       /* Update dma2d cmap */
 
@@ -2527,11 +2532,11 @@ static int stm32_putcmap(struct fb_vtable_s *vtable,
 }
 #endif /* CONFIG_STM32_FB_CMAP */
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_ioctl_waitforvsync
  * Description:
  *   Entrypoint ioctl FBIO_WAITFORSYNC
- ***************************************************************************/
+ ****************************************************************************/
 
 #ifdef CONFIG_FB_SYNC
 static int stm32_waitforvsync(FAR struct fb_vtable_s *vtable)
@@ -2548,18 +2553,18 @@ static int stm32_waitforvsync(FAR struct fb_vtable_s *vtable)
 }
 #endif /* CONFIG_FB_SYNC */
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_getoverlayinfo
  * Description:
  *   Entrypoint ioctl FBIOGET_OVERLAYINFO
- ***************************************************************************/
+ ****************************************************************************/
 
 #ifdef CONFIG_FB_OVERLAY
 static int stm32_getoverlayinfo(FAR struct fb_vtable_s *vtable,
                                 int overlayno,
                                 FAR struct fb_overlayinfo_s *oinfo)
 {
-  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)vtable;
 
   lcdinfo("vtable=%p overlay=%d oinfo=%p\n", vtable, overlayno, oinfo);
   DEBUGASSERT(vtable != NULL && priv == &g_vtable);
@@ -2575,16 +2580,16 @@ static int stm32_getoverlayinfo(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_settransp
  * Description:
  *   Entrypoint ioctl FBIOSET_TRANSP
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_settransp(FAR struct fb_vtable_s *vtable,
                            FAR const struct fb_overlayinfo_s *oinfo)
 {
-  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)vtable;
 
   DEBUGASSERT(vtable != NULL && priv == &g_vtable);
   lcdinfo("vtable=%p, overlay=%d, transp=%02x, transp_mode=%02x\n", vtable,
@@ -2631,11 +2636,11 @@ static int stm32_settransp(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_setchromakey
  * Description:
  *   Entrypoint ioctl FBIOSET_CHROMAKEY
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_setchromakey(FAR struct fb_vtable_s *vtable,
                               FAR const struct fb_overlayinfo_s *oinfo)
@@ -2657,6 +2662,7 @@ static int stm32_setchromakey(FAR struct fb_vtable_s *vtable,
           return -ENOSYS;
         }
 #  endif
+
 #  ifndef CONFIG_STM32_LTDC_L2_CHROMAKEY
       if (oinfo->overlay == LTDC_LAYER_L2)
         {
@@ -2698,11 +2704,11 @@ static int stm32_setchromakey(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_setcolor
  * Description:
  *   Entrypoint ioctl FBIOSET_COLOR
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_setcolor(FAR struct fb_vtable_s *vtable,
                           FAR const struct fb_overlayinfo_s *oinfo)
@@ -2719,7 +2725,8 @@ static int stm32_setcolor(FAR struct fb_vtable_s *vtable,
        */
 
       int ret;
-      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)
+                                         vtable;
       FAR struct stm32_ltdc_s * layer = &priv->layer[oinfo->overlay];
       FAR struct fb_overlayinfo_s * poverlay = layer->dma2dinfo.oinfo;
 
@@ -2743,16 +2750,16 @@ static int stm32_setcolor(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_setblank
  * Description:
  *   Entrypoint ioctl FBIOSET_BLANK
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_setblank(FAR struct fb_vtable_s *vtable,
                           FAR const struct fb_overlayinfo_s *oinfo)
 {
-  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+  FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)vtable;
 
   DEBUGASSERT(vtable != NULL && priv == &g_vtable && oinfo != NULL);
   lcdinfo("vtable=%p, overlay=%d, blank=%02x\n", vtable, oinfo->blank);
@@ -2784,11 +2791,11 @@ static int stm32_setblank(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_setarea
  * Description:
  *   Entrypoint ioctl FBIOSET_AREA
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_setarea(FAR struct fb_vtable_s *vtable,
                          FAR const struct fb_overlayinfo_s *oinfo)
@@ -2804,10 +2811,12 @@ static int stm32_setarea(FAR struct fb_vtable_s *vtable,
 
       return -ENOSYS;
     }
+
 #  ifdef CONFIG_STM32_DMA2D
   if (oinfo->overlay < LTDC_NOVERLAYS)
     {
-      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)
+                                         vtable;
       FAR struct stm32_ltdc_s * layer  = &priv->layer[oinfo->overlay];
 
       nxsem_wait(layer->lock);
@@ -2822,11 +2831,11 @@ static int stm32_setarea(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_blit
  * Description:
  *   Entrypoint ioctl FBIOSET_BLIT
- ***************************************************************************/
+ ****************************************************************************/
 
 #  ifdef CONFIG_FB_OVERLAY_BLIT
 static int stm32_blit(FAR struct fb_vtable_s *vtable,
@@ -2835,13 +2844,15 @@ static int stm32_blit(FAR struct fb_vtable_s *vtable,
   DEBUGASSERT(vtable != NULL && vtable == &g_vtable.vtable && blit != NULL);
   lcdinfo("vtable = %p, blit = %p\n", vtable, blit);
 
-  if (blit->dest.overlay < LTDC_NOVERLAYS && blit->src.overlay < LTDC_NOVERLAYS)
+  if (blit->dest.overlay < LTDC_NOVERLAYS &&
+      blit->src.overlay < LTDC_NOVERLAYS)
     {
 #    ifdef CONFIG_STM32_DMA2D
       int ret;
       struct fb_area_s sarea;
       FAR const struct fb_area_s *darea = &blit->dest.area;
-      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)
+                                         vtable;
       FAR struct stm32_ltdc_s *dlayer = &priv->layer[blit->dest.overlay];
       FAR struct stm32_ltdc_s *slayer = &priv->layer[blit->src.overlay];
 
@@ -2857,7 +2868,7 @@ static int stm32_blit(FAR struct fb_vtable_s *vtable,
       if (!stm32_ltdc_lvalidate(dlayer, darea) ||
           !stm32_ltdc_lvalidate(slayer, &sarea))
         {
-            return -EINVAL;
+          return -EINVAL;
         }
 
       sarea.w = MIN(darea->w, sarea.w);
@@ -2880,11 +2891,11 @@ static int stm32_blit(FAR struct fb_vtable_s *vtable,
   return -EINVAL;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Name: stm32_blend
  * Description:
  *   Entrypoint ioctl FBIOSET_BLEND
- ***************************************************************************/
+ ****************************************************************************/
 
 static int stm32_blend(FAR struct fb_vtable_s *vtable,
                        FAR const struct fb_overlayblend_s *blend)
@@ -2901,10 +2912,13 @@ static int stm32_blend(FAR struct fb_vtable_s *vtable,
       struct fb_area_s barea;
       FAR const struct fb_area_s *darea = &blend->dest.area;
       FAR const struct fb_area_s *farea = &blend->foreground.area;
-      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s*)vtable;
+      FAR struct stm32_ltdcdev_s *priv = (FAR struct stm32_ltdcdev_s *)
+                                         vtable;
       FAR struct stm32_ltdc_s *dlayer = &priv->layer[blend->dest.overlay];
-      FAR struct stm32_ltdc_s *flayer = &priv->layer[blend->foreground.overlay];
-      FAR struct stm32_ltdc_s *blayer = &priv->layer[blend->background.overlay];
+      FAR struct stm32_ltdc_s *flayer =
+                                    &priv->layer[blend->foreground.overlay];
+      FAR struct stm32_ltdc_s *blayer =
+                                    &priv->layer[blend->background.overlay];
 
       DEBUGASSERT(&dlayer->oinfo == dlayer->dma2dinfo.oinfo &&
                   &flayer->oinfo == flayer->dma2dinfo.oinfo &&
@@ -2920,8 +2934,8 @@ static int stm32_blend(FAR struct fb_vtable_s *vtable,
           !stm32_ltdc_lvalidate(flayer, farea) ||
           !stm32_ltdc_lvalidate(blayer, &barea))
         {
-            lcderr("ERROR: Returning EINVAL\n");
-            return -EINVAL;
+          lcderr("ERROR: Returning EINVAL\n");
+          return -EINVAL;
         }
 
       barea.w = MIN(darea->w, barea.w);