All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] PAL-M support fix for CX88 chipsets
@ 2005-05-03 12:48 Mauro Carvalho Chehab
  2005-05-03 15:38 ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2005-05-03 12:48 UTC (permalink / raw)
  To: linux-kernel

    This patch fixes PAL-M chroma subcarrier frequency (FSC) to its 
correct value of 3.5756115 MHz and adjusts horizontal total samples for 
PAL-M, according with formula Line Draw Time / (4*FSC), where Line Draw 
Time is 63.555 us.
     Without this patch, the Notch subcarrier filter was trying to 
capture using NTSC-M frequency, which is very close, but not equal. This 
could result in Black and White or miscolored frames.

-----

diff -puNr linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c 
linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c
--- linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c   
2005-04-20 21:03:14.000000000 -0300
+++ linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c       
2005-05-03 09:23:21.000000000 -0300
@@ -736,6 +736,9 @@ static unsigned int inline norm_fsc8(str
 {
        static const unsigned int ntsc = 28636360;
        static const unsigned int pal  = 35468950;
+        static const unsigned int palm  = 28604892;
+
+       if (V4L2_STD_PAL_M  & norm->id) return palm;

        return (norm->id & V4L2_STD_625_50) ? pal : ntsc;
 }
@@ -749,6 +752,8 @@ static unsigned int inline norm_notchfil

 static unsigned int inline norm_htotal(struct cx88_tvnorm *norm)
 {
+       // Should allways be Line Draw Time / 4FSC
+       if (V4L2_STD_PAL_M  & norm->id) return 909;
        return (norm->id & V4L2_STD_625_50) ? 1135 : 910;
 }


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

* Re: [2.6 patch] PAL-M support fix for CX88 chipsets
  2005-05-03 12:48 [2.6 patch] PAL-M support fix for CX88 chipsets Mauro Carvalho Chehab
@ 2005-05-03 15:38 ` Randy.Dunlap
  2005-05-03 17:43   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2005-05-03 15:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel

On Tue, 03 May 2005 09:48:24 -0300 Mauro Carvalho Chehab wrote:

|     This patch fixes PAL-M chroma subcarrier frequency (FSC) to its 
| correct value of 3.5756115 MHz and adjusts horizontal total samples for 
| PAL-M, according with formula Line Draw Time / (4*FSC), where Line Draw 
| Time is 63.555 us.
|      Without this patch, the Notch subcarrier filter was trying to 
| capture using NTSC-M frequency, which is very close, but not equal. This 
| could result in Black and White or miscolored frames.

This patch does not apply cleanly:
patching file cx88-core.c
Hunk #1 FAILED at 736.
Hunk #2 FAILED at 752.
2 out of 2 hunks FAILED -- saving rejects to file cx88-core.c.rej

due to tabs being converted to spaces.
Please mail it to yourself and then try to apply the patch
to see if that works.  You may have to use a different
mail client/app.  Hm, thunderbird.  Did you copy/paste the
patch?  That usually doesn't work.

Oh, and kernel comment style is /* ... */, not //.

| -----
| 
| diff -puNr linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c 
| linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c
| --- linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c   
| 2005-04-20 21:03:14.000000000 -0300
| +++ linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c       
| 2005-05-03 09:23:21.000000000 -0300
| @@ -736,6 +736,9 @@ static unsigned int inline norm_fsc8(str
|  {
|         static const unsigned int ntsc = 28636360;
|         static const unsigned int pal  = 35468950;
| +        static const unsigned int palm  = 28604892;
| +
| +       if (V4L2_STD_PAL_M  & norm->id) return palm;
| 
|         return (norm->id & V4L2_STD_625_50) ? pal : ntsc;
|  }
| @@ -749,6 +752,8 @@ static unsigned int inline norm_notchfil
| 
|  static unsigned int inline norm_htotal(struct cx88_tvnorm *norm)
|  {
| +       // Should allways be Line Draw Time / 4FSC
| +       if (V4L2_STD_PAL_M  & norm->id) return 909;
|         return (norm->id & V4L2_STD_625_50) ? 1135 : 910;
|  }


---
~Randy

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

* Re: [2.6 patch] PAL-M support fix for CX88 chipsets
  2005-05-03 15:38 ` Randy.Dunlap
@ 2005-05-03 17:43   ` Mauro Carvalho Chehab
  2005-05-03 17:52     ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2005-05-03 17:43 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Randy.Dunlap wrote:

>On Tue, 03 May 2005 09:48:24 -0300 Mauro Carvalho Chehab wrote:
>
>|     This patch fixes PAL-M chroma subcarrier frequency (FSC) to its 
>| correct value of 3.5756115 MHz and adjusts horizontal total samples for 
>| PAL-M, according with formula Line Draw Time / (4*FSC), where Line Draw 
>| Time is 63.555 us.
>|      Without this patch, the Notch subcarrier filter was trying to 
>| capture using NTSC-M frequency, which is very close, but not equal. This 
>| could result in Black and White or miscolored frames.
>
>This patch does not apply cleanly:
>patching file cx88-core.c
>Hunk #1 FAILED at 736.
>Hunk #2 FAILED at 752.
>2 out of 2 hunks FAILED -- saving rejects to file cx88-core.c.rej
>
>due to tabs being converted to spaces.
>Please mail it to yourself and then try to apply the patch
>to see if that works.  You may have to use a different
>mail client/app.  Hm, thunderbird.  Did you copy/paste the
>patch?  That usually doesn't work.
>
>  
>
    That was my case. I normally prefer not to insert as a MIME 
attachment. As it was a small patch, I'd used copy/paste method...

>Oh, and kernel comment style is /* ... */, not //.
>  
>
    I've corrected the comments and fixed some typo.

    Thank you.

    Mauro.

[-- Attachment #2: pal.dif --]
[-- Type: text/plain, Size: 790 bytes --]

--- linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c	2005-04-20 21:03:14.000000000 -0300
+++ linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c	2005-05-03 14:31:49.000000000 -0300
@@ -736,6 +736,9 @@ static unsigned int inline norm_fsc8(str
 {
 	static const unsigned int ntsc = 28636360;
 	static const unsigned int pal  = 35468950;
+        static const unsigned int palm  = 28604892;
+
+	if (V4L2_STD_PAL_M  & norm->id) return palm;
 
 	return (norm->id & V4L2_STD_625_50) ? pal : ntsc;
 }
@@ -749,6 +752,8 @@ static unsigned int inline norm_notchfil
 
 static unsigned int inline norm_htotal(struct cx88_tvnorm *norm)
 {
+	/* Should always be Line Draw Time / (4*FSC) */
+	if (V4L2_STD_PAL_M  & norm->id) return 909;
 	return (norm->id & V4L2_STD_625_50) ? 1135 : 910;
 }
 

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

* Re: [2.6 patch] PAL-M support fix for CX88 chipsets
  2005-05-03 17:43   ` Mauro Carvalho Chehab
@ 2005-05-03 17:52     ` Randy.Dunlap
  2005-05-03 18:04       ` [2.6 patch] PAL-M support fix for CX88 chipsets - final version :-) Mauro Carvalho Chehab
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2005-05-03 17:52 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel

