Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp673759pxb; Tue, 5 Apr 2022 18:13:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCqXEBlQanBvHXvTpeYc24H36IqkSBFX1d7mQ0xy8GsMvx/JVcZlriiBhnF/i5RBIaTQng X-Received: by 2002:aa7:dbd0:0:b0:416:633c:a0cc with SMTP id v16-20020aa7dbd0000000b00416633ca0ccmr6262267edt.349.1649207626945; Tue, 05 Apr 2022 18:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207626; cv=none; d=google.com; s=arc-20160816; b=oPpDyet4ScpCw0ZLyJ4l6+q96MmWcsroYh1GccrihzmhsEbEYyph1f6vdNZwaPNxAR YLyn/dEGVKyqkTaAcz3R1Y9WXB+8fVRlVHdrz5HBj48tQuEX7KANyPZsyrQwJiqyk4Bh 3XkjANQzqhf0+GqODzpBT8RMEiqNowyVSFeXhXDk/ncjndWdFptxQOhSr9OCttZhoHC4 +AKdNoOQltRUjDbOvFuDogQ2Z0wOnN0LaWxdoq9kRmdlJkcuJuTcBZ30XzJRiRgiITRI DbiFuf6B+SbQgOjqCA8A8+qMsi9dsupT4HLuaCe5iXNlHqq/lSH3fGlOGcLsi1IoVwl0 x4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iiqgNa4rd9HE+JYuyEYGcVi1hUH5fKJrwSHGvBDMPiQ=; b=A0YbP0o4w0BZbrl8ekfDzNhpw3jg82IFCbJ+UwPLSwKeyYqDZ+7O5UKvsy+e9zSy6h OkfklNDMDymJFzl/NsUVDTDmcZMTHI14vXU4dbPWIZ7+lna1KoAaMmjdI7tcXKrraoZp kLVFQqHTev/Kvn7OZ2eWqnDZn88qBFSGejqC9IKjMj8+wQ4gln1GaENY6RYbbfgyTgo4 XECVLDxObfP0AUVu/TLQuWzG5bOuXxRYNqdu3W7irhQ/EBs8vx9qw0wfQKnEtvanhMXL P4U9ibJKUdrW8ZGvpKRr6spbWLeI2lLYZFByIRoXDJOuOlRnXviiJj+GNh6wjXmkTAeH Pjig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="d/fTka51"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a170906608e00b006df76385cd5si9617290ejj.373.2022.04.05.18.13.20; Tue, 05 Apr 2022 18:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="d/fTka51"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384805AbiDEPPG (ORCPT + 99 others); Tue, 5 Apr 2022 11:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346654AbiDEJpT (ORCPT ); Tue, 5 Apr 2022 05:45:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37EDCDAFF2; Tue, 5 Apr 2022 02:31:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83BE7616AE; Tue, 5 Apr 2022 09:31:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84A3BC385A4; Tue, 5 Apr 2022 09:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151072; bh=p0yrrYaEW8mSo8kS3j473PpFIUaa3apm+1xjXPAWWIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/fTka51CiUue6WACEFdZucGEt3z/bTf9W2WXAaU2vnSRDAv+HpxhHjQQUIkey60A 4mP4X1tva0BnQnxn9HlU8aWJq62abwf39UoPOUvm/R/XoqZyHf6NXB52pntwkAJwrV DfhvkMRUlww7etKQZIHJNyfjGGXC+moEUkYNPgoE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Ezequiel Garcia , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.15 283/913] media: hantro: Fix overfill bottom register field name Date: Tue, 5 Apr 2022 09:22:25 +0200 Message-Id: <20220405070348.340963458@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai [ 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 Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/hantro/hantro_h1_jpeg_enc.c | 2 +- drivers/staging/media/hantro/hantro_h1_regs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c index 9cd713c02a45..686d813f5c62 100644 --- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c +++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c @@ -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); } diff --git a/drivers/staging/media/hantro/hantro_h1_regs.h b/drivers/staging/media/hantro/hantro_h1_regs.h index d6e9825bb5c7..30e7e7b920b5 100644 --- a/drivers/staging/media/hantro/hantro_h1_regs.h +++ b/drivers/staging/media/hantro/hantro_h1_regs.h @@ -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) -- 2.34.1