You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/17 10:34:38 UTC

[GitHub] [incubator-nuttx] michi-jung opened a new pull request, #6465: Add LCD pointer to color plane info

michi-jung opened a new pull request, #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465

   ## Summary
   
   In order to support multiple LCD instances per board add a pointer to
   the LCD a color plane belongs to to the lcd_planeinfo_s struct.  Also
   enhance the putrun, getrun, putarea and getarea methods to pass through
   the LCD pointer to the respective driver.
   
   Also, as an example, enhance SSD1306 driver to support multiple LCDs.
   
   ## Impact
   
   This is only a draft pull request for review and feedback.  If the community agrees that the approach is good to go I will have to adapt all other LCD drivers accordingly.
   
   ## Testing
   
   It works fine for me with two SSD1309 based OLEDs on a Nucleo-144 with an STM32U5 MCU.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#issuecomment-1160400086

   Thanks, @pkarashchenko, for the review.  I aggree with all of your comments and applied the respective changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902188316


##########
drivers/lcd/ug-2864ambag01.c:
##########
@@ -682,15 +682,13 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col,
  ****************************************************************************/
 
 #if defined(CONFIG_LCD_LANDSCAPE) || defined(CONFIG_LCD_RLANDSCAPE)
-static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col,
+static int ug2864ambag01_getrun(FAR struct lcd_dev_s *dev,
+                                fb_coord_t row, fb_coord_t col,
                                 FAR uint8_t *buffer,
                                 size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug2864ambag01_dev_s *priv = &g_oleddev;

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901617295


##########
drivers/lcd/p14201.c:
##########
@@ -643,11 +646,12 @@ static inline void rit_clear(FAR struct rit_dev_s *priv)
  ****************************************************************************/
 
 #ifdef CONFIG_P14201_FRAMEBUFFER
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/p14201.c:
##########
@@ -809,11 +813,12 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col,
   return OK;
 }
 #else
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/p14201.c:
##########
@@ -201,10 +201,12 @@ static void rit_sndcmds(FAR struct rit_dev_s *priv,
 
 /* LCD Data Transfer Methods */
 
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901616927


##########
drivers/lcd/st7567.c:
##########
@@ -555,14 +556,12 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int st7567_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
-                     size_t npixels)
+static int st7567_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/st7567.c:
##########
@@ -403,15 +406,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901616691


##########
include/nuttx/lcd/lcd.h:
##########
@@ -139,6 +145,12 @@ struct lcd_planeinfo_s
    */
 
   uint8_t  bpp;
+
+  /* This is the LCD interface corresponding to which this color plane
+   * belongs.
+   */
+
+  struct lcd_dev_s *dev;

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902605000


