Commit 180a49e3 authored by Salah Triki's avatar Salah Triki Committed by Philipp Zabel

gpu: ipu-v3: image-convert: use swap()

Use swap() instead of implementing it since it makes code cleaner.
Signed-off-by: default avatarSalah Triki <salah.triki@gmail.com>
Link: https://lore.kernel.org/r/20210713140521.GA1873885@pc
[p.zabel@pengutronix.de: add "image-convert:" prefix to commit description]
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 31231092
...@@ -990,7 +990,7 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx, ...@@ -990,7 +990,7 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx,
const struct ipu_image_pixfmt *fmt = image->fmt; const struct ipu_image_pixfmt *fmt = image->fmt;
unsigned int row, col, tile = 0; unsigned int row, col, tile = 0;
u32 H, top, y_stride, uv_stride; 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_row_off, y_col_off, y_off;
u32 y_size, uv_size; u32 y_size, uv_size;
...@@ -1021,11 +1021,8 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx, ...@@ -1021,11 +1021,8 @@ static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx,
u_off = y_size - y_off + uv_off; u_off = y_size - y_off + uv_off;
v_off = (fmt->uv_packed) ? 0 : u_off + uv_size; v_off = (fmt->uv_packed) ? 0 : u_off + uv_size;
if (fmt->uv_swapped) { if (fmt->uv_swapped)
tmp = u_off; swap(u_off, v_off);
u_off = v_off;
v_off = tmp;
}
image->tile[tile].offset = y_off; image->tile[tile].offset = y_off;
image->tile[tile].u_off = u_off; image->tile[tile].u_off = u_off;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment