All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsuchiya Yuto <kitakar@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Hans de Goede <hdegoede@redhat.com>,
	Patrik Gfeller <patrik.gfeller@gmail.com>,
	Tsuchiya Yuto <kitakar@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Arnd Bergmann <arnd@arndb.de>, Kaixu Xia <kaixuxia@tencent.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [BUG/RFC PATCH 1/5] [BUG][RFC] media: atomisp: pci: assume run_mode is PREVIEW
Date: Mon, 18 Oct 2021 01:23:32 +0900	[thread overview]
Message-ID: <20211017162337.44860-2-kitakar@gmail.com> (raw)
In-Reply-To: <20211017162337.44860-1-kitakar@gmail.com>

This is almost a BUG report with a patch to just make atomisp work
again with the current mainline kernel. Thus, prefixed with [BUG][RFC].

RFC:
  1. When looking at the `case CI_MODE_NONE:`, it tries to do something.
     So, it should rather work with CI_MODE_NONE, too? Just I don't know
     how to configure userspace apps to use CI_MODE_NONE ?
  2. How can we re-add the run mode support again without relying on
     the s_parm ?

>8-----------------------------------------------------------------8<

After the commit 8a7c5594c020 ("media: v4l2-ioctl: clear fields in s_parm")
added on v4.18 (backported to v4.9.182 and v4.14.127), the capture mode
flag is cleared (except for V4L2_MODE_HIGHQUALITY).

Due to this, it seems that now we can't use this flag to set atomisp
run_mode. This results in capture not working with the following message
(loaded atomisp driver with dbg_level=1):

	kern  :warn  : [ 3658.776616] ia_css_pipe_get_info: ia_css_stream_create needs to be called before ia_css_[stream/pipe]_get_info
	kern  :err   : [ 3658.776641] atomisp-isp2 0000:00:03.0: get_frame_info 1920x1080 (padded to 0)
	kern  :warn  : [ 3658.776666] atomisp-isp2 0000:00:03.0: Can't set format on ISP. Error -22

So, when we can't detect run mode from the s_parm capturemode
(CI_MODE_NONE), let's assume the run mode is PREVIEW.

Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index c8a625667e81..6fc64f0ccc31 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -2638,7 +2638,11 @@ static int atomisp_s_parm(struct file *file, void *fh,
 				asd->high_speed_mode = true;
 		}
 
-		goto out;
+		dev_warn(isp->dev,
+			 "setting run_mode using s_parm capturemode is not supported anymore\n");
+		dev_warn(isp->dev, "assuming run_mode is PREVIEW\n");
+		mode = ATOMISP_RUN_MODE_PREVIEW;
+		break;
 	}
 	case CI_MODE_VIDEO:
 		mode = ATOMISP_RUN_MODE_VIDEO;
-- 
2.33.1


WARNING: multiple messages have this Message-ID (diff)
From: Tsuchiya Yuto <kitakar@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Patrik Gfeller <patrik.gfeller@gmail.com>,
	Tsuchiya Yuto <kitakar@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Arnd Bergmann <arnd@arndb.de>, Kaixu Xia <kaixuxia@tencent.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [BUG/RFC PATCH 1/5] [BUG][RFC] media: atomisp: pci: assume run_mode is PREVIEW
Date: Mon, 18 Oct 2021 01:23:32 +0900	[thread overview]
Message-ID: <20211017162337.44860-2-kitakar@gmail.com> (raw)
In-Reply-To: <20211017162337.44860-1-kitakar@gmail.com>

This is almost a BUG report with a patch to just make atomisp work
again with the current mainline kernel. Thus, prefixed with [BUG][RFC].

RFC:
  1. When looking at the `case CI_MODE_NONE:`, it tries to do something.
     So, it should rather work with CI_MODE_NONE, too? Just I don't know
     how to configure userspace apps to use CI_MODE_NONE ?
  2. How can we re-add the run mode support again without relying on
     the s_parm ?

>8-----------------------------------------------------------------8<

After the commit 8a7c5594c020 ("media: v4l2-ioctl: clear fields in s_parm")
added on v4.18 (backported to v4.9.182 and v4.14.127), the capture mode
flag is cleared (except for V4L2_MODE_HIGHQUALITY).

Due to this, it seems that now we can't use this flag to set atomisp
run_mode. This results in capture not working with the following message
(loaded atomisp driver with dbg_level=1):

	kern  :warn  : [ 3658.776616] ia_css_pipe_get_info: ia_css_stream_create needs to be called before ia_css_[stream/pipe]_get_info
	kern  :err   : [ 3658.776641] atomisp-isp2 0000:00:03.0: get_frame_info 1920x1080 (padded to 0)
	kern  :warn  : [ 3658.776666] atomisp-isp2 0000:00:03.0: Can't set format on ISP. Error -22

