From patchwork Sat Feb 17 11:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561331 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E3E1657A7 for ; Sat, 17 Feb 2024 11:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169095; cv=none; b=SqP3dRpUy7n7XYI/yBZPKbiXC0muvz7MeiB2DiqHkUjlMiYma6iAg4B1V6FbRSr5RoZTFtrQQmWZHJ9/YcLkKB7vBe3BEu1YNCfr8urwu36Odh8bCK1+AErXGdfCJdqvvR0omNChJACiDVBKtHPZdfoXPuHK8ZNxgfIbwB13TME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169095; c=relaxed/simple; bh=Yy6ZhQGvdwv9I5KaiJCZGMizUUFt3DwUeRFu/bhR6LM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G4Gc5bcI1BK1B/OP3E4FWNJGeCPIdpusl5d3WthyIRVIffMg7yV6wCWfcffjh9j9D72x/2mhL9gShvTrBxFT7CtoI7OJK2sHNcZ/2Xfb4NVM5jObuL9Nu/OL5nJ2shoaMxLX4TpQjsEf3LE/67Ms5Evhh8T7sLK65chyWVFZdhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Q8An/jad; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Q8An/jad" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169092; 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=JxtKH/IxVhZWhUh595joMazU/KxejBiOVioc+RVztLE=; b=Q8An/jadDBRRgppFaPqkZgYSjii78mgTer47470FXFkn7Lyv+mnJwZ0Nm7dCR8ViMfjZW7 ajYdpXpQd6MXMagsjkcQk6MEdDOmW4tzLJHJLcQA2t8AbJxeQEWC+EHOdNah1uu5XT9eTc v6dfYSfeFBqQe/6Mjgxhx2NiutmVpg4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-PBD5ubZ6PBSumySnBg6Ggg-1; Sat, 17 Feb 2024 06:24:47 -0500 X-MC-Unique: PBD5ubZ6PBSumySnBg6Ggg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3410A29AC005; Sat, 17 Feb 2024 11:24:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF1AF1C1C7E3; Sat, 17 Feb 2024 11:24:45 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 1/9] media: atomisp: Remove isp_subdev_propagate() Date: Sat, 17 Feb 2024 12:24:30 +0100 Message-ID: <20240217112438.15240-2-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 isp_subdev_propagate() is a wrapper around atomisp_subdev_set_selection() which gets only used in a single place. Scall atomisp_subdev_set_selection() directly in that single place instead. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- .../media/atomisp/pci/atomisp_subdev.c | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index a87fc74159e2..8293bda0c681 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -287,35 +287,6 @@ static void isp_get_fmt_rect(struct v4l2_subdev *sd, } } -static void isp_subdev_propagate(struct v4l2_subdev *sd, - struct v4l2_subdev_state *sd_state, - u32 which, uint32_t pad, uint32_t target, - uint32_t flags) -{ - struct v4l2_mbus_framefmt *ffmt[ATOMISP_SUBDEV_PADS_NUM]; - struct v4l2_rect *crop[ATOMISP_SUBDEV_PADS_NUM], - *comp[ATOMISP_SUBDEV_PADS_NUM]; - - if (flags & V4L2_SEL_FLAG_KEEP_CONFIG) - return; - - isp_get_fmt_rect(sd, sd_state, which, ffmt, crop, comp); - - switch (pad) { - case ATOMISP_SUBDEV_PAD_SINK: { - struct v4l2_rect r = {0}; - - /* Only crop target supported on sink pad. */ - r.width = ffmt[pad]->width; - r.height = ffmt[pad]->height; - - atomisp_subdev_set_selection(sd, sd_state, which, pad, - target, flags, &r); - break; - } - } -} - static int isp_subdev_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_selection *sel) @@ -541,6 +512,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd, case ATOMISP_SUBDEV_PAD_SINK: { const struct atomisp_in_fmt_conv *fc = atomisp_find_in_fmt_conv(ffmt->code); + struct v4l2_rect r = {}; if (!fc) { fc = atomisp_in_fmt_conv; @@ -551,8 +523,12 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd, *__ffmt = *ffmt; - isp_subdev_propagate(sd, sd_state, which, pad, - V4L2_SEL_TGT_CROP, 0); + /* Propagate new ffmt to selection */ + r.width = ffmt->width; + r.height = ffmt->height; + /* Only crop target supported on sink pad. */ + atomisp_subdev_set_selection(sd, sd_state, which, pad, + V4L2_SEL_TGT_CROP, 0, &r); if (which == V4L2_SUBDEV_FORMAT_ACTIVE) { atomisp_css_input_set_resolution(isp_sd, From patchwork Sat Feb 17 11:24:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561332 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E3A9651BD for ; Sat, 17 Feb 2024 11:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169097; cv=none; b=ArShToJVpc4UR3ziER75qdd7W8ryzMeE3hLk6TUWUhYXOeWyuuPVakRiwJTp/+RaUMzuSLkJhIYy/ow5IM+jLfbuJ7t0EJKDXHtbeuoiLhBq2yi0yi6oYiqXXRKkZFjUifDAyrRtZtV6KHRdesZ2ZCl0CYZfDdaLJajW3+hY2Fs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169097; c=relaxed/simple; bh=UrCQQxu8wBrCARkGsA0k45w/EsXOxfOGkfpkKb/drr0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sY+pU85p+eWDw5klQC2WY9EPuUbTQUblU4fdBMkW+ePBdJpbWHEX7l9AYz5tyN0xd2EotjZVIfXiq730FisDGlXTj166WfqDeJsc8mxN9vh4TI+sfAH2TVp8XWlgaptZ0oitjQQZ7XvQvFNsdWxir5muwqLiYLrP6bgzKthg3zA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cy6iL3Q/; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cy6iL3Q/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169093; 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=7Jk/Wjgit8vPCUNupIftP3Nnf9Um0EqGRiw6KxRGK0w=; b=cy6iL3Q/SrVbcA5UIDn7xY2PXq00a68WPKjoGGlf0LcRzujc4B0/qnqyv9kohdbgVwMEUe yOoqls8bONXtmTO5rEaJ52ojXliUn8RuRTJ+i0Bt77QUkbmnGZg4nL2uo22V1GZGiq8O2k CZYpeSvmkaNH++d6pHyWzBwlL0DkibE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-Lb0kwEu4OouNRHcJdb4mJg-1; Sat, 17 Feb 2024 06:24:49 -0500 X-MC-Unique: Lb0kwEu4OouNRHcJdb4mJg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DDA8287B2A0; Sat, 17 Feb 2024 11:24:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 654BA1C1C7E2; Sat, 17 Feb 2024 11:24:47 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 2/9] media: atomisp: Rename atomisp_set_crop_and_fmt() Date: Sat, 17 Feb 2024 12:24:31 +0100 Message-ID: <20240217112438.15240-3-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Rename atomisp_set_crop_and_fmt() to atomisp_set_sensor_crop_and_fmt() to make clear that it operates on the sensor subdev. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 8593ba90605f..eb37bb6e41f9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -3721,9 +3721,9 @@ void atomisp_get_padding(struct atomisp_device *isp, u32 width, u32 height, *padding_h = max_t(u32, *padding_h, min_pad_h); } -static int atomisp_set_crop_and_fmt(struct atomisp_device *isp, - struct v4l2_mbus_framefmt *ffmt, - int which) +static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp, + struct v4l2_mbus_framefmt *ffmt, + int which) { struct atomisp_input_subdev *input = &isp->inputs[isp->asd.input_curr]; struct v4l2_subdev_selection sel = { @@ -3817,7 +3817,7 @@ int atomisp_try_fmt(struct atomisp_device *isp, struct v4l2_pix_format *f, dev_dbg(isp->dev, "try_mbus_fmt: try %ux%u\n", ffmt.width, ffmt.height); - ret = atomisp_set_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_TRY); + ret = atomisp_set_sensor_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_TRY); if (ret) return ret; @@ -4263,7 +4263,7 @@ static int atomisp_set_fmt_to_snr(struct video_device *vdev, const struct v4l2_p /* Disable dvs if resolution can't be supported by sensor */ if (asd->params.video_dis_en && asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { - ret = atomisp_set_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_TRY); + ret = atomisp_set_sensor_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_TRY); if (ret) return ret; @@ -4281,7 +4281,7 @@ static int atomisp_set_fmt_to_snr(struct video_device *vdev, const struct v4l2_p } } - ret = atomisp_set_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_ACTIVE); + ret = atomisp_set_sensor_crop_and_fmt(isp, &ffmt, V4L2_SUBDEV_FORMAT_ACTIVE); if (ret) return ret; From patchwork Sat Feb 17 11:24:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561333 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6E0F657AE for ; Sat, 17 Feb 2024 11:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169097; cv=none; b=kGyLFdcWZ/T9CNSoSypGa6J33wDucXA/zaDc8jFThjxz1GBBQIzsLuPIe1KG6S8vjpmr7PAAys/je/IJMO3H7bDd3ma0+gbCJhWZUqY85cTbsXlV6SWDrxzzcrMtp9oLdEpjzj5vGxdiB5Q7+RlKJcfat3n/KeSosmGBmbjmQEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169097; c=relaxed/simple; bh=wrY5hsk/7VGSEWxvstXo3h77Rosl0WWFusvFiGFVvTo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J+mtiCil2aq1FCaFTaOjt6/iT/PafjTRVJ/ITX+z4bKZoiLuBTe8K8UtCGJqc/TFnUo4oNGE1kgWTGQOuQH1xemxmkt2yaQSq6IQaB3dkeUDR/oN/Wub8EXjqi5dnVwJ7qn+EoqO+AURNuUlFfPMp3kvQ/FR061Be8HEZsM3GLE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VVPpKWfy; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VVPpKWfy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169094; 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=o5lg1lSxy7EYXyfmSlWrlwLP9RH/aRRWA+ZgpxSM3hU=; b=VVPpKWfyFAsa55Wl5V+UZcLdibZv8krxWH9dUfL/bwbxg6RhTtlYjMmtwLsUa44lArtRZy D/J8ftScvoAz2BbdtfTHvk2nv3De7n8etP/KJWV/Z8iNCmc80uM4teLiRaz/Rhu58lOZTc wAXWB33zvgqWGWvMxFazUecNTNwXWg4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-mHiUNi9QO_aLweMSRaDNSw-1; Sat, 17 Feb 2024 06:24:51 -0500 X-MC-Unique: mHiUNi9QO_aLweMSRaDNSw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 95A7429AC006; Sat, 17 Feb 2024 11:24:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B7421C1C7E3; Sat, 17 Feb 2024 11:24:49 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 3/9] media: atomisp: Remove custom VCM handling Date: Sat, 17 Feb 2024 12:24:32 +0100 Message-ID: <20240217112438.15240-4-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Remove the custom VCM handling, instead the VCM should be controlled through its own v4l2-subdev and the new ipu-bridge.c code already supports instantiating an i2c_client for this and setting up the necessary endpoints in the fwnode graph. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- .../media/atomisp/include/linux/atomisp.h | 3 - .../atomisp/include/linux/atomisp_platform.h | 5 +- .../media/atomisp/pci/atomisp_internal.h | 4 - .../staging/media/atomisp/pci/atomisp_ioctl.c | 86 +------------------ .../staging/media/atomisp/pci/atomisp_v4l2.c | 15 ---- 5 files changed, 3 insertions(+), 110 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index bbbd904b696a..d9a7a599038d 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -914,9 +914,6 @@ enum atomisp_burst_capture_options { /* VCM step time */ #define V4L2_CID_VCM_TIMING (V4L2_CID_CAMERA_LASTP1 + 12) -/* Query Focus Status */ -#define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_LASTP1 + 14) - /* number of frames to skip at stream start */ #define V4L2_CID_G_SKIP_FRAMES (V4L2_CID_CAMERA_LASTP1 + 17) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h index 487ef5846c24..2535402afd73 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h @@ -111,9 +111,8 @@ enum atomisp_input_format { enum intel_v4l2_subdev_type { RAW_CAMERA = 1, - CAMERA_MOTOR = 2, - LED_FLASH = 3, - TEST_PATTERN = 4, + LED_FLASH = 2, + TEST_PATTERN = 3, }; struct intel_v4l2_subdev_id { diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h index bba9bc64d447..ca8ed3a6b9b8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_internal.h +++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h @@ -134,9 +134,6 @@ struct atomisp_input_subdev { struct v4l2_rect active_rect; /* Sensor state for which == V4L2_SUBDEV_FORMAT_TRY calls */ struct v4l2_subdev_state *try_sd_state; - - struct v4l2_subdev *motor; - /* * To show this resource is used by * which stream, in ISP multiple stream mode @@ -210,7 +207,6 @@ struct atomisp_device { unsigned int input_cnt; struct atomisp_input_subdev inputs[ATOM_ISP_MAX_INPUTS]; struct v4l2_subdev *flash; - struct v4l2_subdev *motor; struct atomisp_regs saved_regs; struct atomisp_css_env css_env; diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index bb8e5e883b50..ef555054fdbf 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -557,7 +557,6 @@ static int atomisp_enum_input(struct file *file, void *fh, struct video_device *vdev = video_devdata(file); struct atomisp_device *isp = video_get_drvdata(vdev); int index = input->index; - struct v4l2_subdev *motor; if (index >= isp->input_cnt) return -EINVAL; @@ -569,28 +568,6 @@ static int atomisp_enum_input(struct file *file, void *fh, strscpy(input->name, isp->inputs[index].camera->name, sizeof(input->name)); - /* - * HACK: append actuator's name to sensor's - * As currently userspace can't talk directly to subdev nodes, this - * ioctl is the only way to enum inputs + possible external actuators - * for 3A tuning purpose. - */ - if (!IS_ISP2401) - motor = isp->inputs[index].motor; - else - motor = isp->motor; - - if (motor && strlen(motor->name) > 0) { - const int cur_len = strlen(input->name); - const int max_size = sizeof(input->name) - cur_len - 1; - - if (max_size > 1) { - input->name[cur_len] = '+'; - strscpy(&input->name[cur_len + 1], - motor->name, max_size); - } - } - input->type = V4L2_INPUT_TYPE_CAMERA; input->index = index; input->reserved[0] = isp->inputs[index].type; @@ -629,7 +606,6 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input) struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev); struct atomisp_sub_device *asd = pipe->asd; struct v4l2_subdev *camera = NULL; - struct v4l2_subdev *motor; int ret; ret = atomisp_pipe_check(pipe, true); @@ -666,17 +642,6 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input) return ret; } - if (!IS_ISP2401) { - motor = isp->inputs[input].motor; - } else { - motor = isp->motor; - if (motor) - ret = v4l2_subdev_call(motor, core, s_power, 1); - } - - if (motor) - ret = v4l2_subdev_call(motor, core, init, 1); - asd->input_curr = input; /* mark this camera is used by the current stream */ isp->inputs[input].asd = asd; @@ -1433,26 +1398,8 @@ static int atomisp_s_ctrl(struct file *file, void *fh, static int atomisp_queryctl(struct file *file, void *fh, struct v4l2_queryctrl *qc) { - int i, ret = -EINVAL; struct video_device *vdev = video_devdata(file); - struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; - struct atomisp_device *isp = video_get_drvdata(vdev); - - switch (qc->id) { - case V4L2_CID_FOCUS_ABSOLUTE: - case V4L2_CID_FOCUS_RELATIVE: - case V4L2_CID_FOCUS_STATUS: - if (!IS_ISP2401) { - return v4l2_queryctrl(isp->inputs[asd->input_curr].camera-> - ctrl_handler, qc); - } - /* ISP2401 */ - if (isp->motor) - return v4l2_queryctrl(isp->motor->ctrl_handler, qc); - else - return v4l2_queryctrl(isp->inputs[asd->input_curr]. - camera->ctrl_handler, qc); - } + int i, ret = -EINVAL; if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL) return ret; @@ -1478,16 +1425,10 @@ static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, struct video_device *vdev = video_devdata(file); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; struct atomisp_device *isp = video_get_drvdata(vdev); - struct v4l2_subdev *motor; struct v4l2_control ctrl; int i; int ret = 0; - if (!IS_ISP2401) - motor = isp->inputs[asd->input_curr].motor; - else - motor = isp->motor; - for (i = 0; i < c->count; i++) { ctrl.id = c->controls[i].id; ctrl.value = c->controls[i].value; @@ -1509,13 +1450,6 @@ static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, v4l2_g_ctrl(isp->inputs[asd->input_curr].camera-> ctrl_handler, &ctrl); break; - case V4L2_CID_FOCUS_ABSOLUTE: - case V4L2_CID_FOCUS_RELATIVE: - case V4L2_CID_FOCUS_STATUS: - case V4L2_CID_FOCUS_AUTO: - if (motor) - ret = v4l2_g_ctrl(motor->ctrl_handler, &ctrl); - break; case V4L2_CID_FLASH_STATUS: case V4L2_CID_FLASH_INTENSITY: case V4L2_CID_FLASH_TORCH_INTENSITY: @@ -1584,16 +1518,10 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, void *fh, struct video_device *vdev = video_devdata(file); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; struct atomisp_device *isp = video_get_drvdata(vdev); - struct v4l2_subdev *motor; struct v4l2_control ctrl; int i; int ret = 0; - if (!IS_ISP2401) - motor = isp->inputs[asd->input_curr].motor; - else - motor = isp->motor; - for (i = 0; i < c->count; i++) { struct v4l2_ctrl *ctr; @@ -1616,18 +1544,6 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, void *fh, isp->inputs[asd->input_curr].camera-> ctrl_handler, &ctrl); break; - case V4L2_CID_FOCUS_ABSOLUTE: - case V4L2_CID_FOCUS_RELATIVE: - case V4L2_CID_FOCUS_STATUS: - case V4L2_CID_FOCUS_AUTO: - if (motor) - ret = v4l2_s_ctrl(NULL, motor->ctrl_handler, - &ctrl); - else - ret = v4l2_s_ctrl(NULL, - isp->inputs[asd->input_curr]. - camera->ctrl_handler, &ctrl); - break; case V4L2_CID_FLASH_STATUS: case V4L2_CID_FLASH_INTENSITY: case V4L2_CID_FLASH_TORCH_INTENSITY: diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index f736e54c7df3..1a936dbe8eb4 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -823,13 +823,6 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) isp->sensor_lanes[mipi_port] = subdevs->lanes; isp->sensor_subdevs[subdevs->port] = subdevs->subdev; break; - case CAMERA_MOTOR: - if (isp->motor) { - dev_warn(isp->dev, "too many atomisp motors\n"); - continue; - } - isp->motor = subdevs->subdev; - break; case LED_FLASH: if (isp->flash) { dev_warn(isp->dev, "too many atomisp flash devices\n"); @@ -1066,14 +1059,6 @@ int atomisp_register_device_nodes(struct atomisp_device *isp) atomisp_init_sensor(input); - /* - * HACK: Currently VCM belongs to primary sensor only, but correct - * approach must be to acquire from platform code which sensor - * owns it. - */ - if (i == ATOMISP_CAMERA_PORT_PRIMARY) - input->motor = isp->motor; - err = media_create_pad_link(&input->camera->entity, 0, &isp->csi2_port[i].subdev.entity, CSI2_PAD_SINK, From patchwork Sat Feb 17 11:24:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561334 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7003657C1 for ; Sat, 17 Feb 2024 11:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169099; cv=none; b=aeaTkTWnwD85Bo6jMLu8OY7LE2AfOIUxPK7VDSf+EkoBZD8J8KOzmI8x2l78S3I1TuWciqcxYmti2f91cy4yc4Wk39b5amPWH/1A4QFMK7M+dHkwyLmvfxp+jEtUpnZXZ8ylWrLdMLpOzOk7WNhNLMXMXCaVDD5dVEuMuPKxt1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169099; c=relaxed/simple; bh=a9d4fkcb0BFPn59gHtHVoJPwdj5lYLO/Rh+er5M4XKo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qc1Iz8WYTrMo48EZly/KvD7ixJTrCtlPK0zZIpwsFe6wVbJKBY2ILOB7wVHn2EtfKjqf3MvzTUoRq3ixjoVdMxhvV7fkhq24m9mC3yX/VzTW9RXs5hXe0Vaf7DPnjOytlSrwy7H8hJEpKypWiWH65udMRq5DXchGdcmXLqb2HCE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MwJJa4ET; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MwJJa4ET" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169096; 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=n+mKSxLdVQJzI6hiIn7VNxIYUjVbfdt4KZD8j3an3UM=; b=MwJJa4ET1/varzBdJYAeLAsNUDAw7T8KS7/HTF9+K9D/0BgK4C/FwCBZmOQxWWyorad/wS oN33ydVAorf2B/i+VGb29nASTQakrV6l5YGcM6CUGrMShuPMmYIHGChIBa5WuVs/XjEc+x THc/CzZMrv1TT+SYeZuJO18vr191+mM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-Y1nWyGWaPFG8EdqkijlXDw-1; Sat, 17 Feb 2024 06:24:52 -0500 X-MC-Unique: Y1nWyGWaPFG8EdqkijlXDw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D8A5383D741; Sat, 17 Feb 2024 11:24:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7E6E1C1C7E2; Sat, 17 Feb 2024 11:24:50 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 4/9] media: atomisp: Remove ISP controls which get passed through to the camera Date: Sat, 17 Feb 2024 12:24:33 +0100 Message-ID: <20240217112438.15240-5-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Drop all ISP controls and ioctls which just get passed through to the camera subdev. Instead these calls should be done directly at the sensor subdev. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- .../media/atomisp/include/linux/atomisp.h | 21 -- .../staging/media/atomisp/pci/atomisp_ioctl.c | 248 ------------------ 2 files changed, 269 deletions(-) diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h index d9a7a599038d..b2735a008052 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h @@ -837,9 +837,6 @@ enum atomisp_burst_capture_options { #define ATOMISP_IOC_S_PARAMETERS \ _IOW('v', BASE_VIDIOC_PRIVATE + 32, struct atomisp_parameters) -#define ATOMISP_IOC_EXT_ISP_CTRL \ - _IOWR('v', BASE_VIDIOC_PRIVATE + 35, struct atomisp_ext_isp_ctrl) - #define ATOMISP_IOC_EXP_ID_UNLOCK \ _IOW('v', BASE_VIDIOC_PRIVATE + 36, int) @@ -909,19 +906,6 @@ enum atomisp_burst_capture_options { /* Set the flash mode (see enum atomisp_flash_mode) */ #define V4L2_CID_FLASH_MODE (V4L2_CID_CAMERA_LASTP1 + 10) -/* VCM slew control */ -#define V4L2_CID_VCM_SLEW (V4L2_CID_CAMERA_LASTP1 + 11) -/* VCM step time */ -#define V4L2_CID_VCM_TIMING (V4L2_CID_CAMERA_LASTP1 + 12) - -/* number of frames to skip at stream start */ -#define V4L2_CID_G_SKIP_FRAMES (V4L2_CID_CAMERA_LASTP1 + 17) - -/* Query sensor's 2A status */ -#define V4L2_CID_2A_STATUS (V4L2_CID_CAMERA_LASTP1 + 18) -#define V4L2_2A_STATUS_AE_READY BIT(0) -#define V4L2_2A_STATUS_AWB_READY BIT(1) - #define V4L2_CID_RUN_MODE (V4L2_CID_CAMERA_LASTP1 + 20) #define ATOMISP_RUN_MODE_VIDEO 1 #define ATOMISP_RUN_MODE_STILL_CAPTURE 2 @@ -952,11 +936,6 @@ enum atomisp_burst_capture_options { /* Disable digital zoom */ #define V4L2_CID_DISABLE_DZ (V4L2_CID_CAMERA_LASTP1 + 32) -#define V4L2_CID_TEST_PATTERN_COLOR_R (V4L2_CID_CAMERA_LASTP1 + 33) -#define V4L2_CID_TEST_PATTERN_COLOR_GR (V4L2_CID_CAMERA_LASTP1 + 34) -#define V4L2_CID_TEST_PATTERN_COLOR_GB (V4L2_CID_CAMERA_LASTP1 + 35) -#define V4L2_CID_TEST_PATTERN_COLOR_B (V4L2_CID_CAMERA_LASTP1 + 36) - #define V4L2_CID_ATOMISP_SELECT_ISP_VERSION (V4L2_CID_CAMERA_LASTP1 + 38) #define V4L2_BUF_FLAG_BUFFER_INVALID 0x0400 diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index ef555054fdbf..74cf055cb09b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -82,15 +82,6 @@ static struct v4l2_queryctrl ci_v4l2_controls[] = { .step = 1, .default_value = 0x00, }, - { - .id = V4L2_CID_POWER_LINE_FREQUENCY, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Light frequency filter", - .minimum = 1, - .maximum = 2, - .step = 1, - .default_value = 1, - }, { .id = V4L2_CID_COLORFX, .type = V4L2_CTRL_TYPE_INTEGER, @@ -100,15 +91,6 @@ static struct v4l2_queryctrl ci_v4l2_controls[] = { .step = 1, .default_value = 0, }, - { - .id = V4L2_CID_COLORFX_CBCR, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Image Color Effect CbCr", - .minimum = 0, - .maximum = 0xffff, - .step = 1, - .default_value = 0, - }, { .id = V4L2_CID_ATOMISP_BAD_PIXEL_DETECTION, .type = V4L2_CTRL_TYPE_INTEGER, @@ -172,142 +154,6 @@ static struct v4l2_queryctrl ci_v4l2_controls[] = { .step = 1, .default_value = 1, }, - { - .id = V4L2_CID_2A_STATUS, - .type = V4L2_CTRL_TYPE_BITMASK, - .name = "AE and AWB status", - .minimum = 0, - .maximum = V4L2_2A_STATUS_AE_READY | V4L2_2A_STATUS_AWB_READY, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "exposure", - .minimum = -4, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_EXPOSURE_ZONE_NUM, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "one-time exposure zone number", - .minimum = 0x0, - .maximum = 0xffff, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_EXPOSURE_AUTO_PRIORITY, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure auto priority", - .minimum = V4L2_EXPOSURE_AUTO, - .maximum = V4L2_EXPOSURE_APERTURE_PRIORITY, - .step = 1, - .default_value = V4L2_EXPOSURE_AUTO, - }, - { - .id = V4L2_CID_SCENE_MODE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "scene mode", - .minimum = 0, - .maximum = 13, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_ISO_SENSITIVITY, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "iso", - .minimum = -4, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_ISO_SENSITIVITY_AUTO, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "iso mode", - .minimum = V4L2_ISO_SENSITIVITY_MANUAL, - .maximum = V4L2_ISO_SENSITIVITY_AUTO, - .step = 1, - .default_value = V4L2_ISO_SENSITIVITY_AUTO, - }, - { - .id = V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "white balance", - .minimum = 0, - .maximum = 9, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_EXPOSURE_METERING, - .type = V4L2_CTRL_TYPE_MENU, - .name = "metering", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 1, - }, - { - .id = V4L2_CID_3A_LOCK, - .type = V4L2_CTRL_TYPE_BITMASK, - .name = "3a lock", - .minimum = 0, - .maximum = V4L2_LOCK_EXPOSURE | V4L2_LOCK_WHITE_BALANCE - | V4L2_LOCK_FOCUS, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_TEST_PATTERN, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Test Pattern", - .minimum = 0, - .maximum = 0xffff, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_TEST_PATTERN_COLOR_R, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Test Pattern Solid Color R", - .minimum = INT_MIN, - .maximum = INT_MAX, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_TEST_PATTERN_COLOR_GR, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Test Pattern Solid Color GR", - .minimum = INT_MIN, - .maximum = INT_MAX, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_TEST_PATTERN_COLOR_GB, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Test Pattern Solid Color GB", - .minimum = INT_MIN, - .maximum = INT_MAX, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_TEST_PATTERN_COLOR_B, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Test Pattern Solid Color B", - .minimum = INT_MIN, - .maximum = INT_MAX, - .step = 1, - .default_value = 0, - }, }; static const u32 ctrls_num = ARRAY_SIZE(ci_v4l2_controls); @@ -1248,7 +1094,6 @@ static int atomisp_g_ctrl(struct file *file, void *fh, { struct video_device *vdev = video_devdata(file); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; - struct atomisp_device *isp = video_get_drvdata(vdev); int i, ret = -EINVAL; for (i = 0; i < ctrls_num; i++) { @@ -1262,27 +1107,6 @@ static int atomisp_g_ctrl(struct file *file, void *fh, return ret; switch (control->id) { - case V4L2_CID_IRIS_ABSOLUTE: - case V4L2_CID_EXPOSURE_ABSOLUTE: - case V4L2_CID_2A_STATUS: - case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: - case V4L2_CID_EXPOSURE: - case V4L2_CID_EXPOSURE_AUTO: - case V4L2_CID_SCENE_MODE: - case V4L2_CID_ISO_SENSITIVITY: - case V4L2_CID_ISO_SENSITIVITY_AUTO: - case V4L2_CID_CONTRAST: - case V4L2_CID_SATURATION: - case V4L2_CID_SHARPNESS: - case V4L2_CID_3A_LOCK: - case V4L2_CID_EXPOSURE_ZONE_NUM: - case V4L2_CID_TEST_PATTERN: - case V4L2_CID_TEST_PATTERN_COLOR_R: - case V4L2_CID_TEST_PATTERN_COLOR_GR: - case V4L2_CID_TEST_PATTERN_COLOR_GB: - case V4L2_CID_TEST_PATTERN_COLOR_B: - return v4l2_g_ctrl(isp->inputs[asd->input_curr].camera-> - ctrl_handler, control); case V4L2_CID_COLORFX: ret = atomisp_color_effect(asd, 0, &control->value); break; @@ -1322,7 +1146,6 @@ static int atomisp_s_ctrl(struct file *file, void *fh, { struct video_device *vdev = video_devdata(file); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; - struct atomisp_device *isp = video_get_drvdata(vdev); int i, ret = -EINVAL; for (i = 0; i < ctrls_num; i++) { @@ -1336,28 +1159,6 @@ static int atomisp_s_ctrl(struct file *file, void *fh, return ret; switch (control->id) { - case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: - case V4L2_CID_EXPOSURE: - case V4L2_CID_EXPOSURE_AUTO: - case V4L2_CID_EXPOSURE_AUTO_PRIORITY: - case V4L2_CID_SCENE_MODE: - case V4L2_CID_ISO_SENSITIVITY: - case V4L2_CID_ISO_SENSITIVITY_AUTO: - case V4L2_CID_POWER_LINE_FREQUENCY: - case V4L2_CID_EXPOSURE_METERING: - case V4L2_CID_CONTRAST: - case V4L2_CID_SATURATION: - case V4L2_CID_SHARPNESS: - case V4L2_CID_3A_LOCK: - case V4L2_CID_COLORFX_CBCR: - case V4L2_CID_TEST_PATTERN: - case V4L2_CID_TEST_PATTERN_COLOR_R: - case V4L2_CID_TEST_PATTERN_COLOR_GR: - case V4L2_CID_TEST_PATTERN_COLOR_GB: - case V4L2_CID_TEST_PATTERN_COLOR_B: - return v4l2_s_ctrl(NULL, - isp->inputs[asd->input_curr].camera-> - ctrl_handler, control); case V4L2_CID_COLORFX: ret = atomisp_color_effect(asd, 1, &control->value); break; @@ -1398,7 +1199,6 @@ static int atomisp_s_ctrl(struct file *file, void *fh, static int atomisp_queryctl(struct file *file, void *fh, struct v4l2_queryctrl *qc) { - struct video_device *vdev = video_devdata(file); int i, ret = -EINVAL; if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL) @@ -1433,23 +1233,6 @@ static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, ctrl.id = c->controls[i].id; ctrl.value = c->controls[i].value; switch (ctrl.id) { - case V4L2_CID_EXPOSURE_ABSOLUTE: - case V4L2_CID_EXPOSURE_AUTO: - case V4L2_CID_IRIS_ABSOLUTE: - case V4L2_CID_3A_LOCK: - case V4L2_CID_TEST_PATTERN: - case V4L2_CID_TEST_PATTERN_COLOR_R: - case V4L2_CID_TEST_PATTERN_COLOR_GR: - case V4L2_CID_TEST_PATTERN_COLOR_GB: - case V4L2_CID_TEST_PATTERN_COLOR_B: - /* - * Exposure related control will be handled by sensor - * driver - */ - ret = - v4l2_g_ctrl(isp->inputs[asd->input_curr].camera-> - ctrl_handler, &ctrl); - break; case V4L2_CID_FLASH_STATUS: case V4L2_CID_FLASH_INTENSITY: case V4L2_CID_FLASH_TORCH_INTENSITY: @@ -1466,11 +1249,6 @@ static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, case V4L2_CID_ZOOM_ABSOLUTE: ret = atomisp_digital_zoom(asd, 0, &ctrl.value); break; - case V4L2_CID_G_SKIP_FRAMES: - ret = v4l2_subdev_call( - isp->inputs[asd->input_curr].camera, - sensor, g_skip_frames, (u32 *)&ctrl.value); - break; default: ret = -EINVAL; } @@ -1528,22 +1306,6 @@ static int atomisp_camera_s_ext_ctrls(struct file *file, void *fh, ctrl.id = c->controls[i].id; ctrl.value = c->controls[i].value; switch (ctrl.id) { - case V4L2_CID_EXPOSURE_ABSOLUTE: - case V4L2_CID_EXPOSURE_AUTO: - case V4L2_CID_EXPOSURE_METERING: - case V4L2_CID_IRIS_ABSOLUTE: - case V4L2_CID_VCM_TIMING: - case V4L2_CID_VCM_SLEW: - case V4L2_CID_3A_LOCK: - case V4L2_CID_TEST_PATTERN: - case V4L2_CID_TEST_PATTERN_COLOR_R: - case V4L2_CID_TEST_PATTERN_COLOR_GR: - case V4L2_CID_TEST_PATTERN_COLOR_GB: - case V4L2_CID_TEST_PATTERN_COLOR_B: - ret = v4l2_s_ctrl(NULL, - isp->inputs[asd->input_curr].camera-> - ctrl_handler, &ctrl); - break; case V4L2_CID_FLASH_STATUS: case V4L2_CID_FLASH_INTENSITY: case V4L2_CID_FLASH_TORCH_INTENSITY: @@ -1692,7 +1454,6 @@ static long atomisp_vidioc_default(struct file *file, void *fh, bool valid_prio, unsigned int cmd, void *arg) { struct video_device *vdev = video_devdata(file); - struct atomisp_device *isp = video_get_drvdata(vdev); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; int err; @@ -1839,11 +1600,6 @@ static long atomisp_vidioc_default(struct file *file, void *fh, err = atomisp_fixed_pattern_table(asd, arg); break; - case ATOMISP_IOC_S_EXPOSURE: - err = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, - core, ioctl, cmd, arg); - break; - case ATOMISP_IOC_S_ISP_SHD_TAB: err = atomisp_set_shading_table(asd, arg); break; @@ -1860,10 +1616,6 @@ static long atomisp_vidioc_default(struct file *file, void *fh, err = atomisp_set_parameters(vdev, arg); break; - case ATOMISP_IOC_EXT_ISP_CTRL: - err = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, - core, ioctl, cmd, arg); - break; case ATOMISP_IOC_EXP_ID_UNLOCK: err = atomisp_exp_id_unlock(asd, arg); break; From patchwork Sat Feb 17 11:24:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561335 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CF42657A9 for ; Sat, 17 Feb 2024 11:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169101; cv=none; b=TwnE/3lHkdJXN0MEAoe/TFrlgdrkc3qmviJNztSaRggTv0u7/Juge2dX+oZD5DhTxPm/GbG8M1/sqW56juEU3GxLoudaxpSLSROJz6/Gc0gDLvQZC5O/5GgpyYa060Ur6egLd1psW85fQ8ryjB4YrFCVUGmgB0VvL1H7M7JIyhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169101; c=relaxed/simple; bh=GhHWTQah4qAfwcyOiKugTZYg+iNzrMhg4TO18/Rhp7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MmTZXDGaYAVf9hoGmRrd3r3kd1Zt9GnJMYVLav3eVwX1mLk6kyuAq93tcnChEC1zf0MPomnAHXxYJPJqguGMC+kfoGGn7dyLJRCQyrItUFmlTWId20ml+lSveaESFUWZRDE+QdWv8B8cUt13LVl3E9vnAHLMKa7THI1b+QCNyG4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QFAvjR9x; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QFAvjR9x" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169099; 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=CJYlabdakQKxlJf7c7KUDCD4THOgNbpITlRwUK0S6Pc=; b=QFAvjR9xFwgCe7CX5YVw8fqDh5XyvHk6bvWDdloWzff238/ZQVZHEyytf2NXecTmRTjNsm X8aR6Ebs2nATUaQVoHtJX2v1sFXAg+Idyxc+AN6WfFj1wQ4e7/QVBg3bmc4cprr1f6YGWk F153k1ajZRmVf5fN58LJTk+p4ShMApA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-PcI-C41HNIy1inDFWs4NyA-1; Sat, 17 Feb 2024 06:24:54 -0500 X-MC-Unique: PcI-C41HNIy1inDFWs4NyA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06E3E811E79; Sat, 17 Feb 2024 11:24:54 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F0191C1C7E3; Sat, 17 Feb 2024 11:24:52 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 5/9] media: atomisp: Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev Date: Sat, 17 Feb 2024 12:24:34 +0100 Message-ID: <20240217112438.15240-6-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev, so that a proper /dev/v4l-subdev# gets created for it. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/pci/atomisp_subdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 8293bda0c681..7f1ca05ce54a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -802,7 +802,6 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd) sprintf(sd->name, "ATOMISP_SUBDEV"); v4l2_set_subdevdata(sd, asd); sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE; - sd->devnode = &asd->video_out.vdev; pads[ATOMISP_SUBDEV_PAD_SINK].flags = MEDIA_PAD_FL_SINK; pads[ATOMISP_SUBDEV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; From patchwork Sat Feb 17 11:24:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561336 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B3CE65BCB for ; Sat, 17 Feb 2024 11:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169103; cv=none; b=NN/jEcFsCI9MTgEvpcWMBdOLN0vDDTm0REzqsuh+9Ng3VJIZBQxCWFB9zPOBEj7WZNuS5u2H0JP/XrpWkrMXlf+FSSJ899woG/BjRzvzc+SeLIaKPGKDfzMMX2E71PwN8f9tWrrx07KYTqsv5rjJ1TRX5cz3iOTX0RclKo1M7pE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169103; c=relaxed/simple; bh=8NW5Lsd/1KLX4ZLoikxEDyI6ucdsbbpCST8y2JiTL94=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oNmnmM+nA9A4fp9eyIKM3au5HV1f6SVOI/p89m8pnzJLgpmhGCo5kGPeD90f1vZt8cXdWk+xfGqxtOP/rbaNFr65j0v9tJ00RsrmVoiVPND5v73vGWmtQEXSCGXW62TCfs5m2ei/jxBEwKHxg0Mncpijnn1n7NKvLlaWBmGr1sM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bljcv/DZ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bljcv/DZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169100; 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=GKKNqo4hqFWfY+GTeOdjGgs/exMxBIg6xVtevCFKBhw=; b=bljcv/DZvtJZEWxC8A6uoaZjHGV5es+UyQGl8jcSWVA7q3FI71LtbXtWg6kvyUQR2eeioN kkbJsRNZMzSxnPGhosXWhbTg8CamXGBmB94slSk5bg35K2a+1Mp5r/r6Y4vuv0Ay13OBev Qxm5o068K/98tLgiJ2QIl83VwBBdhso= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-fF38kjPFPOyevTBpnXvcDA-1; Sat, 17 Feb 2024 06:24:56 -0500 X-MC-Unique: fF38kjPFPOyevTBpnXvcDA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFB203806707; Sat, 17 Feb 2024 11:24:55 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 382611C1C7E6; Sat, 17 Feb 2024 11:24:54 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 6/9] media: atomisp: Add DMABUF support Date: Sat, 17 Feb 2024 12:24:35 +0100 Message-ID: <20240217112438.15240-7-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Add DMABUF support and while at it drop userptr support. Now that atomisp has been ported to videobuf2 this is trivial. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 1 + drivers/staging/media/atomisp/pci/atomisp_subdev.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 74cf055cb09b..fa6c9f0ea6eb 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1666,6 +1666,7 @@ const struct v4l2_ioctl_ops atomisp_ioctl_ops = { .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = atomisp_qbuf_wrapper, .vidioc_dqbuf = atomisp_dqbuf_wrapper, + .vidioc_expbuf = vb2_ioctl_expbuf, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, .vidioc_default = atomisp_vidioc_default, diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 7f1ca05ce54a..8253b6faf8cd 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -765,7 +765,7 @@ static int atomisp_init_subdev_pipe(struct atomisp_sub_device *asd, /* Init videobuf2 queue structure */ pipe->vb_queue.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - pipe->vb_queue.io_modes = VB2_MMAP | VB2_USERPTR; + pipe->vb_queue.io_modes = VB2_MMAP | VB2_DMABUF; pipe->vb_queue.buf_struct_size = sizeof(struct ia_css_frame); pipe->vb_queue.ops = &atomisp_vb2_ops; pipe->vb_queue.mem_ops = &vb2_vmalloc_memops; From patchwork Sat Feb 17 11:24:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561337 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9642B65BCD for ; Sat, 17 Feb 2024 11:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169105; cv=none; b=gnpk4pc3+CGQz8jaVuS2NTwUm6HYtMHfPXvLf1zphvTciGDWcygoBuOJFksncKYl5sK26qD2TtjXagarBdCD/6avra62s5MzZBdSN9RSZlcoVXRWT3B+gN6B683rWZX2mHznuyLO1o6AaJSX7WKUBy7LNtQb5XAmBYHvkwz2cxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169105; c=relaxed/simple; bh=az0juSVxRAm+2xPusheL0MEA2fzlp8Nt4iN47vXYwV0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QJ7tXhwNPR0gTRzFp7FUaKkZSUmBVdEXu7sx6JX/GqjTJtLHa6Yb2KFgmigEO/Q9v0MCMR1yJeIKJ/vO7oimPstOwNASUQga2BRa/jIrZi+nwuaRdmXPYwceFwI0pOE1i1kI9SW3H6vUk/uIbzOYzaGbTWdZKyLqgfRdX8I/Fnw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Du8Y4eh+; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Du8Y4eh+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169102; 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=aLyDg+vKCWtQHBB/yP8t49hpe+D3zz4E/SvOD24Eu0c=; b=Du8Y4eh+rHGZlTF76vIj8n/9VRfnQp71UViJgkd10SaBN4lLQ7agA/8xvgVsJadENQYYt0 ywEDim/VT3s9Mlz9Zv+MBZDaAwc3OeEMisTCySpkG18JYFEjbLXa6fd9NbZjOvjed/BvQ0 sJiyV4sGm2vKU0ORJk0B7rIgRj5gqFg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-zNfwzdCpOjOGU9dMbvtq4A-1; Sat, 17 Feb 2024 06:24:58 -0500 X-MC-Unique: zNfwzdCpOjOGU9dMbvtq4A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6750D3806707; Sat, 17 Feb 2024 11:24:57 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0D241C1C7E3; Sat, 17 Feb 2024 11:24:55 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 7/9] media: atomisp: Change ISP subdev name to "ATOM ISP" Date: Sat, 17 Feb 2024 12:24:36 +0100 Message-ID: <20240217112438.15240-8-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Change the generic "ATOMISP_SUBDEV" name to "ATOM ISP" to make clear that this is the subdev for the ISP itself. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- drivers/staging/media/atomisp/pci/atomisp_subdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 8253b6faf8cd..822fe7d129e2 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -799,7 +799,7 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *asd) int ret; v4l2_subdev_init(sd, &isp_subdev_v4l2_ops); - sprintf(sd->name, "ATOMISP_SUBDEV"); + sprintf(sd->name, "ATOM ISP"); v4l2_set_subdevdata(sd, asd); sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE; From patchwork Sat Feb 17 11:24:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561338 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8107865BC0 for ; Sat, 17 Feb 2024 11:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169109; cv=none; b=NpC3umxSWDXMtMWv3DsEQVrIx3libLzowNtqh2Pmxm83HsaVccM5T0vHOHFNTk4iNVdkDHR+657qKDX07YKDH3ouTbrnqRXl3ze/OuSoQhswBR9eM0zG/T85Jm5PtG4aCh8PMVQHA/3TuxyQFB5xuscwuZK+Eopm+T0sp2JEAI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169109; c=relaxed/simple; bh=HmbcnKcq48Ewn+Xcm3fpubqQrcEZ0pdlF+AQkNIKtaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ymv+UgdAIFCDSvMrrZqTXfk16zRYGz63uICyPbCywNjO0TcFdtOIZBzoceyQz6u0BKSub/XtyCq3Q5T2L3jFh9Vx/X/TrXy3B7c7VGOqYHOyEN+Mod36q0dP0C5ck/wxXSAQQmCJxX+fMFi86fmXUc/+P4LIWoAI0eAJRw+WYW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=igBr6WX4; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="igBr6WX4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169106; 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=HWflT3B0GVFI1GShcjGRlxXP08PiFbjDEA1rai0ECtE=; b=igBr6WX4pj91ongBm036Zo3WgoDsbb7jBVlTrKoVu5WbFP2Dk47E05SXWhJjY69cny3SvY F4YEInHYfyrb/BFM8n+kQExr0NrqAWfsRfRi/PwLWV1gdT9w05yeVG2MT7wf6NbzF8J0nr fc+TOsgfcgq409hkI4s/l1o7k1iSfF8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-Snku9i4fMOqkeym8lWH-YA-1; Sat, 17 Feb 2024 06:24:59 -0500 X-MC-Unique: Snku9i4fMOqkeym8lWH-YA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FFDC3C0008A; Sat, 17 Feb 2024 11:24:59 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9886F1C1C7E6; Sat, 17 Feb 2024 11:24:57 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 8/9] media: atomisp: Make MC link from ISP to /dev/video# output node immutable Date: Sat, 17 Feb 2024 12:24:37 +0100 Message-ID: <20240217112438.15240-9-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 The link from the ISP's source pad to the /dev/video# output v4l2-dev is always enabled and immutable, mark it as such. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham --- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 1a936dbe8eb4..86028721e7cb 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1090,7 +1090,8 @@ int atomisp_register_device_nodes(struct atomisp_device *isp) return err; err = media_create_pad_link(&isp->asd.subdev.entity, ATOMISP_SUBDEV_PAD_SOURCE, - &isp->asd.video_out.vdev.entity, 0, 0); + &isp->asd.video_out.vdev.entity, 0, + MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE); if (err) return err; From patchwork Sat Feb 17 11:24:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13561339 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4906065BAA for ; Sat, 17 Feb 2024 11:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169109; cv=none; b=L0kMYULOqYZ9euC4R1IsdMlwaPUjowhA7S/H/6+K+8Za36GK+s0sISGcmCFmMfI4uKQvdEn3IIn93emprLCdzE6skOxT2GBoAqOcMBaFss/b2Es30MinuKsY2XlZ8rp2vwibimD04LwJM91M4BPdmZDkxbLChsRzApfzip4VF6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708169109; c=relaxed/simple; bh=LBdizpIdfxKhNb6xt+BBwC5JRMC7DKJqrZW0ugICFg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NuLNBrkjR7noGcN4B5X4KOHNMDImEWDTCzfQbDWHbwr7LiFbDh87Pztddxfzf/SdL0T0KhF1gndXs3JHauV+zcQP+s997B5Q69laJVlgEjSpb7+QzBjboTJ9Y3tN1noF+/fY/lzKCFskI9NxTd/mn+ZjP2awbPNKW8OIYIJkN70= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FYOpr0wt; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FYOpr0wt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708169107; 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=YnD/bpJNWsWwe9bikQDt+Bd0F5krXrJasXs0pkYTi68=; b=FYOpr0wtuovrORxO2U9FPRYVJWB24IJHFBPX2pdAyeYtu+PLPJWl4XKqyDh0LxwBHzOkRC 1heEqE1er6GTrlmOjR6rqXJCCzN9n71LFTGLsN4Q/MW7UugJ4xOVV3jpyMYIzmCYyhpP27 5VLMqXVw5gB0kPX0irXUUeCQLhD0bR4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-pLvs6qLuOu6GDtAvGoFALQ-1; Sat, 17 Feb 2024 06:25:01 -0500 X-MC-Unique: pLvs6qLuOu6GDtAvGoFALQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CBC9C828CE2; Sat, 17 Feb 2024 11:25:00 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50CE31C1C7E7; Sat, 17 Feb 2024 11:24:59 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 9/9] media: atomisp: Implement link_setup op for ISP subdev MC entity Date: Sat, 17 Feb 2024 12:24:38 +0100 Message-ID: <20240217112438.15240-10-hdegoede@redhat.com> In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com> References: <20240217112438.15240-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 The atomisp driver's Android heritage makes it weird in that even though it uses MC + subdev-s it is designed to primarily be controlled through its /dev/video# node. It implements s_input on /dev/video# to select which sensor to use, while ignoring setup_link calls to enable a link to another sensor. Add support for selecting the active sensor the MC way by adding setup_link support. The implementation is a bit convoluted due to the atomisp driver's heritage. Signed-off-by: Hans de Goede --- .../media/atomisp/pci/atomisp_subdev.c | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c index 822fe7d129e2..17819d7586dd 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c @@ -30,6 +30,7 @@ #include "atomisp_common.h" #include "atomisp_compat.h" #include "atomisp_fops.h" +#include "atomisp_ioctl.h" #include "atomisp_internal.h" const struct atomisp_in_fmt_conv atomisp_in_fmt_conv[] = { @@ -634,8 +635,59 @@ static void isp_subdev_init_params(struct atomisp_sub_device *asd) } /* media operations */ +static int atomisp_link_setup(struct media_entity *entity, + const struct media_pad *local, + const struct media_pad *remote, u32 flags) +{ + struct v4l2_subdev *sd = container_of(entity, struct v4l2_subdev, + entity); + struct atomisp_sub_device *asd = v4l2_get_subdevdata(sd); + struct atomisp_device *isp = asd->isp; + int i, csi_idx, ret; + + /* ISP's source is immutable */ + if (local != &asd->pads[ATOMISP_SUBDEV_PAD_SINK]) { + v4l2_err(sd, "Error pad %d does not support changing flags\n", + local->index); + return -EINVAL; + } + + for (csi_idx = 0; csi_idx < ATOMISP_CAMERA_NR_PORTS; csi_idx++) { + if (&isp->csi2_port[csi_idx].pads[CSI2_PAD_SOURCE] == remote) + break; + } + + if (csi_idx == ATOMISP_CAMERA_NR_PORTS) { + v4l2_err(sd, "Error cannot find CSI receiver for remote pad\n"); + return -EINVAL; + } + + /* Ignore disables, input_curr should only be updated on enables */ + if (!(flags & MEDIA_LNK_FL_ENABLED)) + return 0; + + for (i = 0; i < isp->input_cnt; i++) { + if (isp->inputs[i].camera == isp->sensor_subdevs[csi_idx]) + break; + } + + if (i == isp->input_cnt) { + v4l2_err(sd, "Error no sensor for CSI receiver %d\n", csi_idx); + return -EINVAL; + } + + mutex_lock(&isp->mutex); + ret = atomisp_pipe_check(&asd->video_out, true); + if (ret == 0) + asd->input_curr = i; + mutex_unlock(&isp->mutex); + + return ret; +} + static const struct media_entity_operations isp_subdev_media_ops = { .link_validate = v4l2_subdev_link_validate, + .link_setup = atomisp_link_setup, /* .set_power = v4l2_subdev_set_power, */ };