From patchwork Mon Sep 2 08:31:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 825181 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D128D183092 for ; Mon, 2 Sep 2024 08:35:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266159; cv=none; b=KGQ1kJJTZmsIrzHbIsLPfEpkrh2nWCenAxuK+ESxB3WYy8GNHwvDtPFB3/VW/N4y1iqYKrzQpEEh0kZ9L8mH5WiXiI37onYXjzQO7yNgCKA4PmlfTvd3sFtWAhg+moApKA3NQgjK/Z8lnquHqEuSsKHFYHzvFlDBrhmXcARdxYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266159; c=relaxed/simple; bh=c1ZoilupvXOePwyTLsPlmR+RpTfrs6hOkihPa0UZuus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AvUjWrM1DfXtQVb3/Hb8YvM2G8yZMm5ct6MgdcNSOFwrClzMc8YvmctX4HwThWhYPkTqk/Tn+MNKDlQVANRBdfXaN8iOAk7eY/geuJqlIDKvFZwRw5Q9N0H8lYNe2ReKgRHh7GY5Kf4aT4Ydf9O1ciuXB8Bl54OK2ZDZRItUuZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96580C4CEC6; Mon, 2 Sep 2024 08:35:58 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil , Hans de Goede Subject: [PATCH 1/4] media: atomisp: add missing wait_prepare/finish ops Date: Mon, 2 Sep 2024 10:31:21 +0200 Message-ID: <9f401f3732dd728e3d2ca508002c97b80a2eae30.1725265884.git.hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Without these ops the v4l2-compliance blocking wait test will fail. These ops are required to ensure that when VIDIOC_DQBUF has to wait for buffers to arrive, the queue lock is correctly released and retaken. Otherwise the wait for a buffer would block all other queue ioctls. Signed-off-by: Hans Verkuil Cc: Hans de Goede --- drivers/staging/media/atomisp/pci/atomisp_fops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 50c4123ba006..b180fcbea9b1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -441,6 +441,8 @@ const struct vb2_ops atomisp_vb2_ops = { .buf_queue = atomisp_buf_queue, .start_streaming = atomisp_start_streaming, .stop_streaming = atomisp_stop_streaming, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; static void atomisp_dev_init_struct(struct atomisp_device *isp) From patchwork Mon Sep 2 08:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 824816 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7A3F3186E55 for ; Mon, 2 Sep 2024 08:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266161; cv=none; b=ToJdm3RzeGDLT64AFRjazQF1SsA0PQabXVZ3651CjW2GSIb8bX6t1fIIF6OZkF6OOgDVMCRyVXBg087l7Qm6TOSOwF6X1xMixV3MV+pO415/9QMxvHd9+KEbtQ2Pmdb3tbtDIB9d0zLSWRJT916taKLINnNROQ+OFJZIIicyNtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266161; c=relaxed/simple; bh=i1zW5ezhI+uzHZi3F5gsg5NhDVl/y+quoO8No/mYr3Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=piLtCSjmPReueU6qeUv88lCX0Mh9GXkeHUTw52v1dsxlX4mS5XSln39pNuktfVoQBYmG81VjiaRcnwPOVG7LQ8gsewVPn44BlX/pP/YogcH6Toptdg8I+LgKVPzKysfbgkX6Fd7M49+C9sECKZcMHEm0u/+nSfaDxltL7AR+ymU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6619C4CEC8; Mon, 2 Sep 2024 08:35:59 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil , Sakari Ailus , Laurent Pinchart Subject: [PATCH 2/4] media: omap3isp: add missing wait_prepare/finish ops Date: Mon, 2 Sep 2024 10:31:22 +0200 Message-ID: <1dc1a43151a5c66ed00935055730c56517b44ac9.1725265884.git.hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Without these ops the v4l2-compliance blocking wait test will fail. These ops are required to ensure that when VIDIOC_DQBUF has to wait for buffers to arrive, the queue lock is correctly released and retaken. Otherwise the wait for a buffer would block all other queue ioctls. Signed-off-by: Hans Verkuil Cc: Sakari Ailus Cc: Laurent Pinchart Acked-by: Sakari Ailus --- drivers/media/platform/ti/omap3isp/ispvideo.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/platform/ti/omap3isp/ispvideo.c b/drivers/media/platform/ti/omap3isp/ispvideo.c index daca689dc082..5c9aa80023fd 100644 --- a/drivers/media/platform/ti/omap3isp/ispvideo.c +++ b/drivers/media/platform/ti/omap3isp/ispvideo.c @@ -480,11 +480,29 @@ static int isp_video_start_streaming(struct vb2_queue *queue, return 0; } +static void omap3isp_wait_prepare(struct vb2_queue *vq) +{ + struct isp_video_fh *vfh = vb2_get_drv_priv(vq); + struct isp_video *video = vfh->video; + + mutex_unlock(&video->queue_lock); +} + +static void omap3isp_wait_finish(struct vb2_queue *vq) +{ + struct isp_video_fh *vfh = vb2_get_drv_priv(vq); + struct isp_video *video = vfh->video; + + mutex_lock(&video->queue_lock); +} + static const struct vb2_ops isp_video_queue_ops = { .queue_setup = isp_video_queue_setup, .buf_prepare = isp_video_buffer_prepare, .buf_queue = isp_video_buffer_queue, .start_streaming = isp_video_start_streaming, + .wait_prepare = omap3isp_wait_prepare, + .wait_finish = omap3isp_wait_finish, }; /* From patchwork Mon Sep 2 08:31:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 825180 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DE364185B78 for ; Mon, 2 Sep 2024 08:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266162; cv=none; b=jQMr+vTMwKeWMYmWwkGKKcmQ758eIbcBzeXr0WIg/cTw9dnt9Qt4RCLGVZwm7VjXFAPv+09kY/oNUvZRHCy6Ag+PG0aQ80xHu6+hFj0FITUNeoGiFTRSoznERNmYf/2YMbEsqVDSVh2L18WOlYIOiXnrwfPnJqovTBhKRMxKj4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266162; c=relaxed/simple; bh=2uz8PHPy75tBB2bEaV3WyfPmw+1LyeXcp75kPYyDQh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tDyXergUAes6gN86ZOPh4czzVNaQRuYp04tv9khDfX6ju3z7D0nHTZ3MmjPVyGRADbz9RRR4zW1eB3lRgme3Dnc1EX9LJqTLsGVB+n7YOOwZOyI2ngorVsUZs1y/nj/fjf1M+MoRpzrGFNBRxDdU7SmbdhyEkOT2CrKiI8bu0eU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72FAEC4CEC6; Mon, 2 Sep 2024 08:36:01 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil , Jacopo Mondi , Laurent Pinchart Subject: [PATCH 3/4] media: pisp_be: add missing wait_prepare/finish ops Date: Mon, 2 Sep 2024 10:31:23 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Without these ops the v4l2-compliance blocking wait test will fail. These ops are required to ensure that when VIDIOC_DQBUF has to wait for buffers to arrive, the queue lock is correctly released and retaken. Otherwise the wait for a buffer would block all other queue ioctls. Signed-off-by: Hans Verkuil Cc: Jacopo Mondi Cc: Laurent Pinchart --- drivers/media/platform/raspberrypi/pisp_be/pisp_be.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c index 65ff2382cffe..7ce3be626c4a 100644 --- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c +++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c @@ -964,6 +964,8 @@ static const struct vb2_ops pispbe_node_queue_ops = { .buf_queue = pispbe_node_buffer_queue, .start_streaming = pispbe_node_start_streaming, .stop_streaming = pispbe_node_stop_streaming, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, }; static const struct v4l2_file_operations pispbe_fops = { From patchwork Mon Sep 2 08:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 824815 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4159817C9B3 for ; Mon, 2 Sep 2024 08:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266164; cv=none; b=aLQ8H/EWTjNqaM6s3du2L53MyJCYC+m/uIJeFSz4vJS+cQU28tiirMI4iEgvITiU+W6wKca6QvXU7SXr/dRTpFrj+dZpdfDcJILXegTqCWDym0ECmH6w8uffiBICYQCAKIwFEzwvL1mresyWPGx/ofuDrOdE0Pugnk4SHkZRmZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725266164; c=relaxed/simple; bh=JbaDlZeVXDY0tB3P7a0tbnj8rqi1AnQm6tuabUWnf5E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ic+LeEkPiDIYMkBPFoG8PYT/w3rsnjzDmzAIqm+dlTifKqQv8VvLwN2/cxzbvJGT2uH/I9+yQnomoha8HOIWskjIqCfF4rYfA47iQThhMPVw9eMDWK/fAulldWcMob/gAgKvCknyP3vgolLu+UKEP4owpSlqGex0zOajfwgDirA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F08DAC4CEC2; Mon, 2 Sep 2024 08:36:02 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil , Stanimir Varbanov Subject: [PATCH 4/4] media: venus: add missing wait_prepare/finish ops Date: Mon, 2 Sep 2024 10:31:24 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Without these ops the v4l2-compliance blocking wait test will fail. These ops are required to ensure that when VIDIOC_DQBUF has to wait for buffers to arrive, the queue lock is correctly released and retaken. Otherwise the wait for a buffer would block all other queue ioctls. Signed-off-by: Hans Verkuil Cc: Stanimir Varbanov Reviewed-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/vdec.c | 2 ++ drivers/media/platform/qcom/venus/venc.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index d12089370d91..666309f684f1 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1390,6 +1390,8 @@ static const struct vb2_ops vdec_vb2_ops = { .buf_prepare = venus_helper_vb2_buf_prepare, .start_streaming = vdec_start_streaming, .stop_streaming = vdec_stop_streaming, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .buf_queue = vdec_vb2_buf_queue, }; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 3ec2fb8d9fab..5804a4911537 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1319,6 +1319,8 @@ static const struct vb2_ops venc_vb2_ops = { .buf_prepare = venus_helper_vb2_buf_prepare, .start_streaming = venc_start_streaming, .stop_streaming = venus_helper_vb2_stop_streaming, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .buf_queue = venc_vb2_buf_queue, };