]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:38:12 +0000 (14:38 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 89d78e0133e71ba324fb67ca776223fba4353418 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 4ea548312052a3361dd4038bbfd223119bc416dc)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
drivers/staging/media/hantro/hantro_h1_regs.h

index 9cd713c02a45501694a88dc35dab549bd6c746b2..686d813f5c6264281a47791f4198495b450bc3b6 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 d6e9825bb5c7be3ca3e336c3649c5bfc7b697b78..30e7e7b920b553aeca0c3fc1ca4be04712d8ef42 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)