On Tue, 03 May 2005 14:43:15 -0300 Mauro Carvalho Chehab wrote:

| >On Tue, 03 May 2005 09:48:24 -0300 Mauro Carvalho Chehab wrote:
| >
| >|     This patch fixes PAL-M chroma subcarrier frequency (FSC) to its 
| >| correct value of 3.5756115 MHz and adjusts horizontal total samples for 
| >| PAL-M, according with formula Line Draw Time / (4*FSC), where Line Draw 
| >| Time is 63.555 us.
| >|      Without this patch, the Notch subcarrier filter was trying to 
| >| capture using NTSC-M frequency, which is very close, but not equal. This 
| >| could result in Black and White or miscolored frames.


This line:
+        static const unsigned int palm  = 28604892;
begins with spaces, not a TAB.


+	if (V4L2_STD_PAL_M  & norm->id) return palm;
Please only 1 space after the _M, and put the return on a
separate line.

Same comments for the next if/return.

And please clean up the next (final :) version with a
clean description and Signed-off-by: line.

---
~Randy

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

* Re: [2.6 patch] PAL-M support fix for CX88 chipsets - final version :-)
  2005-05-03 17:52     ` Randy.Dunlap
@ 2005-05-03 18:04       ` Mauro Carvalho Chehab
  2005-05-03 18:11         ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2005-05-03 18:04 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

This patch fixes PAL-M chroma subcarrier frequency (FSC) to its correct 
value of 3.5756115 MHz and adjusts horizontal total samples for PAL-M, 
according with formula Line Draw Time / (4*FSC).

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>

[-- Attachment #2: pal.dif --]
[-- Type: text/plain, Size: 794 bytes --]

--- linux-2.6.12-rc3.org/drivers/media/video/cx88/cx88-core.c	2005-04-20 21:03:14.000000000 -0300
+++ linux-2.6.12-rc3/drivers/media/video/cx88/cx88-core.c	2005-05-03 14:59:21.000000000 -0300
@@ -736,6 +736,10 @@ static unsigned int inline norm_fsc8(str
 {
 	static const unsigned int ntsc = 28636360;
 	static const unsigned int pal  = 35468950;
+	static const unsigned int palm  = 28604892;
+
+	if (V4L2_STD_PAL_M & norm->id)
+		return palm;
 
 	return (norm->id & V4L2_STD_625_50) ? pal : ntsc;
 }
@@ -749,6 +753,11 @@ static unsigned int inline norm_notchfil
 
 static unsigned int inline norm_htotal(struct cx88_tvnorm *norm)
 {
+	/* Should always be Line Draw Time / (4*FSC) */
+
+	if (V4L2_STD_PAL_M  & norm->id)
+		return 909;
+
 	return (norm->id & V4L2_STD_625_50) ? 1135 : 910;
 }
 

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

* Re: [2.6 patch] PAL-M support fix for CX88 chipsets - final version :-)
  2005-05-03 18:04       ` [2.6 patch] PAL-M support fix for CX88 chipsets - final version :-) Mauro Carvalho Chehab
@ 2005-05-03 18:11         ` Randy.Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy.Dunlap @ 2005-05-03 18:11 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel

On Tue, 03 May 2005 15:04:35 -0300 Mauro Carvalho Chehab wrote:

| This patch fixes PAL-M chroma subcarrier frequency (FSC) to its correct 
| value of 3.5756115 MHz and adjusts horizontal total samples for PAL-M, 
| according with formula Line Draw Time / (4*FSC).
| 
| Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>


+	if (V4L2_STD_PAL_M  & norm->id)
still has 2 spaces after _M, but it's not a big deal.

Now who will merge it?


Thanks.
---
~Randy

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

end of thread, other threads:[~2005-05-03 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-03 12:48 [2.6 patch] PAL-M support fix for CX88 chipsets Mauro Carvalho Chehab
2005-05-03 15:38 ` Randy.Dunlap
2005-05-03 17:43   ` Mauro Carvalho Chehab
2005-05-03 17:52     ` Randy.Dunlap
2005-05-03 18:04       ` [2.6 patch] PAL-M support fix for CX88 chipsets - final version :-) Mauro Carvalho Chehab
2005-05-03 18:11         ` Randy.Dunlap

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.