So, when we can't detect run mode from the s_parm capturemode
(CI_MODE_NONE), let's assume the run mode is PREVIEW.

Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index c8a625667e81..6fc64f0ccc31 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -2638,7 +2638,11 @@ static int atomisp_s_parm(struct file *file, void *fh,
 				asd->high_speed_mode = true;
 		}
 
-		goto out;
+		dev_warn(isp->dev,
+			 "setting run_mode using s_parm capturemode is not supported anymore\n");
+		dev_warn(isp->dev, "assuming run_mode is PREVIEW\n");
+		mode = ATOMISP_RUN_MODE_PREVIEW;
+		break;
 	}
 	case CI_MODE_VIDEO:
 		mode = ATOMISP_RUN_MODE_VIDEO;
-- 
2.33.1


  reply	other threads:[~2021-10-17 16:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-17 16:23 [BUG 0/5] bug reports for atomisp to make it work Tsuchiya Yuto
2021-10-17 16:23 ` Tsuchiya Yuto
2021-10-17 16:23 ` Tsuchiya Yuto [this message]
2021-10-17 16:23   ` [BUG/RFC PATCH 1/5] [BUG][RFC] media: atomisp: pci: assume run_mode is PREVIEW Tsuchiya Yuto
2021-10-29  9:02   ` Mauro Carvalho Chehab
2021-11-11  8:00     ` Tsuchiya Yuto
2021-10-17 16:23 ` [BUG/RFC PATCH 2/5] [BUG][RFC] media: atomisp: pci: remove dummy_ptr NULL check to avoid duplicate active_bo Tsuchiya Yuto
2021-10-17 16:23   ` Tsuchiya Yuto
2022-02-08  6:19   ` Mauro Carvalho Chehab
2021-10-17 16:23 ` [BUG/RFC PATCH 3/5] [BUG][RFC] media: atomisp: pci: add NULL check for asd obtained from atomisp_video_pipe Tsuchiya Yuto
2021-10-17 16:23   ` Tsuchiya Yuto
2021-11-02 13:02   ` Dan Carpenter
2021-11-02 14:44     ` Andy Shevchenko
2021-11-02 14:45       ` Andy Shevchenko
2021-11-02 15:05         ` Dan Carpenter
2021-11-02 15:49           ` Andy Shevchenko
2021-11-02 22:52             ` Mauro Carvalho Chehab
2021-11-08 15:48     ` Tsuchiya Yuto
2021-10-17 16:23 ` [BUG 4/5] [BUG] media: atomisp: `modprobe -r` not working well (dup video4linux, ATOMISP_SUBDEV_{0,1}) Tsuchiya Yuto
2021-10-17 16:23   ` Tsuchiya Yuto
2021-10-17 16:23 ` [BUG 5/5] [BUG] media: atomisp: atomisp causes touchscreen to stop working on Microsoft Surface 3 Tsuchiya Yuto
2021-10-17 16:23   ` Tsuchiya Yuto
2021-10-18  8:30   ` Hans de Goede
2021-10-21  9:52     ` Tsuchiya Yuto
2021-10-24  8:32       ` Hans de Goede
2021-10-26  9:35         ` Tsuchiya Yuto
2021-10-26 15:41           ` Hans de Goede
2021-10-27 16:07             ` Tsuchiya Yuto
2021-11-07 23:39       ` Hans de Goede
2021-11-08  7:41         ` Mauro Carvalho Chehab
2021-11-08  7:55           ` Hans de Goede
2021-11-08  8:01             ` Mauro Carvalho Chehab
2021-11-09  4:18             ` Tsuchiya Yuto
2021-11-09  9:08               ` Mauro Carvalho Chehab
2021-11-09  4:15         ` Tsuchiya Yuto
2021-11-09  7:35           ` Mauro Carvalho Chehab
2021-10-18  7:50 ` [BUG 0/5] bug reports for atomisp to make it work Hans de Goede
2021-10-18  8:10   ` Andy Shevchenko
2021-10-19 12:58     ` Tsuchiya Yuto
2021-10-19 14:06       ` Andy Shevchenko
2021-10-20  6:48 ` Mauro Carvalho Chehab
2021-10-20 12:35   ` Tsuchiya Yuto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211017162337.44860-2-kitakar@gmail.com \
    --to=kitakar@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=kaixuxia@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mingo@kernel.org \
    --cc=patrik.gfeller@gmail.com \
    --cc=peterz@infradead.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.