All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Hugues FRUCHET <hugues.fruchet@st.com>
Subject: [PATCH] vivid: fix gain when autogain is on
Date: Fri, 29 Jun 2018 11:40:41 +0200	[thread overview]
Message-ID: <b7ae30af-dcaa-f8ef-4171-e73cb0107884@xs4all.nl> (raw)

In the vivid driver you want gain to continuous change while autogain
is on. However, dev->jiffies_vid_cap doesn't actually change. It probably
did in the past, but changes in the code caused this to be a fixed value
that is only set when you start streaming.

Replace it by jiffies, which is always changing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c
index 6b0bfa091592..6eb8ad7fb12c 100644
--- a/drivers/media/platform/vivid/vivid-ctrls.c
+++ b/drivers/media/platform/vivid/vivid-ctrls.c
@@ -295,7 +295,7 @@ static int vivid_user_vid_g_volatile_ctrl(struct v4l2_ctrl *ctrl)

 	switch (ctrl->id) {
 	case V4L2_CID_AUTOGAIN:
-		dev->gain->val = dev->jiffies_vid_cap & 0xff;
+		dev->gain->val = (jiffies / HZ) & 0xff;
 		break;
 	}
 	return 0;

             reply	other threads:[~2018-06-29  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29  9:40 Hans Verkuil [this message]
2018-07-04 12:16 ` [PATCH] vivid: fix gain when autogain is on Mauro Carvalho Chehab
2018-07-04 12:31   ` Hans Verkuil

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=b7ae30af-dcaa-f8ef-4171-e73cb0107884@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=hugues.fruchet@st.com \
    --cc=linux-media@vger.kernel.org \
    /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.