public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: Re: [PATCH] media: platform: s3c-camif: fix function prototype
Date: Thu, 1 Jun 2017 23:37:11 +0200	[thread overview]
Message-ID: <da5c5727-628d-1887-368c-970d5308ee72@gmail.com> (raw)
In-Reply-To: <ea039557-023c-736d-5bfb-928cd87cc3e3@xs4all.nl>

On 05/22/2017 11:02 AM, Hans Verkuil wrote:
>> --- a/drivers/media/platform/s3c-camif/camif-regs.c
>> +++ b/drivers/media/platform/s3c-camif/camif-regs.c
>> @@ -58,7 +58,7 @@ void camif_hw_set_test_pattern(struct camif_dev *camif, unsigned int pattern)
>>   }
>>   
>>   void camif_hw_set_effect(struct camif_dev *camif, unsigned int effect,
>> -			unsigned int cr, unsigned int cb)
>> +			unsigned int cb, unsigned int cr)
>>   {
>>   	static const struct v4l2_control colorfx[] = {
>>   		{ V4L2_COLORFX_NONE,		CIIMGEFF_FIN_BYPASS },
>
> This will also affect this line:
> 
> cfg |= cr | (cb << 13);
> 
> cr and cb are now swapped so this will result in a different color.
> 
> Sylwester, who is wrong here: the prototype or how this function is called?
> 
> I suspect that Gustavo is right and that the prototype is wrong. But in that
> case this patch should also change the cfg assignment.

The function is currently called in a wrong way, it's clear from looking
at the prototype. CR should end up in bits 0:7 and CR in bits 20:13 of
the register. So yes, colour will change after applying the patch - to the
expected one, matching the user API documentation.

Unfortunately I can't test it because I have only the s3c2440 SoC based 
evaluation board where the image effect is not supported.

Probably a more straightforward fix would be to amend the callers (apologies
Gustavo for misleading suggestions).  But I'm inclined to apply the $subject 
patch as is to just close this bug report case.

--
Regards,
Sylwester

  reply	other threads:[~2017-06-01 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 19:05 [media-s3c-camif] question about arguments position Gustavo A. R. Silva
2017-05-04 19:34 ` Sylwester Nawrocki
2017-05-04 19:50   ` Gustavo A. R. Silva
2017-05-04 21:42     ` [PATCH] media: platform: s3c-camif: fix function prototype Gustavo A. R. Silva
2017-05-22  9:02       ` Hans Verkuil
2017-06-01 21:37         ` Sylwester Nawrocki [this message]
2017-06-02  3:43           ` [PATCH] media: platform: s3c-camif: fix arguments position in function call Gustavo A. R. Silva
2017-06-05 10:07             ` Sylwester Nawrocki
2017-06-05 15:52               ` Gustavo A. R. Silva

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=da5c5727-628d-1887-368c-970d5308ee72@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=garsilva@embeddedor.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.nawrocki@samsung.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