drivers/lcd: add stride support for LCD driver
support LCD stride for GET_AREA and PUT_AREA operation Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
parent
bb5b5420ae
commit
bc43c419f2
@ -118,8 +118,11 @@ 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 *lcd_area =
|
||||||
(FAR struct lcddev_area_s *)arg;
|
(FAR struct lcddev_area_s *)arg;
|
||||||
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
|
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
|
||||||
size_t row_size = cols * (priv->planeinfo.bpp > 1 ?
|
size_t pixel_size = priv->planeinfo.bpp > 1 ?
|
||||||
priv->planeinfo.bpp >> 3 : 1);
|
priv->planeinfo.bpp >> 3 : 1;
|
||||||
|
size_t row_size = lcd_area->stride > 0 ?
|
||||||
|
lcd_area->stride * pixel_size :
|
||||||
|
cols * pixel_size;
|
||||||
|
|
||||||
if (priv->planeinfo.getarea)
|
if (priv->planeinfo.getarea)
|
||||||
{
|
{
|
||||||
@ -158,8 +161,11 @@ 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 *lcd_area =
|
||||||
(FAR const struct lcddev_area_s *)arg;
|
(FAR const struct lcddev_area_s *)arg;
|
||||||
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
|
size_t cols = lcd_area->col_end - lcd_area->col_start + 1;
|
||||||
size_t row_size = cols * (priv->planeinfo.bpp > 1 ?
|
size_t pixel_size = priv->planeinfo.bpp > 1 ?
|
||||||
priv->planeinfo.bpp >> 3 : 1);
|
priv->planeinfo.bpp >> 3 : 1;
|
||||||
|
size_t row_size = lcd_area->stride > 0 ?
|
||||||
|
lcd_area->stride * pixel_size :
|
||||||
|
cols * pixel_size;
|
||||||
|
|
||||||
if (priv->planeinfo.putarea)
|
if (priv->planeinfo.putarea)
|
||||||
{
|
{
|
||||||
|
@ -87,6 +87,7 @@ struct lcddev_area_s
|
|||||||
{
|
{
|
||||||
fb_coord_t row_start, row_end;
|
fb_coord_t row_start, row_end;
|
||||||
fb_coord_t col_start, col_end;
|
fb_coord_t col_start, col_end;
|
||||||
|
fb_coord_t stride;
|
||||||
FAR uint8_t *data;
|
FAR uint8_t *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user