From patchwork Tue Feb 21 14:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 89995 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU7u-006Hop-NA; Tue, 21 Feb 2023 15:00:19 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233777AbjBUPAQ (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233588AbjBUPAM (ORCPT ); Tue, 21 Feb 2023 10:00:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD01983CF for ; Tue, 21 Feb 2023 06:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ncKsPatklq73FSfhyVJjjxyWHywf7+BHjiDpNKefA1g=; b=TZKe8VHXPFV4dqKXqSdqHSPKnNCU7ixxxseKN51fyjESLC5/g+oX2D2gzd1eIWVXX0bWLh EXMsYF78TF3KgHyxUXhgLvo1K+T6AUAyErLtz+dEvdR6YW1UF9QuiJtFU01N3vhQ+hgEYR hHb0vQHMTQ7paNjSEokrX/yBL225RJk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-Uac4SaxWNgWNWJEqDobZEA-1; Tue, 21 Feb 2023 09:59:20 -0500 X-MC-Unique: Uac4SaxWNgWNWJEqDobZEA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4C9987A9E0; Tue, 21 Feb 2023 14:59:19 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 122C72026D4B; Tue, 21 Feb 2023 14:59:11 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 01/10] media: atomisp: Remove depth-mode support Date: Tue, 21 Feb 2023 15:58:57 +0100 Message-Id: <20230221145906.8113-2-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Remove support for depth mode. This is a special mode where 2 streams (from 2 different sensors) can be setup and then starting/stopping 1 will automatically also start/stop the other. Like many of these special features I'm pretty sure that if the queue setup is not done exactly right things will crash and there is no error checking for this. This seems to be for stereoscopic vision and the only known hw which actually supports this is the Intel Aero board/SDK, all other 1000+ BYT/CHT models don't need this. This false outside of the standard webcam use scenario which we are trying to get working and this involves a bunch of hacks / special exceptions all over the code, so lets remove this. Link: https://lore.kernel.org/linux-media/ea81b17b-7d1f-a5e1-11dd-04db310e1e50@redhat.com/ Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko --- .../media/atomisp/include/linux/atomisp.h | 2 - .../staging/media/atomisp/pci/atomisp_cmd.c | 24 +------- .../media/atomisp/pci/atomisp_internal.h | 5 -- .../staging/media/atomisp/pci/atomisp_ioctl.c | 59 ------------------- .../staging/media/atomisp/pci/atomisp_ioctl.h | 3 - .../media/atomisp/pci/atomisp_subdev.c | 36 ----------- .../media/atomisp/pci/atomisp_subdev.h | 1 - 7 files changed, 1 insertion(+), 129 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index 63b1bcd35399..1dc7ac2b90ba 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -1107,8 +1107,6 @@ struct atomisp_sensor_ae_bracketing_lut { /* Lock and unlock raw buffer */ #define V4L2_CID_ENABLE_RAW_BUFFER_LOCK (V4L2_CID_CAMERA_LASTP1 + 29) -#define V4L2_CID_DEPTH_MODE (V4L2_CID_CAMERA_LASTP1 + 30) - #define V4L2_CID_EXPOSURE_ZONE_NUM (V4L2_CID_CAMERA_LASTP1 + 31) /* Disable digital zoom */ #define V4L2_CID_DISABLE_DZ (V4L2_CID_CAMERA_LASTP1 + 32) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 47f18ac5e40e..a89686ac2d97 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -1114,9 +1114,8 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) struct pci_dev *pdev = to_pci_dev(isp->dev); enum ia_css_pipe_id css_pipe_id; bool stream_restart[MAX_STREAM_NUM] = {0}; - bool depth_mode = false; - int i, ret, depth_cnt = 0; unsigned long flags; + int i, ret; lockdep_assert_held(&isp->mutex); @@ -1134,8 +1133,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) !asd->stream_prepared) continue; - depth_cnt++; - if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) cancel_work_sync(&asd->delayed_init_work); @@ -1186,13 +1183,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) atomisp_reset(isp); isp->isp_timeout = false; - if (!isp_timeout) { - for (i = 0; i < isp->num_of_streams; i++) { - if (isp->asd[i].depth_mode->val) - return; - } - } - for (i = 0; i < isp->num_of_streams; i++) { struct atomisp_sub_device *asd = &isp->asd[i]; @@ -1248,12 +1238,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) atomisp_recover_params_queue(&asd->video_out_preview); atomisp_recover_params_queue(&asd->video_out_video_capture); - if ((asd->depth_mode->val) && - (depth_cnt == ATOMISP_DEPTH_SENSOR_STREAMON_COUNT)) { - depth_mode = true; - continue; - } - ret = v4l2_subdev_call( isp->inputs[asd->input_curr].camera, video, s_stream, 1); @@ -1261,12 +1245,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) dev_warn(isp->dev, "can't start streaming on sensor!\n"); } - - if (depth_mode) { - if (atomisp_stream_on_master_slave_sensor(isp, true)) - dev_warn(isp->dev, - "master slave sensor stream on failed!\n"); - } } void atomisp_assert_recovery_work(struct work_struct *work) diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h index fa38d91420cf..90caa4254893 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_internal.h +++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h @@ -133,11 +133,6 @@ (ATOMISP_SOC_CAMERA(asd) && ATOMISP_CSS_SUPPORT_YUVPP && \ !asd->copy_mode) -#define ATOMISP_DEPTH_SENSOR_STREAMON_COUNT 2 - -#define ATOMISP_DEPTH_DEFAULT_MASTER_SENSOR 0 -#define ATOMISP_DEPTH_DEFAULT_SLAVE_SENSOR 1 - /* ISP2401 */ #define ATOMISP_ION_DEVICE_FD_OFFSET 16 #define ATOMISP_ION_SHARED_FD_MASK (0xFFFF) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index d1314bdbf7d5..d3b773bac5aa 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1173,51 +1173,6 @@ static unsigned int atomisp_sensor_start_stream(struct atomisp_sub_device *asd) return 1; } -int atomisp_stream_on_master_slave_sensor(struct atomisp_device *isp, - bool isp_timeout) -{ - unsigned int master, slave, delay_slave = 0; - int ret; - - master = ATOMISP_DEPTH_DEFAULT_MASTER_SENSOR; - slave = ATOMISP_DEPTH_DEFAULT_SLAVE_SENSOR; - dev_warn(isp->dev, - "depth mode use default master=%s.slave=%s.\n", - isp->inputs[master].camera->name, - isp->inputs[slave].camera->name); - - ret = v4l2_subdev_call(isp->inputs[master].camera, core, - ioctl, ATOMISP_IOC_G_DEPTH_SYNC_COMP, - &delay_slave); - if (ret) - dev_warn(isp->dev, - "get depth sensor %s compensation delay failed.\n", - isp->inputs[master].camera->name); - - ret = v4l2_subdev_call(isp->inputs[master].camera, - video, s_stream, 1); - if (ret) { - dev_err(isp->dev, "depth mode master sensor %s stream-on failed.\n", - isp->inputs[master].camera->name); - return -EINVAL; - } - - if (delay_slave != 0) - udelay(delay_slave); - - ret = v4l2_subdev_call(isp->inputs[slave].camera, - video, s_stream, 1); - if (ret) { - dev_err(isp->dev, "depth mode slave sensor %s stream-on failed.\n", - isp->inputs[slave].camera->name); - v4l2_subdev_call(isp->inputs[master].camera, video, s_stream, 0); - - return -EINVAL; - } - - return 0; -} - /* Input system HW workaround */ /* Input system address translation corrupts burst during */ /* invalidate. SW workaround for this is to set burst length */ @@ -1396,19 +1351,6 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) dev_dbg(isp->dev, "DFS auto mode failed!\n"); } - if (asd->depth_mode->val && atomisp_streaming_count(isp) == - ATOMISP_DEPTH_SENSOR_STREAMON_COUNT) { - ret = atomisp_stream_on_master_slave_sensor(isp, false); - if (ret) { - dev_err(isp->dev, "master slave sensor stream on failed!\n"); - goto out_unlock; - } - goto start_delay_wq; - } else if (asd->depth_mode->val && (atomisp_streaming_count(isp) < - ATOMISP_DEPTH_SENSOR_STREAMON_COUNT)) { - goto start_delay_wq; - } - /* Enable the CSI interface on ANN B0/K0 */ if (isp->media_dev.hw_revision >= ((ATOMISP_HW_REVISION_ISP2401 << ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0)) { @@ -1427,7 +1369,6 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) goto out_unlock; } -start_delay_wq: if (asd->continuous_mode->val) { atomisp_subdev_get_ffmt(&asd->subdev, NULL, V4L2_SUBDEV_FORMAT_ACTIVE, diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.h b/drivers/staging/media/atomisp/pci/atomisp_ioctl.h index 59e071f035f9..93139decf1d0 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.h +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.h @@ -53,9 +53,6 @@ unsigned int atomisp_streaming_count(struct atomisp_device *isp); long atomisp_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg); -int atomisp_stream_on_master_slave_sensor(struct atomisp_device *isp, - bool isp_timeout); - int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count); void atomisp_stop_streaming(struct vb2_queue *vq); diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 9cfb85c61db6..4cbe900d3ca1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -758,23 +758,9 @@ static int s_ctrl(struct v4l2_ctrl *ctrl) { struct atomisp_sub_device *asd = container_of( ctrl->handler, struct atomisp_sub_device, ctrl_handler); - unsigned int streaming; - unsigned long flags; - switch (ctrl->id) { case V4L2_CID_RUN_MODE: return __atomisp_update_run_mode(asd); - case V4L2_CID_DEPTH_MODE: - /* Use spinlock instead of mutex to avoid possible locking issues */ - spin_lock_irqsave(&asd->isp->lock, flags); - streaming = asd->streaming; - spin_unlock_irqrestore(&asd->isp->lock, flags); - if (streaming != ATOMISP_DEVICE_STREAMING_DISABLED) { - dev_err(asd->isp->dev, - "ISP is streaming, it is not supported to change the depth mode\n"); - return -EINVAL; - } - break; } return 0; @@ -930,24 +916,6 @@ static const struct v4l2_ctrl_config ctrl_disable_dz = { .def = 0, }; -/* - * Control for ISP depth mode - * - * When enabled, that means ISP will deal with dual streams and sensors will be - * in slave/master mode. - * slave sensor will have no output until master sensor is streamed on. - */ -static const struct v4l2_ctrl_config ctrl_depth_mode = { - .ops = &ctrl_ops, - .id = V4L2_CID_DEPTH_MODE, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Depth mode", - .min = 0, - .max = 1, - .step = 1, - .def = 0, -}; - static int atomisp_init_subdev_pipe(struct atomisp_sub_device *asd, struct atomisp_video_pipe *pipe, enum v4l2_buf_type buf_type) { @@ -1086,10 +1054,6 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd) v4l2_ctrl_new_custom(&asd->ctrl_handler, &ctrl_enable_raw_buffer_lock, NULL); - asd->depth_mode = - v4l2_ctrl_new_custom(&asd->ctrl_handler, - &ctrl_depth_mode, - NULL); asd->disable_dz = v4l2_ctrl_new_custom(&asd->ctrl_handler, &ctrl_disable_dz, diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h index daa6077a83bd..5cf8f3d9c916 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h @@ -266,7 +266,6 @@ struct atomisp_sub_device { struct v4l2_ctrl_handler ctrl_handler; struct v4l2_ctrl *fmt_auto; struct v4l2_ctrl *run_mode; - struct v4l2_ctrl *depth_mode; struct v4l2_ctrl *vfpp; struct v4l2_ctrl *continuous_mode; struct v4l2_ctrl *continuous_raw_buffer_size; From patchwork Tue Feb 21 14:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 89996 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU7w-006Hop-5g; Tue, 21 Feb 2023 15:00:23 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234123AbjBUPAS (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbjBUPAR (ORCPT ); Tue, 21 Feb 2023 10:00:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9029D93D3 for ; Tue, 21 Feb 2023 06:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4x6N2whcJOV+nra/btK61U4ViaLZtykMDude5qXOGL4=; b=DT2NhbIUJQEWY2RlwPOLHNELpipLAF2gs5q+TgIBraDqMlDFNplFvKngjM8639IwzstBoP PAGSIkCHZAzxKtRm8TwiSv740EZQXsSlS/xyhk15VEifNrk3bnFkjZR3nocUI7tCqoHdD6 gf9ZUIog5jDtFxDgLFJn5sZPCj0/c9w= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-yZN-1-bCOGeE6qIPUq48mw-1; Tue, 21 Feb 2023 09:59:25 -0500 X-MC-Unique: yZN-1-bCOGeE6qIPUq48mw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D25F380611A; Tue, 21 Feb 2023 14:59:24 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F62E2026D4B; Tue, 21 Feb 2023 14:59:19 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 02/10] media: atomisp: Remove continuous mode support Date: Tue, 21 Feb 2023 15:58:58 +0100 Message-Id: <20230221145906.8113-3-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Continues mode is a special mode where 2 /dev/video devices can be active at the same time. Either the video-preview + video nodes or the viewfinder (for still capture) + capture nodes. For the video-preview + video-recording case modern userspace will use a single stream multiplexed by pipewire. The still-capture case is extra special only starting the preview stream and then relying on a custom ATOMISP_IOC_S_CONT_CAPTURE_CONFIG ioctl to set things up followed by a second stream on to capture the amount of configured still pictures. While running the sensor at full resolution all the time. This case too is better handled with dma-buf + GPU downscaling for the view-finder rather then all this custom special code. Besises this the ioctl expects a bunch of special non error checked conditions to be met otherwise things will crash/hang. The continues mode also involves a special cases all over the code getting in the way of further cleanups and simplifying the code to using just 1 /dev/video# node. So lets remove it and the related custom ATOMISP_IOC_S_CONT_CAPTURE_CONFIG ioctl. Link: https://lore.kernel.org/linux-media/ea81b17b-7d1f-a5e1-11dd-04db310e1e50@redhat.com/ Signed-off-by: Hans de Goede --- .../media/atomisp/include/linux/atomisp.h | 23 - .../staging/media/atomisp/pci/atomisp_cmd.c | 574 ++---------------- .../staging/media/atomisp/pci/atomisp_cmd.h | 3 - .../media/atomisp/pci/atomisp_compat_css20.c | 70 +-- .../staging/media/atomisp/pci/atomisp_fops.c | 56 -- .../staging/media/atomisp/pci/atomisp_ioctl.c | 95 +-- .../media/atomisp/pci/atomisp_subdev.c | 32 +- .../media/atomisp/pci/atomisp_subdev.h | 4 - 8 files changed, 79 insertions(+), 778 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index 1dc7ac2b90ba..290a6ed7237e 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -299,26 +299,6 @@ struct atomisp_3a_statistics { u32 isp_config_id; /* isp config ID */ }; -/** - * struct atomisp_cont_capture_conf - continuous capture parameters - * @num_captures: number of still images to capture - * @skip_frames: number of frames to skip between 2 captures - * @offset: offset in ring buffer to start capture - * - * For example, to capture 1 frame from past, current, and 1 from future - * and skip one frame between each capture, parameters would be: - * num_captures:3 - * skip_frames:1 - * offset:-2 - */ - -struct atomisp_cont_capture_conf { - int num_captures; - unsigned int skip_frames; - int offset; - __u32 reserved[5]; -}; - struct atomisp_ae_window { int x_left; int x_right; @@ -958,9 +938,6 @@ struct atomisp_sensor_ae_bracketing_lut { #define ATOMISP_IOC_S_PARAMETERS \ _IOW('v', BASE_VIDIOC_PRIVATE + 32, struct atomisp_parameters) -#define ATOMISP_IOC_S_CONT_CAPTURE_CONFIG \ - _IOWR('v', BASE_VIDIOC_PRIVATE + 33, struct atomisp_cont_capture_conf) - #define ATOMISP_IOC_G_METADATA \ _IOWR('v', BASE_VIDIOC_PRIVATE + 34, struct atomisp_metadata) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index a89686ac2d97..fb8765fdefda 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -79,8 +79,6 @@ union host { } ptr; }; -static int atomisp_set_raw_buffer_bitmap(struct atomisp_sub_device *asd, int exp_id); - /* * get sensor:dis71430/ov2720 related info from v4l2_subdev->priv data field. * subdev->priv is set in mrst.c @@ -242,18 +240,6 @@ int atomisp_freq_scaling(struct atomisp_device *isp, curr_rules.height = asd->fmt[asd->capture_pad].fmt.height; curr_rules.fps = fps; curr_rules.run_mode = asd->run_mode->val; - /* - * For continuous mode, we need to make the capture setting applied - * since preview mode, because there is no chance to do this when - * starting image capture. - */ - if (asd->continuous_mode->val) { - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) - curr_rules.run_mode = ATOMISP_RUN_MODE_SDV; - else - curr_rules.run_mode = - ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE; - } /* search for the target frequency by looping freq rules*/ for (i = 0; i < dfs->dfs_table_size; i++) { @@ -746,13 +732,7 @@ enum atomisp_metadata_type atomisp_get_metadata_type(struct atomisp_sub_device *asd, enum ia_css_pipe_id pipe_id) { - if (!asd->continuous_mode->val) - return ATOMISP_MAIN_METADATA; - - if (pipe_id == IA_CSS_PIPE_ID_CAPTURE) /* online capture pipe */ - return ATOMISP_SEC_METADATA; - else - return ATOMISP_MAIN_METADATA; + return ATOMISP_MAIN_METADATA; } void atomisp_buf_done(struct atomisp_sub_device *asd, int error, @@ -883,15 +863,6 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, pipe = vb_to_pipe(&frame->vb.vb2_buf); - /* FIXME: - * YUVPP doesn't set postview exp_id correctlly in SDV mode. - * This is a WORKAROUND to set exp_id. see HSDES-1503911606. - */ - if (IS_BYT && buf_type == IA_CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME && - asd->continuous_mode->val && ATOMISP_USE_YUVPP(asd)) - frame->exp_id = (asd->postview_exp_id++) % - (ATOMISP_MAX_EXP_ID + 1); - dev_dbg(isp->dev, "%s: vf frame with exp_id %d is ready\n", __func__, frame->exp_id); if (asd->params.flash_state == ATOMISP_FLASH_ONGOING) { @@ -908,18 +879,6 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, __func__); } pipe->frame_config_id[frame->vb.vb2_buf.index] = frame->isp_config_id; - if (css_pipe_id == IA_CSS_PIPE_ID_CAPTURE && - asd->pending_capture_request > 0) { - err = atomisp_css_offline_capture_configure(asd, - asd->params.offline_parm.num_captures, - asd->params.offline_parm.skip_frames, - asd->params.offline_parm.offset); - - asd->pending_capture_request--; - - dev_dbg(isp->dev, "Trigger capture again for new buffer. err=%d\n", - err); - } break; case IA_CSS_BUFFER_TYPE_OUTPUT_FRAME: case IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME: @@ -934,15 +893,6 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, pipe = vb_to_pipe(&frame->vb.vb2_buf); - /* FIXME: - * YUVPP doesn't set preview exp_id correctlly in ZSL mode. - * This is a WORKAROUND to set exp_id. see HSDES-1503911606. - */ - if (IS_BYT && buf_type == IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME && - asd->continuous_mode->val && ATOMISP_USE_YUVPP(asd)) - frame->exp_id = (asd->preview_exp_id++) % - (ATOMISP_MAX_EXP_ID + 1); - dev_dbg(isp->dev, "%s: main frame with exp_id %d is ready\n", __func__, frame->exp_id); @@ -993,35 +943,6 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, asd->params.last_frame_status = asd->frame_status[i]; - if (asd->continuous_mode->val) { - if (css_pipe_id == IA_CSS_PIPE_ID_PREVIEW || - css_pipe_id == IA_CSS_PIPE_ID_VIDEO) { - asd->latest_preview_exp_id = frame->exp_id; - } else if (css_pipe_id == - IA_CSS_PIPE_ID_CAPTURE) { - if (asd->run_mode->val == - ATOMISP_RUN_MODE_VIDEO) - dev_dbg(isp->dev, "SDV capture raw buffer id: %u\n", - frame->exp_id); - else - dev_dbg(isp->dev, "ZSL capture raw buffer id: %u\n", - frame->exp_id); - } - } - /* - * Only after enabled the raw buffer lock - * and in continuous mode. - * in preview/video pipe, each buffer will - * be locked automatically, so record it here. - */ - if (((css_pipe_id == IA_CSS_PIPE_ID_PREVIEW) || - (css_pipe_id == IA_CSS_PIPE_ID_VIDEO)) && - asd->enable_raw_buffer_lock->val && - asd->continuous_mode->val) { - atomisp_set_raw_buffer_bitmap(asd, frame->exp_id); - WARN_ON(frame->exp_id > ATOMISP_MAX_EXP_ID); - } - if (asd->params.css_update_params_needed) { atomisp_apply_css_parameters(asd, &asd->params.css_param); @@ -1220,13 +1141,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) if (!stream_restart[i]) continue; - if (asd->continuous_mode->val && - asd->delayed_init == ATOMISP_DELAYED_INIT_NOT_QUEUED) { - reinit_completion(&asd->init_done); - asd->delayed_init = ATOMISP_DELAYED_INIT_QUEUED; - queue_work(asd->delayed_init_workq, - &asd->delayed_init_work); - } /* * dequeueing buffers is not needed. CSS will recycle * buffers that it has. @@ -2027,132 +1941,27 @@ int atomisp_get_dvs2_bq_resolutions(struct atomisp_sub_device *asd, bq_res->envelope_bq.width_bq = 0; bq_res->envelope_bq.height_bq = 0; /* the GDC input resolution */ - if (!asd->continuous_mode->val) { - bq_res->source_bq.width_bq = bq_res->output_bq.width_bq + - pipe_cfg->dvs_envelope.width / 2; - bq_res->source_bq.height_bq = bq_res->output_bq.height_bq + - pipe_cfg->dvs_envelope.height / 2; - /* - * Bad pixels caused by spatial filter processing - * ISP filter resolution should be given by CSS/FW, but for now - * there is not such API to query, and it is fixed value, so - * hardcoded here. - */ - bq_res->ispfilter_bq.width_bq = 12 / 2; - bq_res->ispfilter_bq.height_bq = 12 / 2; - /* spatial filter shift, always 4 pixels */ - bq_res->gdc_shift_bq.width_bq = 4 / 2; - bq_res->gdc_shift_bq.height_bq = 4 / 2; - - if (asd->params.video_dis_en) { - bq_res->envelope_bq.width_bq = pipe_cfg->dvs_envelope.width - / 2 - bq_res->ispfilter_bq.width_bq; - bq_res->envelope_bq.height_bq = pipe_cfg->dvs_envelope.height - / 2 - bq_res->ispfilter_bq.height_bq; - } - } else { - unsigned int w_padding; - unsigned int gdc_effective_input = 0; - - /* For GDC: - * gdc_effective_input = effective_input + envelope - * - * From the comment and formula in BZ1786, - * we see the source_bq should be: - * effective_input / bayer_ds_ratio - */ - bq_res->source_bq.width_bq = - (input_config->effective_res.width * - pipe_cfg->bayer_ds_out_res.width / - input_config->effective_res.width + 1) / 2; - bq_res->source_bq.height_bq = - (input_config->effective_res.height * - pipe_cfg->bayer_ds_out_res.height / - input_config->effective_res.height + 1) / 2; - - if (!asd->params.video_dis_en) { - /* - * We adjust the ispfilter_bq to: - * ispfilter_bq = 128/BDS - * we still need firmware team to provide an offical - * formula for SDV. - */ - bq_res->ispfilter_bq.width_bq = 128 * - pipe_cfg->bayer_ds_out_res.width / - input_config->effective_res.width / 2; - bq_res->ispfilter_bq.height_bq = 128 * - pipe_cfg->bayer_ds_out_res.width / - input_config->effective_res.width / 2; - - if (IS_HWREVISION(asd->isp, ATOMISP_HW_REVISION_ISP2401)) { - /* No additional left padding for ISYS2401 */ - bq_res->gdc_shift_bq.width_bq = 4 / 2; - bq_res->gdc_shift_bq.height_bq = 4 / 2; - } else { - /* - * For the w_padding and gdc_shift_bq cacluation - * Please see the BZ 1786 and 4358 for more info. - * Just test that this formula can work now, - * but we still have no offical formula. - * - * w_padding = ceiling(gdc_effective_input - * /128, 1) * 128 - effective_width - * gdc_shift_bq = w_padding/BDS/2 + ispfilter_bq/2 - */ - gdc_effective_input = - input_config->effective_res.width + - pipe_cfg->dvs_envelope.width; - w_padding = roundup(gdc_effective_input, 128) - - input_config->effective_res.width; - w_padding = w_padding * - pipe_cfg->bayer_ds_out_res.width / - input_config->effective_res.width + 1; - w_padding = roundup(w_padding / 2, 1); - - bq_res->gdc_shift_bq.width_bq = bq_res->ispfilter_bq.width_bq / 2 - + w_padding; - bq_res->gdc_shift_bq.height_bq = 4 / 2; - } - } else { - unsigned int dvs_w, dvs_h, dvs_w_max, dvs_h_max; - - bq_res->ispfilter_bq.width_bq = 8 / 2; - bq_res->ispfilter_bq.height_bq = 8 / 2; - - if (IS_HWREVISION(asd->isp, ATOMISP_HW_REVISION_ISP2401)) { - /* No additional left padding for ISYS2401 */ - bq_res->gdc_shift_bq.width_bq = 4 / 2; - bq_res->gdc_shift_bq.height_bq = 4 / 2; - } else { - w_padding = - roundup(input_config->effective_res.width, 128) - - input_config->effective_res.width; - if (w_padding < 12) - w_padding = 12; - bq_res->gdc_shift_bq.width_bq = 4 / 2 + - ((w_padding - 12) * - pipe_cfg->bayer_ds_out_res.width / - input_config->effective_res.width + 1) / 2; - bq_res->gdc_shift_bq.height_bq = 4 / 2; - } + bq_res->source_bq.width_bq = bq_res->output_bq.width_bq + + pipe_cfg->dvs_envelope.width / 2; + bq_res->source_bq.height_bq = bq_res->output_bq.height_bq + + pipe_cfg->dvs_envelope.height / 2; + /* + * Bad pixels caused by spatial filter processing + * ISP filter resolution should be given by CSS/FW, but for now + * there is not such API to query, and it is fixed value, so + * hardcoded here. + */ + bq_res->ispfilter_bq.width_bq = 12 / 2; + bq_res->ispfilter_bq.height_bq = 12 / 2; + /* spatial filter shift, always 4 pixels */ + bq_res->gdc_shift_bq.width_bq = 4 / 2; + bq_res->gdc_shift_bq.height_bq = 4 / 2; - dvs_w = pipe_cfg->bayer_ds_out_res.width - - pipe_cfg->output_info[0].res.width; - dvs_h = pipe_cfg->bayer_ds_out_res.height - - pipe_cfg->output_info[0].res.height; - dvs_w_max = rounddown( - pipe_cfg->output_info[0].res.width / 5, - ATOM_ISP_STEP_WIDTH); - dvs_h_max = rounddown( - pipe_cfg->output_info[0].res.height / 5, - ATOM_ISP_STEP_HEIGHT); - bq_res->envelope_bq.width_bq = - min((dvs_w / 2), (dvs_w_max / 2)) - - bq_res->ispfilter_bq.width_bq; - bq_res->envelope_bq.height_bq = - min((dvs_h / 2), (dvs_h_max / 2)) - - bq_res->ispfilter_bq.height_bq; - } + if (asd->params.video_dis_en) { + bq_res->envelope_bq.width_bq = pipe_cfg->dvs_envelope.width / 2 - + bq_res->ispfilter_bq.width_bq; + bq_res->envelope_bq.height_bq = pipe_cfg->dvs_envelope.height / 2 - + bq_res->ispfilter_bq.height_bq; } dev_dbg(asd->isp->dev, @@ -3729,28 +3538,8 @@ int atomisp_param(struct atomisp_sub_device *asd, int flag, } /* update dvs envelop info */ - if (!asd->continuous_mode->val) { - config->dvs_envelop.width = vp_cfg->dvs_envelope.width; - config->dvs_envelop.height = - vp_cfg->dvs_envelope.height; - } else { - unsigned int dvs_w, dvs_h, dvs_w_max, dvs_h_max; - - dvs_w = vp_cfg->bayer_ds_out_res.width - - vp_cfg->output_info[0].res.width; - dvs_h = vp_cfg->bayer_ds_out_res.height - - vp_cfg->output_info[0].res.height; - dvs_w_max = rounddown( - vp_cfg->output_info[0].res.width / 5, - ATOM_ISP_STEP_WIDTH); - dvs_h_max = rounddown( - vp_cfg->output_info[0].res.height / 5, - ATOM_ISP_STEP_HEIGHT); - - config->dvs_envelop.width = min(dvs_w, dvs_w_max); - config->dvs_envelop.height = min(dvs_h, dvs_h_max); - } - + config->dvs_envelop.width = vp_cfg->dvs_envelope.width; + config->dvs_envelop.height = vp_cfg->dvs_envelope.height; return 0; } @@ -4417,43 +4206,6 @@ static inline int atomisp_set_sensor_mipi_to_isp( return 0; } -static int __enable_continuous_mode(struct atomisp_sub_device *asd, - bool enable) -{ - struct atomisp_device *isp = asd->isp; - - dev_dbg(isp->dev, - "continuous mode %d, raw buffers %d, stop preview %d\n", - enable, asd->continuous_raw_buffer_size->val, - !asd->continuous_viewfinder->val); - - if (!IS_ISP2401) - atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_PRIMARY); - else - atomisp_update_capture_mode(asd); - - /* in case of ANR, force capture pipe to offline mode */ - atomisp_css_capture_enable_online(asd, ATOMISP_INPUT_STREAM_GENERAL, - asd->params.low_light ? false : !enable); - atomisp_css_preview_enable_online(asd, ATOMISP_INPUT_STREAM_GENERAL, - !enable); - atomisp_css_enable_continuous(asd, enable); - atomisp_css_enable_cvf(asd, asd->continuous_viewfinder->val); - - atomisp_css_continuous_set_num_raw_frames(asd, - asd->continuous_raw_buffer_size->val); - - if (!enable) { - atomisp_css_enable_raw_binning(asd, false); - atomisp_css_input_set_two_pixels_per_clock(asd, false); - } - - if (isp->inputs[asd->input_curr].type != FILE_INPUT) - atomisp_css_input_set_mode(asd, IA_CSS_INPUT_MODE_BUFFERED_SENSOR); - - return atomisp_update_run_mode(asd); -} - static int configure_pp_input_nop(struct atomisp_sub_device *asd, unsigned int width, unsigned int height) { @@ -4495,17 +4247,6 @@ static int css_input_resolution_changed(struct atomisp_sub_device *asd, else atomisp_css_input_set_two_pixels_per_clock(asd, true); - if (asd->continuous_mode->val) { - /* Note for all checks: ffmt includes pad_w+pad_h */ - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO || - (ffmt->width >= 2048 || ffmt->height >= 1536)) { - /* - * For preview pipe, enable only if resolution - * is >= 3M for ISP2400. - */ - atomisp_css_enable_raw_binning(asd, true); - } - } /* * If sensor input changed, which means metadata resolution changed * together. Release all metadata buffers here to let it re-allocated @@ -4648,12 +4389,6 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, } } - if (asd->continuous_mode->val) { - ret = __enable_continuous_mode(asd, true); - if (ret) - return -EINVAL; - } - atomisp_css_input_set_mode(asd, IA_CSS_INPUT_MODE_BUFFERED_SENSOR); for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) @@ -4669,36 +4404,9 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, get_frame_info = atomisp_css_video_get_output_frame_info; pipe_id = IA_CSS_PIPE_ID_VIDEO; } else if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { - if (!asd->continuous_mode->val) { - configure_output = atomisp_css_video_configure_output; - get_frame_info = - atomisp_css_video_get_output_frame_info; - pipe_id = IA_CSS_PIPE_ID_VIDEO; - } else { - if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW || - source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO) { - configure_output = - atomisp_css_video_configure_output; - get_frame_info = - atomisp_css_video_get_output_frame_info; - configure_pp_input = - atomisp_css_video_configure_pp_input; - pipe_id = IA_CSS_PIPE_ID_VIDEO; - } else { - configure_output = - atomisp_css_capture_configure_output; - get_frame_info = - atomisp_css_capture_get_output_frame_info; - configure_pp_input = - atomisp_css_capture_configure_pp_input; - pipe_id = IA_CSS_PIPE_ID_CAPTURE; - - atomisp_update_capture_mode(asd); - atomisp_css_capture_enable_online(asd, - ATOMISP_INPUT_STREAM_GENERAL, - false); - } - } + configure_output = atomisp_css_video_configure_output; + get_frame_info = atomisp_css_video_get_output_frame_info; + pipe_id = IA_CSS_PIPE_ID_VIDEO; } else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW) { configure_output = atomisp_css_preview_configure_output; get_frame_info = atomisp_css_preview_get_output_frame_info; @@ -4719,26 +4427,23 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, atomisp_update_capture_mode(asd); } - if (!asd->continuous_mode->val) - /* in case of ANR, force capture pipe to offline mode */ - atomisp_css_capture_enable_online(asd, ATOMISP_INPUT_STREAM_GENERAL, - asd->params.low_light ? - false : asd->params.online_process); + /* in case of ANR, force capture pipe to offline mode */ + atomisp_css_capture_enable_online(asd, ATOMISP_INPUT_STREAM_GENERAL, + asd->params.low_light ? + false : asd->params.online_process); configure_output = atomisp_css_capture_configure_output; get_frame_info = atomisp_css_capture_get_output_frame_info; configure_pp_input = atomisp_css_capture_configure_pp_input; pipe_id = IA_CSS_PIPE_ID_CAPTURE; - if (!asd->params.online_process && - !asd->continuous_mode->val) { + if (!asd->params.online_process) { ret = atomisp_css_capture_get_output_raw_frame_info(asd, raw_output_info); if (ret) return ret; } - if (!asd->continuous_mode->val && asd->run_mode->val - != ATOMISP_RUN_MODE_STILL_CAPTURE) { + if (asd->run_mode->val != ATOMISP_RUN_MODE_STILL_CAPTURE) { dev_err(isp->dev, "Need to set the running mode first\n"); asd->run_mode->val = ATOMISP_RUN_MODE_STILL_CAPTURE; @@ -4793,7 +4498,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, ia_css_frame_free(asd->raw_output_frame); asd->raw_output_frame = NULL; - if (!asd->continuous_mode->val && !asd->params.online_process && + if (!asd->params.online_process && ia_css_frame_allocate_from_info(&asd->raw_output_frame, raw_output_info)) return -ENOMEM; @@ -5144,7 +4849,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) } /* construct resolution supported by isp */ - if (res_overflow && !asd->continuous_mode->val) { + if (res_overflow) { f->fmt.pix.width = rounddown( clamp_t(u32, f->fmt.pix.width - padding_w, ATOM_ISP_MIN_WIDTH, @@ -5158,63 +4863,35 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) atomisp_get_dis_envelop(asd, f->fmt.pix.width, f->fmt.pix.height, &dvs_env_w, &dvs_env_h); - if (asd->continuous_mode->val) { - struct v4l2_rect *r; + asd->capture_pad = source_pad; - r = atomisp_subdev_get_rect( - &asd->subdev, NULL, - V4L2_SUBDEV_FORMAT_ACTIVE, - ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE, - V4L2_SEL_TGT_COMPOSE); - /* - * The ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE should get resolutions - * properly set otherwise, it should not be the capture_pad. - */ - if (r->width && r->height) - asd->capture_pad = ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE; - else - asd->capture_pad = source_pad; - } else { - asd->capture_pad = source_pad; - } /* - * set format info to sensor - * In continuous mode, resolution is set only if it is higher than - * existing value. This because preview pipe will be configured after - * capture pipe and usually has lower resolution than capture pipe. + * For jpeg or custom raw format the sensor will return constant + * width and height. Because we already had quried try_mbus_fmt, + * f->fmt.pix.width and f->fmt.pix.height has been changed to + * this fixed width and height. So we cannot select the correct + * resolution with that information. So use the original width + * and height while set_mbus_fmt() so actual resolutions are + * being used in while set media bus format. */ - if (!asd->continuous_mode->val || - isp_sink_fmt->width < (f->fmt.pix.width + padding_w + dvs_env_w) || - isp_sink_fmt->height < (f->fmt.pix.height + padding_h + - dvs_env_h)) { - /* - * For jpeg or custom raw format the sensor will return constant - * width and height. Because we already had quried try_mbus_fmt, - * f->fmt.pix.width and f->fmt.pix.height has been changed to - * this fixed width and height. So we cannot select the correct - * resolution with that information. So use the original width - * and height while set_mbus_fmt() so actual resolutions are - * being used in while set media bus format. - */ - s_fmt = f->fmt.pix; - if (f->fmt.pix.pixelformat == V4L2_PIX_FMT_JPEG || - f->fmt.pix.pixelformat == V4L2_PIX_FMT_CUSTOM_M10MO_RAW) { - s_fmt.width = backup_fmt.width; - s_fmt.height = backup_fmt.height; - } - ret = atomisp_set_fmt_to_snr(vdev, &s_fmt, - f->fmt.pix.pixelformat, padding_w, - padding_h, dvs_env_w, dvs_env_h); - if (ret) { - dev_warn(isp->dev, - "Set format to sensor failed with %d\n", ret); - return -EINVAL; - } - - atomisp_csi_lane_config(isp); - crop_needs_override = true; + s_fmt = f->fmt.pix; + if (f->fmt.pix.pixelformat == V4L2_PIX_FMT_JPEG || + f->fmt.pix.pixelformat == V4L2_PIX_FMT_CUSTOM_M10MO_RAW) { + s_fmt.width = backup_fmt.width; + s_fmt.height = backup_fmt.height; + } + ret = atomisp_set_fmt_to_snr(vdev, &s_fmt, + f->fmt.pix.pixelformat, padding_w, + padding_h, dvs_env_w, dvs_env_h); + if (ret) { + dev_warn(isp->dev, + "Set format to sensor failed with %d\n", ret); + return -EINVAL; } + atomisp_csi_lane_config(isp); + crop_needs_override = true; + atomisp_check_copy_mode(asd, source_pad, &backup_fmt); asd->yuvpp_mode = false; /* Reset variable */ @@ -5228,27 +4905,10 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) if (isp_sink_crop.width * 9 / 10 < f->fmt.pix.width || isp_sink_crop.height * 9 / 10 < f->fmt.pix.height || (atomisp_subdev_format_conversion(asd, source_pad) && - ((asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO && - !asd->continuous_mode->val) || + (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO || asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER))) { - /* for continuous mode, preview size might be smaller than - * still capture size. if preview size still needs crop, - * pick the larger one between crop size of preview and - * still capture. - */ - if (asd->continuous_mode->val - && source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW - && !crop_needs_override) { - isp_sink_crop.width = - max_t(unsigned int, f->fmt.pix.width, - isp_sink_crop.width); - isp_sink_crop.height = - max_t(unsigned int, f->fmt.pix.height, - isp_sink_crop.height); - } else { - isp_sink_crop.width = f->fmt.pix.width; - isp_sink_crop.height = f->fmt.pix.height; - } + isp_sink_crop.width = f->fmt.pix.width; + isp_sink_crop.height = f->fmt.pix.height; atomisp_subdev_set_selection(&asd->subdev, fh.state, V4L2_SUBDEV_FORMAT_ACTIVE, @@ -5448,71 +5108,6 @@ int atomisp_set_shading_table(struct atomisp_sub_device *asd, return ret; } -int atomisp_offline_capture_configure(struct atomisp_sub_device *asd, - struct atomisp_cont_capture_conf *cvf_config) -{ - struct v4l2_ctrl *c; - - lockdep_assert_held(&asd->isp->mutex); - - /* - * In case of M10MO ZSL capture case, we need to issue a separate - * capture request to M10MO which will output captured jpeg image - */ - c = v4l2_ctrl_find( - asd->isp->inputs[asd->input_curr].camera->ctrl_handler, - V4L2_CID_START_ZSL_CAPTURE); - if (c) { - int ret; - - dev_dbg(asd->isp->dev, "%s trigger ZSL capture request\n", - __func__); - /* TODO: use the cvf_config */ - ret = v4l2_ctrl_s_ctrl(c, 1); - if (ret) - return ret; - - return v4l2_ctrl_s_ctrl(c, 0); - } - - asd->params.offline_parm = *cvf_config; - - if (asd->params.offline_parm.num_captures) { - if (asd->streaming == ATOMISP_DEVICE_STREAMING_DISABLED) { - unsigned int init_raw_num; - - if (asd->enable_raw_buffer_lock->val) { - init_raw_num = - ATOMISP_CSS2_NUM_OFFLINE_INIT_CONTINUOUS_FRAMES_LOCK_EN; - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO && - asd->params.video_dis_en) - init_raw_num += - ATOMISP_CSS2_NUM_DVS_FRAME_DELAY; - } else { - init_raw_num = - ATOMISP_CSS2_NUM_OFFLINE_INIT_CONTINUOUS_FRAMES; - } - - /* TODO: this can be removed once user-space - * has been updated to use control API */ - asd->continuous_raw_buffer_size->val = - max_t(int, - asd->continuous_raw_buffer_size->val, - asd->params.offline_parm. - num_captures + init_raw_num); - asd->continuous_raw_buffer_size->val = - min_t(int, ATOMISP_CONT_RAW_FRAMES, - asd->continuous_raw_buffer_size->val); - } - asd->continuous_mode->val = true; - } else { - asd->continuous_mode->val = false; - __enable_continuous_mode(asd, false); - } - - return 0; -} - /* * set auto exposure metering window to camera sensor */ @@ -5609,53 +5204,6 @@ void atomisp_init_raw_buffer_bitmap(struct atomisp_sub_device *asd) spin_unlock_irqrestore(&asd->raw_buffer_bitmap_lock, flags); } -static int atomisp_set_raw_buffer_bitmap(struct atomisp_sub_device *asd, int exp_id) -{ - int *bitmap, bit; - unsigned long flags; - - if (__checking_exp_id(asd, exp_id)) - return -EINVAL; - - bitmap = asd->raw_buffer_bitmap + exp_id / 32; - bit = exp_id % 32; - spin_lock_irqsave(&asd->raw_buffer_bitmap_lock, flags); - (*bitmap) |= (1 << bit); - asd->raw_buffer_locked_count++; - spin_unlock_irqrestore(&asd->raw_buffer_bitmap_lock, flags); - - dev_dbg(asd->isp->dev, "%s: exp_id %d, raw_buffer_locked_count %d\n", - __func__, exp_id, asd->raw_buffer_locked_count); - - /* Check if the raw buffer after next is still locked!!! */ - exp_id += 2; - if (exp_id > ATOMISP_MAX_EXP_ID) - exp_id -= ATOMISP_MAX_EXP_ID; - bitmap = asd->raw_buffer_bitmap + exp_id / 32; - bit = exp_id % 32; - if ((*bitmap) & (1 << bit)) { - int ret; - - /* WORKAROUND unlock the raw buffer compulsively */ - ret = atomisp_css_exp_id_unlock(asd, exp_id); - if (ret) { - dev_err(asd->isp->dev, - "%s exp_id is wrapping back to %d but force unlock failed, err %d.\n", - __func__, exp_id, ret); - return ret; - } - - spin_lock_irqsave(&asd->raw_buffer_bitmap_lock, flags); - (*bitmap) &= ~(1 << bit); - asd->raw_buffer_locked_count--; - spin_unlock_irqrestore(&asd->raw_buffer_bitmap_lock, flags); - dev_warn(asd->isp->dev, - "%s exp_id is wrapping back to %d but it is still locked so force unlock it, raw_buffer_locked_count %d\n", - __func__, exp_id, asd->raw_buffer_locked_count); - } - return 0; -} - static int __is_raw_buffer_locked(struct atomisp_sub_device *asd, int exp_id) { int *bitmap, bit; diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp_cmd.h index 733b9f8cd06f..bea950a128a9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.h @@ -268,9 +268,6 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f); int atomisp_set_shading_table(struct atomisp_sub_device *asd, struct atomisp_shading_table *shading_table); -int atomisp_offline_capture_configure(struct atomisp_sub_device *asd, - struct atomisp_cont_capture_conf *cvf_config); - void atomisp_free_internal_buffers(struct atomisp_sub_device *asd); int atomisp_s_ae_window(struct atomisp_sub_device *asd, diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 30bc49402d10..accae44ad72b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -651,13 +651,10 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd, return false; case ATOMISP_RUN_MODE_PREVIEW: - if (!asd->continuous_mode->val) { - if (pipe_id == IA_CSS_PIPE_ID_PREVIEW) - return true; + if (pipe_id == IA_CSS_PIPE_ID_PREVIEW) + return true; - return false; - } - fallthrough; + return false; case ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE: if (pipe_id == IA_CSS_PIPE_ID_CAPTURE || pipe_id == IA_CSS_PIPE_ID_PREVIEW) @@ -665,14 +662,10 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd, return false; case ATOMISP_RUN_MODE_VIDEO: - if (!asd->continuous_mode->val) { - if (pipe_id == IA_CSS_PIPE_ID_VIDEO || - pipe_id == IA_CSS_PIPE_ID_YUVPP) - return true; - else - return false; - } - fallthrough; + if (pipe_id == IA_CSS_PIPE_ID_VIDEO || pipe_id == IA_CSS_PIPE_ID_YUVPP) + return true; + + return false; case ATOMISP_RUN_MODE_SDV: if (pipe_id == IA_CSS_PIPE_ID_CAPTURE || pipe_id == IA_CSS_PIPE_ID_VIDEO) @@ -2129,17 +2122,8 @@ static void __configure_video_preview_output(struct atomisp_sub_device *asd, __pipe_id_to_pipe_mode(asd, pipe_id); stream_env->update_pipe[pipe_id] = true; - /* - * second_output will be as video main output in SDV mode - * with SOC camera. output will be as video main output in - * normal video mode. - */ - if (asd->continuous_mode->val) - css_output_info = &stream_env->pipe_configs[pipe_id]. - output_info[ATOMISP_CSS_OUTPUT_SECOND_INDEX]; - else - css_output_info = &stream_env->pipe_configs[pipe_id]. - output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; + css_output_info = + &stream_env->pipe_configs[pipe_id].output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; css_output_info->res.width = width; css_output_info->res.height = height; @@ -2475,17 +2459,8 @@ static void __configure_video_vf_output(struct atomisp_sub_device *asd, __pipe_id_to_pipe_mode(asd, pipe_id); stream_env->update_pipe[pipe_id] = true; - /* - * second_vf_output will be as video viewfinder in SDV mode - * with SOC camera. vf_output will be as video viewfinder in - * normal video mode. - */ - if (asd->continuous_mode->val) - css_output_info = &stream_env->pipe_configs[pipe_id]. - vf_output_info[ATOMISP_CSS_OUTPUT_SECOND_INDEX]; - else - css_output_info = &stream_env->pipe_configs[pipe_id]. - vf_output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; + css_output_info = + &stream_env->pipe_configs[pipe_id].vf_output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; css_output_info->res.width = width; css_output_info->res.height = height; @@ -2626,12 +2601,7 @@ int atomisp_get_css_frame_info(struct atomisp_sub_device *asd, *frame_info = info.output_info[0]; break; case ATOMISP_SUBDEV_PAD_SOURCE_VIDEO: - if (ATOMISP_USE_YUVPP(asd) && asd->continuous_mode->val) - *frame_info = info. - output_info[ATOMISP_CSS_OUTPUT_SECOND_INDEX]; - else - *frame_info = info. - output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; + *frame_info = info.output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; break; case ATOMISP_SUBDEV_PAD_SOURCE_VF: if (stream_index == ATOMISP_INPUT_STREAM_POSTVIEW) @@ -2643,15 +2613,7 @@ int atomisp_get_css_frame_info(struct atomisp_sub_device *asd, if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO && (pipe_index == IA_CSS_PIPE_ID_VIDEO || pipe_index == IA_CSS_PIPE_ID_YUVPP)) - if (ATOMISP_USE_YUVPP(asd) && asd->continuous_mode->val) - *frame_info = info. - vf_output_info[ATOMISP_CSS_OUTPUT_SECOND_INDEX]; - else - *frame_info = info. - vf_output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; - else if (ATOMISP_USE_YUVPP(asd) && asd->continuous_mode->val) - *frame_info = - info.output_info[ATOMISP_CSS_OUTPUT_SECOND_INDEX]; + *frame_info = info.vf_output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; else *frame_info = info.output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; @@ -2816,8 +2778,6 @@ int atomisp_css_video_get_viewfinder_frame_info( if (ATOMISP_USE_YUVPP(asd)) { pipe_id = IA_CSS_PIPE_ID_YUVPP; - if (asd->continuous_mode->val) - frame_type = ATOMISP_CSS_SECOND_VF_FRAME; } else { pipe_id = IA_CSS_PIPE_ID_VIDEO; } @@ -2870,8 +2830,6 @@ int atomisp_css_preview_get_output_frame_info( if (ATOMISP_USE_YUVPP(asd)) { pipe_id = IA_CSS_PIPE_ID_YUVPP; - if (asd->continuous_mode->val) - frame_type = ATOMISP_CSS_SECOND_OUTPUT_FRAME; } else { pipe_id = IA_CSS_PIPE_ID_PREVIEW; } @@ -2904,8 +2862,6 @@ int atomisp_css_video_get_output_frame_info( if (ATOMISP_USE_YUVPP(asd)) { pipe_id = IA_CSS_PIPE_ID_YUVPP; - if (asd->continuous_mode->val) - frame_type = ATOMISP_CSS_SECOND_OUTPUT_FRAME; } else { pipe_id = IA_CSS_PIPE_ID_VIDEO; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index ce01479bdd68..280e8057676b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -348,31 +348,6 @@ static int atomisp_get_css_buf_type(struct atomisp_sub_device *asd, uint16_t source_pad) { if (ATOMISP_USE_YUVPP(asd)) { - /* when run ZSL case */ - if (asd->continuous_mode->val && - asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) { - if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE) - return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME; - else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW) - return IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME; - else - return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME; - } - - /*when run SDV case*/ - if (asd->continuous_mode->val && - asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { - if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE) - return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME; - else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW) - return IA_CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME; - else if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO) - return IA_CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME; - else - return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME; - } - - /*other case: default setting*/ if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE || source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO || (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW && @@ -414,22 +389,10 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) preview_pipe = &asd->video_out_capture; css_preview_pipe_id = IA_CSS_PIPE_ID_CAPTURE; } else if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { - if (asd->continuous_mode->val) { - capture_pipe = &asd->video_out_capture; - vf_pipe = &asd->video_out_vf; - css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE; - } video_pipe = &asd->video_out_video_capture; preview_pipe = &asd->video_out_preview; css_video_pipe_id = IA_CSS_PIPE_ID_VIDEO; css_preview_pipe_id = IA_CSS_PIPE_ID_VIDEO; - } else if (asd->continuous_mode->val) { - capture_pipe = &asd->video_out_capture; - vf_pipe = &asd->video_out_vf; - preview_pipe = &asd->video_out_preview; - - css_preview_pipe_id = IA_CSS_PIPE_ID_PREVIEW; - css_capture_pipe_id = IA_CSS_PIPE_ID_CAPTURE; } else if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) { preview_pipe = &asd->video_out_preview; css_preview_pipe_id = IA_CSS_PIPE_ID_PREVIEW; @@ -545,7 +508,6 @@ static void atomisp_buf_queue(struct vb2_buffer *vb) struct atomisp_video_pipe *pipe = vb_to_pipe(vb); struct ia_css_frame *frame = vb_to_frame(vb); struct atomisp_sub_device *asd = pipe->asd; - u16 source_pad = atomisp_subdev_source_pad(&pipe->vdev); unsigned long irqflags; int ret; @@ -593,21 +555,6 @@ static void atomisp_buf_queue(struct vb2_buffer *vb) atomisp_qbuffers_to_css(asd); } - /* - * Workaround: Due to the design of HALv3, - * sometimes in ZSL or SDV mode HAL needs to - * capture multiple images within one streaming cycle. - * But the capture number cannot be determined by HAL. - * So HAL only sets the capture number to be 1 and queue multiple - * buffers. Atomisp driver needs to check this case and re-trigger - * CSS to do capture when new buffer is queued. - */ - if (asd->continuous_mode->val && source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE && - !asd->enable_raw_buffer_lock->val && asd->params.offline_parm.num_captures == 1) { - asd->pending_capture_request++; - dev_dbg(asd->isp->dev, "Add one pending capture request.\n"); - } - out_unlock: mutex_unlock(&asd->isp->mutex); } @@ -667,9 +614,6 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) /* s3a grid not enabled for any pipe */ asd->params.s3a_enabled_pipe = IA_CSS_PIPE_ID_NUM; - asd->params.offline_parm.num_captures = 1; - asd->params.offline_parm.skip_frames = 0; - asd->params.offline_parm.offset = 0; asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; /* Add for channel */ asd->input_curr = 0; diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index d3b773bac5aa..cb6324510aca 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1123,13 +1123,6 @@ enum ia_css_pipe_id atomisp_get_css_pipe_id(struct atomisp_sub_device *asd) if (ATOMISP_USE_YUVPP(asd)) return IA_CSS_PIPE_ID_YUVPP; - if (asd->continuous_mode->val) { - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) - return IA_CSS_PIPE_ID_VIDEO; - else - return IA_CSS_PIPE_ID_PREVIEW; - } - /* * Disable vf_pp and run CSS in video mode. This allows using ISP * scaling but it has one frame delay due to CSS internal buffering. @@ -1164,10 +1157,7 @@ static unsigned int atomisp_sensor_start_stream(struct atomisp_sub_device *asd) if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO || (asd->run_mode->val == ATOMISP_RUN_MODE_STILL_CAPTURE && - !atomisp_is_mbuscode_raw( - asd->fmt[ - asd->capture_pad].fmt.code) && - !asd->continuous_mode->val)) + !atomisp_is_mbuscode_raw(asd->fmt[asd->capture_pad].fmt.code))) return 2; else return 1; @@ -1221,57 +1211,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) */ sensor_start_stream = atomisp_sensor_start_stream(asd); - /* Reset pending capture request count. */ - asd->pending_capture_request = 0; - if (atomisp_subdev_streaming_count(asd) > sensor_start_stream) { - /* trigger still capture */ - if (asd->continuous_mode->val && - atomisp_subdev_source_pad(vdev) - == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE) { - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) - dev_dbg(isp->dev, "SDV last video raw buffer id: %u\n", - asd->latest_preview_exp_id); - else - dev_dbg(isp->dev, "ZSL last preview raw buffer id: %u\n", - asd->latest_preview_exp_id); - - if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) { - flush_work(&asd->delayed_init_work); - mutex_unlock(&isp->mutex); - ret = wait_for_completion_interruptible(&asd->init_done); - mutex_lock(&isp->mutex); - if (ret) { - ret = -ERESTARTSYS; - goto out_unlock; - } - } - - /* handle per_frame_setting parameter and buffers */ - atomisp_handle_parameter_and_buffer(pipe); - - /* - * only ZSL/SDV capture request will be here, raise - * the ISP freq to the highest possible to minimize - * the S2S latency. - */ - atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_MAX, false); - /* - * When asd->enable_raw_buffer_lock->val is true, - * An extra IOCTL is needed to call - * atomisp_css_exp_id_capture and trigger real capture - */ - if (!asd->enable_raw_buffer_lock->val) { - ret = atomisp_css_offline_capture_configure(asd, - asd->params.offline_parm.num_captures, - asd->params.offline_parm.skip_frames, - asd->params.offline_parm.offset); - if (ret) { - ret = -EINVAL; - goto out_unlock; - } - } - } atomisp_qbuffers_to_css(asd); ret = 0; goto out_unlock; @@ -1369,17 +1309,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) goto out_unlock; } - if (asd->continuous_mode->val) { - atomisp_subdev_get_ffmt(&asd->subdev, NULL, - V4L2_SUBDEV_FORMAT_ACTIVE, - ATOMISP_SUBDEV_PAD_SINK); - - reinit_completion(&asd->init_done); - asd->delayed_init = ATOMISP_DELAYED_INIT_QUEUED; - queue_work(asd->delayed_init_workq, &asd->delayed_init_work); - } else { - asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; - } + asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; out_unlock: mutex_unlock(&isp->mutex); @@ -1420,24 +1350,6 @@ void atomisp_stop_streaming(struct vb2_queue *vq) if (ret == 0) dev_warn(isp->dev, "Warning timeout waiting for CSS to return buffers\n"); - /* - * do only videobuf_streamoff for capture & vf pipes in - * case of continuous capture - */ - if (asd->continuous_mode->val && - atomisp_subdev_source_pad(vdev) != ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW && - atomisp_subdev_source_pad(vdev) != ATOMISP_SUBDEV_PAD_SOURCE_VIDEO) { - if (atomisp_subdev_source_pad(vdev) == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE) { - /* stop continuous still capture if needed */ - if (asd->params.offline_parm.num_captures == -1) - atomisp_css_offline_capture_configure(asd, - 0, 0, 0); - atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_AUTO, false); - } - - goto out_unlock; - } - if (asd->streaming == ATOMISP_DEVICE_STREAMING_ENABLED) first_streamoff = true; @@ -2245,9 +2157,6 @@ static long atomisp_vidioc_default(struct file *file, void *fh, err = atomisp_set_parameters(vdev, arg); break; - case ATOMISP_IOC_S_CONT_CAPTURE_CONFIG: - err = atomisp_offline_capture_configure(asd, arg); - break; case ATOMISP_IOC_G_METADATA: err = atomisp_get_metadata(asd, 0, arg); break; diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 4cbe900d3ca1..821f3204b759 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -427,8 +427,7 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd, isp_sd->params.video_dis_en = 0; if (isp_sd->params.video_dis_en && - isp_sd->run_mode->val == ATOMISP_RUN_MODE_VIDEO && - !isp_sd->continuous_mode->val) { + isp_sd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { /* This resolution contains 20 % of DVS slack * (of the desired captured image before * scaling, or 1 / 6 of what we get from the @@ -459,8 +458,7 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd, break; if (isp_sd->params.video_dis_en && - isp_sd->run_mode->val == ATOMISP_RUN_MODE_VIDEO && - !isp_sd->continuous_mode->val) { + isp_sd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { dvs_w = rounddown(crop[pad]->width / 5, ATOM_ISP_STEP_WIDTH); dvs_h = rounddown(crop[pad]->height / 5, @@ -727,11 +725,7 @@ static int __atomisp_update_run_mode(struct atomisp_sub_device *asd) struct v4l2_ctrl *c; s32 mode; - if (ctrl->val != ATOMISP_RUN_MODE_VIDEO && - asd->continuous_mode->val) - mode = ATOMISP_RUN_MODE_PREVIEW; - else - mode = ctrl->val; + mode = ctrl->val; c = v4l2_ctrl_find( isp->inputs[asd->input_curr].camera->ctrl_handler, @@ -816,24 +810,6 @@ static const struct v4l2_ctrl_config ctrl_vfpp = { .qmenu = ctrl_vfpp_mode_menu, }; -/* - * Control for ISP continuous mode - * - * When enabled, capture processing is possible without - * stopping the preview pipeline. When disabled, ISP needs - * to be restarted between preview and capture. - */ -static const struct v4l2_ctrl_config ctrl_continuous_mode = { - .ops = &ctrl_ops, - .id = V4L2_CID_ATOMISP_CONTINUOUS_MODE, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Continuous mode", - .min = 0, - .max = 1, - .step = 1, - .def = 0, -}; - /* * Control for continuous mode raw buffer size * @@ -1040,8 +1016,6 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd) &ctrl_run_mode, NULL); asd->vfpp = v4l2_ctrl_new_custom(&asd->ctrl_handler, &ctrl_vfpp, NULL); - asd->continuous_mode = v4l2_ctrl_new_custom(&asd->ctrl_handler, - &ctrl_continuous_mode, NULL); asd->continuous_viewfinder = v4l2_ctrl_new_custom(&asd->ctrl_handler, &ctrl_continuous_viewfinder, NULL); diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h index 5cf8f3d9c916..141b93a6c0be 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h @@ -237,8 +237,6 @@ struct atomisp_subdev_params { enum atomisp_flash_state flash_state; enum atomisp_frame_status last_frame_status; - /* continuous capture */ - struct atomisp_cont_capture_conf offline_parm; /* Flag to check if driver needs to update params to css */ bool css_update_params_needed; }; @@ -267,7 +265,6 @@ struct atomisp_sub_device { struct v4l2_ctrl *fmt_auto; struct v4l2_ctrl *run_mode; struct v4l2_ctrl *vfpp; - struct v4l2_ctrl *continuous_mode; struct v4l2_ctrl *continuous_raw_buffer_size; struct v4l2_ctrl *continuous_viewfinder; struct v4l2_ctrl *enable_raw_buffer_lock; @@ -351,7 +348,6 @@ struct atomisp_sub_device { struct atomisp_resolution sensor_array_res; bool high_speed_mode; /* Indicate whether now is a high speed mode */ - int pending_capture_request; /* Indicates the number of pending capture requests. */ unsigned int preview_exp_id; unsigned int postview_exp_id; From patchwork Tue Feb 21 14:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 89999 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU88-006Hq7-2F; Tue, 21 Feb 2023 15:00:32 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234572AbjBUPAa (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234532AbjBUPA1 (ORCPT ); Tue, 21 Feb 2023 10:00:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE9E9EEF for ; Tue, 21 Feb 2023 06:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eXWh2URWSGercEdDDjtwVJhq6pSscqutL7bNofFyaOk=; b=W44ZxkwllG5Lowm+Fugu6+85hcV1atuzIgFk9M49sXDjqoq07G3hySz4Zm5FE7ASWBWxXp an7I2ua+ZM5nORSppN+IWMVjKkxNSZVDrVaesCEkxwWmceQHbUxJwvPE1UKVlvo9dzRrYq JwY4OO79JX6FCFgLV5CowW5m3RuxBb0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-vY3xSvMWMeuFu2oWrVbWOQ-1; Tue, 21 Feb 2023 09:59:28 -0500 X-MC-Unique: vY3xSvMWMeuFu2oWrVbWOQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1123118E0920; Tue, 21 Feb 2023 14:59:28 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01E4A2026D4B; Tue, 21 Feb 2023 14:59:24 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 03/10] media: atomisp: Remove delayed_init related code Date: Tue, 21 Feb 2023 15:58:59 +0100 Message-Id: <20230221145906.8113-4-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no After the continues-mode removal the delayed-work never gets queues remove all the related code. Signed-off-by: Hans de Goede --- .../media/atomisp/include/linux/atomisp.h | 1 - .../staging/media/atomisp/pci/atomisp_cmd.c | 35 ------------------- .../staging/media/atomisp/pci/atomisp_cmd.h | 1 - .../staging/media/atomisp/pci/atomisp_fops.c | 1 - .../media/atomisp/pci/atomisp_internal.h | 4 --- .../staging/media/atomisp/pci/atomisp_ioctl.c | 7 ---- .../media/atomisp/pci/atomisp_subdev.c | 1 - .../media/atomisp/pci/atomisp_subdev.h | 6 ---- .../staging/media/atomisp/pci/atomisp_v4l2.c | 25 ------------- 9 files changed, 81 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index 290a6ed7237e..b3cceea570ca 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -1102,7 +1102,6 @@ struct atomisp_sensor_ae_bracketing_lut { #define V4L2_EVENT_ATOMISP_3A_STATS_READY (V4L2_EVENT_PRIVATE_START + 1) #define V4L2_EVENT_ATOMISP_METADATA_READY (V4L2_EVENT_PRIVATE_START + 2) -#define V4L2_EVENT_ATOMISP_RAW_BUFFERS_ALLOC_DONE (V4L2_EVENT_PRIVATE_START + 3) #define V4L2_EVENT_ATOMISP_ACC_COMPLETE (V4L2_EVENT_PRIVATE_START + 4) #define V4L2_EVENT_ATOMISP_PAUSE_BUFFER (V4L2_EVENT_PRIVATE_START + 5) #define V4L2_EVENT_ATOMISP_CSS_RESET (V4L2_EVENT_PRIVATE_START + 6) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index fb8765fdefda..2af0de77c6ae 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -1001,35 +1001,6 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, atomisp_qbuffers_to_css(asd); } -void atomisp_delayed_init_work(struct work_struct *work) -{ - struct atomisp_sub_device *asd = container_of(work, - struct atomisp_sub_device, - delayed_init_work); - /* - * to SOC camera, use yuvpp pipe and no support continuous mode. - */ - if (!ATOMISP_USE_YUVPP(asd)) { - struct v4l2_event event = {0}; - struct ia_css_stream *stream; - - stream = asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream; - - - if (ia_css_alloc_continuous_frame_remain(stream)) - return; - - ia_css_update_continuous_frames(stream); - - event.type = V4L2_EVENT_ATOMISP_RAW_BUFFERS_ALLOC_DONE; - v4l2_event_queue(asd->subdev.devnode, &event); - } - - /* signal streamon after delayed init is done */ - asd->delayed_init = ATOMISP_DELAYED_INIT_DONE; - complete(&asd->init_done); -} - static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) { struct pci_dev *pdev = to_pci_dev(isp->dev); @@ -1054,12 +1025,6 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) !asd->stream_prepared) continue; - if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) - cancel_work_sync(&asd->delayed_init_work); - - complete(&asd->init_done); - asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; - stream_restart[asd->index] = true; spin_lock_irqsave(&isp->lock, flags); diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp_cmd.h index bea950a128a9..d26593cc648e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.h @@ -72,7 +72,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr); const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus( u32 mbus_code); bool atomisp_is_mbuscode_raw(uint32_t code); -void atomisp_delayed_init_work(struct work_struct *work); /* Get internal fmt according to V4L2 fmt */ bool atomisp_is_viewfinder_support(struct atomisp_device *isp); diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 280e8057676b..28649a522683 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -614,7 +614,6 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) /* s3a grid not enabled for any pipe */ asd->params.s3a_enabled_pipe = IA_CSS_PIPE_ID_NUM; - asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; /* Add for channel */ asd->input_curr = 0; diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h index 90caa4254893..7f346161c4b5 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_internal.h +++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h @@ -101,10 +101,6 @@ #define ATOMISP_METADATA_QUEUE_DEPTH_FOR_HAL 8 #define ATOMISP_S3A_BUF_QUEUE_DEPTH_FOR_HAL 8 -#define ATOMISP_DELAYED_INIT_NOT_QUEUED 0 -#define ATOMISP_DELAYED_INIT_QUEUED 1 -#define ATOMISP_DELAYED_INIT_DONE 2 - /* * Define how fast CPU should be able to serve ISP interrupts. * The bigger the value, the higher risk that the ISP is not diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index cb6324510aca..87e9b0b284d9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1309,8 +1309,6 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) goto out_unlock; } - asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; - out_unlock: mutex_unlock(&isp->mutex); return ret; @@ -1366,11 +1364,6 @@ void atomisp_stop_streaming(struct vb2_queue *vq) atomisp_clear_css_buffer_counters(asd); atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, false); - if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) { - cancel_work_sync(&asd->delayed_init_work); - asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED; - } - css_pipe_id = atomisp_get_css_pipe_id(asd); atomisp_css_stop(asd, css_pipe_id, false); diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 821f3204b759..9f07ed9f5306 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -189,7 +189,6 @@ static int isp_subdev_subscribe_event(struct v4l2_subdev *sd, sub->type != V4L2_EVENT_ATOMISP_METADATA_READY && sub->type != V4L2_EVENT_ATOMISP_PAUSE_BUFFER && sub->type != V4L2_EVENT_ATOMISP_CSS_RESET && - sub->type != V4L2_EVENT_ATOMISP_RAW_BUFFERS_ALLOC_DONE && sub->type != V4L2_EVENT_ATOMISP_ACC_COMPLETE) return -EINVAL; diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h index 141b93a6c0be..5583d6a02346 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h @@ -325,12 +325,6 @@ struct atomisp_sub_device { */ unsigned int index; - /* delayed memory allocation for css */ - struct completion init_done; - struct workqueue_struct *delayed_init_workq; - unsigned int delayed_init; - struct work_struct delayed_init_work; - unsigned int latest_preview_exp_id; /* CSS ZSL/SDV raw buffer id */ unsigned int mipi_frame_size; diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index e3672069877f..ce223fbb6640 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1083,27 +1083,6 @@ static int atomisp_register_entities(struct atomisp_device *isp) } } - for (i = 0; i < isp->num_of_streams; i++) { - struct atomisp_sub_device *asd = &isp->asd[i]; - - init_completion(&asd->init_done); - - asd->delayed_init_workq = - alloc_workqueue(isp->v4l2_dev.name, WQ_CPU_INTENSIVE, - 1); - if (!asd->delayed_init_workq) { - dev_err(isp->dev, - "Failed to initialize delayed init workq\n"); - ret = -ENOMEM; - - for (; i > 0; i--) - destroy_workqueue(isp->asd[i - 1]. - delayed_init_workq); - goto wq_alloc_failed; - } - INIT_WORK(&asd->delayed_init_work, atomisp_delayed_init_work); - } - for (i = 0; i < isp->input_cnt; i++) { if (isp->inputs[i].port >= ATOMISP_CAMERA_NR_PORTS) { dev_err(isp->dev, "isp->inputs port %d not supported\n", @@ -1126,10 +1105,6 @@ static int atomisp_register_entities(struct atomisp_device *isp) return 0; link_failed: - for (i = 0; i < isp->num_of_streams; i++) - destroy_workqueue(isp->asd[i]. - delayed_init_workq); -wq_alloc_failed: for (i = 0; i < isp->num_of_streams; i++) atomisp_subdev_unregister_entities( &isp->asd[i]); From patchwork Tue Feb 21 14:59:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 89997 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU84-006Hop-Mz; Tue, 21 Feb 2023 15:00:29 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234471AbjBUPA1 (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234229AbjBUPA0 (ORCPT ); Tue, 21 Feb 2023 10:00:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB5F93D7 for ; Tue, 21 Feb 2023 06:59:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PkjWOkRIndZUfF/YTGs93yN5o9BcsbFnbkOKoQ8RUi8=; b=VkTmJlOuUOghBhAXU3Ij/26R2cYPdoLTHBvALUM4diCLhlVGxzsFaYF70LewO/2NQthoY4 czrYX+x0iXVm3H754cV6LXUum75HUQWRCIGi5Z64g5Xv1DL7WYryVqLmqrZivyhNoepFgO lsajp5/DCGCBrslTx9LuhhnXtctTlh4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-350-KRZv-xpSOKeFZ9TKcFjuhg-1; Tue, 21 Feb 2023 09:59:32 -0500 X-MC-Unique: KRZv-xpSOKeFZ9TKcFjuhg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A87D285A5B1; Tue, 21 Feb 2023 14:59:31 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 733242026D4B; Tue, 21 Feb 2023 14:59:28 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 04/10] media: atomisp: Remove crop_needs_override from atomisp_set_fmt() Date: Tue, 21 Feb 2023 15:59:00 +0100 Message-Id: <20230221145906.8113-5-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Remove the crop_needs_override local helper variable from atomisp_set_fmt(), as it always is true now. Signed-off-by: Hans de Goede --- .../staging/media/atomisp/pci/atomisp_cmd.c | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 2af0de77c6ae..22b8e13e9c2e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -4634,7 +4634,6 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) struct v4l2_pix_format backup_fmt, s_fmt; unsigned int dvs_env_w = 0, dvs_env_h = 0; unsigned int padding_w = pad_w, padding_h = pad_h; - bool res_overflow = false, crop_needs_override = false; struct v4l2_mbus_framefmt *isp_sink_fmt; struct v4l2_mbus_framefmt isp_source_fmt = {0}; struct v4l2_subdev_format vformat = { @@ -4642,6 +4641,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) }; struct v4l2_rect isp_sink_crop; u16 source_pad = atomisp_subdev_source_pad(vdev); + bool res_overflow = false; struct v4l2_subdev_fh fh; int ret; @@ -4855,7 +4855,6 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) } atomisp_csi_lane_config(isp); - crop_needs_override = true; atomisp_check_copy_mode(asd, source_pad, &backup_fmt); asd->yuvpp_mode = false; /* Reset variable */ @@ -4917,30 +4916,29 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) * which appears to be related by a hardware * performance limitation. It's unclear why this * particular code triggers the issue. */ - if (crop_needs_override) { - if (isp_sink_crop.width * main_compose.height > - isp_sink_crop.height * main_compose.width) { - sink_crop.height = isp_sink_crop.height; - sink_crop.width = DIV_NEAREST_STEP( - sink_crop.height * - f->fmt.pix.width, - f->fmt.pix.height, - ATOM_ISP_STEP_WIDTH); - } else { - sink_crop.width = isp_sink_crop.width; - sink_crop.height = DIV_NEAREST_STEP( - sink_crop.width * - f->fmt.pix.height, - f->fmt.pix.width, - ATOM_ISP_STEP_HEIGHT); - } - atomisp_subdev_set_selection(&asd->subdev, fh.state, - V4L2_SUBDEV_FORMAT_ACTIVE, - ATOMISP_SUBDEV_PAD_SINK, - V4L2_SEL_TGT_CROP, - V4L2_SEL_FLAG_KEEP_CONFIG, - &sink_crop); + if (isp_sink_crop.width * main_compose.height > + isp_sink_crop.height * main_compose.width) { + sink_crop.height = isp_sink_crop.height; + sink_crop.width = DIV_NEAREST_STEP( + sink_crop.height * + f->fmt.pix.width, + f->fmt.pix.height, + ATOM_ISP_STEP_WIDTH); + } else { + sink_crop.width = isp_sink_crop.width; + sink_crop.height = DIV_NEAREST_STEP( + sink_crop.width * + f->fmt.pix.height, + f->fmt.pix.width, + ATOM_ISP_STEP_HEIGHT); } + atomisp_subdev_set_selection(&asd->subdev, fh.state, + V4L2_SUBDEV_FORMAT_ACTIVE, + ATOMISP_SUBDEV_PAD_SINK, + V4L2_SEL_TGT_CROP, + V4L2_SEL_FLAG_KEEP_CONFIG, + &sink_crop); + atomisp_subdev_set_selection(&asd->subdev, fh.state, V4L2_SUBDEV_FORMAT_ACTIVE, source_pad, From patchwork Tue Feb 21 14:59:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 89998 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU87-006Hq7-6u; Tue, 21 Feb 2023 15:00:31 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234563AbjBUPA3 (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234519AbjBUPA1 (ORCPT ); Tue, 21 Feb 2023 10:00:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203FCBDE8 for ; Tue, 21 Feb 2023 06:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9d8J6Rd7lJIueXtSdRpXYS+6+vNgW3vrsqkU+Knn3Kc=; b=aBi1Ye90SB+B71hty6LEdBJZt76C9J7uVDJJniITTeC2S1pjo1iqDCKF0iB6LP935yn6xm R1TVwUv2lFauiWwNLJFELxUDKtsoyFcG0J5tsnFks5nuxidSvm97c2JLa55ebWH09WzmJl 3ORS8d28j0ZIcmShPuZ/vrwW6EN57AI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591--6_bSAZIMe-89OhNccEKkw-1; Tue, 21 Feb 2023 09:59:36 -0500 X-MC-Unique: -6_bSAZIMe-89OhNccEKkw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8921101A52E; Tue, 21 Feb 2023 14:59:35 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45F2F2026D4B; Tue, 21 Feb 2023 14:59:31 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 05/10] media: atomisp: Remove atomisp_css_enable_raw_binning() Date: Tue, 21 Feb 2023 15:59:01 +0100 Message-Id: <20230221145906.8113-6-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Remove the now unused atomisp_css_enable_raw_binning() function. Signed-off-by: Hans de Goede --- .../media/atomisp/pci/atomisp_compat.h | 3 --- .../media/atomisp/pci/atomisp_compat_css20.c | 19 ------------------- 2 files changed, 22 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat.h b/drivers/staging/media/atomisp/pci/atomisp_compat.h index 7316eb9f974a..06d54c9bcb49 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat.h +++ b/drivers/staging/media/atomisp/pci/atomisp_compat.h @@ -196,9 +196,6 @@ void atomisp_css_input_set_two_pixels_per_clock( struct atomisp_sub_device *asd, bool two_ppc); -void atomisp_css_enable_raw_binning(struct atomisp_sub_device *asd, - bool enable); - void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable); void atomisp_css_capture_set_mode(struct atomisp_sub_device *asd, diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index accae44ad72b..914af04e9211 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -1728,25 +1728,6 @@ void atomisp_css_input_set_two_pixels_per_clock( .update_pipe[i] = true; } -void atomisp_css_enable_raw_binning(struct atomisp_sub_device *asd, - bool enable) -{ - struct atomisp_stream_env *stream_env = - &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]; - unsigned int pipe; - - if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) - pipe = IA_CSS_PIPE_ID_VIDEO; - else - pipe = IA_CSS_PIPE_ID_PREVIEW; - - stream_env->pipe_extra_configs[pipe].enable_raw_binning = enable; - stream_env->update_pipe[pipe] = true; - if (enable) - stream_env->pipe_configs[pipe].output_info[0].padded_width = - stream_env->stream_config.input_config.effective_res.width; -} - void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable) { int i; From patchwork Tue Feb 21 14:59:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 90000 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU8H-006Hq7-02; Tue, 21 Feb 2023 15:00:41 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234588AbjBUPAi (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234578AbjBUPAc (ORCPT ); Tue, 21 Feb 2023 10:00:32 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C941E5DE for ; Tue, 21 Feb 2023 06:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=90px5i4rRfIXxe5wQUs/OIEz0jYuXtqNMDf179nVdzA=; b=L3/kPcOdcyD2Zuq9PvHL1GZ2icQBSpe2iNXSIudzZOf65wGwMuVbQbRUmZB2oI1olOHMb3 /hz9zuBURQAzCXrx1RIpO12ES/AoWA220oFPi3T2c5n3zm2jkvOQi8GylaUIRlhK8vjhwF cxMBKOAOpUSjQ7PXlC9CWpHmjoofoWc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-wcmTsapmODOg3kl-DCpHhg-1; Tue, 21 Feb 2023 09:59:41 -0500 X-MC-Unique: wcmTsapmODOg3kl-DCpHhg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73ED53806118; Tue, 21 Feb 2023 14:59:40 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 764972026D4B; Tue, 21 Feb 2023 14:59:36 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 06/10] media: atomisp: Remove atomisp_get_metadata_type() Date: Tue, 21 Feb 2023 15:59:02 +0100 Message-Id: <20230221145906.8113-7-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no atomisp_get_metadata_type() always returns ATOMISP_MAIN_METADATA, replace its uses with ATOMISP_MAIN_METADATA and remove it. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 9 +-------- drivers/staging/media/atomisp/pci/atomisp_cmd.h | 5 ----- drivers/staging/media/atomisp/pci/atomisp_fops.c | 3 +-- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 22b8e13e9c2e..2c73af9f039f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -728,13 +728,6 @@ static void atomisp_recover_params_queue(struct atomisp_video_pipe *pipe) atomisp_handle_parameter_and_buffer(pipe); } -enum atomisp_metadata_type -atomisp_get_metadata_type(struct atomisp_sub_device *asd, - enum ia_css_pipe_id pipe_id) -{ - return ATOMISP_MAIN_METADATA; -} - void atomisp_buf_done(struct atomisp_sub_device *asd, int error, enum ia_css_buffer_type buf_type, enum ia_css_pipe_id css_pipe_id, @@ -806,7 +799,7 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error, if (error) break; - md_type = atomisp_get_metadata_type(asd, css_pipe_id); + md_type = ATOMISP_MAIN_METADATA; list_for_each_entry_safe(md_iter, _md_buf_tmp, &asd->metadata_in_css[md_type], list) { if (md_iter->metadata == diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp_cmd.h index d26593cc648e..399b549bcf83 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.h @@ -313,11 +313,6 @@ void atomisp_init_raw_buffer_bitmap(struct atomisp_sub_device *asd); int atomisp_enable_dz_capt_pipe(struct atomisp_sub_device *asd, unsigned int *enable); -/* Function to get metadata type bu pipe id */ -enum atomisp_metadata_type -atomisp_get_metadata_type(struct atomisp_sub_device *asd, - enum ia_css_pipe_id pipe_id); - u32 atomisp_get_pixel_depth(u32 pixelformat); /* Function for HAL to inject a fake event to wake up poll thread */ diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 28649a522683..55c9ff87c112 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -112,8 +112,7 @@ static int atomisp_q_one_metadata_buffer(struct atomisp_sub_device *asd, enum ia_css_pipe_id css_pipe_id) { struct atomisp_metadata_buf *metadata_buf; - enum atomisp_metadata_type md_type = - atomisp_get_metadata_type(asd, css_pipe_id); + enum atomisp_metadata_type md_type = ATOMISP_MAIN_METADATA; struct list_head *metadata_list; if (asd->metadata_bufs_in_css[stream_id][css_pipe_id] >= From patchwork Tue Feb 21 14:59:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 90003 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU8U-006Hq7-VX; Tue, 21 Feb 2023 15:00:55 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234595AbjBUPAw (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbjBUPAu (ORCPT ); Tue, 21 Feb 2023 10:00:50 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A539C2B29E for ; Tue, 21 Feb 2023 06:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vAnq26hgr7830+8KT0BiPGWYLndD2v5UVWfJTzp060g=; b=aLjIWAzj8WWqH/253CbtOxLLyAECEIX0XlVpCVFm4VeJMqrLQIb2L8ArR4c3w1mkDSXxti MxKeQiGbDnZNizZC/Scy1qeU1zrJ8fog82MLqjLIQIUqsJXo3IVHVMqX0j/S9fVAL3KyJo 6IAiShytnU6DDNIjlJ/nQPlmXCofFo0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262-NlvNv1abPsKgMW9ChGSgQw-1; Tue, 21 Feb 2023 09:59:44 -0500 X-MC-Unique: NlvNv1abPsKgMW9ChGSgQw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8644882820; Tue, 21 Feb 2023 14:59:43 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE5522026D4B; Tue, 21 Feb 2023 14:59:40 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 07/10] media: atomisp: Remove unused SOC_CAMERA, XENON_FLASH and FILE_INPUT subdev types Date: Tue, 21 Feb 2023 15:59:03 +0100 Message-Id: <20230221145906.8113-8-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Nothing registers subdevs with the SOC_CAMERA, XENON_FLASH and FILE_INPUT types, remove the code for these. Signed-off-by: Hans de Goede --- .../atomisp/include/linux/atomisp_platform.h | 9 +++------ .../staging/media/atomisp/pci/atomisp_cmd.c | 20 ++----------------- .../media/atomisp/pci/atomisp_compat_css20.c | 13 ++---------- .../staging/media/atomisp/pci/atomisp_fops.c | 6 ++---- .../media/atomisp/pci/atomisp_internal.h | 12 +---------- .../media/atomisp/pci/atomisp_subdev.c | 9 --------- .../staging/media/atomisp/pci/atomisp_v4l2.c | 10 ++-------- 7 files changed, 12 insertions(+), 67 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h index 539b21d39d3b..b77bf814a5a6 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h @@ -111,12 +111,9 @@ enum atomisp_input_format { enum intel_v4l2_subdev_type { RAW_CAMERA = 1, - SOC_CAMERA = 2, - CAMERA_MOTOR = 3, - LED_FLASH = 4, - XENON_FLASH = 5, - FILE_INPUT = 6, - TEST_PATTERN = 7, + CAMERA_MOTOR = 2, + LED_FLASH = 3, + TEST_PATTERN = 4, }; struct intel_v4l2_subdev_id { diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 2c73af9f039f..e4519cab8b5e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -1068,9 +1068,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) if (!stream_restart[i]) continue; - if (isp->inputs[asd->input_curr].type != FILE_INPUT) - atomisp_css_input_set_mode(asd, - IA_CSS_INPUT_MODE_BUFFERED_SENSOR); + atomisp_css_input_set_mode(asd, IA_CSS_INPUT_MODE_BUFFERED_SENSOR); css_pipe_id = atomisp_get_css_pipe_id(asd); if (atomisp_css_start(asd, css_pipe_id, true)) { @@ -4269,8 +4267,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, if (!format) return -EINVAL; - if (isp->inputs[asd->input_curr].type != TEST_PATTERN && - isp->inputs[asd->input_curr].type != FILE_INPUT) { + if (isp->inputs[asd->input_curr].type != TEST_PATTERN) { mipi_info = atomisp_to_sensor_mipi_info( isp->inputs[asd->input_curr].camera); if (!mipi_info) { @@ -4371,13 +4368,6 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, configure_pp_input = atomisp_css_preview_configure_pp_input; pipe_id = IA_CSS_PIPE_ID_PREVIEW; } else { - /* CSS doesn't support low light mode on SOC cameras, so disable - * it. FIXME: if this is done elsewhere, it gives corrupted - * colors into thumbnail image. - */ - if (isp->inputs[asd->input_curr].type == SOC_CAMERA) - asd->params.low_light = false; - if (format->sh_fmt == IA_CSS_FRAME_FORMAT_RAW) { atomisp_css_capture_set_mode(asd, IA_CSS_CAPTURE_MODE_RAW); atomisp_css_enable_dz(asd, false); @@ -4468,12 +4458,6 @@ static void atomisp_get_dis_envelop(struct atomisp_sub_device *asd, unsigned int width, unsigned int height, unsigned int *dvs_env_w, unsigned int *dvs_env_h) { - struct atomisp_device *isp = asd->isp; - - /* if subdev type is SOC camera,we do not need to set DVS */ - if (isp->inputs[asd->input_curr].type == SOC_CAMERA) - asd->params.video_dis_en = false; - if (asd->params.video_dis_en && asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { /* envelope is 20% of the output resolution */ diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 914af04e9211..e8e39d0e412e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -590,8 +590,6 @@ static void __apply_additional_pipe_config( .enable_reduced_pipe = true; stream_env->pipe_configs[pipe_id] .enable_dz = false; - if (ATOMISP_SOC_CAMERA(asd)) - stream_env->pipe_configs[pipe_id].enable_dz = true; if (asd->params.video_dis_en) { stream_env->pipe_extra_configs[pipe_id] @@ -605,10 +603,7 @@ static void __apply_additional_pipe_config( break; case IA_CSS_PIPE_ID_YUVPP: case IA_CSS_PIPE_ID_COPY: - if (ATOMISP_SOC_CAMERA(asd)) - stream_env->pipe_configs[pipe_id].enable_dz = true; - else - stream_env->pipe_configs[pipe_id].enable_dz = false; + stream_env->pipe_configs[pipe_id].enable_dz = false; break; default: break; @@ -2563,13 +2558,9 @@ int atomisp_get_css_frame_info(struct atomisp_sub_device *asd, int stream_index; struct atomisp_device *isp = asd->isp; - if (ATOMISP_SOC_CAMERA(asd)) { - stream_index = ATOMISP_INPUT_STREAM_GENERAL; - } else { - stream_index = (pipe_index == IA_CSS_PIPE_ID_YUVPP) ? + stream_index = (pipe_index == IA_CSS_PIPE_ID_YUVPP) ? ATOMISP_INPUT_STREAM_VIDEO : ATOMISP_INPUT_STREAM_GENERAL; - } if (0 != ia_css_pipe_get_info(asd->stream_env[stream_index] .pipes[pipe_index], &info)) { diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 55c9ff87c112..e5203f68f0f9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -458,10 +458,8 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) buf_type = atomisp_get_css_buf_type( asd, css_preview_pipe_id, atomisp_subdev_source_pad(&preview_pipe->vdev)); - if (ATOMISP_SOC_CAMERA(asd) && css_preview_pipe_id == IA_CSS_PIPE_ID_YUVPP) - input_stream_id = ATOMISP_INPUT_STREAM_GENERAL; - /* else for ext isp use case */ - else if (css_preview_pipe_id == IA_CSS_PIPE_ID_YUVPP) + + if (css_preview_pipe_id == IA_CSS_PIPE_ID_YUVPP) input_stream_id = ATOMISP_INPUT_STREAM_VIDEO; else if (asd->stream_env[ATOMISP_INPUT_STREAM_PREVIEW].stream) input_stream_id = ATOMISP_INPUT_STREAM_PREVIEW; diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h index 7f346161c4b5..1c1c4cf41e32 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_internal.h +++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h @@ -117,17 +117,7 @@ #define ATOMISP_CSS_OUTPUT_SECOND_INDEX 1 #define ATOMISP_CSS_OUTPUT_DEFAULT_INDEX 0 -/* - * ATOMISP_SOC_CAMERA - * This is to differentiate between ext-isp and soc camera in - * Moorefield/Baytrail platform. - */ -#define ATOMISP_SOC_CAMERA(asd) \ - (asd->isp->inputs[asd->input_curr].type == SOC_CAMERA) - -#define ATOMISP_USE_YUVPP(asd) \ - (ATOMISP_SOC_CAMERA(asd) && ATOMISP_CSS_SUPPORT_YUVPP && \ - !asd->copy_mode) +#define ATOMISP_USE_YUVPP(asd) false /* ISP2401 */ #define ATOMISP_ION_DEVICE_FD_OFFSET 16 diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 9f07ed9f5306..371991883076 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -409,11 +409,6 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd, padding_h = 12; } - if (isp->inputs[isp_sd->input_curr].type == SOC_CAMERA) { - padding_w = 0; - padding_h = 0; - } - if (atomisp_subdev_format_conversion(isp_sd, isp_sd->capture_pad) && crop[pad]->width && crop[pad]->height) { @@ -421,10 +416,6 @@ int atomisp_subdev_set_selection(struct v4l2_subdev *sd, crop[pad]->height -= padding_h; } - /* if subdev type is SOC camera,we do not need to set DVS */ - if (isp->inputs[isp_sd->input_curr].type == SOC_CAMERA) - isp_sd->params.video_dis_en = 0; - if (isp_sd->params.video_dis_en && isp_sd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { /* This resolution contains 20 % of DVS slack diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index ce223fbb6640..4f5698e54711 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -842,8 +842,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) for (i = 0; i < isp->input_cnt; i++) { struct camera_mipi_info *mipi_info; - if (isp->inputs[i].type != RAW_CAMERA && - isp->inputs[i].type != SOC_CAMERA) + if (isp->inputs[i].type != RAW_CAMERA) continue; mipi_info = atomisp_to_sensor_mipi_info(isp->inputs[i].camera); @@ -923,8 +922,7 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) int camera_count = 0; for (subdevs = pdata->subdevs; subdevs->type; ++subdevs) { - if (subdevs->type == RAW_CAMERA || - subdevs->type == SOC_CAMERA) + if (subdevs->type == RAW_CAMERA) camera_count++; } if (camera_count) @@ -945,9 +943,6 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) case RAW_CAMERA: dev_dbg(isp->dev, "raw_index: %d\n", raw_index); raw_index = isp->input_cnt; - fallthrough; - case SOC_CAMERA: - dev_dbg(isp->dev, "SOC_INDEX: %d\n", isp->input_cnt); if (isp->input_cnt >= ATOM_ISP_MAX_INPUTS) { dev_warn(isp->dev, "too many atomisp inputs, ignored\n"); @@ -974,7 +969,6 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) isp->motor = subdevs->subdev; break; case LED_FLASH: - case XENON_FLASH: if (isp->flash) { dev_warn(isp->dev, "too many atomisp flash devices\n"); continue; From patchwork Tue Feb 21 14:59:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 90001 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU8S-006Hq7-6P; Tue, 21 Feb 2023 15:00:53 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234568AbjBUPAu (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbjBUPAt (ORCPT ); Tue, 21 Feb 2023 10:00:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43832B2BF for ; Tue, 21 Feb 2023 06:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g7vtjw7t0Y+mu7x0uX29b3cxmwCxURZo059EiYH/NJw=; b=a3yMUpStiY9QVC7dxN/0AtThsShrbPuNlfL7FfkThJWtSxxhSO5bfZvH2kRoENPXQZ9q2G AaM1I0AjLI+T25R/8SYTptuqZRGbi81TOIr0n3cr8EtNQ1LkyAWWDkEauuvFgObqNKjfQA 2PCAt6EWUfcNBnP2Gkv+qJQ8Kdxz0uI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-m6p3kl33OJOHyKU3iJGlDA-1; Tue, 21 Feb 2023 09:59:48 -0500 X-MC-Unique: m6p3kl33OJOHyKU3iJGlDA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FC471C05AB3; Tue, 21 Feb 2023 14:59:47 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5565A2026D4B; Tue, 21 Feb 2023 14:59:44 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 08/10] media: atomisp: Remove ATOMISP_USE_YUVPP() Date: Tue, 21 Feb 2023 15:59:04 +0100 Message-Id: <20230221145906.8113-9-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no ATOMISP_USE_YUVPP() always returns false, so remove it and remove any code-paths which only run when it would return true. Signed-off-by: Hans de Goede --- .../staging/media/atomisp/pci/atomisp_cmd.c | 15 +- .../media/atomisp/pci/atomisp_compat_css20.c | 215 ++---------------- .../staging/media/atomisp/pci/atomisp_fops.c | 33 --- .../media/atomisp/pci/atomisp_internal.h | 2 - .../staging/media/atomisp/pci/atomisp_ioctl.c | 3 - 5 files changed, 21 insertions(+), 247 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index e4519cab8b5e..2b95d8f0dbd2 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -196,7 +196,6 @@ int atomisp_freq_scaling(struct atomisp_device *isp, enum atomisp_dfs_mode mode, bool force) { - struct pci_dev *pdev = to_pci_dev(isp->dev); /* FIXME! Only use subdev[0] status yet */ struct atomisp_sub_device *asd = &isp->asd[0]; const struct atomisp_dfs_config *dfs; @@ -205,10 +204,6 @@ int atomisp_freq_scaling(struct atomisp_device *isp, int i, ret; unsigned short fps = 0; - if ((pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK) == - ATOMISP_PCI_DEVICE_SOC_CHT && ATOMISP_USE_YUVPP(asd)) - isp->dfs = &dfs_config_cht_soc; - dfs = isp->dfs; if (dfs->lowest_freq == 0 || dfs->max_freq_at_vmin == 0 || @@ -4398,12 +4393,6 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, } } - /* - * to SOC camera, use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - pipe_id = IA_CSS_PIPE_ID_YUVPP; - if (asd->copy_mode) ret = atomisp_css_copy_configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, pix->width, pix->height, @@ -5282,9 +5271,7 @@ static int atomisp_get_pipe_id(struct atomisp_video_pipe *pipe) return -EINVAL; } - if (ATOMISP_USE_YUVPP(asd)) { - return IA_CSS_PIPE_ID_YUVPP; - } else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER) { + if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER) { return IA_CSS_PIPE_ID_VIDEO; } else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_LOWLAT) { return IA_CSS_PIPE_ID_CAPTURE; diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index e8e39d0e412e..8bd7605fbe8f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -1853,17 +1853,6 @@ void atomisp_css_enable_continuous(struct atomisp_sub_device *asd, &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]; int i; - /* - * To SOC camera, there is only one YUVPP pipe in any case - * including ZSL/SDV/continuous viewfinder, so always set - * stream_config.continuous to 0. - */ - if (ATOMISP_USE_YUVPP(asd)) { - stream_env->stream_config.continuous = 0; - stream_env->stream_config.online = 1; - return; - } - if (stream_env->stream_config.continuous != !!enable) { stream_env->stream_config.continuous = !!enable; stream_env->stream_config.pack_raw_pixels = true; @@ -2081,42 +2070,6 @@ static void __configure_output(struct atomisp_sub_device *asd, pipe_id, width, height, format); } -static void __configure_video_preview_output(struct atomisp_sub_device *asd, - unsigned int stream_index, - unsigned int width, unsigned int height, - unsigned int min_width, - enum ia_css_frame_format format, - enum ia_css_pipe_id pipe_id) -{ - struct atomisp_device *isp = asd->isp; - struct atomisp_stream_env *stream_env = - &asd->stream_env[stream_index]; - struct ia_css_frame_info *css_output_info; - struct ia_css_stream_config *stream_config = &stream_env->stream_config; - - stream_env->pipe_configs[pipe_id].mode = - __pipe_id_to_pipe_mode(asd, pipe_id); - stream_env->update_pipe[pipe_id] = true; - - css_output_info = - &stream_env->pipe_configs[pipe_id].output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; - - css_output_info->res.width = width; - css_output_info->res.height = height; - css_output_info->format = format; - css_output_info->padded_width = min_width; - - /* isp binary 2.2 specific setting*/ - if (width > stream_config->input_config.effective_res.width || - height > stream_config->input_config.effective_res.height) { - stream_config->input_config.effective_res.width = width; - stream_config->input_config.effective_res.height = height; - } - - dev_dbg(isp->dev, "configuring pipe[%d] output info w=%d.h=%d.f=%d.\n", - pipe_id, width, height, format); -} - /* * For CSS2.1, capture pipe uses capture_pp_in_res to configure yuv * downscaling input resolution. @@ -2420,33 +2373,6 @@ static void __configure_vf_output(struct atomisp_sub_device *asd, pipe_id, width, height, format); } -static void __configure_video_vf_output(struct atomisp_sub_device *asd, - unsigned int width, unsigned int height, - unsigned int min_width, - enum ia_css_frame_format format, - enum ia_css_pipe_id pipe_id) -{ - struct atomisp_device *isp = asd->isp; - struct atomisp_stream_env *stream_env = - &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]; - struct ia_css_frame_info *css_output_info; - - stream_env->pipe_configs[pipe_id].mode = - __pipe_id_to_pipe_mode(asd, pipe_id); - stream_env->update_pipe[pipe_id] = true; - - css_output_info = - &stream_env->pipe_configs[pipe_id].vf_output_info[ATOMISP_CSS_OUTPUT_DEFAULT_INDEX]; - - css_output_info->res.width = width; - css_output_info->res.height = height; - css_output_info->format = format; - css_output_info->padded_width = min_width; - dev_dbg(isp->dev, - "configuring pipe[%d] vf output info w=%d.h=%d.f=%d.\n", - pipe_id, width, height, format); -} - static int __get_frame_info(struct atomisp_sub_device *asd, unsigned int stream_index, struct ia_css_frame_info *info, @@ -2506,11 +2432,6 @@ static unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd, uint16_t source_pad) { struct atomisp_device *isp = asd->isp; - /* - * to SOC camera, use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - return IA_CSS_PIPE_ID_YUVPP; switch (source_pad) { case ATOMISP_SUBDEV_PAD_SOURCE_VIDEO: @@ -2651,16 +2572,8 @@ int atomisp_css_preview_configure_output(struct atomisp_sub_device *asd, unsigned int min_width, enum ia_css_frame_format format) { - /* - * to SOC camera, use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - __configure_video_preview_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, - height, - min_width, format, IA_CSS_PIPE_ID_YUVPP); - else - __configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, height, - min_width, format, IA_CSS_PIPE_ID_PREVIEW); + __configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, height, + min_width, format, IA_CSS_PIPE_ID_PREVIEW); return 0; } @@ -2669,18 +2582,8 @@ int atomisp_css_capture_configure_output(struct atomisp_sub_device *asd, unsigned int min_width, enum ia_css_frame_format format) { - enum ia_css_pipe_id pipe_id; - - /* - * to SOC camera, use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - pipe_id = IA_CSS_PIPE_ID_YUVPP; - else - pipe_id = IA_CSS_PIPE_ID_CAPTURE; - __configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, height, - min_width, format, pipe_id); + min_width, format, IA_CSS_PIPE_ID_CAPTURE); return 0; } @@ -2689,16 +2592,8 @@ int atomisp_css_video_configure_output(struct atomisp_sub_device *asd, unsigned int min_width, enum ia_css_frame_format format) { - /* - * to SOC camera, use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - __configure_video_preview_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, - height, - min_width, format, IA_CSS_PIPE_ID_YUVPP); - else - __configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, height, - min_width, format, IA_CSS_PIPE_ID_VIDEO); + __configure_output(asd, ATOMISP_INPUT_STREAM_GENERAL, width, height, + min_width, format, IA_CSS_PIPE_ID_VIDEO); return 0; } @@ -2708,15 +2603,8 @@ int atomisp_css_video_configure_viewfinder( unsigned int min_width, enum ia_css_frame_format format) { - /* - * to SOC camera, video will use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - __configure_video_vf_output(asd, width, height, min_width, format, - IA_CSS_PIPE_ID_YUVPP); - else - __configure_vf_output(asd, width, height, min_width, format, - IA_CSS_PIPE_ID_VIDEO); + __configure_vf_output(asd, width, height, min_width, format, + IA_CSS_PIPE_ID_VIDEO); return 0; } @@ -2726,18 +2614,7 @@ int atomisp_css_capture_configure_viewfinder( unsigned int min_width, enum ia_css_frame_format format) { - enum ia_css_pipe_id pipe_id; - - /* - * to SOC camera, video will use yuvpp pipe. - */ - if (ATOMISP_USE_YUVPP(asd)) - pipe_id = IA_CSS_PIPE_ID_YUVPP; - else - pipe_id = IA_CSS_PIPE_ID_CAPTURE; - - __configure_vf_output(asd, width, height, min_width, format, - pipe_id); + __configure_vf_output(asd, width, height, min_width, format, IA_CSS_PIPE_ID_CAPTURE); return 0; } @@ -2745,41 +2622,22 @@ int atomisp_css_video_get_viewfinder_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - enum ia_css_pipe_id pipe_id; - enum frame_info_type frame_type = ATOMISP_CSS_VF_FRAME; - - if (ATOMISP_USE_YUVPP(asd)) { - pipe_id = IA_CSS_PIPE_ID_YUVPP; - } else { - pipe_id = IA_CSS_PIPE_ID_VIDEO; - } - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - frame_type, pipe_id); + ATOMISP_CSS_VF_FRAME, IA_CSS_PIPE_ID_VIDEO); } int atomisp_css_capture_get_viewfinder_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - enum ia_css_pipe_id pipe_id; - - if (ATOMISP_USE_YUVPP(asd)) - pipe_id = IA_CSS_PIPE_ID_YUVPP; - else - pipe_id = IA_CSS_PIPE_ID_CAPTURE; - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - ATOMISP_CSS_VF_FRAME, pipe_id); + ATOMISP_CSS_VF_FRAME, IA_CSS_PIPE_ID_CAPTURE); } int atomisp_css_capture_get_output_raw_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - if (ATOMISP_USE_YUVPP(asd)) - return 0; - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, ATOMISP_CSS_RAW_FRAME, IA_CSS_PIPE_ID_CAPTURE); } @@ -2797,49 +2655,24 @@ int atomisp_css_preview_get_output_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - enum ia_css_pipe_id pipe_id; - enum frame_info_type frame_type = ATOMISP_CSS_OUTPUT_FRAME; - - if (ATOMISP_USE_YUVPP(asd)) { - pipe_id = IA_CSS_PIPE_ID_YUVPP; - } else { - pipe_id = IA_CSS_PIPE_ID_PREVIEW; - } - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - frame_type, pipe_id); + ATOMISP_CSS_OUTPUT_FRAME, IA_CSS_PIPE_ID_PREVIEW); } int atomisp_css_capture_get_output_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - enum ia_css_pipe_id pipe_id; - - if (ATOMISP_USE_YUVPP(asd)) - pipe_id = IA_CSS_PIPE_ID_YUVPP; - else - pipe_id = IA_CSS_PIPE_ID_CAPTURE; - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - ATOMISP_CSS_OUTPUT_FRAME, pipe_id); + ATOMISP_CSS_OUTPUT_FRAME, IA_CSS_PIPE_ID_CAPTURE); } int atomisp_css_video_get_output_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info) { - enum ia_css_pipe_id pipe_id; - enum frame_info_type frame_type = ATOMISP_CSS_OUTPUT_FRAME; - - if (ATOMISP_USE_YUVPP(asd)) { - pipe_id = IA_CSS_PIPE_ID_YUVPP; - } else { - pipe_id = IA_CSS_PIPE_ID_VIDEO; - } - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - frame_type, pipe_id); + ATOMISP_CSS_OUTPUT_FRAME, IA_CSS_PIPE_ID_VIDEO); } int atomisp_css_preview_configure_pp_input( @@ -2848,15 +2681,12 @@ int atomisp_css_preview_configure_pp_input( { struct atomisp_stream_env *stream_env = &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]; - __configure_preview_pp_input(asd, width, height, - ATOMISP_USE_YUVPP(asd) ? - IA_CSS_PIPE_ID_YUVPP : IA_CSS_PIPE_ID_PREVIEW); + __configure_preview_pp_input(asd, width, height, IA_CSS_PIPE_ID_PREVIEW); if (width > stream_env->pipe_configs[IA_CSS_PIPE_ID_CAPTURE]. capt_pp_in_res.width) - __configure_capture_pp_input(asd, width, height, - ATOMISP_USE_YUVPP(asd) ? - IA_CSS_PIPE_ID_YUVPP : IA_CSS_PIPE_ID_CAPTURE); + __configure_capture_pp_input(asd, width, height, IA_CSS_PIPE_ID_CAPTURE); + return 0; } @@ -2864,9 +2694,7 @@ int atomisp_css_capture_configure_pp_input( struct atomisp_sub_device *asd, unsigned int width, unsigned int height) { - __configure_capture_pp_input(asd, width, height, - ATOMISP_USE_YUVPP(asd) ? - IA_CSS_PIPE_ID_YUVPP : IA_CSS_PIPE_ID_CAPTURE); + __configure_capture_pp_input(asd, width, height, IA_CSS_PIPE_ID_CAPTURE); return 0; } @@ -2877,15 +2705,12 @@ int atomisp_css_video_configure_pp_input( struct atomisp_stream_env *stream_env = &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]; - __configure_video_pp_input(asd, width, height, - ATOMISP_USE_YUVPP(asd) ? - IA_CSS_PIPE_ID_YUVPP : IA_CSS_PIPE_ID_VIDEO); + __configure_video_pp_input(asd, width, height, IA_CSS_PIPE_ID_VIDEO); if (width > stream_env->pipe_configs[IA_CSS_PIPE_ID_CAPTURE]. capt_pp_in_res.width) - __configure_capture_pp_input(asd, width, height, - ATOMISP_USE_YUVPP(asd) ? - IA_CSS_PIPE_ID_YUVPP : IA_CSS_PIPE_ID_CAPTURE); + __configure_capture_pp_input(asd, width, height, IA_CSS_PIPE_ID_CAPTURE); + return 0; } diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index e5203f68f0f9..5ba5739c144b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -346,16 +346,6 @@ static int atomisp_get_css_buf_type(struct atomisp_sub_device *asd, enum ia_css_pipe_id pipe_id, uint16_t source_pad) { - if (ATOMISP_USE_YUVPP(asd)) { - if (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE || - source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO || - (source_pad == ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW && - asd->run_mode->val != ATOMISP_RUN_MODE_VIDEO)) - return IA_CSS_BUFFER_TYPE_OUTPUT_FRAME; - else - return IA_CSS_BUFFER_TYPE_VF_OUTPUT_FRAME; - } - if (pipe_id == IA_CSS_PIPE_ID_COPY || source_pad == ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE || source_pad == ATOMISP_SUBDEV_PAD_SOURCE_VIDEO || @@ -424,12 +414,6 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) atomisp_subdev_source_pad(&capture_pipe->vdev)); input_stream_id = ATOMISP_INPUT_STREAM_GENERAL; - /* - * use yuvpp pipe for SOC camera. - */ - if (ATOMISP_USE_YUVPP(asd)) - css_capture_pipe_id = IA_CSS_PIPE_ID_YUVPP; - atomisp_q_video_buffers_to_css(asd, capture_pipe, input_stream_id, buf_type, css_capture_pipe_id); @@ -444,11 +428,6 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) else input_stream_id = ATOMISP_INPUT_STREAM_GENERAL; - /* - * use yuvpp pipe for SOC camera. - */ - if (ATOMISP_USE_YUVPP(asd)) - css_capture_pipe_id = IA_CSS_PIPE_ID_YUVPP; atomisp_q_video_buffers_to_css(asd, vf_pipe, input_stream_id, buf_type, css_capture_pipe_id); @@ -466,12 +445,6 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) else input_stream_id = ATOMISP_INPUT_STREAM_GENERAL; - /* - * use yuvpp pipe for SOC camera. - */ - if (ATOMISP_USE_YUVPP(asd)) - css_preview_pipe_id = IA_CSS_PIPE_ID_YUVPP; - atomisp_q_video_buffers_to_css(asd, preview_pipe, input_stream_id, buf_type, css_preview_pipe_id); @@ -486,12 +459,6 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) else input_stream_id = ATOMISP_INPUT_STREAM_GENERAL; - /* - * use yuvpp pipe for SOC camera. - */ - if (ATOMISP_USE_YUVPP(asd)) - css_video_pipe_id = IA_CSS_PIPE_ID_YUVPP; - atomisp_q_video_buffers_to_css(asd, video_pipe, input_stream_id, buf_type, css_video_pipe_id); diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h index 1c1c4cf41e32..681a9258288d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_internal.h +++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h @@ -117,8 +117,6 @@ #define ATOMISP_CSS_OUTPUT_SECOND_INDEX 1 #define ATOMISP_CSS_OUTPUT_DEFAULT_INDEX 0 -#define ATOMISP_USE_YUVPP(asd) false - /* ISP2401 */ #define ATOMISP_ION_DEVICE_FD_OFFSET 16 #define ATOMISP_ION_SHARED_FD_MASK (0xFFFF) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 87e9b0b284d9..99cfe8a80bb1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1120,9 +1120,6 @@ static int atomisp_dqbuf_wrapper(struct file *file, void *fh, struct v4l2_buffer enum ia_css_pipe_id atomisp_get_css_pipe_id(struct atomisp_sub_device *asd) { - if (ATOMISP_USE_YUVPP(asd)) - return IA_CSS_PIPE_ID_YUVPP; - /* * Disable vf_pp and run CSS in video mode. This allows using ISP * scaling but it has one frame delay due to CSS internal buffering. From patchwork Tue Feb 21 14:59:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 90002 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU8T-006Hq7-OO; Tue, 21 Feb 2023 15:00:54 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234594AbjBUPAv (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234551AbjBUPAt (ORCPT ); Tue, 21 Feb 2023 10:00:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925E22B607 for ; Tue, 21 Feb 2023 06:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Ue7yOV/J05gG3qNTTS35eXJ5nVwxV3Alxr9QkLAdVs=; b=cBQrOpu6V5X7iDtj+sjpkJZ3x+qZoI1JLaJzvAsi+0tfODGvFq6ByYJCuUq7oex+eZoKee JPhA0G8r+kDhW2i8UsQU0qtoxVibReKxtStyO90op/3DaIEnBlGaPhceL03/RifEp9Wjtc twS222p1pcRgyN/4A/OPZ7MGXUBpCNM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-282-ieTwQndAMlapMNMHSXthNg-1; Tue, 21 Feb 2023 09:59:51 -0500 X-MC-Unique: ieTwQndAMlapMNMHSXthNg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 333C1380611C; Tue, 21 Feb 2023 14:59:51 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFCE82026D4B; Tue, 21 Feb 2023 14:59:47 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 09/10] media: atomisp: Remove yuvpp_mode Date: Tue, 21 Feb 2023 15:59:05 +0100 Message-Id: <20230221145906.8113-10-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no yuvpp_mode is never set, so it always is false remove it. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 1 - .../staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ---- drivers/staging/media/atomisp/pci/atomisp_fops.c | 10 ---------- drivers/staging/media/atomisp/pci/atomisp_subdev.h | 1 - 4 files changed, 16 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 2b95d8f0dbd2..937cfe9489fc 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -4823,7 +4823,6 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) atomisp_csi_lane_config(isp); atomisp_check_copy_mode(asd, source_pad, &backup_fmt); - asd->yuvpp_mode = false; /* Reset variable */ isp_sink_crop = *atomisp_subdev_get_rect(&asd->subdev, NULL, V4L2_SUBDEV_FORMAT_ACTIVE, diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 8bd7605fbe8f..10be77c478b8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -2435,8 +2435,6 @@ static unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd, switch (source_pad) { case ATOMISP_SUBDEV_PAD_SOURCE_VIDEO: - if (asd->yuvpp_mode) - return IA_CSS_PIPE_ID_YUVPP; if (asd->copy_mode) return IA_CSS_PIPE_ID_COPY; if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO @@ -2455,8 +2453,6 @@ static unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd, } fallthrough; case ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW: - if (asd->yuvpp_mode) - return IA_CSS_PIPE_ID_YUVPP; if (asd->copy_mode) return IA_CSS_PIPE_ID_COPY; if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 5ba5739c144b..d8d4c412f66a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -399,15 +399,6 @@ int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd) css_video_pipe_id = IA_CSS_PIPE_ID_COPY; } - if (asd->yuvpp_mode) { - capture_pipe = &asd->video_out_capture; - video_pipe = &asd->video_out_video_capture; - preview_pipe = &asd->video_out_preview; - css_capture_pipe_id = IA_CSS_PIPE_ID_COPY; - css_video_pipe_id = IA_CSS_PIPE_ID_YUVPP; - css_preview_pipe_id = IA_CSS_PIPE_ID_YUVPP; - } - if (capture_pipe) { buf_type = atomisp_get_css_buf_type( asd, css_capture_pipe_id, @@ -583,7 +574,6 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) asd->mipi_frame_size = 0; asd->copy_mode = false; - asd->yuvpp_mode = false; asd->stream_prepared = false; asd->high_speed_mode = false; diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h index 5583d6a02346..df6e2a8c5f84 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h @@ -330,7 +330,6 @@ struct atomisp_sub_device { unsigned int mipi_frame_size; bool copy_mode; /* CSI2+ use copy mode */ - bool yuvpp_mode; /* CSI2+ yuvpp pipe */ int raw_buffer_bitmap[ATOMISP_MAX_EXP_ID / 32 + 1]; /* Record each Raw Buffer lock status */ From patchwork Tue Feb 21 14:59:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 90004 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1pUU8Y-006Hq7-9H; Tue, 21 Feb 2023 15:00:58 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234596AbjBUPA4 (ORCPT + 1 other); Tue, 21 Feb 2023 10:00:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbjBUPAx (ORCPT ); Tue, 21 Feb 2023 10:00:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF7732B60C for ; Tue, 21 Feb 2023 07:00:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676991599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cCHQpVhGQcTxlg2tn6KMidOIFhUN3/xM0/6PlOWePJI=; b=GAjO7n6Vbs5QG41tCaiF2XH7gbMhIya506mrxSgcYbqMpKoLOpGZxNMxEDgQhwQyyDp8eD 4CyJdymO9yXjKi0zLbX2STaMLiJq9H9Ae3W2rgd0IVLXk8wwZXvcgUsFx5k4WjoOvJQedX M3JnaLyZaLRl+wH+IcrfIa3mMqlfLkc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-42-cXq6VLyWNfW62EdGlqZboQ-1; Tue, 21 Feb 2023 09:59:55 -0500 X-MC-Unique: cXq6VLyWNfW62EdGlqZboQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD82B811E9C; Tue, 21 Feb 2023 14:59:54 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.195.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95D562026D4B; Tue, 21 Feb 2023 14:59:51 +0000 (UTC) From: Hans de Goede To: Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Andy Shevchenko , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 10/10] media: atomisp: Remove online_process setting Date: Tue, 21 Feb 2023 15:59:06 +0100 Message-Id: <20230221145906.8113-11-hdegoede@redhat.com> In-Reply-To: <20230221145906.8113-1-hdegoede@redhat.com> References: <20230221145906.8113-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no online_process is always true, remove it. Signed-off-by: Hans de Goede --- .../staging/media/atomisp/pci/atomisp_cmd.c | 30 ++----------------- .../media/atomisp/pci/atomisp_compat.h | 4 --- .../media/atomisp/pci/atomisp_compat_css20.c | 8 ----- .../staging/media/atomisp/pci/atomisp_fops.c | 1 - .../media/atomisp/pci/atomisp_subdev.h | 4 --- 5 files changed, 3 insertions(+), 44 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 937cfe9489fc..b8112721f0a7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -1622,11 +1622,6 @@ int atomisp_formats(struct atomisp_sub_device *asd, int flag, void atomisp_free_internal_buffers(struct atomisp_sub_device *asd) { atomisp_free_css_parameters(&asd->params.css_param); - - if (asd->raw_output_frame) { - ia_css_frame_free(asd->raw_output_frame); - asd->raw_output_frame = NULL; - } } static void atomisp_update_grid_info(struct atomisp_sub_device *asd, @@ -4221,7 +4216,6 @@ static int css_input_resolution_changed(struct atomisp_sub_device *asd, static int atomisp_set_fmt_to_isp(struct video_device *vdev, struct ia_css_frame_info *output_info, - struct ia_css_frame_info *raw_output_info, struct v4l2_pix_format *pix, unsigned int source_pad) { @@ -4372,20 +4366,13 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, /* in case of ANR, force capture pipe to offline mode */ atomisp_css_capture_enable_online(asd, ATOMISP_INPUT_STREAM_GENERAL, - asd->params.low_light ? - false : asd->params.online_process); + !asd->params.low_light); configure_output = atomisp_css_capture_configure_output; get_frame_info = atomisp_css_capture_get_output_frame_info; configure_pp_input = atomisp_css_capture_configure_pp_input; pipe_id = IA_CSS_PIPE_ID_CAPTURE; - if (!asd->params.online_process) { - ret = atomisp_css_capture_get_output_raw_frame_info(asd, - raw_output_info); - if (ret) - return ret; - } if (asd->run_mode->val != ATOMISP_RUN_MODE_STILL_CAPTURE) { dev_err(isp->dev, "Need to set the running mode first\n"); @@ -4430,16 +4417,6 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, } atomisp_update_grid_info(asd, pipe_id, source_pad); - - /* Free the raw_dump buffer first */ - ia_css_frame_free(asd->raw_output_frame); - asd->raw_output_frame = NULL; - - if (!asd->params.online_process && - ia_css_frame_allocate_from_info(&asd->raw_output_frame, - raw_output_info)) - return -ENOMEM; - return 0; } @@ -4595,7 +4572,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) struct atomisp_sub_device *asd = pipe->asd; const struct atomisp_format_bridge *format_bridge; const struct atomisp_format_bridge *snr_format_bridge; - struct ia_css_frame_info output_info, raw_output_info; + struct ia_css_frame_info output_info; struct v4l2_pix_format snr_fmt; struct v4l2_pix_format backup_fmt, s_fmt; unsigned int dvs_env_w = 0, dvs_env_h = 0; @@ -4912,8 +4889,7 @@ int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f) } set_fmt_to_isp: - ret = atomisp_set_fmt_to_isp(vdev, &output_info, &raw_output_info, - &f->fmt.pix, source_pad); + ret = atomisp_set_fmt_to_isp(vdev, &output_info, &f->fmt.pix, source_pad); if (ret) { dev_warn(isp->dev, "Can't set format on ISP. Error %d\n", ret); return -EINVAL; diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat.h b/drivers/staging/media/atomisp/pci/atomisp_compat.h index 06d54c9bcb49..707509922784 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat.h +++ b/drivers/staging/media/atomisp/pci/atomisp_compat.h @@ -303,10 +303,6 @@ int atomisp_css_copy_get_output_frame_info( unsigned int stream_index, struct ia_css_frame_info *info); -int atomisp_css_capture_get_output_raw_frame_info( - struct atomisp_sub_device *asd, - struct ia_css_frame_info *info); - int atomisp_css_preview_get_output_frame_info( struct atomisp_sub_device *asd, struct ia_css_frame_info *info); diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 10be77c478b8..a1c1c9b1e806 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -2630,14 +2630,6 @@ int atomisp_css_capture_get_viewfinder_frame_info( ATOMISP_CSS_VF_FRAME, IA_CSS_PIPE_ID_CAPTURE); } -int atomisp_css_capture_get_output_raw_frame_info( - struct atomisp_sub_device *asd, - struct ia_css_frame_info *info) -{ - return __get_frame_info(asd, ATOMISP_INPUT_STREAM_GENERAL, info, - ATOMISP_CSS_RAW_FRAME, IA_CSS_PIPE_ID_CAPTURE); -} - int atomisp_css_copy_get_output_frame_info( struct atomisp_sub_device *asd, unsigned int stream_index, diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index d8d4c412f66a..7f757f510190 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -564,7 +564,6 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) asd->params.fpn_en = false; asd->params.xnr_en = false; asd->params.false_color = 0; - asd->params.online_process = 1; asd->params.yuv_ds_en = 0; /* s3a grid not enabled for any pipe */ asd->params.s3a_enabled_pipe = IA_CSS_PIPE_ID_NUM; diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h index df6e2a8c5f84..bcb0fe8d0538 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h @@ -183,9 +183,6 @@ struct atomisp_css_params { }; struct atomisp_subdev_params { - /* FIXME: Determines whether raw capture buffer are being passed to - * user space. Unimplemented for now. */ - int online_process; int yuv_ds_en; unsigned int color_effect; bool gdc_cac_en; @@ -303,7 +300,6 @@ struct atomisp_sub_device { spinlock_t dis_stats_lock; struct ia_css_frame *vf_frame; /* TODO: needed? */ - struct ia_css_frame *raw_output_frame; enum atomisp_frame_status frame_status[VIDEO_MAX_FRAME]; /* This field specifies which camera (v4l2 input) is selected. */