summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mxc/ipu3/ipu_device.c5
-rw-r--r--include/linux/ipu.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c
index c7d37df019ed..46a9645fcf25 100644
--- a/drivers/mxc/ipu3/ipu_device.c
+++ b/drivers/mxc/ipu3/ipu_device.c
@@ -371,13 +371,10 @@ static bool deinterlace_3_field(struct ipu_task_entry *t)
static u32 tiled_filed_size(struct ipu_task_entry *t)
{
- u32 y_size;
u32 field_size;
/* note: page_align is required by VPU hw ouput buffer */
- y_size = t->input.width * t->input.height/2;
- field_size = ALIGN(y_size, SZ_4K) + ALIGN(y_size/2, SZ_4K);
-
+ field_size = TILED_NV12_FRAME_SIZE(t->input.width, t->input.height/2);
return field_size;
}
diff --git a/include/linux/ipu.h b/include/linux/ipu.h
index 973cfe9b45a5..e0c9e90c2804 100644
--- a/include/linux/ipu.h
+++ b/include/linux/ipu.h
@@ -141,6 +141,8 @@ typedef enum {
#define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*!< 16 YUV 4:2:2 */
/*! @} */
#define IPU_PIX_FMT_TILED_NV12_MBALIGN (16)
+#define TILED_NV12_FRAME_SIZE(w, h) \
+ (ALIGN((w) * (h), SZ_4K) + ALIGN((w) * (h) / 2, SZ_4K))
/* IPU device */
typedef enum {
RGB_CS,