media: ti-vpe: cal: Rename MAX_(WIDTH|HEIGHT)_* macros with CAL_ prefix
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 6 Dec 2020 23:53:33 +0000 (00:53 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 4 Jan 2021 10:31:33 +0000 (11:31 +0100)
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal-video.c
drivers/media/platform/ti-vpe/cal.h

index 355bb365daf0d68e79cadfb4267f0c02535e2299..42e750925e8b84aef75783975b2695f2cfb79705 100644 (file)
@@ -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);
index 6e6bdf8af3d072f2d56e1b716b2aca8a923a0198..d42d381d928f5fd4de63a1f6e825702884272f28 100644 (file)
 #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