##########
drivers/lcd/ug-9664hswag01.c:
##########
@@ -440,15 +443,12 @@ static void ug_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int ug_putrun(fb_coord_t row, fb_coord_t col,
+static int ug_putrun(FAR struct lcd_dev_s *dev,
+                     fb_coord_t row, fb_coord_t col,
                      FAR const uint8_t *buffer,
                      size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug_dev_s *priv = &g_ugdev;

Review Comment:
   Ok, that's fine . The change look good to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901617745


##########
drivers/lcd/mio283qt9a.c:
##########
@@ -166,10 +166,12 @@ static void mio283qt9a_setarea(FAR struct mio283qt9a_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,
+                             fb_coord_t row, fb_coord_t col,
                              FAR const uint8_t *buffer,
                              size_t npixels);
-static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt2.c:
##########
@@ -570,12 +573,13 @@ static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int mio283qt2_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt2.c:
##########
@@ -521,11 +522,12 @@ static void mio283qt2_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt2.c:
##########
@@ -521,11 +522,12 @@ static void mio283qt2_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#issuecomment-1161579921

   @pkarashchenko, @xiaoxiang781216: Is there anything left to be done for to get this upstreamed? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902188316


##########
drivers/lcd/ug-2864ambag01.c:
##########
@@ -682,15 +682,13 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col,
  ****************************************************************************/
 
 #if defined(CONFIG_LCD_LANDSCAPE) || defined(CONFIG_LCD_RLANDSCAPE)
-static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col,
+static int ug2864ambag01_getrun(FAR struct lcd_dev_s *dev,
+                                fb_coord_t row, fb_coord_t col,
                                 FAR uint8_t *buffer,
                                 size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug2864ambag01_dev_s *priv = &g_oleddev;

Review Comment:
   c



##########
drivers/lcd/st7789.c:
##########
@@ -511,10 +515,11 @@ static void st7789_fill(FAR struct st7789_dev_s *dev, uint16_t color)
  *
  ****************************************************************************/
 
-static int st7789_putrun(fb_coord_t row, fb_coord_t col,
+static int st7789_putrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
                          FAR const uint8_t *buffer, size_t npixels)
 {
-  FAR struct st7789_dev_s *priv = &g_lcddev;

Review Comment:
   remove g_lcddev



##########
drivers/lcd/st7567.c:
##########
@@ -555,14 +556,12 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int st7567_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
-                     size_t npixels)
+static int st7567_getrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
+                         FAR uint8_t *buffer,
+                         size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * ST7567 device
-   */
-
-  FAR struct st7567_dev_s *priv = &g_st7567dev;

Review Comment:
   remove g_st7567dev



##########
drivers/lcd/ssd1351.c:
##########
@@ -744,11 +749,12 @@ static int ssd1351_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int ssd1351_getrun(fb_coord_t row, fb_coord_t col,
+static int ssd1351_getrun(FAR struct lcd_dev_s *dev,
+                          fb_coord_t row, fb_coord_t col,
                           FAR uint8_t *buffer, size_t npixels)
 {
 #if defined(CONFIG_SSD1351_PARALLEL8BIT) && !defined(CONFIG_LCD_NOGETRUN)
-  FAR struct ssd1351_dev_s *priv = &g_lcddev;

Review Comment:
   remove g_lcddev



##########
drivers/lcd/ug-9664hswag01.c:
##########
@@ -440,15 +443,12 @@ static void ug_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int ug_putrun(fb_coord_t row, fb_coord_t col,
+static int ug_putrun(FAR struct lcd_dev_s *dev,
+                     fb_coord_t row, fb_coord_t col,
                      FAR const uint8_t *buffer,
                      size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug_dev_s *priv = &g_ugdev;

Review Comment:
   should we remove g_ugdev too?



##########
drivers/lcd/st7735.c:
##########
@@ -558,10 +562,11 @@ static int st7735_putrun(fb_coord_t row, fb_coord_t col,
  ****************************************************************************/
 
 #ifndef CONFIG_LCD_NOGETRUN
-static int st7735_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
-                         size_t npixels)
+static int st7735_getrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
+                         FAR uint8_t *buffer, size_t npixels)
 {
-  FAR struct st7735_dev_s *priv = &g_lcddev;

Review Comment:
   remove g_lcddev



##########
drivers/lcd/ssd1289.c:
##########
@@ -588,11 +590,12 @@ static void ssd1289_showrun(FAR struct ssd1289_dev_s *priv, fb_coord_t row,
  *
  ****************************************************************************/
 
-static int ssd1289_putrun(fb_coord_t row, fb_coord_t col,
+static int ssd1289_putrun(FAR struct lcd_dev_s *dev,
+                          fb_coord_t row, fb_coord_t col,
                           FAR const uint8_t *buffer,
                           size_t npixels)
 {
-  FAR struct ssd1289_dev_s *priv = &g_lcddev;

Review Comment:
   remove g_lcddev



##########
drivers/lcd/pcd8544.c:
##########
@@ -567,14 +572,15 @@ static int pcd8544_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int pcd8544_getrun(fb_coord_t row, fb_coord_t col,
+static int pcd8544_getrun(FAR struct lcd_dev_s *dev,
+                          fb_coord_t row, fb_coord_t col,
                           FAR uint8_t *buffer, size_t npixels)
 {
   /* Because of this line of code, we will only be able to support a single
    * PCD8544 device
    */
 
-  FAR struct pcd8544_dev_s *priv = &g_pcd8544dev;

Review Comment:
   remove g_pcd8544dev



##########
drivers/lcd/p14201.c:
##########
@@ -643,11 +646,12 @@ static inline void rit_clear(FAR struct rit_dev_s *priv)
  ****************************************************************************/
 
 #ifdef CONFIG_P14201_FRAMEBUFFER
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(FAR struct lcd_dev_s *dev,
+                      fb_coord_t row, fb_coord_t col,
                       FAR const uint8_t *buffer,
                       size_t npixels)
 {
-  FAR struct rit_dev_s *priv = (FAR struct rit_dev_s *)&g_oleddev;

Review Comment:
   remove g_oleddev



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -472,15 +475,17 @@ static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_getrun(FAR struct lcd_dev_s *dev,
+                             fb_coord_t row, fb_coord_t col,
                              FAR uint8_t *buffer,
                              size_t npixels)
 {
 #ifndef CONFIG_LCD_NOGETRUN
-  FAR struct mio283qt9a_dev_s *priv = &g_lcddev;

Review Comment:
   ditto



##########
drivers/lcd/memlcd.c:
##########
@@ -483,10 +488,11 @@ static int memlcd_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int memlcd_getrun(fb_coord_t row, fb_coord_t col,
+static int memlcd_getrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
                          FAR uint8_t * buffer, size_t npixels)
 {
-  FAR struct memlcd_dev_s *mlcd = (FAR struct memlcd_dev_s *)&g_memlcddev;

Review Comment:
   ditto



##########
drivers/lcd/ili9225.c:
##########
@@ -585,10 +590,11 @@ static int ili9225_putrun(fb_coord_t row, fb_coord_t col,
  ****************************************************************************/
 
 #ifndef CONFIG_LCD_NOGETRUN
-static int ili9225_getrun(fb_coord_t row, fb_coord_t col,
+static int ili9225_getrun(FAR struct lcd_dev_s *dev,
+                          fb_coord_t row, fb_coord_t col,
                           FAR uint8_t *buffer, size_t npixels)
 {
-  FAR struct ili9225_dev_s *priv = &g_lcddev;

Review Comment:
   ditto



##########
drivers/lcd/max7219.c:
##########
@@ -530,14 +535,15 @@ static int max7219_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int max7219_getrun(fb_coord_t row, fb_coord_t col,
-                          FAR uint8_t *buffer, size_t npixels)
+static int max7219_getrun(FAR struct lcd_dev_s *dev, fb_coord_t row,
+                          fb_coord_t col, FAR uint8_t *buffer,
+                          size_t npixels)
 {
   /* Because of this line of code, we will only be able to support a single
    * MAX7219 device.
    */
 
-  FAR struct max7219_dev_s *priv = &g_max7219dev;

Review Comment:
   ditto



##########
drivers/lcd/ra8875.c:
##########
@@ -745,11 +749,13 @@ static int ra8875_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int ra8875_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
+static int ra8875_getrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
+                         FAR uint8_t *buffer,
                          size_t npixels)
 {
 #ifndef CONFIG_LCD_NOGETRUN
-  FAR struct ra8875_dev_s *priv = &g_lcddev;

Review Comment:
   remove g_lcddev



##########
drivers/lcd/st7565.c:
##########
@@ -578,15 +577,11 @@ static int st7565_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int st7565_getrun(fb_coord_t row, fb_coord_t col,
-                         FAR uint8_t * buffer,
+static int st7565_getrun(FAR struct lcd_dev_s *dev, fb_coord_t row,
+                         fb_coord_t col, FAR uint8_t *buffer,
                          size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * ST7565 device.
-   */
-
-  FAR struct st7565_dev_s *priv = &g_st7565dev;

Review Comment:
   remove g_st7565dev



##########
drivers/lcd/gc9a01.c:
##########
@@ -669,10 +677,11 @@ static int gc9a01_putarea(fb_coord_t row_start, fb_coord_t row_end,
  ****************************************************************************/
 
 #ifndef CONFIG_LCD_NOGETRUN
-static int gc9a01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
-                         size_t npixels)
+static int gc9a01_getrun(FAR struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
+                         FAR uint8_t *buffer, size_t npixels)
 {
-  FAR struct gc9a01_dev_s *priv = &g_lcddev;

Review Comment:
   ditto



##########
drivers/lcd/mio283qt2.c:
##########
@@ -521,11 +522,12 @@ static void mio283qt2_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(FAR struct lcd_dev_s *dev,
+                            fb_coord_t row, fb_coord_t col,
                             FAR const uint8_t *buffer,
                             size_t npixels)
 {
-  FAR struct mio283qt2_dev_s *priv = &g_lcddev;

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901618446


##########
drivers/lcd/mio283qt9a.c:
##########
@@ -424,11 +425,12 @@ static void mio283qt9a_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/p14201.c:
##########
@@ -201,10 +201,12 @@ static void rit_sndcmds(FAR struct rit_dev_s *priv,
 
 /* LCD Data Transfer Methods */
 
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,
+                      fb_coord_t row, fb_coord_t col,
                       FAR const uint8_t *buffer,
                       size_t npixels);
-static int rit_getrun(fb_coord_t row, fb_coord_t col,
+static int rit_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902574720


##########
drivers/lcd/ug-9664hswag01.c:
##########
@@ -440,15 +443,12 @@ static void ug_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int ug_putrun(fb_coord_t row, fb_coord_t col,
+static int ug_putrun(FAR struct lcd_dev_s *dev,
+                     fb_coord_t row, fb_coord_t col,
                      FAR const uint8_t *buffer,
                      size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug_dev_s *priv = &g_ugdev;

Review Comment:
   I am afraid I do not fully understand.  There is only the declaration of the global variable `g_ugdev` and a single reference within `ug_initialize()` left.  Do you mean to allocate the ug_dev_s dynamically on the heap? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902583505


##########
drivers/lcd/ug-9664hswag01.c:
##########
@@ -440,15 +443,12 @@ static void ug_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int ug_putrun(fb_coord_t row, fb_coord_t col,
+static int ug_putrun(FAR struct lcd_dev_s *dev,
+                     fb_coord_t row, fb_coord_t col,
                      FAR const uint8_t *buffer,
                      size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug_dev_s *priv = &g_ugdev;

Review Comment:
   Yes, can driver support the multiple instances with this simple change?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901617117


##########
drivers/lcd/st7567.c:
##########
@@ -224,10 +224,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi);
 
 /* LCD Data Transfer Methods */
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/st7567.c:
##########
@@ -224,10 +224,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi);
 
 /* LCD Data Transfer Methods */
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
                          FAR const uint8_t *buffer,
                          size_t npixels);
-static int st7567_getrun(fb_coord_t row, fb_coord_t col,
+static int st7567_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901617537


##########
drivers/lcd/mio283qt9a.c:
##########
@@ -472,15 +475,17 @@ static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -166,10 +166,12 @@ static void mio283qt9a_setarea(FAR struct mio283qt9a_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#issuecomment-1160341243

   @xiaoxiang781216, @pkarashchenko and/or other committers: Could you please have a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901618024


##########
drivers/lcd/mio283qt2.c:
##########
@@ -521,11 +522,12 @@ static void mio283qt2_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt2.c:
##########
@@ -281,10 +281,12 @@ static void mio283qt2_setarea(FAR struct mio283qt2_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



##########
drivers/lcd/ili9341.c:
##########
@@ -660,7 +621,7 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
  *   Read a partial raster line from the LCD.
  *
  * Input Parameters:
- *   devno   - Number of the lcd device
+ *   devno   - The lcd device

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901618268


##########
drivers/lcd/ili9341.c:
##########
@@ -600,7 +560,7 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
  *   Write a partial raster line to the LCD.
  *
  * Input Parameters:
- *   devno   - Number of lcd device
+ *   dev     - The lcd device

Review Comment:
   ok, applied.



##########
drivers/lcd/mio283qt2.c:
##########
@@ -281,10 +281,12 @@ static void mio283qt2_setarea(FAR struct mio283qt2_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,
+                            fb_coord_t row, fb_coord_t col,
                             FAR const uint8_t *buffer,
                             size_t npixels);
-static int mio283qt2_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_getrun(struct lcd_dev_s *dev,

Review Comment:
   ok, applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r901577528


##########
include/nuttx/lcd/lcd.h:
##########
@@ -139,6 +145,12 @@ struct lcd_planeinfo_s
    */
 
   uint8_t  bpp;
+
+  /* This is the LCD interface corresponding to which this color plane
+   * belongs.
+   */
+
+  struct lcd_dev_s *dev;

Review Comment:
   ```suggestion
     FAR struct lcd_dev_s *dev;
   ```



##########
drivers/lcd/st7567.c:
##########
@@ -555,14 +556,12 @@ static int st7567_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int st7567_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
-                     size_t npixels)
+static int st7567_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int st7567_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/st7567.c:
##########
@@ -224,10 +224,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi);
 
 /* LCD Data Transfer Methods */
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int st7567_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/p14201.c:
##########
@@ -809,11 +813,12 @@ static int rit_putrun(fb_coord_t row, fb_coord_t col,
   return OK;
 }
 #else
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int rit_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -166,10 +166,12 @@ static void mio283qt9a_setarea(FAR struct mio283qt9a_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,
+                             fb_coord_t row, fb_coord_t col,
                              FAR const uint8_t *buffer,
                              size_t npixels);
-static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt9a_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt2.c:
##########
@@ -521,11 +522,12 @@ static void mio283qt2_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt2_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/ili9341.c:
##########
@@ -660,7 +621,7 @@ static int ili9341_putrun(int devno, fb_coord_t row, fb_coord_t col,
  *   Read a partial raster line from the LCD.
  *
  * Input Parameters:
- *   devno   - Number of the lcd device
+ *   devno   - The lcd device

Review Comment:
   ```suggestion
    *   lcd_dev   - The lcd device
   ```



##########
drivers/lcd/st7567.c:
##########
@@ -403,15 +406,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int st7567_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/st7567.c:
##########
@@ -224,10 +224,12 @@ static void st7567_deselect(FAR struct spi_dev_s *spi);
 
 /* LCD Data Transfer Methods */
 
-static int st7567_putrun(fb_coord_t row, fb_coord_t col,
+static int st7567_putrun(struct lcd_dev_s *dev,
+                         fb_coord_t row, fb_coord_t col,
                          FAR const uint8_t *buffer,
                          size_t npixels);
-static int st7567_getrun(fb_coord_t row, fb_coord_t col,
+static int st7567_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int st7567_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/p14201.c:
##########
@@ -643,11 +646,12 @@ static inline void rit_clear(FAR struct rit_dev_s *priv)
  ****************************************************************************/
 
 #ifdef CONFIG_P14201_FRAMEBUFFER
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int rit_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/p14201.c:
##########
@@ -201,10 +201,12 @@ static void rit_sndcmds(FAR struct rit_dev_s *priv,
 
 /* LCD Data Transfer Methods */
 
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int rit_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -472,15 +475,17 @@ static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int mio283qt9a_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt9a_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/p14201.c:
##########
@@ -201,10 +201,12 @@ static void rit_sndcmds(FAR struct rit_dev_s *priv,
 
 /* LCD Data Transfer Methods */
 
-static int rit_putrun(fb_coord_t row, fb_coord_t col,
+static int rit_putrun(struct lcd_dev_s *dev,
+                      fb_coord_t row, fb_coord_t col,
                       FAR const uint8_t *buffer,
                       size_t npixels);
-static int rit_getrun(fb_coord_t row, fb_coord_t col,
+static int rit_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int rit_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt2.c:
##########
@@ -570,12 +573,13 @@ static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
  *
  ****************************************************************************/
 
-static int mio283qt2_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt2_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -166,10 +166,12 @@ static void mio283qt9a_setarea(FAR struct mio283qt9a_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt9a_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt9a.c:
##########
@@ -424,11 +425,12 @@ static void mio283qt9a_dumprun(FAR const char *msg,
  *
  ****************************************************************************/
 
-static int mio283qt9a_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt9a_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt9a_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt2.c:
##########
@@ -281,10 +281,12 @@ static void mio283qt2_setarea(FAR struct mio283qt2_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,
+                            fb_coord_t row, fb_coord_t col,
                             FAR const uint8_t *buffer,
                             size_t npixels);
-static int mio283qt2_getrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_getrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt2_getrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/mio283qt2.c:
##########
@@ -281,10 +281,12 @@ static void mio283qt2_setarea(FAR struct mio283qt2_lcd_s *lcd,
 
 /* LCD Data Transfer Methods */
 
-static int mio283qt2_putrun(fb_coord_t row, fb_coord_t col,
+static int mio283qt2_putrun(struct lcd_dev_s *dev,

Review Comment:
   ```suggestion
   static int mio283qt2_putrun(FAR struct lcd_dev_s *dev,
   ```



##########
drivers/lcd/ili9341.c:
##########
@@ -600,7 +560,7 @@ static void ili9341_selectarea(FAR struct ili9341_lcd_s *lcd,
  *   Write a partial raster line to the LCD.
  *
  * Input Parameters:
- *   devno   - Number of lcd device
+ *   dev     - The lcd device

Review Comment:
   ```suggestion
    *   lcd_dev     - The lcd device
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] michi-jung commented on a diff in pull request #6465: Add lcd_dev_s pointer to lcd_planeinfo_s to support multiple LCDs per board

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6465:
URL: https://github.com/apache/incubator-nuttx/pull/6465#discussion_r902592712


##########
drivers/lcd/ug-9664hswag01.c:
##########
@@ -440,15 +443,12 @@ static void ug_deselect(FAR struct spi_dev_s *spi)
  *
  ****************************************************************************/
 
-static int ug_putrun(fb_coord_t row, fb_coord_t col,
+static int ug_putrun(FAR struct lcd_dev_s *dev,
+                     fb_coord_t row, fb_coord_t col,
                      FAR const uint8_t *buffer,
                      size_t npixels)
 {
-  /* Because of this line of code, we will only be able to support a single
-   * UG device
-   */
-
-  FAR struct ug_dev_s *priv = &g_ugdev;

Review Comment:
   I believe its more efficient to have the data objects statically allocated.  See for example the changed [ssd1306_base.c](https://github.com/secore-ly/incubator-nuttx/blob/f9c804faa67264e4d1988b64884e0038d54968f6/drivers/lcd/ssd1306_base.c#L220) for how this could be implemented.  However, this also requires a change to the respective drivers xxx_initialize() function signature and a change to all callers.  My goal with this pull request is to get the barrier to multiple LCD support out of the way, not necessarily to make every LCD driver capable of supporting multiple LCDs per board.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org