linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, dacohen@gmail.com, snjw23@gmail.com,
	andriy.shevchenko@linux.intel.com, t.stanislaws@samsung.com,
	tuukkat76@gmail.com, k.debski@samsung.com, riverful@gmail.com,
	hverkuil@xs4all.nl, teturtia@gmail.com,
	pradeep.sawlani@gmail.com
Subject: Re: [PATCH v5.3 35/35] smiapp: Add driver
Date: Sun, 11 Mar 2012 16:03:44 +0200	[thread overview]
Message-ID: <4F5CB0C0.3010802@iki.fi> (raw)
In-Reply-To: <4311682.RklyrCL4F8@avalon>

Hi Laurent,

Thanks for the comments!

Laurent Pinchart wrote:
> On Thursday 08 March 2012 18:49:43 Sakari Ailus wrote:
>> Add driver for SMIA++/SMIA image sensors. The driver exposes the sensor as
>> three subdevs, pixel array, binner and scaler --- in case the device has a
>> scaler.
>>
>> Currently it relies on the board code for external clock handling. There is
>> no fast way out of this dependency before the ISP drivers (omap3isp) among
>> others will be able to export that clock through the clock framework
>> instead.
>>
>> Signed-off-by: Sakari Ailus<sakari.ailus@maxwell.research.nokia.com>
>
> [snip]
>
>> diff --git a/drivers/media/video/smiapp-pll.c
>> b/drivers/media/video/smiapp-pll.c index be63bb4..326bd0e 100644
>> --- a/drivers/media/video/smiapp-pll.c
>> +++ b/drivers/media/video/smiapp-pll.c
>> @@ -22,6 +22,8 @@
>>    *
>>    */
>>
>> +#include "smiapp/smiapp-debug.h"
>> +
>
> Is this needed ?

If debugging is enabled for SMIA++ driver the same is done for the PLL 
code. It's the only driver using the PLL code currently and I think it's 
an appropriate way to enable debug output.

I expect this to be changed in the future though.

What do you think? Would you only rely on dynamic printk?

>>   #include<linux/gcd.h>
>>   #include<linux/lcm.h>
>>   #include<linux/module.h>
>
> [snio]
>
>> diff --git a/drivers/media/video/smiapp/smiapp-core.c
>> b/drivers/media/video/smiapp/smiapp-core.c new file mode 100644
>> index 0000000..68f4397
>> --- /dev/null
>> +++ b/drivers/media/video/smiapp/smiapp-core.c
>
> [snip]
>
>> +static int smiapp_set_format(struct v4l2_subdev *subdev,
>> +			     struct v4l2_subdev_fh *fh,
>> +			     struct v4l2_subdev_format *fmt)
>> +{
>> +	struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
>> +	struct smiapp_subdev *ssd = to_smiapp_subdev(subdev);
>> +	struct v4l2_rect *crops[SMIAPP_PADS];
>> +	const struct smiapp_csi_data_format *csi_format;
>> +
>> +	mutex_lock(&sensor->mutex);
>> +
>> +	/*
>> +	 * Media bus code is changeable on src subdev's source pad. On
>> +	 * other source pads we just get format here.
>> +	 */
>> +	if (fmt->pad == ssd->source_pad) {
>> +		int rval = __smiapp_get_format(subdev, fh, fmt);
>
> This overwrites fmt completely, you won't be able to change it at all.

Good catch. I'll fix it and resend.

>> +		if (!rval&&  subdev ==&sensor->src->sd) {
>> +			csi_format = smiapp_validate_csi_data_format(
>> +				sensor, fmt->format.code);
>> +			if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
>> +				sensor->csi_format = csi_format;
>> +			fmt->format.code = csi_format->code;
>> +		}
>> +
>> +		mutex_unlock(&sensor->mutex);
>> +		return rval;
>> +	}
>> +
>> +	/* Sink pad. Width and height are changeable here. */
>> +	fmt->format.code = __smiapp_get_mbus_code(subdev, fmt->pad);
>> +	fmt->format.width&= ~1;
>> +	fmt->format.height&= ~1;
>> +
>> +	fmt->format.width =
>> +		clamp(fmt->format.width,
>> +		      sensor->limits[SMIAPP_LIMIT_MIN_X_OUTPUT_SIZE],
>> +		      sensor->limits[SMIAPP_LIMIT_MAX_X_OUTPUT_SIZE]);
>> +	fmt->format.height =
>> +		clamp(fmt->format.height,
>> +		      sensor->limits[SMIAPP_LIMIT_MIN_Y_OUTPUT_SIZE],
>> +		      sensor->limits[SMIAPP_LIMIT_MAX_Y_OUTPUT_SIZE]);
>> +
>> +	smiapp_get_crop_compose(subdev, fh, crops, NULL, fmt->which);
>> +
>> +	crops[ssd->sink_pad]->left = 0;
>> +	crops[ssd->sink_pad]->top = 0;
>> +	crops[ssd->sink_pad]->width = fmt->format.width;
>> +	crops[ssd->sink_pad]->height = fmt->format.height;
>> +	if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
>> +		ssd->sink_fmt = *crops[ssd->sink_pad];
>> +	smiapp_propagate(subdev, fh, fmt->which,
>> +			 V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL);
>> +
>> +	mutex_unlock(&sensor->mutex);
>> +
>> +	return 0;
>> +}
>

