Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1369961 > unrolled thread
| Started by | Robert Jarzmik <robert.jarzmik@free.fr> |
|---|---|
| First post | 2016-04-02 16:30 +0200 |
| Last post | 2016-04-04 08:30 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH RFC v2 0/2] pxa_camera transition to v4l2 standalone device Robert Jarzmik <robert.jarzmik@free.fr> - 2016-04-02 16:30 +0200
[PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus Robert Jarzmik <robert.jarzmik@free.fr> - 2016-04-02 16:30 +0200
Re: [PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus Guennadi Liakhovetski <g.liakhovetski@gmx.de> - 2016-04-06 06:00 +0200
Re: [PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus Robert Jarzmik <robert.jarzmik@free.fr> - 2016-04-06 08:50 +0200
Re: [PATCH RFC v2 0/2] pxa_camera transition to v4l2 standalone device Hans Verkuil <hverkuil@xs4all.nl> - 2016-04-03 19:50 +0200
Re: [PATCH RFC v2 0/2] pxa_camera transition to v4l2 standalone device Robert Jarzmik <robert.jarzmik@free.fr> - 2016-04-04 08:30 +0200
| From | Robert Jarzmik <robert.jarzmik@free.fr> |
|---|---|
| Date | 2016-04-02 16:30 +0200 |
| Subject | [PATCH RFC v2 0/2] pxa_camera transition to v4l2 standalone device |
| Message-ID | <rjuIN-531-7@gated-at.bofh.it> |
Hi Hans and Guennadi,
This is the second opus of this RFC. The goal is still to see how close our
ports are to see if there are things we could either reuse of change.
From RFCv1, the main change is cleaning up in function names and functions
grouping, and fixes to make v4l2-compliance happy while live tests still show no
regression.
For the next steps, I'll have to :
- split the second patch, which will be a headache task, into :
- first functions grouping and renaming
=> this to ensure the "internal functions" are almost untouched
- the the port itself
I'm leaving soc_mediabus for now, that's another task.
I'm not seeing a big review traction, especially on the vb2 conversion, so I'll
leave this patchset in RFC form until vb2 patch is reviewed and merged, and then
will come back to this work.
For information, here is the result of v4l2-compliance -s.
Driver Info:
Driver name : pxa27x-camera
Card type : PXA_Camera
Bus info : platform:pxa-camera
Driver version: 4.6.0
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Compliance test for device /dev/video0 (not using libv4l2):
Required ioctls:
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK
test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
Test input 0:
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
warn: v4l2-test-formats.cpp(713): TRY_FMT cannot handle an invalid pixelformat.
warn: v4l2-test-formats.cpp(714): This may or may not be a problem. For more information see:
warn: v4l2-test-formats.cpp(715): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
test VIDIOC_TRY_FMT: OK
warn: v4l2-test-formats.cpp(933): S_FMT cannot handle an invalid pixelformat.
warn: v4l2-test-formats.cpp(934): This may or may not be a problem. For more information see:
warn: v4l2-test-formats.cpp(935): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
Test input 0:
Streaming ioctls:
test read/write: OK (Not Supported)
test MMAP: OK
test USERPTR: OK
test DMABUF: Cannot test, specify --expbuf-device
Total: 45, Succeeded: 45, Failed: 0, Warnings: 6
Robert Jarzmik (2):
media: platform: transfer format translations to soc_mediabus
media: platform: pxa_camera: make a standalone v4l2 device
drivers/media/platform/soc_camera/pxa_camera.c | 1086 ++++++++++++----------
drivers/media/platform/soc_camera/soc_camera.c | 7 +-
drivers/media/platform/soc_camera/soc_mediabus.c | 65 ++
include/linux/platform_data/media/camera-pxa.h | 2 +
include/media/drv-intf/soc_mediabus.h | 22 +
include/media/soc_camera.h | 15 -
6 files changed, 708 insertions(+), 489 deletions(-)
--
2.1.4
[toc] | [next] | [standalone]
| From | Robert Jarzmik <robert.jarzmik@free.fr> |
|---|---|
| Date | 2016-04-02 16:30 +0200 |
| Subject | [PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus |
| Message-ID | <rjuIO-531-15@gated-at.bofh.it> |
| In reply to | #1369961 |
Transfer the formats translations to soc_mediabus. Even is soc_camera
was to be deprecated, soc_mediabus will survive, and should describe all
that happens on the bus connecting the image processing unit of the SoC
and the sensor.
The translation engine provides an easy way to compute the formats
available in the v4l2 device, given any sensors format capabilities
bound with known image processing transformations.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/media/platform/soc_camera/soc_camera.c | 7 +--
drivers/media/platform/soc_camera/soc_mediabus.c | 65 ++++++++++++++++++++++++
include/media/drv-intf/soc_mediabus.h | 22 ++++++++
include/media/soc_camera.h | 15 ------
4 files changed, 88 insertions(+), 21 deletions(-)
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 46c7186f7867..039524a20056 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -204,12 +204,7 @@ static void soc_camera_clock_stop(struct soc_camera_host *ici)
const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
struct soc_camera_device *icd, unsigned int fourcc)
{
- unsigned int i;
-
- for (i = 0; i < icd->num_user_formats; i++)
- if (icd->user_formats[i].host_fmt->fourcc == fourcc)
- return icd->user_formats + i;
- return NULL;
+ return soc_mbus_xlate_by_fourcc(icd->user_formats, fourcc);
}
EXPORT_SYMBOL(soc_camera_xlate_by_fourcc);
diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
index e3e665e1c503..95c13055f50f 100644
--- a/drivers/media/platform/soc_camera/soc_mediabus.c
+++ b/drivers/media/platform/soc_camera/soc_mediabus.c
@@ -10,6 +10,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/slab.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mediabus.h>
@@ -512,6 +513,70 @@ unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
}
EXPORT_SYMBOL(soc_mbus_config_compatible);
+struct soc_camera_format_xlate *soc_mbus_build_fmts_xlate(
+ struct v4l2_device *v4l2_dev, struct v4l2_subdev *subdev,
+ int (*get_formats)(struct v4l2_device *, unsigned int,
+ struct soc_camera_format_xlate *xlate))
+{
+ unsigned int i, fmts = 0, raw_fmts = 0;
+ int ret;
+ struct v4l2_subdev_mbus_code_enum code = {
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+ };
+ struct soc_camera_format_xlate *user_formats;
+
+ while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) {
+ raw_fmts++;
+ code.index++;
+ }
+
+ /*
+ * First pass - only count formats this host-sensor
+ * configuration can provide
+ */
+ for (i = 0; i < raw_fmts; i++) {
+ ret = get_formats(v4l2_dev, i, NULL);
+ if (ret < 0)
+ return ERR_PTR(ret);
+ fmts += ret;
+ }
+
+ if (!fmts)
+ return ERR_PTR(-ENXIO);
+
+ user_formats = kcalloc(fmts + 1, sizeof(*user_formats), GFP_KERNEL);
+ if (!user_formats)
+ return ERR_PTR(-ENOMEM);
+
+ /* Second pass - actually fill data formats */
+ fmts = 0;
+ for (i = 0; i < raw_fmts; i++) {
+ ret = get_formats(v4l2_dev, i, user_formats + fmts);
+ if (ret < 0)
+ goto egfmt;
+ fmts += ret;
+ }
+ user_formats[fmts].code = 0;
+
+ return user_formats;
+egfmt:
+ kfree(user_formats);
+ return ERR_PTR(ret);
+}
+EXPORT_SYMBOL(soc_mbus_build_fmts_xlate);
+
+const struct soc_camera_format_xlate *soc_mbus_xlate_by_fourcc(
+ struct soc_camera_format_xlate *user_formats, unsigned int fourcc)
+{
+ unsigned int i;
+
+ for (i = 0; user_formats[i].code; i++)
+ if (user_formats[i].host_fmt->fourcc == fourcc)
+ return user_formats + i;
+ return NULL;
+}
+EXPORT_SYMBOL(soc_mbus_xlate_by_fourcc);
+
static int __init soc_mbus_init(void)
{
return 0;
diff --git a/include/media/drv-intf/soc_mediabus.h b/include/media/drv-intf/soc_mediabus.h
index 2ff773785fb6..08af52f6338c 100644
--- a/include/media/drv-intf/soc_mediabus.h
+++ b/include/media/drv-intf/soc_mediabus.h
@@ -95,6 +95,21 @@ struct soc_mbus_lookup {
struct soc_mbus_pixelfmt fmt;
};
+/**
+ * struct soc_camera_format_xlate - match between host and sensor formats
+ * @code: code of a sensor provided format
+ * @host_fmt: host format after host translation from code
+ *
+ * Host and sensor translation structure. Used in table of host and sensor
+ * formats matchings in soc_camera_device. A host can override the generic list
+ * generation by implementing get_formats(), and use it for format checks and
+ * format setup.
+ */
+struct soc_camera_format_xlate {
+ u32 code;
+ const struct soc_mbus_pixelfmt *host_fmt;
+};
+
const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
u32 code,
const struct soc_mbus_lookup *lookup,
@@ -108,5 +123,12 @@ int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
unsigned int *numerator, unsigned int *denominator);
unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
unsigned int flags);
+struct soc_camera_format_xlate *soc_mbus_build_fmts_xlate(
+ struct v4l2_device *v4l2_dev, struct v4l2_subdev *subdev,
+ int (*get_formats)(struct v4l2_device *, unsigned int,
+ struct soc_camera_format_xlate *xlate));
+const struct soc_camera_format_xlate *soc_mbus_xlate_by_fourcc(
+ struct soc_camera_format_xlate *user_formats, unsigned int fourcc);
+
#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 97aa13314bfd..db6ea91d5cb0 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -285,21 +285,6 @@ void soc_camera_host_unregister(struct soc_camera_host *ici);
const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
struct soc_camera_device *icd, unsigned int fourcc);
-/**
- * struct soc_camera_format_xlate - match between host and sensor formats
- * @code: code of a sensor provided format
- * @host_fmt: host format after host translation from code
- *
- * Host and sensor translation structure. Used in table of host and sensor
- * formats matchings in soc_camera_device. A host can override the generic list
- * generation by implementing get_formats(), and use it for format checks and
- * format setup.
- */
-struct soc_camera_format_xlate {
- u32 code;
- const struct soc_mbus_pixelfmt *host_fmt;
-};
-
#define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
/**
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
|---|---|
| Date | 2016-04-06 06:00 +0200 |
| Subject | Re: [PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus |
| Message-ID | <rkMNk-6gt-17@gated-at.bofh.it> |
| In reply to | #1369963 |
Hi Robert,
Not sure I understand, what should the purpose of this patch be? Why do
you want to move some function(s) from one file to another? And you aren't
even calling the new soc_mbus_build_fmts_xlate() function, and you aren't
replacing the currently used analogous soc_camera_init_user_formats()
function. Or was this patch not-to-be-reviewed?
Thanks
Guennadi
On Sat, 2 Apr 2016, Robert Jarzmik wrote:
> Transfer the formats translations to soc_mediabus. Even is soc_camera
> was to be deprecated, soc_mediabus will survive, and should describe all
> that happens on the bus connecting the image processing unit of the SoC
> and the sensor.
>
> The translation engine provides an easy way to compute the formats
> available in the v4l2 device, given any sensors format capabilities
> bound with known image processing transformations.
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
> drivers/media/platform/soc_camera/soc_camera.c | 7 +--
> drivers/media/platform/soc_camera/soc_mediabus.c | 65 ++++++++++++++++++++++++
> include/media/drv-intf/soc_mediabus.h | 22 ++++++++
> include/media/soc_camera.h | 15 ------
> 4 files changed, 88 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
> index 46c7186f7867..039524a20056 100644
> --- a/drivers/media/platform/soc_camera/soc_camera.c
> +++ b/drivers/media/platform/soc_camera/soc_camera.c
> @@ -204,12 +204,7 @@ static void soc_camera_clock_stop(struct soc_camera_host *ici)
> const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
> struct soc_camera_device *icd, unsigned int fourcc)
> {
> - unsigned int i;
> -
> - for (i = 0; i < icd->num_user_formats; i++)
> - if (icd->user_formats[i].host_fmt->fourcc == fourcc)
> - return icd->user_formats + i;
> - return NULL;
> + return soc_mbus_xlate_by_fourcc(icd->user_formats, fourcc);
> }
> EXPORT_SYMBOL(soc_camera_xlate_by_fourcc);
>
> diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
> index e3e665e1c503..95c13055f50f 100644
> --- a/drivers/media/platform/soc_camera/soc_mediabus.c
> +++ b/drivers/media/platform/soc_camera/soc_mediabus.c
> @@ -10,6 +10,7 @@
>
> #include <linux/kernel.h>
> #include <linux/module.h>
> +#include <linux/slab.h>
>
> #include <media/v4l2-device.h>
> #include <media/v4l2-mediabus.h>
> @@ -512,6 +513,70 @@ unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
> }
> EXPORT_SYMBOL(soc_mbus_config_compatible);
>
> +struct soc_camera_format_xlate *soc_mbus_build_fmts_xlate(
> + struct v4l2_device *v4l2_dev, struct v4l2_subdev *subdev,
> + int (*get_formats)(struct v4l2_device *, unsigned int,
> + struct soc_camera_format_xlate *xlate))
> +{
> + unsigned int i, fmts = 0, raw_fmts = 0;
> + int ret;
> + struct v4l2_subdev_mbus_code_enum code = {
> + .which = V4L2_SUBDEV_FORMAT_ACTIVE,
> + };
> + struct soc_camera_format_xlate *user_formats;
> +
> + while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) {
> + raw_fmts++;
> + code.index++;
> + }
> +
> + /*
> + * First pass - only count formats this host-sensor
> + * configuration can provide
> + */
> + for (i = 0; i < raw_fmts; i++) {
> + ret = get_formats(v4l2_dev, i, NULL);
> + if (ret < 0)
> + return ERR_PTR(ret);
> + fmts += ret;
> + }
> +
> + if (!fmts)
> + return ERR_PTR(-ENXIO);
> +
> + user_formats = kcalloc(fmts + 1, sizeof(*user_formats), GFP_KERNEL);
> + if (!user_formats)
> + return ERR_PTR(-ENOMEM);
> +
> + /* Second pass - actually fill data formats */
> + fmts = 0;
> + for (i = 0; i < raw_fmts; i++) {
> + ret = get_formats(v4l2_dev, i, user_formats + fmts);
> + if (ret < 0)
> + goto egfmt;
> + fmts += ret;
> + }
> + user_formats[fmts].code = 0;
> +
> + return user_formats;
> +egfmt:
> + kfree(user_formats);
> + return ERR_PTR(ret);
> +}
> +EXPORT_SYMBOL(soc_mbus_build_fmts_xlate);
> +
> +const struct soc_camera_format_xlate *soc_mbus_xlate_by_fourcc(
> + struct soc_camera_format_xlate *user_formats, unsigned int fourcc)
> +{
> + unsigned int i;
> +
> + for (i = 0; user_formats[i].code; i++)
> + if (user_formats[i].host_fmt->fourcc == fourcc)
> + return user_formats + i;
> + return NULL;
> +}
> +EXPORT_SYMBOL(soc_mbus_xlate_by_fourcc);
> +
> static int __init soc_mbus_init(void)
> {
> return 0;
> diff --git a/include/media/drv-intf/soc_mediabus.h b/include/media/drv-intf/soc_mediabus.h
> index 2ff773785fb6..08af52f6338c 100644
> --- a/include/media/drv-intf/soc_mediabus.h
> +++ b/include/media/drv-intf/soc_mediabus.h
> @@ -95,6 +95,21 @@ struct soc_mbus_lookup {
> struct soc_mbus_pixelfmt fmt;
> };
>
> +/**
> + * struct soc_camera_format_xlate - match between host and sensor formats
> + * @code: code of a sensor provided format
> + * @host_fmt: host format after host translation from code
> + *
> + * Host and sensor translation structure. Used in table of host and sensor
> + * formats matchings in soc_camera_device. A host can override the generic list
> + * generation by implementing get_formats(), and use it for format checks and
> + * format setup.
> + */
> +struct soc_camera_format_xlate {
> + u32 code;
> + const struct soc_mbus_pixelfmt *host_fmt;
> +};
> +
> const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
> u32 code,
> const struct soc_mbus_lookup *lookup,
> @@ -108,5 +123,12 @@ int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
> unsigned int *numerator, unsigned int *denominator);
> unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
> unsigned int flags);
> +struct soc_camera_format_xlate *soc_mbus_build_fmts_xlate(
> + struct v4l2_device *v4l2_dev, struct v4l2_subdev *subdev,
> + int (*get_formats)(struct v4l2_device *, unsigned int,
> + struct soc_camera_format_xlate *xlate));
> +const struct soc_camera_format_xlate *soc_mbus_xlate_by_fourcc(
> + struct soc_camera_format_xlate *user_formats, unsigned int fourcc);
> +
>
> #endif
> diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> index 97aa13314bfd..db6ea91d5cb0 100644
> --- a/include/media/soc_camera.h
> +++ b/include/media/soc_camera.h
> @@ -285,21 +285,6 @@ void soc_camera_host_unregister(struct soc_camera_host *ici);
> const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
> struct soc_camera_device *icd, unsigned int fourcc);
>
> -/**
> - * struct soc_camera_format_xlate - match between host and sensor formats
> - * @code: code of a sensor provided format
> - * @host_fmt: host format after host translation from code
> - *
> - * Host and sensor translation structure. Used in table of host and sensor
> - * formats matchings in soc_camera_device. A host can override the generic list
> - * generation by implementing get_formats(), and use it for format checks and
> - * format setup.
> - */
> -struct soc_camera_format_xlate {
> - u32 code;
> - const struct soc_mbus_pixelfmt *host_fmt;
> -};
> -
> #define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
>
> /**
> --
> 2.1.4
>
[toc] | [prev] | [next] | [standalone]
| From | Robert Jarzmik <robert.jarzmik@free.fr> |
|---|---|
| Date | 2016-04-06 08:50 +0200 |
| Subject | Re: [PATCH RFC v2 1/2] media: platform: transfer format translations to soc_mediabus |
| Message-ID | <rkPrQ-8ko-7@gated-at.bofh.it> |
| In reply to | #1372172 |
Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes: Hi Guennadi, > Not sure I understand, what should the purpose of this patch be? See in [1]. > Why do you want to move some function(s) from one file to another? And you > aren't even calling the new soc_mbus_build_fmts_xlate() function I'm calling it in pxa_camera_build_formats() in patch 2/2. > and you aren't replacing the currently used analogous > soc_camera_init_user_formats() function. I'm doing that in patch 2/2. > Or was this patch not-to-be-reviewed? Actually these 2 patches are designed to be discussion openers :) For me, their purpose is to expose the transition of pxa_camera out of soc_camera and see if the chosen path is good, or if there exists a better one. In other words, these patches show that : - in a first stage, soc_mediabus should be kept [1] => at least for formats translation (soc_mbus_build_fmts_xlate()) => and for used formats by sensors => this is why patch 1/1 exists - the conversion almost doesn't touch the pxa_camera_() core functions (IP manipulation), which is good, and only touch the upper layer - that soc_mediabus adherence removal will be another task - the amount of code which is shifted from soc_camera to pxa_camera - the functionalities that are lost through conversion which should be readded later => cropping is one => pixel clock sensing is another one All in all, before submitting patch for real, ie. not in RFC mode, I wanted to be sure the proposed conversion is sound, and compare to other drivers conversion to see if we were going in the same direction. As to whether this patch should be reviewed or not, I'd say that I was just expecting to have an "that might be the way to go" or "NAK, wrong patch, let's do something else instead". Cheers. -- Robert
[toc] | [prev] | [next] | [standalone]
| From | Hans Verkuil <hverkuil@xs4all.nl> |
|---|---|
| Date | 2016-04-03 19:50 +0200 |
| Subject | Re: [PATCH RFC v2 0/2] pxa_camera transition to v4l2 standalone device |
| Message-ID | <rjUjU-6Y2-5@gated-at.bofh.it> |
| In reply to | #1369961 |
Hi Robert, Thanks for the patches! On 04/02/2016 07:26 AM, Robert Jarzmik wrote: > Hi Hans and Guennadi, > > This is the second opus of this RFC. The goal is still to see how close our > ports are to see if there are things we could either reuse of change. > > From RFCv1, the main change is cleaning up in function names and functions > grouping, and fixes to make v4l2-compliance happy while live tests still show no > regression. > > For the next steps, I'll have to : > - split the second patch, which will be a headache task, into : > - first functions grouping and renaming > => this to ensure the "internal functions" are almost untouched > - the the port itself > > I'm leaving soc_mediabus for now, that's another task. > > I'm not seeing a big review traction, especially on the vb2 conversion, so I'll > leave this patchset in RFC form until vb2 patch is reviewed and merged, and then > will come back to this work. It's been a very busy time for me, and both Guennadi and myself are attending the ELC the coming week. Speaking for myself that means that it is unlikely I'll have time to review anything for the next two weeks. My own renesas driver conversion work is just as slow for the same reasons. I hope and expect that that situation will improve during April. Being able to ditch soc-camera is a fairly high-prio thing for me, but I just don't have much time right now. Regarding the compliance test: it looks good to me, except for this one: > Streaming ioctls: > test read/write: OK (Not Supported) With vb2 this is easy to support by just using vb2_fop_read as the read function and setting the VB2_READ flag in the io_modes. It's free, so I see no reason not to use it. Can you also test with 'v4l2-compliance -f'? This tests all format variations. Regards, Hans > > For information, here is the result of v4l2-compliance -s. > > Driver Info: > Driver name : pxa27x-camera > Card type : PXA_Camera > Bus info : platform:pxa-camera > Driver version: 4.6.0 > Capabilities : 0x84200001 > Video Capture > Streaming > Extended Pix Format > Device Capabilities > Device Caps : 0x04200001 > Video Capture > Streaming > Extended Pix Format > > Compliance test for device /dev/video0 (not using libv4l2): > > Required ioctls: > test VIDIOC_QUERYCAP: OK > > Allow for multiple opens: > test second video open: OK > test VIDIOC_QUERYCAP: OK > test VIDIOC_G/S_PRIORITY: OK > > Debug ioctls: > test VIDIOC_DBG_G/S_REGISTER: OK > test VIDIOC_LOG_STATUS: OK (Not Supported) > > Input ioctls: > test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) > test VIDIOC_G/S_FREQUENCY: OK (Not Supported) > test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) > test VIDIOC_ENUMAUDIO: OK (Not Supported) > test VIDIOC_G/S/ENUMINPUT: OK > test VIDIOC_G/S_AUDIO: OK (Not Supported) > Inputs: 1 Audio Inputs: 0 Tuners: 0 > > Output ioctls: > test VIDIOC_G/S_MODULATOR: OK (Not Supported) > test VIDIOC_G/S_FREQUENCY: OK (Not Supported) > test VIDIOC_ENUMAUDOUT: OK (Not Supported) > test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) > test VIDIOC_G/S_AUDOUT: OK (Not Supported) > Outputs: 0 Audio Outputs: 0 Modulators: 0 > > Input/Output configuration ioctls: > test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) > test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) > test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) > test VIDIOC_G/S_EDID: OK (Not Supported) > > Test input 0: > > Control ioctls: > test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) > test VIDIOC_QUERYCTRL: OK (Not Supported) > test VIDIOC_G/S_CTRL: OK (Not Supported) > test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) > test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) > test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) > Standard Controls: 0 Private Controls: 0 > > Format ioctls: > test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK > test VIDIOC_G/S_PARM: OK (Not Supported) > test VIDIOC_G_FBUF: OK (Not Supported) > test VIDIOC_G_FMT: OK > warn: v4l2-test-formats.cpp(713): TRY_FMT cannot handle an invalid pixelformat. > warn: v4l2-test-formats.cpp(714): This may or may not be a problem. For more information see: > warn: v4l2-test-formats.cpp(715): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html > test VIDIOC_TRY_FMT: OK > warn: v4l2-test-formats.cpp(933): S_FMT cannot handle an invalid pixelformat. > warn: v4l2-test-formats.cpp(934): This may or may not be a problem. For more information see: > warn: v4l2-test-formats.cpp(935): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html > test VIDIOC_S_FMT: OK > test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) > test Cropping: OK (Not Supported) > test Composing: OK (Not Supported) > test Scaling: OK > > Codec ioctls: > test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) > test VIDIOC_G_ENC_INDEX: OK (Not Supported) > test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) > > Buffer ioctls: > test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK > test VIDIOC_EXPBUF: OK > > Test input 0: > > Streaming ioctls: > test read/write: OK (Not Supported) > test MMAP: OK > test USERPTR: OK > test DMABUF: Cannot test, specify --expbuf-device > > Total: 45, Succeeded: 45, Failed: 0, Warnings: 6 > > Robert Jarzmik (2): > media: platform: transfer format translations to soc_mediabus > media: platform: pxa_camera: make a standalone v4l2 device > > drivers/media/platform/soc_camera/pxa_camera.c | 1086 ++++++++++++---------- > drivers/media/platform/soc_camera/soc_camera.c | 7 +- > drivers/media/platform/soc_camera/soc_mediabus.c | 65 ++ > include/linux/platform_data/media/camera-pxa.h | 2 + > include/media/drv-intf/soc_mediabus.h | 22 + > include/media/soc_camera.h | 15 - > 6 files changed, 708 insertions(+), 489 deletions(-) >
[toc] | [prev] | [next] | [standalone]
| From | Robert Jarzmik <robert.jarzmik@free.fr> |
|---|---|
| Date | 2016-04-04 08:30 +0200 |
| Message-ID | <rk6bn-7rL-3@gated-at.bofh.it> |
| In reply to | #1370268 |
Hans Verkuil <hverkuil@xs4all.nl> writes: > Hi Robert, > > It's been a very busy time for me, and both Guennadi and myself are attending the > ELC the coming week. Speaking for myself that means that it is unlikely I'll have > time to review anything for the next two weeks. > > My own renesas driver conversion work is just as slow for the same reasons. I hope > and expect that that situation will improve during April. > > Being able to ditch soc-camera is a fairly high-prio thing for me, but I just don't > have much time right now. Hi Hans, No worry for me, that can wait for weeks/monthes now. I have other tasks in the alsa area and the PXA maintainance I've been delaying for too long, so it's time to switch over. >> Streaming ioctls: >> test read/write: OK (Not Supported) > > With vb2 this is easy to support by just using vb2_fop_read as the read function and > setting the VB2_READ flag in the io_modes. It's free, so I see no reason not > to use it. Ok. > Can you also test with 'v4l2-compliance -f'? This tests all format variations. Will do. Cheers. -- Robert
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web