public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Hunold (LinuxTV.org CVS maintainer) <hunold@linuxtv.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 13/14] fix v4l1 backward compatibility in saa7146 driver
Date: Wed, 8 Oct 2003 15:29:00 +0200	[thread overview]
Message-ID: <1065619740659@convergence.de> (raw)
In-Reply-To: <1065619739957@convergence.de>

- [DVB] fix VIDIOC_S_FBUF for v4l1 backward compatility with xfree86 / v4l_drv
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/common/saa7146_video.c linux-2.6.0-test6-cvs/drivers/media/common/saa7146_video.c
--- linux-2.6.0-test6/drivers/media/common/saa7146_video.c	2003-10-01 12:25:26.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/common/saa7146_video.c	2003-09-30 19:15:11.000000000 +0200
@@ -904,6 +904,8 @@
 	{
 		struct v4l2_framebuffer *fb = arg;
 		struct saa7146_format *fmt;
+		struct saa7146_fh *ov_fh = NULL;
+		int restart_overlay = 0;
 
 		DEB_EE(("VIDIOC_S_FBUF\n"));
 
@@ -913,10 +915,6 @@
 			return -EPERM;
 		}
 */
-		if( 0 != vv->ov_data ) {
-			DEB_D(("VIDIOC_S_FBUF: overlay is active.\n"));
-			return -EPERM;
-		}
 
 		/* check args */
 		fmt = format_by_fourcc(dev,fb->fmt.pixelformat);
@@ -924,12 +922,27 @@
 			return -EINVAL;
 		}
 		
+		down(&dev->lock);
+
+		if( vv->ov_data != NULL ) {
+			ov_fh = vv->ov_data->fh;
+			saa7146_stop_preview(ov_fh);
+			restart_overlay = 1;
+		}
+
 		/* ok, accept it */
 		vv->ov_fb = *fb;
 		vv->ov_fmt = fmt;
 		if (0 == vv->ov_fb.fmt.bytesperline)
 			vv->ov_fb.fmt.bytesperline =
 				vv->ov_fb.fmt.width*fmt->depth/8;
+
+		if( 0 != restart_overlay ) {
+			saa7146_start_preview(ov_fh);
+		}
+
+		up(&dev->lock);
+
 		return 0;
 	}
 	case VIDIOC_ENUM_FMT:


  reply	other threads:[~2003-10-08 13:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-08 13:28 [PATCH 1/14] LinuxTV.org DVB driver update Michael Hunold
2003-10-08 13:28 ` [PATCH 2/14] firmware update for av7110 dvb driver Michael Hunold
2003-10-08 13:28   ` [PATCH 3/14] add new DVB-T frontend driver Michael Hunold
2003-10-08 13:28     ` [PATCH 4/14] video capture updates for saa7146 core Michael Hunold
2003-10-08 13:28       ` [PATCH 5/14] multiple device *read* opens support Michael Hunold
2003-10-08 13:28         ` [PATCH 6/14] update copyright and licensing Michael Hunold
2003-10-08 13:28           ` [PATCH 7/14] usual c99 initializer fixes Michael Hunold
2003-10-08 13:28             ` [PATCH 8/14] various patches for non-av7110 dvb-drivers Michael Hunold
2003-10-08 13:28               ` [PATCH 9/14] various av7110 dvb-driver updates Michael Hunold
2003-10-08 13:28                 ` [PATCH 10/14] update dvb frontend drivers Michael Hunold
2003-10-08 13:28                   ` [PATCH 11/14] Kconfig and Makefile updates, inspired by Adrian Bunk and Roman Zippel Michael Hunold
2003-10-08 13:28                     ` [PATCH 12/14] some more av7110 dvb-driver updates Michael Hunold
2003-10-08 13:29                       ` Michael Hunold [this message]
2003-10-08 13:29                         ` [PATCH 14/14] firmware blob for new DVB-T frontend driver Michael Hunold
2003-10-08 14:45   ` [PATCH 2/14] firmware update for av7110 dvb driver Marcel Holtmann
2003-10-08 15:36     ` Michael Hunold
2003-10-08 15:54       ` Michael Hunold
2003-10-12 21:42         ` Manuel Estrada Sainz
2003-10-11 11:59     ` Jochen Friedrich
2003-10-10 20:15 ` [PATCH 1/14] LinuxTV.org DVB driver update Stephen Hemminger
2003-10-11  8:41   ` Michael Hunold
2003-10-11 17:53     ` David S. Miller
2003-10-12  9:16       ` Geert Uytterhoeven
2003-10-12 11:08         ` Sam Ravnborg
2003-10-12 20:14           ` Michael Hunold
2003-10-13 16:01           ` Stephen Hemminger
2003-10-14  9:59             ` Michael Hunold
2003-10-12 20:10         ` Michael Hunold

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=1065619740659@convergence.de \
    --to=hunold@linuxtv.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox