Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1198526
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Josh Wu <josh.wu@atmel.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming() |
| Date | Mon, 03 Aug 2015 06:00:01 +0200 |
| Message-ID | <pTf4R-7Ua-3@gated-at.bofh.it> (permalink) |
| References | <pCiVc-7bY-5@gated-at.bofh.it> <pCiVc-7bY-3@gated-at.bofh.it> <pSjDA-al-11@gated-at.bofh.it> |
| X-Original-To | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="windows-1252"; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Originating-IP | [10.168.5.13] |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 95 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Linux Media Mailing List <linux-media@vger.kernel.org>, "Guennadi Liakhovetski" <g.liakhovetski@gmx.de>, Mauro Carvalho Chehab <mchehab@osg.samsung.com>, <linux-kernel@vger.kernel.org> |
| X-Original-Date | Mon, 3 Aug 2015 11:56:01 +0800 |
| X-Original-Message-ID | <55BEE651.9020607@atmel.com> |
| X-Original-References | <1434537579-23417-1-git-send-email-josh.wu@atmel.com> <1434537579-23417-2-git-send-email-josh.wu@atmel.com> <1972518.SdailnKCEF@avalon> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1198526 |
Show key headers only | View raw
HI, Laurent
On 7/31/2015 10:37 PM, Laurent Pinchart wrote:
> Hi Josh,
>
> Thank you for the patch.
>
> On Wednesday 17 June 2015 18:39:39 Josh Wu wrote:
>> As in set_fmt() function we only need to know which format is been set,
>> we don't need to access the ISI hardware in this moment.
>>
>> So move the configure_geometry(), which access the ISI hardware, to
>> start_streaming() will make code more consistent and simpler.
>>
>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>> ---
>>
>> drivers/media/platform/soc_camera/atmel-isi.c | 17 +++++------------
>> 1 file changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
>> b/drivers/media/platform/soc_camera/atmel-isi.c index 8bc40ca..b01086d
>> 100644
>> --- a/drivers/media/platform/soc_camera/atmel-isi.c
>> +++ b/drivers/media/platform/soc_camera/atmel-isi.c
>> @@ -390,6 +390,11 @@ static int start_streaming(struct vb2_queue *vq,
>> unsigned int count) /* Disable all interrupts */
>> isi_writel(isi, ISI_INTDIS, (u32)~0UL);
>>
>> + ret = configure_geometry(isi, icd->user_width, icd->user_height,
>> + icd->current_fmt->code);
> I would also make configure_geometry a void function, as the only failure case
> really can't occur.
I think this case can be reached if user require a RGB565 format to
capture and sensor also support RGB565 format.
As atmel-isi driver will provide RGB565 support via the pass-through
mode (maybe we need re-consider this part).
So that will cause the configure_geometry() returns an error since it
found the bus format is not Y8 or YUV422.
In my opinion, we should not change configure_geometry()'s return type,
until we add a insanity format check before we call configure_geometry()
in future.
>
> Apart from that,
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thanks for the review.
Best Regards,
Josh Wu
>
>> + if (ret < 0)
>> + return ret;
>> +
>> spin_lock_irq(&isi->lock);
>> /* Clear any pending interrupt */
>> isi_readl(isi, ISI_STATUS);
>> @@ -477,8 +482,6 @@ static int isi_camera_init_videobuf(struct vb2_queue *q,
>> static int isi_camera_set_fmt(struct soc_camera_device *icd,
>> struct v4l2_format *f)
>> {
>> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
>> - struct atmel_isi *isi = ici->priv;
>> struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
>> const struct soc_camera_format_xlate *xlate;
>> struct v4l2_pix_format *pix = &f->fmt.pix;
>> @@ -511,16 +514,6 @@ static int isi_camera_set_fmt(struct soc_camera_device
>> *icd, if (mf->code != xlate->code)
>> return -EINVAL;
>>
>> - /* Enable PM and peripheral clock before operate isi registers */
>> - pm_runtime_get_sync(ici->v4l2_dev.dev);
>> -
>> - ret = configure_geometry(isi, pix->width, pix->height, xlate->code);
>> -
>> - pm_runtime_put(ici->v4l2_dev.dev);
>> -
>> - if (ret < 0)
>> - return ret;
>> -
>> pix->width = mf->width;
>> pix->height = mf->height;
>> pix->field = mf->field;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming() Josh Wu <josh.wu@atmel.com> - 2015-08-03 06:00 +0200
Re: [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming() Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2015-08-03 15:30 +0200
Re: [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming() Josh Wu <josh.wu@atmel.com> - 2015-08-04 08:30 +0200
csiph-web