Commit f1ef14f3 authored by Philipp Zabel's avatar Philipp Zabel

gpu: ipu-v3: image-convert: disable double buffering if necessary

Double-buffering only works if tile sizes are the same and the resizing
coefficient does not change between tiles, even for non-planar formats.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarSteve Longerbeam <slongerbeam@gmail.com>
Tested-by: default avatarSteve Longerbeam <slongerbeam@gmail.com>
parent e46279f0
...@@ -1990,6 +1990,7 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task, ...@@ -1990,6 +1990,7 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
struct ipu_image_convert_chan *chan; struct ipu_image_convert_chan *chan;
struct ipu_image_convert_ctx *ctx; struct ipu_image_convert_ctx *ctx;
unsigned long flags; unsigned long flags;
unsigned int i;
bool get_res; bool get_res;
int ret; int ret;
...@@ -2077,15 +2078,37 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task, ...@@ -2077,15 +2078,37 @@ ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
* for every tile, and therefore would have to be updated for * for every tile, and therefore would have to be updated for
* each buffer which is not possible. So double-buffering is * each buffer which is not possible. So double-buffering is
* impossible when either the source or destination images are * impossible when either the source or destination images are
* a planar format (YUV420, YUV422P, etc.). * a planar format (YUV420, YUV422P, etc.). Further, differently
* sized tiles or different resizing coefficients per tile
* prevent double-buffering as well.
*/ */
ctx->double_buffering = (ctx->num_tiles > 1 && ctx->double_buffering = (ctx->num_tiles > 1 &&
!s_image->fmt->planar && !s_image->fmt->planar &&
!d_image->fmt->planar); !d_image->fmt->planar);
for (i = 1; i < ctx->num_tiles; i++) {
if (ctx->in.tile[i].width != ctx->in.tile[0].width ||
ctx->in.tile[i].height != ctx->in.tile[0].height ||
ctx->out.tile[i].width != ctx->out.tile[0].width ||
ctx->out.tile[i].height != ctx->out.tile[0].height) {
ctx->double_buffering = false;
break;
}
}
for (i = 1; i < ctx->in.num_cols; i++) {
if (ctx->resize_coeffs_h[i] != ctx->resize_coeffs_h[0]) {
ctx->double_buffering = false;
break;
}
}
for (i = 1; i < ctx->in.num_rows; i++) {
if (ctx->resize_coeffs_v[i] != ctx->resize_coeffs_v[0]) {
ctx->double_buffering = false;
break;
}
}
if (ipu_rot_mode_is_irt(ctx->rot_mode)) { if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
unsigned long intermediate_size = d_image->tile[0].size; unsigned long intermediate_size = d_image->tile[0].size;
unsigned int i;
for (i = 1; i < ctx->num_tiles; i++) { for (i = 1; i < ctx->num_tiles; i++) {
if (d_image->tile[i].size > intermediate_size) if (d_image->tile[i].size > intermediate_size)
......
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