linux/drivers/media/pci
Hans de Goede 35ccecef6e [media] [REGRESSION] bt8xx: Fix too large height in cropcap
Since commit a1fd287780:
"[media] bttv-driver: fix two warnings"
cropcap.defrect.height and cropcap.bounds.height for the PAL entry are 32
resp 30 pixels too large, if a userspace app (ie xawtv) actually tries to use
the full advertised height, the resulting image is broken in ways only a
screenshot can describe.
The cause of this is the fix for this warning:
drivers/media/pci/bt8xx/bttv-driver.c:308:3: warning: initialized field overwritten [-Woverride-init]
In this chunk of the commit:
@@ -301,11 +301,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
                        /* totalwidth */ 1135,
                        /* sqwidth */ 944,
                        /* vdelay */ 0x20,
-                       /* sheight */ 576,
-                       /* videostart0 */ 23)
                /* bt878 (and bt848?) can capture another
                   line below active video. */
-               .cropcap.bounds.height = (576 + 2) + 0x20 - 2,
+                       /* sheight */ (576 + 2) + 0x20 - 2,
+                       /* videostart0 */ 23)
        },{
                .v4l2_id        = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
                .name           = "NTSC",
Which replaces the overriding of cropcap.bounds.height initialization outside
of the CROPCAP macro (which also initializes it), with passing a
different sheight value to the CROPCAP macro.
There are 2 problems with this warning fix:
1) The sheight value is used twice in the CROPCAP macro, and the old code
   only changed one resulting value.
2) The old code increased the .cropcap.bounds.height value (and did not
   touch the .cropcap.defrect.height value at all) by 2, where as the fixed
   code increases it by 32, as the fixed code passes (576 + 2) + 0x20 - 2
   to the CROPCAP macro, but the + 0x20 - 2 is already done by the macro so
   now is done twice for .cropcap.bounds.height, and also is applied to
   .cropcap.defrect.height where it should not be applied at all.
This patch fixes this by adding an extraheight parameter to the CROPCAP entry
and using it for the PAL entry.

Cc: stable@kernel.org	# For Kernel 3.8
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26 08:37:00 -03:00
..
b2c2
bt8xx [media] [REGRESSION] bt8xx: Fix too large height in cropcap 2013-03-26 08:37:00 -03:00
cx18 [media] cx18/ivtv: fix regression: remove __init from a non-init function 2013-02-11 18:18:14 -02:00
cx88 [media] btcx-risc: move from media/i2c to media/common 2013-02-08 16:11:25 -02:00
cx23885 [media] btcx-risc: move from media/i2c to media/common 2013-02-08 16:11:25 -02:00
cx25821 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-02-24 17:35:10 -08:00
ddbridge Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
dm1105 Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
ivtv [media] cx18/ivtv: fix regression: remove __init from a non-init function 2013-02-11 18:18:14 -02:00
mantis Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
meye [media] meye: convert to the control framework 2013-02-05 18:23:47 -02:00
ngene Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
pluto2 Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
pt1 Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
saa7134 [media] saa7134: Add capture card Hawell HW-9004V1 2013-02-08 14:50:33 -02:00
saa7146
saa7164 [media] saa7164: silence GCC warnings 2013-02-05 13:50:14 -02:00
sta2x11 [media] sta2x11_vip: convert to videobuf2, control framework, file handler 2013-02-06 14:17:17 -02:00
ttpci [media] [V2,03/24] pci/ttpci/av7110.c: use IS_ENABLED() macro 2013-02-06 09:19:43 -02:00
zoran Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
Kconfig
Makefile