Commit 811cb526 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: ti-vpe: cal: Rename MAX_(WIDTH|HEIGHT)_* macros with CAL_ prefix

The MAX_WIDTH_BYTES and MAX_HEIGHT_LINES macros have a generic name that
is prone to namespace clashes. Rename them with a CAL_ prefix. While at
it, expand their documentation and add CAL_MIN_(WIDTH|HEIGHT)_* macros
that will be used to implement CAMERARX subdev operations.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarBenoit Parrot <bparrot@ti.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 71681550
......@@ -163,9 +163,10 @@ static int cal_calc_format_size(struct cal_ctx *ctx,
* We need to recalculate the actual maxi width depending on the
* number of bytes per pixels required.
*/
max_width = MAX_WIDTH_BYTES / (ALIGN(fmt->bpp, 8) >> 3);
max_width = CAL_MAX_WIDTH_BYTES / (ALIGN(fmt->bpp, 8) >> 3);
v4l_bound_align_image(&f->fmt.pix.width, 48, max_width, 2,
&f->fmt.pix.height, 32, MAX_HEIGHT_LINES, 0, 0);
&f->fmt.pix.height, 32, CAL_MAX_HEIGHT_LINES,
0, 0);
bpl = (f->fmt.pix.width * ALIGN(fmt->bpp, 8)) >> 3;
f->fmt.pix.bytesperline = ALIGN(bpl, 16);
......
......@@ -31,8 +31,16 @@
#define CAL_NUM_CONTEXT 2
#define CAL_NUM_CSI2_PORTS 2
#define MAX_WIDTH_BYTES (8192 * 8)
#define MAX_HEIGHT_LINES 16383
/*
* The width is limited by the size of the CAL_WR_DMA_XSIZE_j.XSIZE field,
* expressed in multiples of 64 bits. The height is limited by the size of the
* CAL_CSI2_CTXi_j.CTXi_LINES and CAL_WR_DMA_CTRL_j.YSIZE fields, expressed in
* lines.
*/
#define CAL_MIN_WIDTH_BYTES 16
#define CAL_MAX_WIDTH_BYTES (8192 * 8)
#define CAL_MIN_HEIGHT_LINES 1
#define CAL_MAX_HEIGHT_LINES 16383
#define CAL_CAMERARX_PAD_SINK 0
#define CAL_CAMERARX_PAD_SOURCE 1
......
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