Skip to content

Commit

Permalink
Fixing row_size calculation when bpp is equal 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jturnsek authored and xiaoxiang781216 committed Sep 16, 2023
1 parent 6840b44 commit 4407aa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/lcd/lcd_dev.c
Expand Up @@ -118,7 +118,8 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
FAR struct lcddev_area_s *lcd_area =
(FAR struct lcddev_area_s *)arg;
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
size_t row_size = cols * (priv->planeinfo.bpp >> 3);
size_t row_size = cols * (priv->planeinfo.bpp > 1 ?
priv->planeinfo.bpp >> 3 : 1);

if (priv->planeinfo.getarea)
{
Expand Down Expand Up @@ -157,7 +158,8 @@ static int lcddev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
FAR const struct lcddev_area_s *lcd_area =
(FAR const struct lcddev_area_s *)arg;
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
size_t row_size = cols * (priv->planeinfo.bpp >> 3);
size_t row_size = cols * (priv->planeinfo.bpp > 1 ?
priv->planeinfo.bpp >> 3 : 1);

if (priv->planeinfo.putarea)
{
Expand Down

0 comments on commit 4407aa1

Please sign in to comment.