summaryrefslogtreecommitdiff
path: root/drivers/gpu/ipu-v3
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2022-05-06 08:07:07 +0300
committerDave Airlie <airlied@redhat.com>2022-05-06 08:07:39 +0300
commit97ab530870cc23bf20952ce8a1d86196dddc2e6e (patch)
tree9c8f7fef8d74445355613de36e2fbc65e4de9be1 /drivers/gpu/ipu-v3
parentb900352f9ddebc5c8dd30dc16218c4ff1b8c9147 (diff)
parent927d8fd465adbaaad6cce82f840d489d7c378f29 (diff)
downloadlinux-97ab530870cc23bf20952ce8a1d86196dddc2e6e.tar.xz
Merge tag 'imx-drm-next-2022-05-04' of git://git.pengutronix.de/pza/linux into drm-next
drm/imx: various cleanups - Use swap() instead of open-coding in ipu-image-convert. - Use devm_platform_ioremap_resource() helper in imx-tve. - Make static channel_offsets array const in ipu-dc. - Remove redundant zpos, color encoding and range initialization. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20220504144628.3954620-1-p.zabel@pengutronix.de
Diffstat (limited to 'drivers/gpu/ipu-v3')
-rw-r--r--drivers/gpu/ipu-v3/ipu-dc.c5
-rw-r--r--drivers/gpu/ipu-v3/ipu-image-convert.c9
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-dc.c b/drivers/gpu/ipu-v3/ipu-dc.c
index ca96b235491a..b038a6d7307b 100644
--- a/drivers/gpu/ipu-v3/ipu-dc.c
+++ b/drivers/gpu/ipu-v3/ipu-dc.c
@@ -344,8 +344,9 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
unsigned long base, unsigned long template_base)
{
struct ipu_dc_priv *priv;
- static int channel_offsets[] = { 0, 0x1c, 0x38, 0x54, 0x58, 0x5c,
- 0x78, 0, 0x94, 0xb4};
+ static const int channel_offsets[] = {
+ 0, 0x1c, 0x38, 0x54, 0x58, 0x5c, 0x78, 0, 0x94, 0xb4
+ };
int i;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index aa1d4b6d278f..af1612044eef 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -990,7 +990,7 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx,
const struct ipu_image_pixfmt *fmt = image->fmt;
unsigned int row, col, tile = 0;
u32 H, top, y_stride, uv_stride;
- u32 uv_row_off, uv_col_off, uv_off, u_off, v_off, tmp;
+ u32 uv_row_off, uv_col_off, uv_off, u_off, v_off;
u32 y_row_off, y_col_off, y_off;
u32 y_size, uv_size;
@@ -1021,11 +1021,8 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx,
u_off = y_size - y_off + uv_off;
v_off = (fmt->uv_packed) ? 0 : u_off + uv_size;
- if (fmt->uv_swapped) {
- tmp = u_off;
- u_off = v_off;
- v_off = tmp;
- }
+ if (fmt->uv_swapped)
+ swap(u_off, v_off);
image->tile[tile].offset = y_off;
image->tile[tile].u_off = u_off;