Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1017944iob; Fri, 13 May 2022 19:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmYgv2pc7sSqiON6rH/nQTUCkRsIIPMaQ2MunA7jD88TOdMHRpRT6jy17LRvYlFJ40RO/N X-Received: by 2002:a5d:6388:0:b0:20a:ed44:fd38 with SMTP id p8-20020a5d6388000000b0020aed44fd38mr6169460wru.153.1652496540873; Fri, 13 May 2022 19:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652496540; cv=none; d=google.com; s=arc-20160816; b=pRFY3t0NfGX9NJD77VJToHw2XHRDqteaYKT6VCCWd+Xd9y8YRgVQSNAENMOqEogYbz euLkeNPL5WaRsORAZKq3nFi6/y7v7VLfy0LZKepb4HKWxebe3aRmDBHxxmfB7UwMQuzP H04U1tX98dIaJvH08UKVRyd93VDxwrHh6fPRTv7YFL2LWktqrjUacKWJ2FirgtU7DH1q iRicSEMaiYHjrTOZYheWDIBAy6A9Ou0oan3CasIGEzGYVqjnKu1qjcT/mkVVAyu2vZj2 xaN5+uUoxdACLaKpy3dwVPFJzVHRFq/bXr5Un0uCJDf5o7B3PPulYPkpVa4mq4UDRGYY oBGA== 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=4n98tGe9IFA4h4/hc87i7XY5Cmdz19Jqc/iG4IR5FxY=; b=Tka04LjJzV0y1XLeAb3mQl2lfWaJ0DEwsbZ2GL+gNkuxSEpVi9rpo1W6at0BCvSBqz A5P842g77WbplUbasbuolfwyMAfMINCipeuI3mDhAFocFB17c8GJ5UTb2Zk3Uq1+j2bo 1jC6DSp8GKcd3RYIKOiN2B02J/JW+O6R885bQy03FAK143Olo8O3ASdN4H/sPksagyrn 8Pr62jgOT9lXQFnNyFWODh1t4VGbBUfKZd43H5mwN9QE0sR/S/FFZxhfTYUJhc4Q1W62 haq7cHDfK+vhui6c7P12miV6lpYOsWJRF45fr4moBVG6CE2JJNyuN7ygWqXM77CibU09 qPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VqNNO9dp; 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 18-20020a05600c269200b0039437f4ca80si3224596wmt.153.2022.05.13.19.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:49:00 -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=VqNNO9dp; 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 F368036F92B; Fri, 13 May 2022 16:36:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384395AbiEMUby (ORCPT + 99 others); Fri, 13 May 2022 16:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384408AbiEMUak (ORCPT ); Fri, 13 May 2022 16:30:40 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED15C7A460; Fri, 13 May 2022 13:29:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id B4FE31F46489 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652473790; bh=lIxlnphkLCaVBUiFzEyVrDZH6uoUDfUFIWUVGXdyJKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VqNNO9dpmcXgsqSoG08E/e4ANf6VIO0SS4tqU/u1KEPXwTpJERV+/ZKV39worJ/Ik EhhzeGw9ektnLCaFKZZoVh/ov4dW1HN3Pl/mjsaVhtSZb8u7j0l1YQnXBJmEAuL+YO qK96ZpUc1cFJOR2fjrOiqBMi/JuYcjQQ5Mc97EZYhIM5kGujK0nsMRGGAXwnf/8IJa Dy5jYKWOlG057qgtsqTConC6avwGnh2A+0nb+gzMwMZczHRgUyQT6MpcVCB3f4Rf46 YroY+kNaa97PiU91F/GlX/lNJdDVEyQpTpUKwDhXeLuMC3dPe3zDCBwFaMvywATF98 mCB9fD+/Q2cDQ== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Boris Brezillon Cc: nicolas@ndufresne.ca, Jonas Karlman , linux-media@vger.kernel.org, Ezequiel Garcia , Mauro Carvalho Chehab , linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v5 10/20] media: rkvdec: h264: Fix bit depth wrap in pps packet Date: Fri, 13 May 2022 16:29:12 -0400 Message-Id: <20220513202922.13846-11-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220513202922.13846-1-nicolas.dufresne@collabora.com> References: <20220513202922.13846-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 Signed-off-by: Hans Verkuil --- 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.3