Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2196611iof; Tue, 7 Jun 2022 22:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBKKW6vg2f0DyvvRGncSLBvJ9uzqmPnC4M0/7IeTQXTcNPJzhj2ZsVeNs95aA2AInxOSb1 X-Received: by 2002:a17:903:248b:b0:160:f4b0:e663 with SMTP id p11-20020a170903248b00b00160f4b0e663mr32309813plw.49.1654667676160; Tue, 07 Jun 2022 22:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667676; cv=none; d=google.com; s=arc-20160816; b=WHAlP8hk+DSzi7YiAzdyFk9BKkoLfTKltHrdpNQOVJ97tVcjLoGa7GppzPKKR7Xvmp kYBw/gEhcUbs5aT+HA/cY2LjGHq2gC26yQLVxVYgNISj9toYJZIR16z234qeylwnV2xc ouQxDs+mm6vRIITqtaohTaWfc1l8hD4BDatYJNKmqV0Jc6XLtKIy5t7iog3voar3V9Gi NnCxd/ToEv0jq34SASnkqnchl/kPLgjyb/N0OznrqRUxLfPFNBGxCJ6U7IeszuhQBfmX uj73revJ377zLiJ4PfV3wf3lfLmDk0HU208cDu6Cz6ts0dSgC3I8pF4GA8cGbnDociJ9 0SQg== 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=pSQJB8+W1FUDcMAskzjJpcDCTeyXpA1SsRNCYxl77VI=; b=RR60JKzdWRpVWYEvNldV20oXkKreM3Ivy/9ZUXFQ5ZoOaNVRQ+plOZzjD9w/ly1vpc w0vBanQfWNguCINo2s+K3kmGrWBqHMh7jvzXalM4yUzBUZiAT/DSJLr5/hfLP+D5Qn07 91xmKkji1pTHnKzNgxdzKADRWRbKLSrooJhOunqiCW471aP3nDWooV5huyd3u7nJ3val UFZc8ZGL7UinXH7VIc/NfGvtNIj4JotApt93G1ntR0ig6JmkW6iolKVj6H1ZlNCwNPF5 VvD4twMPuW6hSXShHlBZIhBiKOGADEgW+fsX93p1FdC8FeLl7CoVHbcKnpPCmZtzHp2c E5kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VpaqeErB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oo10-20020a17090b1c8a00b001ea4718828esi194137pjb.155.2022.06.07.22.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:54:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VpaqeErB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00C3F4ACD73; Tue, 7 Jun 2022 22:21:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237809AbiFHA4C (ORCPT + 99 others); Tue, 7 Jun 2022 20:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381902AbiFGVpc (ORCPT ); Tue, 7 Jun 2022 17:45:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E13C23512A; Tue, 7 Jun 2022 12:07:30 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1B4F8B82182; Tue, 7 Jun 2022 19:07:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D56CC385A5; Tue, 7 Jun 2022 19:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628846; bh=G4QYV8KfCGN2kJuv0APB3ew8HI83mkxuqGlT4tkQ4ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VpaqeErBX06cshDzka/gyYjfFoVwWTh4diUnmTthNoS9uzooAV4oSdHqTrO/FTyfp +nsoz/b4BUhaHK0s2ei1JimeujyRpFBas09h/MkhAy3UJlxTaVue+Pj6eeBegkyYIz vskVDNSCvIhiErYe2WoAPxCe/OyCEFVbF4+Ks8+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonas Karlman , Nicolas Dufresne , Ezequiel Garcia , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.18 477/879] media: rkvdec: h264: Fix bit depth wrap in pps packet Date: Tue, 7 Jun 2022 18:59:55 +0200 Message-Id: <20220607165016.724139272@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Jonas Karlman [ Upstream commit a074aa4760d1dad0bd565c0f66e7250f5f219ab0 ] The luma and chroma bit depth fields in the pps packet are 3 bits wide. 8 is wrongly added to the bit depth values written to these 3 bit fields. Because only the 3 LSB are written, the hardware was configured correctly. Correct this by not adding 8 to the luma and chroma bit depth value. Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/rkvdec/rkvdec-h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c index f5d8c6cb740b..22b4bf9e9ef4 100644 --- a/drivers/staging/media/rkvdec/rkvdec-h264.c +++ b/drivers/staging/media/rkvdec/rkvdec-h264.c @@ -662,8 +662,8 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx, WRITE_PPS(0xff, PROFILE_IDC); WRITE_PPS(1, CONSTRAINT_SET3_FLAG); WRITE_PPS(sps->chroma_format_idc, CHROMA_FORMAT_IDC); - WRITE_PPS(sps->bit_depth_luma_minus8 + 8, BIT_DEPTH_LUMA); - WRITE_PPS(sps->bit_depth_chroma_minus8 + 8, BIT_DEPTH_CHROMA); + WRITE_PPS(sps->bit_depth_luma_minus8, BIT_DEPTH_LUMA); + WRITE_PPS(sps->bit_depth_chroma_minus8, BIT_DEPTH_CHROMA); WRITE_PPS(0, QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG); WRITE_PPS(sps->log2_max_frame_num_minus4, LOG2_MAX_FRAME_NUM_MINUS4); WRITE_PPS(sps->max_num_ref_frames, MAX_NUM_REF_FRAMES); -- 2.35.1