From patchwork Mon Jun 20 17:55:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12888009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F8E4C43334 for ; Mon, 20 Jun 2022 17:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mG2BweQffGq/3VG3HOxYyp4u5dhrarC+i8ZYdS3lcu4=; b=MqUsVRSm7jiu4R eJMMRfCDFPOmYzzQnK3xwBTsi8PiP9d6tpEpZFJqrgY/m9u4tB/teF0xpJsdGqH8KyDGblYJOYw9e 4ZX27EImGgEeI/8dTxe3CmhCrSNnI6kqEVlc2pT6fPWxzhZ0kNBiKitcgZrPYikRsd6YIB064ld6M vA28y6Hdb+bP+ikDl1z1jINqX9rUCuP99MM30euf965gov5+du7lPk/m5yHuRhJA6uM/2GJpZJset 9oeJH5N7Linc6EMX4zGoZW3Pj1KFRoPNQ3X/2HYq0YVQ6a2iu5MSX9+kPnJQ0qpuJK8AzyKLXkhXA Mq4gpzDa7Lg7q2JJpf1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3Ld9-001hfE-RQ; Mon, 20 Jun 2022 17:56:08 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3Lcb-001hPT-TL for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2022 17:55:35 +0000 Received: by mail-wr1-x42f.google.com with SMTP id s1so15685879wra.9 for ; Mon, 20 Jun 2022 10:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IIGvFdI/wJ4/LBOf7PZx+JpLogMq9gYH/QS1CnB4btI=; b=SniQDHgjVfXKBSGsUuDwSkfqHypta48g5YrJl77DFnz9lDLxN/KW8s3NVjF0xwIB1E MspMRJdwEUs/mTnQ2JalZYRQu7KIa/zJfFLUBAb9FuY9zj8M7tnNlFGU86Zcs5g7GVFA 2B2526v1crqcHHSumSR7pfRFshcdw1AydSmmr8cg1EN19U8bAsidLJBsPwSoRfnCFz4I iRG9oWQrRufKxNXX25H7wzYJB7xBAsZVi4ihZ/PldsdeOwUgTFG53NumpzRxOaBr9h2k o9eD6nUDWS5SZW91nRUOQ62Ma46UNNTiSE6DO/RTB387NMpx9ADSXSiVEZlPIEGXMku8 7dVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IIGvFdI/wJ4/LBOf7PZx+JpLogMq9gYH/QS1CnB4btI=; b=2yt8YE3d+UaQC21h/1zXhwd8tNDv2OomY/qinyIYxRoe8z1aH/LphSthQs99wgFlwT bg+rA9HPKwHdlzGaJMb0mYTtK7/Wu/qLHYBGVTwHUuSrAerdphNm8xrqgkMqoiJIeudK URsohcQkCHf8PAuyvN+9uRcT29AkuQG6YDFPCKhgNJS39++5I8Q72YEbsGiwgIgBsZHM wkN+T+thLA4EvpEtIkUThFNgwg0pTKK67a92GWnsE5N8x138HcomxP12ouyOFbkw+0SB DPDZKq3rZ0zpxUfBSJR9T6BSpHXhAV+DAFrTAxxkdzl+y18tc3H2rHQsH0IZKGkuoDXk VIew== X-Gm-Message-State: AJIora+oY+cJbkwp1zpod+dbf8JCWPRrkpZgIUtHoUJgAPzgO02PC3Zn a/sdZfLcmUBa1JV4bClvChE= X-Google-Smtp-Source: AGRyM1ufCg7KEptfMe5HeaGDv+eQ7f13H7/55G33w2XYZBwqxHDxoDuZ2UX8gz0YB/Putqu5tQ5zcA== X-Received: by 2002:a05:6000:2a4:b0:219:2aad:51ce with SMTP id l4-20020a05600002a400b002192aad51cemr23651238wry.719.1655747731160; Mon, 20 Jun 2022 10:55:31 -0700 (PDT) Received: from kista.localdomain (213-161-3-76.dynamic.telemach.net. [213.161.3.76]) by smtp.gmail.com with ESMTPSA id 184-20020a1c02c1000000b0039db31f6372sm19620752wmc.2.2022.06.20.10.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:55:30 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, samuel@sholland.org Cc: mchehab@kernel.org, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH 1/7] media: cedrus: h265: Fix flag name Date: Mon, 20 Jun 2022 19:55:11 +0200 Message-Id: <20220620175517.648767-2-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620175517.648767-1-jernej.skrabec@gmail.com> References: <20220620175517.648767-1-jernej.skrabec@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220620_105533_996169_1A957E64 X-CRM114-Status: GOOD ( 12.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Bit 21 in register 0x24 (slice header info 1) actually represents negated version of low delay flag. This can be seen in vendor Cedar library source code. While this flag is not part of the standard, it can be found in reference HEVC implementation. Fix macro name and change it to flag. Fixes: 86caab29da78 ("media: cedrus: Add HEVC/H.265 decoding support") Signed-off-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 4 +++- drivers/staging/media/sunxi/cedrus/cedrus_regs.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c index 7b67cb4621cf..9ee6f0f111e5 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c @@ -576,7 +576,6 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, reg = VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_TC_OFFSET_DIV2(slice_params->slice_tc_offset_div2) | VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_BETA_OFFSET_DIV2(slice_params->slice_beta_offset_div2) | - VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_POC_BIGEST_IN_RPS_ST(decode_params->num_poc_st_curr_after == 0) | VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_CR_QP_OFFSET(slice_params->slice_cr_qp_offset) | VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_CB_QP_OFFSET(slice_params->slice_cb_qp_offset) | VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_QP_DELTA(slice_params->slice_qp_delta); @@ -589,6 +588,9 @@ static void cedrus_h265_setup(struct cedrus_ctx *ctx, V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED, slice_params->flags); + if (decode_params->num_poc_st_curr_after == 0) + reg |= VE_DEC_H265_DEC_SLICE_HDR_INFO1_FLAG_SLICE_NOT_LOW_DELAY; + cedrus_write(dev, VE_DEC_H265_DEC_SLICE_HDR_INFO1, reg); chroma_log2_weight_denom = pred_weight_table->luma_log2_weight_denom + diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h index bdb062ad8682..d81f7513ade0 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h @@ -377,13 +377,12 @@ #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED BIT(23) #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED BIT(22) +#define VE_DEC_H265_DEC_SLICE_HDR_INFO1_FLAG_SLICE_NOT_LOW_DELAY BIT(21) #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_TC_OFFSET_DIV2(v) \ SHIFT_AND_MASK_BITS(v, 31, 28) #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_BETA_OFFSET_DIV2(v) \ SHIFT_AND_MASK_BITS(v, 27, 24) -#define VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_POC_BIGEST_IN_RPS_ST(v) \ - ((v) ? BIT(21) : 0) #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_CR_QP_OFFSET(v) \ SHIFT_AND_MASK_BITS(v, 20, 16) #define VE_DEC_H265_DEC_SLICE_HDR_INFO1_SLICE_CB_QP_OFFSET(v) \