media: hantro: Fix overfill bottom register field name
authorChen-Yu Tsai <wenst@chromium.org>
Fri, 7 Jan 2022 09:34:49 +0000 (10:34 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 28 Jan 2022 12:22:59 +0000 (13:22 +0100)
The Hantro H1 hardware can crop off pixels from the right and bottom of
the source frame. These are controlled with the H1_REG_IN_IMG_CTRL_OVRFLB
and H1_REG_IN_IMG_CTRL_OVRFLR in the H1_REG_IN_IMG_CTRL register.

The ChromeOS kernel driver that this was based on incorrectly added the
_D4 suffix H1_REG_IN_IMG_CTRL_OVRFLB. This field crops the bottom of the
input frame, and the number is _not_ divided by 4. [1]

Correct the name to avoid confusion when crop support with the selection
API is added.

[1] https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/ \
heads/chromeos-4.19/drivers/staging/media/hantro/hantro_h1_vp8_enc.c#377

Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
Fixes: a29add8c9bb2 ("media: rockchip/vpu: rename from rockchip to hantro")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
drivers/staging/media/hantro/hantro_h1_regs.h

index 1450013..c5d3204 100644 (file)
@@ -23,7 +23,7 @@ static void hantro_h1_set_src_img_ctrl(struct hantro_dev *vpu,
 
        reg = H1_REG_IN_IMG_CTRL_ROW_LEN(pix_fmt->width)
                | H1_REG_IN_IMG_CTRL_OVRFLR_D4(0)
-               | H1_REG_IN_IMG_CTRL_OVRFLB_D4(0)
+               | H1_REG_IN_IMG_CTRL_OVRFLB(0)
                | H1_REG_IN_IMG_CTRL_FMT(ctx->vpu_src_fmt->enc_fmt);
        vepu_write_relaxed(vpu, reg, H1_REG_IN_IMG_CTRL);
 }
index d6e9825..30e7e7b 100644 (file)
@@ -47,7 +47,7 @@
 #define H1_REG_IN_IMG_CTRL                             0x03c
 #define     H1_REG_IN_IMG_CTRL_ROW_LEN(x)              ((x) << 12)
 #define     H1_REG_IN_IMG_CTRL_OVRFLR_D4(x)            ((x) << 10)
-#define     H1_REG_IN_IMG_CTRL_OVRFLB_D4(x)            ((x) << 6)
+#define     H1_REG_IN_IMG_CTRL_OVRFLB(x)               ((x) << 6)
 #define     H1_REG_IN_IMG_CTRL_FMT(x)                  ((x) << 2)
 #define H1_REG_ENC_CTRL0                               0x040
 #define    H1_REG_ENC_CTRL0_INIT_QP(x)                 ((x) << 26)