From patchwork Sat Nov 7 14:05:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: e9hack X-Patchwork-Id: 58320 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA7E5CgT004868 for ; Sat, 7 Nov 2009 14:05:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751974AbZKGOFE (ORCPT ); Sat, 7 Nov 2009 09:05:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751969AbZKGOFE (ORCPT ); Sat, 7 Nov 2009 09:05:04 -0500 Received: from fg-out-1718.google.com ([72.14.220.156]:19515 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbZKGOFC (ORCPT ); Sat, 7 Nov 2009 09:05:02 -0500 Received: by fg-out-1718.google.com with SMTP id e12so643243fga.1 for ; Sat, 07 Nov 2009 06:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=F/XTHY8/EZMpEusdJKBAWlc3iC2uV6xoZhA6BlKw5iw=; b=qylEOD0GnRY1clzfPfeHhemH1FqAi3XXDBnBvfn147MZUPomxCjc17WbDshLfRG6R1 XRZbeNHPY8G0+1ua20dv4SLOedi1Y8enn7BrStdviwiKXUlYLqbxKU6Xf/+W/m7iyIH5 /HIoJCpQzP3EDMnWWz5ybe8WSvWcrt6Zje91w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=hR8jdzSJ+Z5B/6FP215xnUdycUsRB1WiH6ShWREZBFIrwYsEB7kKxD2eATEWokU9hC f+kj2CVP1fkxVm2yo+j8E+/5VFaDvvEOpIkHMPJNVGxCjKdh43I0ZnrYXmyL6O5JILKc Amru5K/4POVgjAuHv12ByDVTn1AqSNdHDNMKI= Received: by 10.86.135.27 with SMTP id i27mr5943434fgd.39.1257602706841; Sat, 07 Nov 2009 06:05:06 -0800 (PST) Received: from ?192.168.23.2? (p57B4194E.dip0.t-ipconnect.de [87.180.25.78]) by mx.google.com with ESMTPS id l12sm2631500fgb.17.2009.11.07.06.05.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 07 Nov 2009 06:05:05 -0800 (PST) Message-ID: <4AF57E8E.5070109@googlemail.com> Date: Sat, 07 Nov 2009 15:05:02 +0100 From: e9hack User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org Subject: Re: bug in changeset 13239:54535665f94b ? References: <4AEDB05E.1090704@googlemail.com> <20091107104113.0df4593b@pedra.chehab.org> In-Reply-To: <20091107104113.0df4593b@pedra.chehab.org> X-Enigmail-Version: 0.96.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org vdr:/usr/src/v4l-dvb/linux/drivers/media/common # hg diff saa7146_video.c diff -r 40705fec2fb2 linux/drivers/media/common/saa7146_video.c --- a/linux/drivers/media/common/saa7146_video.c Fri Nov 06 15:54:49 2009 -0200 +++ b/linux/drivers/media/common/saa7146_video.c Sat Nov 07 15:02:32 2009 +0100 @@ -1093,22 +1093,18 @@ static int vidioc_streamoff(struct file return 0; } - if (vv->video_fh != fh) { - DEB_S(("capturing, but in another open.\n")); - return -EBUSY; - } + err = video_end(fh, file); + if (err != 0) + return err; err = -EINVAL; if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) err = videobuf_streamoff(&fh->video_q); else if (type == V4L2_BUF_TYPE_VBI_CAPTURE) err = videobuf_streamoff(&fh->vbi_q); - if (0 != err) { + if (0 != err) DEB_D(("warning: videobuf_streamoff() failed.\n")); - video_end(fh, file); - } else { - err = video_end(fh, file); - } + return err; } @@ -1332,7 +1328,44 @@ static void buffer_release(struct videob struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; + int i; + u32 mc1; + DEB_CAP(("vbuf:%p\n",vb)); + + mc1 = saa7146_read(dev, MC1); + for(i = 0; i < 3; i++) + { + u32 base_even; + u32 base_odd; + u32 prot_addr; + u32 base_page; + u32 pitch; + u32 num; + u32 vptr; + + if (buf->pt[i].cpu && buf->pt[i].dma) { + const u32 dma_mask[] = {MASK_06, MASK_05, MASK_04}; + vptr = saa7146_read(dev, PCI_VDP1 + i * (PCI_VDP2 - PCI_VDP1)); + base_even = saa7146_read(dev, BASE_EVEN1 + i * (BASE_EVEN2 - BASE_EVEN1)); + base_odd = saa7146_read(dev, BASE_ODD1 + i * (BASE_ODD2 - BASE_ODD1)); + prot_addr = saa7146_read(dev, PROT_ADDR1 + i * (PROT_ADDR2 - PROT_ADDR1)); + base_page = saa7146_read(dev, BASE_PAGE1 + i *(BASE_PAGE2 - BASE_PAGE1)); + pitch = saa7146_read(dev, PITCH1 + i * (PITCH2 - PITCH1)); + num = saa7146_read(dev, NUM_LINE_BYTE1 + i * (NUM_LINE_BYTE2 - NUM_LINE_BYTE1)); + + if ((base_page & (0xfffff000 | ME1)) == (buf->pt[i].dma | ME1) && (mc1 & dma_mask[i])) { + printk("(%s:%d) vdma%d.base_even: %08x\n", __FILE__, __LINE__, i + 1, base_even); + printk("(%s:%d) vdma%d.base_odd: %08x\n", __FILE__, __LINE__, i + 1, base_odd); + printk("(%s:%d) vdma%d.prot_addr: %08x\n", __FILE__, __LINE__, i + 1, prot_addr); + printk("(%s:%d) vdma%d.base_page: %08x\n", __FILE__, __LINE__, i + 1, base_page); + printk("(%s:%d) vdma%d.pitch: %08x\n", __FILE__, __LINE__, i + 1, pitch); + printk("(%s:%d) vdma%d.num_line_byte: %08x\n", __FILE__, __LINE__, i + 1, num); + printk("(%s:%d) vdma%d.vptr: %08x\n", __FILE__, __LINE__, i + 1, vptr); + printk("(%s:%d) MC1: %08x\n", __FILE__, __LINE__, mc1); + } + } + } release_all_pagetables(dev, buf);