From patchwork Mon Nov 13 12:26:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 13453940 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 76B18C4332F for ; Mon, 13 Nov 2023 12:32:40 +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: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:In-Reply-To:References: List-Owner; bh=Od6Aqs/Xve73m7BqJynFPe1LA6XZ1OU4f9tAkRhqO0c=; b=LScUurXgj8EjsU RH6nBt+DOM8szAwfVZYJB1SkqNe6ICmuvqt8oyrfpQqP52qRRz//+Gi297K7pyRdQhvejxguCd9yO YtIuDMDnr0Yxn/9+mtG5ulkv4Bss9YVUnpHnmUvLyMVlgKXQPlsyq8ku3Svhk/E6rG/qXtaHuUfBm L53/EGua9qISSGOWueOxlCbKiwXKrzJeaAkXjG8tJSl8i5qlSCGkwwUJpdxbLMm7hebgpckQjNidF 8TpKADfeIS+6ZqFDtc2jd7U8VoLWZ+vWCbe1Qx/TOJrNFVlaaAR8FvNbJn5cJJL1+/5vTia/ubVBC c5T2w96Py9iEcJy0SZkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2W70-00DxsJ-0r; Mon, 13 Nov 2023 12:32:18 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2W6u-00Dxkf-2F for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 12:32:14 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cc58219376so38794185ad.1 for ; Mon, 13 Nov 2023 04:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699878723; x=1700483523; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=py+4SutQqV3+4rqQPYSiHKI4gA9eXI6g2jeOqoYb50s=; b=j3tVTHQFBuIPbyafjNYjE9ggu+DgqBOQU/4iANt6xvTdIUqyyGNces1J/Kw9RAylr4 UJaFr+R0VLii/L/w5wYz8lmmFVsUKU6qY9mLlqOkOiuwLYu8ApNSX/O4x3Lwu7bOj6US 2M/Etdj/RcqGGk541ljThQK0Tq3pxkz3Zn+G8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699878723; x=1700483523; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=py+4SutQqV3+4rqQPYSiHKI4gA9eXI6g2jeOqoYb50s=; b=wJvPR2D174LaCnjLcOHFuYtqoe2IlGHWJuqTiNgAmJxHbRcpsSs5umf1R3nfhPS99g ZAH6LYRLZtyyGO3G+hVe01moSwFIJ3KZqDJm0v6V4+p1hmkdGFMScWUiD/HnqptWuJ8f m4a/vE89W9Hixh8o4YTV+H2kvDsWn2Lys75u0iZz/xKLFgOySOPEfGeEw3hkR00oZczN Mqq0PzPgYmtnYpYu4wCJMwBC1heKJNHBLTrUl6ijaIyrDTd2A+XwSaMEggricmVT2eBw sJiz/Q99O9Wl4kD+5m4vALAU64EjiNgMgYKgJgBaqfZ2kCc860Q3xtE5jvVVJISUr4ZQ E1aw== X-Gm-Message-State: AOJu0YzOltQL4ZTkf1eMKnE4kk92Z9dodt9D8QYYp4I2lhuHq2/bZCpJ ZZyEivMdIGFOKZXKixnXabwn/A== X-Google-Smtp-Source: AGHT+IHEgiuNFFVDdx270O6Oa6UBDR2x3iAow64arQ4fbeLxoenvFolURDN435oi95jJKjzlfm9Imw== X-Received: by 2002:a17:902:f686:b0:1ce:19cd:b9c4 with SMTP id l6-20020a170902f68600b001ce19cdb9c4mr5539445plg.3.1699878722789; Mon, 13 Nov 2023 04:32:02 -0800 (PST) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:bc9:4777:173:8be3]) by smtp.gmail.com with ESMTPSA id e12-20020a170902d38c00b001bde65894c8sm3924104pld.268.2023.11.13.04.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 04:32:02 -0800 (PST) From: Fei Shao To: Hans Verkuil , AngeloGioacchino Del Regno Cc: Fei Shao , Andrew-CT Chen , Dan Carpenter , Irui Wang , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Dufresne , =?utf-8?b?TsOtY29sYXMg?= =?utf-8?b?Ri4gUi4gQS4gUHJhZG8=?= , Tiffany Lin , Xiaoyong Lu , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 0/4] Improvement around mtk_vcodec_mem_free() logging and usage Date: Mon, 13 Nov 2023 20:26:48 +0800 Message-ID: <20231113123049.4117280-1-fshao@chromium.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_043212_733770_10482E9E X-CRM114-Status: GOOD ( 10.46 ) 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 This series includes some improvements around mtk_vcodec_mem_free() in mtk_vcodec_util.c. I noticed that mtk_vcodec_mem_free() generates a spurious error if the target DMA buffer has been freed previously: mtk_vcodec_mem_free(),69: [MTK_V4L2][ERROR] 18000000.video-codec dma_free size=0 failed! It's actually harmless, but it brings some confusion to our developers and testing infra so I'd like to fix it. Then I found some checks around mtk_vcodec_mem_free() usages in the driver that can optimized together, so I wrapped both into this series. The first two patches are for aesthetic and style improvements, the third suppresses the error mentioned above, and the last removes the redundant code for optimization. Regards, Fei Fei Shao (4): media: mediatek: vcodec: Replace dev_name in error string media: mediatek: vcodec: Drop unnecessary variable media: mediatek: vcodec: Fix mtk_vcodec_mem_free() error log criteria media: mediatek: vcodec: Drop VA check against mtk_vcodec_mem_free() .../mediatek/vcodec/common/mtk_vcodec_util.c | 23 +++++++-------- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 18 ++++-------- .../vcodec/decoder/vdec/vdec_h264_if.c | 9 ++---- .../vcodec/decoder/vdec/vdec_h264_req_if.c | 9 ++---- .../decoder/vdec/vdec_h264_req_multi_if.c | 6 ++-- .../decoder/vdec/vdec_hevc_req_multi_if.c | 9 ++---- .../vcodec/decoder/vdec/vdec_vp8_if.c | 4 +-- .../vcodec/decoder/vdec/vdec_vp8_req_if.c | 12 +++----- .../vcodec/decoder/vdec/vdec_vp9_if.c | 15 ++++------ .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 29 +++++++------------ .../mediatek/vcodec/decoder/vdec_msg_queue.c | 15 ++++------ 11 files changed, 54 insertions(+), 95 deletions(-)