From patchwork Tue Feb 6 08:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 197247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1389777dyb; Tue, 6 Feb 2024 00:09:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2/ED6nzoCsQSEQQcG0jORRWKA8DoWDZjp9dMZacWGcEJgPJE19L4dxEweYHeTa6F3HopR X-Received: by 2002:a05:6808:159b:b0:3bf:e58e:16b1 with SMTP id t27-20020a056808159b00b003bfe58e16b1mr642170oiw.0.1707206961588; Tue, 06 Feb 2024 00:09:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707206961; cv=pass; d=google.com; s=arc-20160816; b=QhRkkkB2nr/euv6WQwTdu+nNHRu8PYCorhQ8kc78JVqIDjZRQlhKgs1KP6MzKXAdtz MeAmrLFad+wVkAsvlyZGthzss0tRXkJloiZ/HfMkWq4NidKM+vWJpSqZsnTsOK51y8Y1 uuny4Z1aHkECbajhh8NXYcKK7IRXh5sOtTJYUtG8gptt4NNpPbOrSwcAK76dKaADG060 u2ckHvz1vE2hQec6qnZ0VrRR2T6m2P3FFQ4Xd4BJT22WwonqJaGUHPkoIT8xF3/LoS8U hJPi/0sGklN37ADtEg921POzdtb72+byffK0NL+e8Y/2QdxE1bNnhZKDRv/GC9A/dAFn DeEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lrb6UbvFkmNPsJzp3gEWTGK1dhqzLPDb2viuFqFFXNg=; fh=jnefFKZf7i9owt+U1fieMo4ciAQach5KXd6XCL+X/ws=; b=zg84sUXy1L+WV0vs/C4jKF76X7v02Emxt4TTyr+SFgz5SaRoP1f2bdt6fDbCg4ioy9 UdjCEnh18LTCBCqtoWdxEfIC/zaCfqRnwkEBcwraPDOiN3+ceND69Wc7On04G1E9gkkf ZuF7Lqv/MBLPMbRubd0bX2fOsuVPeLfbXCk6iqVEXo09o7oI/TV5EaTCFAZhtQR0Q4Qi 1p8suoO3dBX1FzRPadlJJhplQzh1lLUIzn9EOyi/3+imPsmV2A7aQsmjv+uy9zu6ogCN WERmgZYD/zi5cjGP5FHzJ7Xnb0nrzq02FVwhCEzKxNb/FylE5WHrD8C9PLprRrZp1avD Q9Ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MiTtNqiC; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54466-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54466-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCXapl7VCmx/4zOqHi/dWIEPMm3EQuakiSrg/o9a1M5tlTK/6xvbkA7a4Yx702Mq06yq1fb1dxWj4sBs5+j68hmeMe1DGw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t1-20020a632241000000b005d9b919b94asi1266867pgm.311.2024.02.06.00.09.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 00:09:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54466-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MiTtNqiC; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-54466-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54466-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5103DB24D8F for ; Tue, 6 Feb 2024 08:05:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 903F512E1E5; Tue, 6 Feb 2024 08:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="MiTtNqiC" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 908B712BF0F; Tue, 6 Feb 2024 08:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707206559; cv=none; b=Ave1eBM5hHrwzVskrNXcpA0I7JKX0veRXC/kKPSHEzWukq8tD+PNF73y5cjRIL4TD1UlDXp7CnlAQw0sXxj7NeYfHEjhIBx9KNTb7hJHv05WEnpLZl3/xynBN4FBfZOTGqYA0RjM5X8SSYXGc0ov5WP4TbW7eB9X6BsmKwEZ8jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707206559; c=relaxed/simple; bh=pOBMf2guesXNH6vUwvSx6EUngxizNRYUxTMvSY6wvpo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jy7hd0ozjBlfq2uOeQ2AA3DSDHKJomEILqwDeGIJerOrGZe5D7SpGMwKoAV4sO72kYZovba63oxjPoY1c8IqKyeAb2Ll8vPL6V17TRUIawrUOXLw/I4eyW6TTLginqZX1AUcD2wvuTy/cltuPMVFe3EtFBaKReQhZIb6/1Zixwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=MiTtNqiC; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707206550; bh=pOBMf2guesXNH6vUwvSx6EUngxizNRYUxTMvSY6wvpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MiTtNqiCnj+U3nL1lb1MjjqENAAaLb0WsV+insn8X4ytfD87AIMGuN4ilGjz4KKAE zTefrPCciNk8aHAAwuHTBQAo9f/3AR2j4vsjnZf88TD9LbLxdrGJlArjRA2xn1Hje/ ASqDDgqqvynzYAkVFLdXj/HPaxj9EWCVmIJ/irjcrqt/8/eO9QpCzevJ2fczvhYt8I +UAEZlRABsk3LzFI68c3NZit377ANirkCu69oyu3oqZl4Z0Md2IIc5jYfIDwlUpxlZ WTxgWZV+m3QsrkF9r9rtU6jfPqHVD8RpmmNOqZwDqsgd0+xnNJGLSS3VfQsfgNd0uh Tl6Vl6R4UII/g== Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 3861D3782087; Tue, 6 Feb 2024 08:02:30 +0000 (UTC) From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v19 9/9] media: verisilicon: Support deleting buffers on capture queue Date: Tue, 6 Feb 2024 09:02:19 +0100 Message-Id: <20240206080219.11951-10-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240206080219.11951-1-benjamin.gaignard@collabora.com> References: <20240206080219.11951-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790136246676402866 X-GMAIL-MSGID: 1790136246676402866 Allow to delete buffers on capture queue because it the one which own the decoded buffers. After a dynamic resolution change lot of them could remain allocated but won't be used anymore so deleting them save memory. Signed-off-by: Benjamin Gaignard --- drivers/media/platform/verisilicon/hantro_v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c index 941fa23c211a..34eab90e8a42 100644 --- a/drivers/media/platform/verisilicon/hantro_v4l2.c +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c @@ -756,6 +756,7 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = { .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf, .vidioc_create_bufs = v4l2_m2m_ioctl_create_bufs, + .vidioc_delete_bufs = v4l2_m2m_ioctl_delete_bufs, .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,