Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp773556pxb; Tue, 5 Apr 2022 22:44:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw87M8zFnrKuGUV1hUwECfGFf+yLqHd+s1CJmhTO0ohrfrOMzU/VWHKSi8qszEqypk83KE2 X-Received: by 2002:a17:902:e883:b0:153:f7b8:fa9 with SMTP id w3-20020a170902e88300b00153f7b80fa9mr7018863plg.96.1649223871626; Tue, 05 Apr 2022 22:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649223871; cv=none; d=google.com; s=arc-20160816; b=ajuOov/6hR6oYbjTM1U20AwPC+g6Ypk4KTjHyfbpi0vOkMu0lCBW/516ws8tIQzjU/ yXJgNeLr9qA3DAWa40H1H6y+/E/Ms6riIr9PA32+zoFROGA/k4JbthkUjkGCPhnZJHMC Hr0RzgCYsNrqch63QfbNWlyXFN0L9TCss5sOfNJ93Jq3xuOKKisqc+N9K8z4IQPQ79M6 kjyq/5WGOgC8VYCiU7KIvg5pzAUMDApRI97pItGg2aoF99kkvDuXEzVTe1uvsSMEVL0W hOuje0+/ocwP1EjjE8UcfLHA+vZHQHhq6ey87eLp5ZhHdof8zQIDNlZXAjNyD/q1hW9p IFAg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jPaKrwmdi+32zkDPa9wna5zNmR/ExjQ4DLvRrXfHs3I=; b=Q8lSeKIvSNlB8RpCUsa+rjBDP/C7pnP8UuQAhYZpvkgZA3XkuhQaGLnCb/JOpohOLk HlDoofb79q410Dg7m6V2U8tjoSH5G/w5v0/UrXAQjp9p6eV5dD2Zt15Uzhs23GD5m7mb gWRCxIq9fMtupIUvupCcIVdaXm9OQ9GRI3fUqlel5eg3Dkhapp4fz9FxTWvhSnAlgsW0 g8Z0Q6gBNXxgOydoN63P4eHOBothDQWraoIt1CW4BK8Bw4pmwP33xSsYjf7ZnQj4aEMs CooHkYov7ROWPRtCZyrCmh53WlnGRo4IqiXUBVxnMQ8TFGFYnfHztOjZZsxITVvVttXg 83ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LJhLobEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t7-20020a17090340c700b00153b2d16598si13856983pld.416.2022.04.05.22.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:44:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LJhLobEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E62026EC86; Tue, 5 Apr 2022 21:57:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442620AbiDFCfR (ORCPT + 99 others); Tue, 5 Apr 2022 22:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444201AbiDEWVB (ORCPT ); Tue, 5 Apr 2022 18:21:01 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196FA81653; Tue, 5 Apr 2022 13:45:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 7BD5E1F44865 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649191505; bh=FmxP3Of2pm4gkbqbbaer5qaBCfIvVbPhhE5DeBELz4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LJhLobEreEIBQIAqgI5fPU5cdPQvn9SeAwIF1icf4FStyj8Ne3xA2JAXJT0xwDJnR 2Y/rTcEnJbFveYy6xO1foPNJuFpQTIFO9K2xV1cyU7SdWwKkOWFrCRP3QLNJM2x/b6 9HK+aKOnmHf9DkKK3+oYWX6pvu8TPtUYSXN9qgEbJAslJmy+R6c+g1OaRawJorYNW3 +y7yayfl/q7neKlj9LK1qtNvPlXHGlJ5GaPU5awD/XrKLk1T2G9EXBeYSuSWG7wJH1 kMKjOlbJGXbWBiu6kqp5s/S8u/l7iRuYeJ34A7JHoO73wC3OSq3RhGEKNEFHut2U0t rIp57lJK9utDw== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Boris Brezillon Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, Jonas Karlman , Ezequiel Garcia , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev Subject: [PATCH v3 14/24] media: rkvdec: h264: Fix bit depth wrap in pps packet Date: Tue, 5 Apr 2022 16:44:15 -0400 Message-Id: <20220405204426.259074-15-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220405204426.259074-1-nicolas.dufresne@collabora.com> References: <20220405204426.259074-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no 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 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 --- 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 bcde37d72244..8d44a884a52e 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.34.1