All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cafe_ccic: fix colorspace corruption on resume
@ 2010-10-27 13:55 Daniel Drake
  2010-10-28 18:23 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Drake @ 2010-10-27 13:55 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media, corbet

If you suspend and resume during video capture, the video colours
are corrupted on resume. This is because the sensor is being unconditionally
powered off during the resume path.

Only power down during resume if the camera is not in use, and correctly
reconfigure the sensor during resume.
Fixes http://dev.laptop.org/ticket/10190

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 drivers/media/video/cafe_ccic.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 7bc3667..d147525 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -859,8 +859,6 @@ static int cafe_cam_configure(struct cafe_camera *cam)
 	struct v4l2_mbus_framefmt mbus_fmt;
 	int ret;
 
-	if (cam->state != S_IDLE)
-		return -EINVAL;
 	v4l2_fill_mbus_format(&mbus_fmt, &cam->pix_format, cam->mbus_code);
 	ret = sensor_call(cam, core, init, 0);
 	if (ret == 0)
@@ -2197,12 +2195,13 @@ static int cafe_pci_resume(struct pci_dev *pdev)
 		return ret;
 	}
 	cafe_ctlr_init(cam);
-	cafe_ctlr_power_down(cam);
 
 	mutex_lock(&cam->s_mutex);
 	if (cam->users > 0) {
 		cafe_ctlr_power_up(cam);
 		__cafe_cam_reset(cam);
+	} else {
+		cafe_ctlr_power_down(cam);
 	}
 	mutex_unlock(&cam->s_mutex);
 
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cafe_ccic: fix colorspace corruption on resume
  2010-10-27 13:55 [PATCH] cafe_ccic: fix colorspace corruption on resume Daniel Drake
@ 2010-10-28 18:23 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2010-10-28 18:23 UTC (permalink / raw)
  To: Daniel Drake; +Cc: mchehab, linux-media

On Wed, 27 Oct 2010 14:55:00 +0100 (BST)
Daniel Drake <dsd@laptop.org> wrote:

> Only power down during resume if the camera is not in use, and correctly
> reconfigure the sensor during resume.

Makes sense to me.

Acked-by: Jonathan Corbet <corbet@lwn.net>

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-28 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 13:55 [PATCH] cafe_ccic: fix colorspace corruption on resume Daniel Drake
2010-10-28 18:23 ` Jonathan Corbet

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.