Regards,

-- 
Sakari Ailus
sakari.ailus@iki.fi

  reply	other threads:[~2012-03-11 14:03 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 16:32 [PATCH v5 0/35] V4L2 subdev and sensor control changes, SMIA++ driver and N9 camera board code Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 01/35] v4l: Introduce integer menu controls Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 02/35] v4l: Document " Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 03/35] vivi: Add an integer menu test control Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 04/35] v4l: VIDIOC_SUBDEV_S_SELECTION and VIDIOC_SUBDEV_G_SELECTION IOCTLs Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 05/35] v4l: vdev_to_v4l2_subdev() should have return type "struct v4l2_subdev *" Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 06/35] v4l: Check pad number in get try pointer functions Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 07/35] v4l: Support s_crop and g_crop through s/g_selection Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 08/35] v4l: Add subdev selections documentation: svg and dia files Sakari Ailus
2012-03-06 16:42   ` Laurent Pinchart
2012-03-06 16:32 ` [PATCH v5 09/35] v4l: Add subdev selections documentation Sakari Ailus
2012-03-06 16:44   ` Laurent Pinchart
2012-03-07  8:53   ` Michael Jones
2012-03-07 18:11     ` Sakari Ailus
2012-03-15  9:55   ` Sylwester Nawrocki
2012-03-15 13:00     ` Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 10/35] v4l: Mark VIDIOC_SUBDEV_G_CROP and VIDIOC_SUBDEV_S_CROP obsolete Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 11/35] v4l: Image source control class Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 12/35] v4l: Image processing " Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 13/35] v4l: Document raw bayer 4CC codes Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 14/35] v4l: Add DPCM compressed raw bayer pixel formats Sakari Ailus
2012-03-21  9:37   ` Prabhakar Lad
2012-03-21  9:53     ` Sakari Ailus
2012-03-21 11:44     ` [PATCH v5.5 14/40] " Sakari Ailus
2012-03-21 12:08       ` Prabhakar Lad
2012-03-06 16:32 ` [PATCH v5 15/35] media: Add link_validate() op to check links to the sink pad Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 16/35] v4l: Improve sub-device documentation for pad ops Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 17/35] v4l: Implement v4l2_subdev_link_validate() Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 18/35] v4l: Allow changing control handler lock Sakari Ailus
2012-05-14 15:27   ` Sylwester Nawrocki
2012-05-14 15:45     ` Sakari Ailus
2012-05-14 16:02       ` Sylwester Nawrocki
2012-05-14 15:48     ` Sylwester Nawrocki
2012-03-06 16:33 ` [PATCH v5 19/35] omap3isp: Support additional in-memory compressed bayer formats Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 20/35] omap3isp: Move definitions required by board code under include/media Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 21/35] omap3: add definition for CONTROL_CAMERA_PHY_CTRL Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 22/35] omap3isp: Move setting constaints above media_entity_pipeline_start Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 23/35] omap3isp: Assume media_entity_pipeline_start may fail Sakari Ailus
2012-03-06 16:45   ` Laurent Pinchart
2012-03-06 16:33 ` [PATCH v5 24/35] omap3isp: Add lane configuration to platform data Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 25/35] omap3isp: Collect entities that are part of the pipeline Sakari Ailus
2012-03-07 10:35   ` Laurent Pinchart
2012-03-07 17:20     ` Sakari Ailus
2012-03-07 17:22       ` [PATCH v5.1 " Sakari Ailus
2012-03-07 23:50         ` Laurent Pinchart
2012-03-09 18:44           ` [PATCH " Sakari Ailus
2012-03-09 20:31           ` [PATCH v5.3 " Sakari Ailus
2012-03-09 20:34             ` Laurent Pinchart
2012-03-08 17:05     ` Sakari Ailus
2012-03-07 10:50   ` [PATCH v5 " Laurent Pinchart
2012-03-07 15:24     ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 26/35] omap3isp: Add information on external subdev to struct isp_pipeline Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 27/35] omap3isp: Introduce isp_video_check_external_subdevs() Sakari Ailus
2012-03-07 10:43   ` Laurent Pinchart
2012-03-07 17:49     ` Sakari Ailus
2012-03-07 18:52       ` Laurent Pinchart
2012-03-07 23:57         ` Sakari Ailus
2012-03-08 17:04         ` [PATCH v5.3 " Sakari Ailus
2012-03-08 18:05           ` Laurent Pinchart
2012-03-07 18:14     ` [PATCH v5.1 " Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 28/35] omap3isp: Use external rate instead of vpcfg Sakari Ailus
2012-03-07 10:53   ` Laurent Pinchart
2012-03-07 17:54     ` Sakari Ailus
2012-03-07 18:34     ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 29/35] omap3isp: Default link validation for ccp2, csi2, preview and resizer Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 30/35] omap3isp: Move CCDC link validation to ccdc_link_validate() Sakari Ailus
2012-03-07 11:00   ` Laurent Pinchart
2012-03-07 18:02     ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 31/35] omap3isp: Configure CSI-2 phy based on platform data Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 32/35] omap3isp: Add resizer data rate configuration to resizer_link_validate Sakari Ailus
2012-03-07 11:01   ` Laurent Pinchart
2012-03-06 16:33 ` [PATCH v5 33/35] omap3isp: Find source pad from external entity Sakari Ailus
2012-03-07 11:04   ` Laurent Pinchart
2012-03-07 18:08     ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 34/35] smiapp: Generic SMIA++/SMIA PLL calculator Sakari Ailus
2012-03-07 12:26   ` Laurent Pinchart
2012-03-08 13:29     ` Sakari Ailus
2012-03-08 13:57     ` [PATCH v5.1 " Sakari Ailus
2012-03-08 14:38       ` Laurent Pinchart
2012-03-08 14:48         ` Sakari Ailus
2012-03-08 14:49         ` [PATCH v5.2 " Sakari Ailus
2012-03-08 14:51           ` Laurent Pinchart
2012-03-08 13:57     ` [PATCH v5.1 35/35] smiapp: Add driver Sakari Ailus
2012-03-08 14:46       ` Laurent Pinchart
2012-03-08 16:49         ` [PATCH v5.3 " Sakari Ailus
2012-03-11 13:37           ` Laurent Pinchart
2012-03-11 14:03             ` Sakari Ailus [this message]
2012-03-11 14:45               ` [PATCH v5.4 " Sakari Ailus
2012-03-11 16:32                 ` Laurent Pinchart
2012-03-08 15:06       ` [PATCH v5.1 " jean-philippe francois
2012-03-11  9:04         ` Sakari Ailus
2012-03-12  9:44           ` jean-philippe francois
2012-03-06 16:33 ` [PATCH v5 35/35] rm680: Add camera init Sakari Ailus

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=4F5CB0C0.3010802@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dacohen@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=k.debski@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=pradeep.sawlani@gmail.com \
    --cc=riverful@gmail.com \
    --cc=snjw23@gmail.com \
    --cc=t.stanislaws@samsung.com \
    --cc=teturtia@gmail.com \
    --cc=tuukkat76@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).