aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c891
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c171
-rw-r--r--drivers/media/video/bt8xx/bttv-vbi.c366
-rw-r--r--drivers/media/video/bt8xx/bttvp.h88
4 files changed, 1278 insertions, 238 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 41fd09d7d11e..50dfad47ccff 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -9,6 +9,10 @@
9 some v4l2 code lines are taken from Justin's bttv2 driver which is 9 some v4l2 code lines are taken from Justin's bttv2 driver which is
10 (c) 2000 Justin Schoeman <justin@suntiger.ee.up.ac.za> 10 (c) 2000 Justin Schoeman <justin@suntiger.ee.up.ac.za>
11 11
12 Cropping and overscan support
13 Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at>
14 Sponsored by OPQ Systems AB
15
12 This program is free software; you can redistribute it and/or modify 16 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by 17 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or 18 the Free Software Foundation; either version 2 of the License, or
@@ -64,6 +68,7 @@ static unsigned int radio[BTTV_MAX];
64static unsigned int irq_debug; 68static unsigned int irq_debug;
65static unsigned int gbuffers = 8; 69static unsigned int gbuffers = 8;
66static unsigned int gbufsize = 0x208000; 70static unsigned int gbufsize = 0x208000;
71static unsigned int reset_crop = 1;
67 72
68static int video_nr = -1; 73static int video_nr = -1;
69static int radio_nr = -1; 74static int radio_nr = -1;
@@ -103,6 +108,7 @@ module_param(radio_nr, int, 0444);
103module_param(vbi_nr, int, 0444); 108module_param(vbi_nr, int, 0444);
104module_param(gbuffers, int, 0444); 109module_param(gbuffers, int, 0444);
105module_param(gbufsize, int, 0444); 110module_param(gbufsize, int, 0444);
111module_param(reset_crop, int, 0444);
106 112
107module_param(v4l2, int, 0644); 113module_param(v4l2, int, 0644);
108module_param(bigendian, int, 0644); 114module_param(bigendian, int, 0644);
@@ -129,6 +135,8 @@ MODULE_PARM_DESC(bttv_debug,"debug messages, default is 0 (no)");
129MODULE_PARM_DESC(irq_debug,"irq handler debug messages, default is 0 (no)"); 135MODULE_PARM_DESC(irq_debug,"irq handler debug messages, default is 0 (no)");
130MODULE_PARM_DESC(gbuffers,"number of capture buffers. range 2-32, default 8"); 136MODULE_PARM_DESC(gbuffers,"number of capture buffers. range 2-32, default 8");
131MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000"); 137MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000");
138MODULE_PARM_DESC(reset_crop,"reset cropping parameters at open(), default "
139 "is 1 (yes) for compatibility with older applications");
132MODULE_PARM_DESC(automute,"mute audio on bad/missing video signal, default is 1 (yes)"); 140MODULE_PARM_DESC(automute,"mute audio on bad/missing video signal, default is 1 (yes)");
133MODULE_PARM_DESC(chroma_agc,"enables the AGC of chroma signal, default is 0 (no)"); 141MODULE_PARM_DESC(chroma_agc,"enables the AGC of chroma signal, default is 0 (no)");
134MODULE_PARM_DESC(adc_crush,"enables the luminance ADC crush, default is 1 (yes)"); 142MODULE_PARM_DESC(adc_crush,"enables the luminance ADC crush, default is 1 (yes)");
@@ -192,6 +200,33 @@ static u8 SRAM_Table[][60] =
192 } 200 }
193}; 201};
194 202
203/* minhdelayx1 first video pixel we can capture on a line and
204 hdelayx1 start of active video, both relative to rising edge of
205 /HRESET pulse (0H) in 1 / fCLKx1.
206 swidth width of active video and
207 totalwidth total line width, both in 1 / fCLKx1.
208 sqwidth total line width in square pixels.
209 vdelay start of active video in 2 * field lines relative to
210 trailing edge of /VRESET pulse (VDELAY register).
211 sheight height of active video in 2 * field lines.
212 videostart0 ITU-R frame line number of the line corresponding
213 to vdelay in the first field. */
214#define CROPCAP(minhdelayx1, hdelayx1, swidth, totalwidth, sqwidth, \
215 vdelay, sheight, videostart0) \
216 .cropcap.bounds.left = minhdelayx1, \
217 /* * 2 because vertically we count field lines times two, */ \
218 /* e.g. 23 * 2 to 23 * 2 + 576 in PAL-BGHI defrect. */ \
219 .cropcap.bounds.top = (videostart0) * 2 - (vdelay) + MIN_VDELAY, \
220 /* 4 is a safety margin at the end of the line. */ \
221 .cropcap.bounds.width = (totalwidth) - (minhdelayx1) - 4, \
222 .cropcap.bounds.height = (sheight) + (vdelay) - MIN_VDELAY, \
223 .cropcap.defrect.left = hdelayx1, \
224 .cropcap.defrect.top = (videostart0) * 2, \
225 .cropcap.defrect.width = swidth, \
226 .cropcap.defrect.height = sheight, \
227 .cropcap.pixelaspect.numerator = totalwidth, \
228 .cropcap.pixelaspect.denominator = sqwidth,
229
195const struct bttv_tvnorm bttv_tvnorms[] = { 230const struct bttv_tvnorm bttv_tvnorms[] = {
196 /* PAL-BDGHI */ 231 /* PAL-BDGHI */
197 /* max. active video is actually 922, but 924 is divisible by 4 and 3! */ 232 /* max. active video is actually 922, but 924 is divisible by 4 and 3! */
@@ -210,11 +245,26 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
210 .hdelayx1 = 186, 245 .hdelayx1 = 186,
211 .hactivex1 = 924, 246 .hactivex1 = 924,
212 .vdelay = 0x20, 247 .vdelay = 0x20,
213 .vbipack = 255, 248 .vbipack = 255, /* min (2048 / 4, 0x1ff) & 0xff */
214 .sram = 0, 249 .sram = 0,
215 /* ITU-R frame line number of the first VBI line 250 /* ITU-R frame line number of the first VBI line
216 we can capture, of the first and second field. */ 251 we can capture, of the first and second field.
217 .vbistart = { 7,320 }, 252 The last line is determined by cropcap.bounds. */
253 .vbistart = { 7, 320 },
254 CROPCAP(/* minhdelayx1 */ 68,
255 /* hdelayx1 */ 186,
256 /* Should be (768 * 1135 + 944 / 2) / 944.
257 cropcap.defrect is used for image width
258 checks, so we keep the old value 924. */
259 /* swidth */ 924,
260 /* totalwidth */ 1135,
261 /* sqwidth */ 944,
262 /* vdelay */ 0x20,
263 /* sheight */ 576,
264 /* videostart0 */ 23)
265 /* bt878 (and bt848?) can capture another
266 line below active video. */
267 .cropcap.bounds.height = (576 + 2) + 0x20 - 2,
218 },{ 268 },{
219 .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR, 269 .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
220 .name = "NTSC", 270 .name = "NTSC",
@@ -229,9 +279,18 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
229 .hdelayx1 = 128, 279 .hdelayx1 = 128,
230 .hactivex1 = 910, 280 .hactivex1 = 910,
231 .vdelay = 0x1a, 281 .vdelay = 0x1a,
232 .vbipack = 144, 282 .vbipack = 144, /* min (1600 / 4, 0x1ff) & 0xff */
233 .sram = 1, 283 .sram = 1,
234 .vbistart = { 10, 273 }, 284 .vbistart = { 10, 273 },
285 CROPCAP(/* minhdelayx1 */ 68,
286 /* hdelayx1 */ 128,
287 /* Should be (640 * 910 + 780 / 2) / 780? */
288 /* swidth */ 768,
289 /* totalwidth */ 910,
290 /* sqwidth */ 780,
291 /* vdelay */ 0x1a,
292 /* sheight */ 480,
293 /* videostart0 */ 23)
235 },{ 294 },{
236 .v4l2_id = V4L2_STD_SECAM, 295 .v4l2_id = V4L2_STD_SECAM,
237 .name = "SECAM", 296 .name = "SECAM",
@@ -249,6 +308,14 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
249 .vbipack = 255, 308 .vbipack = 255,
250 .sram = 0, /* like PAL, correct? */ 309 .sram = 0, /* like PAL, correct? */
251 .vbistart = { 7, 320 }, 310 .vbistart = { 7, 320 },
311 CROPCAP(/* minhdelayx1 */ 68,
312 /* hdelayx1 */ 186,
313 /* swidth */ 924,
314 /* totalwidth */ 1135,
315 /* sqwidth */ 944,
316 /* vdelay */ 0x20,
317 /* sheight */ 576,
318 /* videostart0 */ 23)
252 },{ 319 },{
253 .v4l2_id = V4L2_STD_PAL_Nc, 320 .v4l2_id = V4L2_STD_PAL_Nc,
254 .name = "PAL-Nc", 321 .name = "PAL-Nc",
@@ -266,6 +333,14 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
266 .vbipack = 144, 333 .vbipack = 144,
267 .sram = -1, 334 .sram = -1,
268 .vbistart = { 7, 320 }, 335 .vbistart = { 7, 320 },
336 CROPCAP(/* minhdelayx1 */ 68,
337 /* hdelayx1 */ 130,
338 /* swidth */ (640 * 910 + 780 / 2) / 780,
339 /* totalwidth */ 910,
340 /* sqwidth */ 780,
341 /* vdelay */ 0x1a,
342 /* sheight */ 576,
343 /* videostart0 */ 23)
269 },{ 344 },{
270 .v4l2_id = V4L2_STD_PAL_M, 345 .v4l2_id = V4L2_STD_PAL_M,
271 .name = "PAL-M", 346 .name = "PAL-M",
@@ -283,6 +358,14 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
283 .vbipack = 144, 358 .vbipack = 144,
284 .sram = -1, 359 .sram = -1,
285 .vbistart = { 10, 273 }, 360 .vbistart = { 10, 273 },
361 CROPCAP(/* minhdelayx1 */ 68,
362 /* hdelayx1 */ 135,
363 /* swidth */ (640 * 910 + 780 / 2) / 780,
364 /* totalwidth */ 910,
365 /* sqwidth */ 780,
366 /* vdelay */ 0x1a,
367 /* sheight */ 480,
368 /* videostart0 */ 23)
286 },{ 369 },{
287 .v4l2_id = V4L2_STD_PAL_N, 370 .v4l2_id = V4L2_STD_PAL_N,
288 .name = "PAL-N", 371 .name = "PAL-N",
@@ -299,7 +382,15 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
299 .vdelay = 0x20, 382 .vdelay = 0x20,
300 .vbipack = 144, 383 .vbipack = 144,
301 .sram = -1, 384 .sram = -1,
302 .vbistart = { 7, 320}, 385 .vbistart = { 7, 320 },
386 CROPCAP(/* minhdelayx1 */ 68,
387 /* hdelayx1 */ 186,
388 /* swidth */ (768 * 1135 + 944 / 2) / 944,
389 /* totalwidth */ 1135,
390 /* sqwidth */ 944,
391 /* vdelay */ 0x20,
392 /* sheight */ 576,
393 /* videostart0 */ 23)
303 },{ 394 },{
304 .v4l2_id = V4L2_STD_NTSC_M_JP, 395 .v4l2_id = V4L2_STD_NTSC_M_JP,
305 .name = "NTSC-JP", 396 .name = "NTSC-JP",
@@ -316,7 +407,15 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
316 .vdelay = 0x16, 407 .vdelay = 0x16,
317 .vbipack = 144, 408 .vbipack = 144,
318 .sram = -1, 409 .sram = -1,
319 .vbistart = {10, 273}, 410 .vbistart = { 10, 273 },
411 CROPCAP(/* minhdelayx1 */ 68,
412 /* hdelayx1 */ 135,
413 /* swidth */ (640 * 910 + 780 / 2) / 780,
414 /* totalwidth */ 910,
415 /* sqwidth */ 780,
416 /* vdelay */ 0x16,
417 /* sheight */ 480,
418 /* videostart0 */ 23)
320 },{ 419 },{
321 /* that one hopefully works with the strange timing 420 /* that one hopefully works with the strange timing
322 * which video recorders produce when playing a NTSC 421 * which video recorders produce when playing a NTSC
@@ -338,6 +437,14 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
338 .vtotal = 524, 437 .vtotal = 524,
339 .sram = -1, 438 .sram = -1,
340 .vbistart = { 10, 273 }, 439 .vbistart = { 10, 273 },
440 CROPCAP(/* minhdelayx1 */ 68,
441 /* hdelayx1 */ 186,
442 /* swidth */ 924,
443 /* totalwidth */ 1135,
444 /* sqwidth */ 944,
445 /* vdelay */ 0x1a,
446 /* sheight */ 480,
447 /* videostart0 */ 23)
341 } 448 }
342}; 449};
343static const unsigned int BTTV_TVNORMS = ARRAY_SIZE(bttv_tvnorms); 450static const unsigned int BTTV_TVNORMS = ARRAY_SIZE(bttv_tvnorms);
@@ -678,25 +785,89 @@ static const int BTTV_CTLS = ARRAY_SIZE(bttv_ctls);
678/* ----------------------------------------------------------------------- */ 785/* ----------------------------------------------------------------------- */
679/* resource management */ 786/* resource management */
680 787
788/*
789 RESOURCE_ allocated by freed by
790
791 VIDEO_READ bttv_read 1) bttv_read 2)
792
793 VIDEO_STREAM VIDIOC_STREAMON VIDIOC_STREAMOFF
794 VIDIOC_QBUF 1) bttv_release
795 VIDIOCMCAPTURE 1)
796
797 OVERLAY VIDIOCCAPTURE on VIDIOCCAPTURE off
798 VIDIOC_OVERLAY on VIDIOC_OVERLAY off
799 3) bttv_release
800
801 VBI VIDIOC_STREAMON VIDIOC_STREAMOFF
802 VIDIOC_QBUF 1) bttv_release
803 bttv_read, bttv_poll 1) 4)
804
805 1) The resource must be allocated when we enter buffer prepare functions
806 and remain allocated while buffers are in the DMA queue.
807 2) This is a single frame read.
808 3) VIDIOC_S_FBUF and VIDIOC_S_FMT (OVERLAY) still work when
809 RESOURCE_OVERLAY is allocated.
810 4) This is a continuous read, implies VIDIOC_STREAMON.
811
812 Note this driver permits video input and standard changes regardless if
813 resources are allocated.
814*/
815
816#define VBI_RESOURCES (RESOURCE_VBI)
817#define VIDEO_RESOURCES (RESOURCE_VIDEO_READ | \
818 RESOURCE_VIDEO_STREAM | \
819 RESOURCE_OVERLAY)
820
681static 821static
682int check_alloc_btres(struct bttv *btv, struct bttv_fh *fh, int bit) 822int check_alloc_btres(struct bttv *btv, struct bttv_fh *fh, int bit)
683{ 823{
824 int xbits; /* mutual exclusive resources */
825
684 if (fh->resources & bit) 826 if (fh->resources & bit)
685 /* have it already allocated */ 827 /* have it already allocated */
686 return 1; 828 return 1;
687 829
830 xbits = bit;
831 if (bit & (RESOURCE_VIDEO_READ | RESOURCE_VIDEO_STREAM))
832 xbits |= RESOURCE_VIDEO_READ | RESOURCE_VIDEO_STREAM;
833
688 /* is it free? */ 834 /* is it free? */
689 mutex_lock(&btv->reslock); 835 mutex_lock(&btv->lock);
690 if (btv->resources & bit) { 836 if (btv->resources & xbits) {
691 /* no, someone else uses it */ 837 /* no, someone else uses it */
692 mutex_unlock(&btv->reslock); 838 goto fail;
693 return 0; 839 }
840
841 if ((bit & VIDEO_RESOURCES)
842 && 0 == (btv->resources & VIDEO_RESOURCES)) {
843 /* Do crop - use current, don't - use default parameters. */
844 __s32 top = btv->crop[!!fh->do_crop].rect.top;
845
846 if (btv->vbi_end > top)
847 goto fail;
848
849 /* We cannot capture the same line as video and VBI data.
850 Claim scan lines crop[].rect.top to bottom. */
851 btv->crop_start = top;
852 } else if (bit & VBI_RESOURCES) {
853 __s32 end = fh->vbi_fmt.end;
854
855 if (end > btv->crop_start)
856 goto fail;
857
858 /* Claim scan lines above fh->vbi_fmt.end. */
859 btv->vbi_end = end;
694 } 860 }
861
695 /* it's free, grab it */ 862 /* it's free, grab it */
696 fh->resources |= bit; 863 fh->resources |= bit;
697 btv->resources |= bit; 864 btv->resources |= bit;
698 mutex_unlock(&btv->reslock); 865 mutex_unlock(&btv->lock);
699 return 1; 866 return 1;
867
868 fail:
869 mutex_unlock(&btv->lock);
870 return 0;
700} 871}
701 872
702static 873static
@@ -711,6 +882,35 @@ int locked_btres(struct bttv *btv, int bit)
711 return (btv->resources & bit); 882 return (btv->resources & bit);
712} 883}
713 884
885/* Call with btv->lock down. */
886static void
887disclaim_vbi_lines(struct bttv *btv)
888{
889 btv->vbi_end = 0;
890}
891
892/* Call with btv->lock down. */
893static void
894disclaim_video_lines(struct bttv *btv)
895{
896 const struct bttv_tvnorm *tvnorm;
897 u8 crop;
898
899 tvnorm = &bttv_tvnorms[btv->tvnorm];
900 btv->crop_start = tvnorm->cropcap.bounds.top
901 + tvnorm->cropcap.bounds.height;
902
903 /* VBI capturing ends at VDELAY, start of video capturing, no
904 matter how many lines the VBI RISC program expects. When video
905 capturing is off, it shall no longer "preempt" VBI capturing,
906 so we set VDELAY to maximum. */
907 crop = btread(BT848_E_CROP) | 0xc0;
908 btwrite(crop, BT848_E_CROP);
909 btwrite(0xfe, BT848_E_VDELAY_LO);
910 btwrite(crop, BT848_O_CROP);
911 btwrite(0xfe, BT848_O_VDELAY_LO);
912}
913
714static 914static
715void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits) 915void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits)
716{ 916{
@@ -718,10 +918,19 @@ void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits)
718 /* trying to free ressources not allocated by us ... */ 918 /* trying to free ressources not allocated by us ... */
719 printk("bttv: BUG! (btres)\n"); 919 printk("bttv: BUG! (btres)\n");
720 } 920 }
721 mutex_lock(&btv->reslock); 921 mutex_lock(&btv->lock);
722 fh->resources &= ~bits; 922 fh->resources &= ~bits;
723 btv->resources &= ~bits; 923 btv->resources &= ~bits;
724 mutex_unlock(&btv->reslock); 924
925 bits = btv->resources;
926
927 if (0 == (bits & VIDEO_RESOURCES))
928 disclaim_video_lines(btv);
929
930 if (0 == (bits & VBI_RESOURCES))
931 disclaim_vbi_lines(btv);
932
933 mutex_unlock(&btv->lock);
725} 934}
726 935
727/* ----------------------------------------------------------------------- */ 936/* ----------------------------------------------------------------------- */
@@ -1030,6 +1239,36 @@ i2c_vidiocschan(struct bttv *btv)
1030 bttv_tda9880_setnorm(btv,btv->tvnorm); 1239 bttv_tda9880_setnorm(btv,btv->tvnorm);
1031} 1240}
1032 1241
1242static void
1243bttv_crop_calc_limits(struct bttv_crop *c)
1244{
1245 /* Scale factor min. 1:1, max. 16:1. Min. image size
1246 48 x 32. Scaled width must be a multiple of 4. */
1247
1248 if (1) {
1249 /* For bug compatibility with VIDIOCGCAP and image
1250 size checks in earlier driver versions. */
1251 c->min_scaled_width = 48;
1252 c->min_scaled_height = 32;
1253 } else {
1254 c->min_scaled_width =
1255 (max(48, c->rect.width >> 4) + 3) & ~3;
1256 c->min_scaled_height =
1257 max(32, c->rect.height >> 4);
1258 }
1259
1260 c->max_scaled_width = c->rect.width & ~3;
1261 c->max_scaled_height = c->rect.height;
1262}
1263
1264static void
1265bttv_crop_reset(struct bttv_crop *c, int norm)
1266{
1267 c->rect = bttv_tvnorms[norm].cropcap.defrect;
1268 bttv_crop_calc_limits(c);
1269}
1270
1271/* Call with btv->lock down. */
1033static int 1272static int
1034set_tvnorm(struct bttv *btv, unsigned int norm) 1273set_tvnorm(struct bttv *btv, unsigned int norm)
1035{ 1274{
@@ -1038,9 +1277,24 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
1038 if (norm < 0 || norm >= BTTV_TVNORMS) 1277 if (norm < 0 || norm >= BTTV_TVNORMS)
1039 return -EINVAL; 1278 return -EINVAL;
1040 1279
1041 btv->tvnorm = norm;
1042 tvnorm = &bttv_tvnorms[norm]; 1280 tvnorm = &bttv_tvnorms[norm];
1043 1281
1282 if (btv->tvnorm < 0 ||
1283 btv->tvnorm >= BTTV_TVNORMS ||
1284 0 != memcmp(&bttv_tvnorms[btv->tvnorm].cropcap,
1285 &tvnorm->cropcap,
1286 sizeof (tvnorm->cropcap))) {
1287 bttv_crop_reset(&btv->crop[0], norm);
1288 btv->crop[1] = btv->crop[0]; /* current = default */
1289
1290 if (0 == (btv->resources & VIDEO_RESOURCES)) {
1291 btv->crop_start = tvnorm->cropcap.bounds.top
1292 + tvnorm->cropcap.bounds.height;
1293 }
1294 }
1295
1296 btv->tvnorm = norm;
1297
1044 btwrite(tvnorm->adelay, BT848_ADELAY); 1298 btwrite(tvnorm->adelay, BT848_ADELAY);
1045 btwrite(tvnorm->bdelay, BT848_BDELAY); 1299 btwrite(tvnorm->bdelay, BT848_BDELAY);
1046 btaor(tvnorm->iform,~(BT848_IFORM_NORM|BT848_IFORM_XTBOTH), 1300 btaor(tvnorm->iform,~(BT848_IFORM_NORM|BT848_IFORM_XTBOTH),
@@ -1057,6 +1311,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
1057 return 0; 1311 return 0;
1058} 1312}
1059 1313
1314/* Call with btv->lock down. */
1060static void 1315static void
1061set_input(struct bttv *btv, unsigned int input) 1316set_input(struct bttv *btv, unsigned int input)
1062{ 1317{
@@ -1459,13 +1714,13 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1459 btv->loop_irq |= 1; 1714 btv->loop_irq |= 1;
1460 bttv_set_dma(btv, 0x03); 1715 bttv_set_dma(btv, 0x03);
1461 spin_unlock_irqrestore(&btv->s_lock,flags); 1716 spin_unlock_irqrestore(&btv->s_lock,flags);
1462 if (NULL == new)
1463 free_btres(btv,fh,RESOURCE_OVERLAY);
1464 if (NULL != old) { 1717 if (NULL != old) {
1465 dprintk("switch_overlay: old=%p state is %d\n",old,old->vb.state); 1718 dprintk("switch_overlay: old=%p state is %d\n",old,old->vb.state);
1466 bttv_dma_free(&fh->cap,btv, old); 1719 bttv_dma_free(&fh->cap,btv, old);
1467 kfree(old); 1720 kfree(old);
1468 } 1721 }
1722 if (NULL == new)
1723 free_btres(btv,fh,RESOURCE_OVERLAY);
1469 dprintk("switch_overlay: done\n"); 1724 dprintk("switch_overlay: done\n");
1470 return retval; 1725 return retval;
1471} 1726}
@@ -1479,7 +1734,10 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1479 unsigned int width, unsigned int height, 1734 unsigned int width, unsigned int height,
1480 enum v4l2_field field) 1735 enum v4l2_field field)
1481{ 1736{
1737 struct bttv_fh *fh = q->priv_data;
1482 int redo_dma_risc = 0; 1738 int redo_dma_risc = 0;
1739 struct bttv_crop c;
1740 int norm;
1483 int rc; 1741 int rc;
1484 1742
1485 /* check settings */ 1743 /* check settings */
@@ -1491,12 +1749,52 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1491 if (width*height > buf->vb.bsize) 1749 if (width*height > buf->vb.bsize)
1492 return -EINVAL; 1750 return -EINVAL;
1493 buf->vb.size = buf->vb.bsize; 1751 buf->vb.size = buf->vb.bsize;
1752
1753 /* Make sure tvnorm and vbi_end remain consistent
1754 until we're done. */
1755 mutex_lock(&btv->lock);
1756
1757 norm = btv->tvnorm;
1758
1759 /* In this mode capturing always starts at defrect.top
1760 (default VDELAY), ignoring cropping parameters. */
1761 if (btv->vbi_end > bttv_tvnorms[norm].cropcap.defrect.top) {
1762 mutex_unlock(&btv->lock);
1763 return -EINVAL;
1764 }
1765
1766 mutex_unlock(&btv->lock);
1767
1768 c.rect = bttv_tvnorms[norm].cropcap.defrect;
1494 } else { 1769 } else {
1495 if (width < 48 || 1770 mutex_lock(&btv->lock);
1496 height < 32 || 1771
1497 width > bttv_tvnorms[btv->tvnorm].swidth || 1772 norm = btv->tvnorm;
1498 height > bttv_tvnorms[btv->tvnorm].sheight) 1773 c = btv->crop[!!fh->do_crop];
1774
1775 mutex_unlock(&btv->lock);
1776
1777 if (width < c.min_scaled_width ||
1778 width > c.max_scaled_width ||
1779 height < c.min_scaled_height)
1499 return -EINVAL; 1780 return -EINVAL;
1781
1782 switch (field) {
1783 case V4L2_FIELD_TOP:
1784 case V4L2_FIELD_BOTTOM:
1785 case V4L2_FIELD_ALTERNATE:
1786 /* btv->crop counts frame lines. Max. scale
1787 factor is 16:1 for frames, 8:1 for fields. */
1788 if (height * 2 > c.max_scaled_height)
1789 return -EINVAL;
1790 break;
1791
1792 default:
1793 if (height > c.max_scaled_height)
1794 return -EINVAL;
1795 break;
1796 }
1797
1500 buf->vb.size = (width * height * fmt->depth) >> 3; 1798 buf->vb.size = (width * height * fmt->depth) >> 3;
1501 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) 1799 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
1502 return -EINVAL; 1800 return -EINVAL;
@@ -1505,12 +1803,17 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1505 /* alloc + fill struct bttv_buffer (if changed) */ 1803 /* alloc + fill struct bttv_buffer (if changed) */
1506 if (buf->vb.width != width || buf->vb.height != height || 1804 if (buf->vb.width != width || buf->vb.height != height ||
1507 buf->vb.field != field || 1805 buf->vb.field != field ||
1508 buf->tvnorm != btv->tvnorm || buf->fmt != fmt) { 1806 buf->tvnorm != norm || buf->fmt != fmt ||
1807 buf->crop.top != c.rect.top ||
1808 buf->crop.left != c.rect.left ||
1809 buf->crop.width != c.rect.width ||
1810 buf->crop.height != c.rect.height) {
1509 buf->vb.width = width; 1811 buf->vb.width = width;
1510 buf->vb.height = height; 1812 buf->vb.height = height;
1511 buf->vb.field = field; 1813 buf->vb.field = field;
1512 buf->tvnorm = btv->tvnorm; 1814 buf->tvnorm = norm;
1513 buf->fmt = fmt; 1815 buf->fmt = fmt;
1816 buf->crop = c.rect;
1514 redo_dma_risc = 1; 1817 redo_dma_risc = 1;
1515 } 1818 }
1516 1819
@@ -1939,11 +2242,179 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1939 return 0; 2242 return 0;
1940} 2243}
1941 2244
1942static int verify_window(const struct bttv_tvnorm *tvn, 2245/* Given cropping boundaries b and the scaled width and height of a
1943 struct v4l2_window *win, int fixup) 2246 single field or frame, which must not exceed hardware limits, this
2247 function adjusts the cropping parameters c. */
2248static void
2249bttv_crop_adjust (struct bttv_crop * c,
2250 const struct v4l2_rect * b,
2251 __s32 width,
2252 __s32 height,
2253 enum v4l2_field field)
2254{
2255 __s32 frame_height = height << !V4L2_FIELD_HAS_BOTH(field);
2256 __s32 max_left;
2257 __s32 max_top;
2258
2259 if (width < c->min_scaled_width) {
2260 /* Max. hor. scale factor 16:1. */
2261 c->rect.width = width * 16;
2262 } else if (width > c->max_scaled_width) {
2263 /* Min. hor. scale factor 1:1. */
2264 c->rect.width = width;
2265
2266 max_left = b->left + b->width - width;
2267 max_left = min(max_left, (__s32) MAX_HDELAY);
2268 if (c->rect.left > max_left)
2269 c->rect.left = max_left;
2270 }
2271
2272 if (height < c->min_scaled_height) {
2273 /* Max. vert. scale factor 16:1, single fields 8:1. */
2274 c->rect.height = height * 16;
2275 } else if (frame_height > c->max_scaled_height) {
2276 /* Min. vert. scale factor 1:1.
2277 Top and height count field lines times two. */
2278 c->rect.height = (frame_height + 1) & ~1;
2279
2280 max_top = b->top + b->height - c->rect.height;
2281 if (c->rect.top > max_top)
2282 c->rect.top = max_top;
2283 }
2284
2285 bttv_crop_calc_limits(c);
2286}
2287
2288/* Returns an error if scaling to a frame or single field with the given
2289 width and height is not possible with the current cropping parameters
2290 and width aligned according to width_mask. If adjust_size is TRUE the
2291 function may adjust the width and/or height instead, rounding width
2292 to (width + width_bias) & width_mask. If adjust_crop is TRUE it may
2293 also adjust the current cropping parameters to get closer to the
2294 desired image size. */
2295static int
2296limit_scaled_size (struct bttv_fh * fh,
2297 __s32 * width,
2298 __s32 * height,
2299 enum v4l2_field field,
2300 unsigned int width_mask,
2301 unsigned int width_bias,
2302 int adjust_size,
2303 int adjust_crop)
2304{
2305 struct bttv *btv = fh->btv;
2306 const struct v4l2_rect *b;
2307 struct bttv_crop *c;
2308 __s32 min_width;
2309 __s32 min_height;
2310 __s32 max_width;
2311 __s32 max_height;
2312 int rc;
2313
2314 BUG_ON((int) width_mask >= 0 ||
2315 width_bias >= (unsigned int) -width_mask);
2316
2317 /* Make sure tvnorm, vbi_end and the current cropping parameters
2318 remain consistent until we're done. */
2319 mutex_lock(&btv->lock);
2320
2321 b = &bttv_tvnorms[btv->tvnorm].cropcap.bounds;
2322
2323 /* Do crop - use current, don't - use default parameters. */
2324 c = &btv->crop[!!fh->do_crop];
2325
2326 if (fh->do_crop
2327 && adjust_size
2328 && adjust_crop
2329 && !locked_btres(btv, VIDEO_RESOURCES)) {
2330 min_width = 48;
2331 min_height = 32;
2332
2333 /* We cannot scale up. When the scaled image is larger
2334 than crop.rect we adjust the crop.rect as required
2335 by the V4L2 spec, hence cropcap.bounds are our limit. */
2336 max_width = min(b->width, (__s32) MAX_HACTIVE);
2337 max_height = b->height;
2338
2339 /* We cannot capture the same line as video and VBI data.
2340 Note btv->vbi_end is really a minimum, see
2341 bttv_vbi_try_fmt(). */
2342 if (btv->vbi_end > b->top) {
2343 max_height -= btv->vbi_end - b->top;
2344 rc = -EBUSY;
2345 if (min_height > max_height)
2346 goto fail;
2347 }
2348 } else {
2349 rc = -EBUSY;
2350 if (btv->vbi_end > c->rect.top)
2351 goto fail;
2352
2353 min_width = c->min_scaled_width;
2354 min_height = c->min_scaled_height;
2355 max_width = c->max_scaled_width;
2356 max_height = c->max_scaled_height;
2357
2358 adjust_crop = 0;
2359 }
2360
2361 min_width = (min_width - width_mask - 1) & width_mask;
2362 max_width = max_width & width_mask;
2363
2364 /* Max. scale factor is 16:1 for frames, 8:1 for fields. */
2365 min_height = min_height;
2366 /* Min. scale factor is 1:1. */
2367 max_height >>= !V4L2_FIELD_HAS_BOTH(field);
2368
2369 if (adjust_size) {
2370 *width = clamp(*width, min_width, max_width);
2371 *height = clamp(*height, min_height, max_height);
2372
2373 /* Round after clamping to avoid overflow. */
2374 *width = (*width + width_bias) & width_mask;
2375
2376 if (adjust_crop) {
2377 bttv_crop_adjust(c, b, *width, *height, field);
2378
2379 if (btv->vbi_end > c->rect.top) {
2380 /* Move the crop window out of the way. */
2381 c->rect.top = btv->vbi_end;
2382 }
2383 }
2384 } else {
2385 rc = -EINVAL;
2386 if (*width < min_width ||
2387 *height < min_height ||
2388 *width > max_width ||
2389 *height > max_height ||
2390 0 != (*width & ~width_mask))
2391 goto fail;
2392 }
2393
2394 rc = 0; /* success */
2395
2396 fail:
2397 mutex_unlock(&btv->lock);
2398
2399 return rc;
2400}
2401
2402/* Returns an error if the given overlay window dimensions are not
2403 possible with the current cropping parameters. If adjust_size is
2404 TRUE the function may adjust the window width and/or height
2405 instead, however it always rounds the horizontal position and
2406 width as btcx_align() does. If adjust_crop is TRUE the function
2407 may also adjust the current cropping parameters to get closer
2408 to the desired window size. */
2409static int
2410verify_window (struct bttv_fh * fh,
2411 struct v4l2_window * win,
2412 int adjust_size,
2413 int adjust_crop)
1944{ 2414{
1945 enum v4l2_field field; 2415 enum v4l2_field field;
1946 int maxw, maxh; 2416 unsigned int width_mask;
2417 int rc;
1947 2418
1948 if (win->w.width < 48 || win->w.height < 32) 2419 if (win->w.width < 48 || win->w.height < 32)
1949 return -EINVAL; 2420 return -EINVAL;
@@ -1951,32 +2422,52 @@ static int verify_window(const struct bttv_tvnorm *tvn,
1951 return -EINVAL; 2422 return -EINVAL;
1952 2423
1953 field = win->field; 2424 field = win->field;
1954 maxw = tvn->swidth;
1955 maxh = tvn->sheight;
1956 2425
1957 if (V4L2_FIELD_ANY == field) { 2426 if (V4L2_FIELD_ANY == field) {
1958 field = (win->w.height > maxh/2) 2427 __s32 height2;
2428
2429 height2 = fh->btv->crop[!!fh->do_crop].rect.height >> 1;
2430 field = (win->w.height > height2)
1959 ? V4L2_FIELD_INTERLACED 2431 ? V4L2_FIELD_INTERLACED
1960 : V4L2_FIELD_TOP; 2432 : V4L2_FIELD_TOP;
1961 } 2433 }
1962 switch (field) { 2434 switch (field) {
1963 case V4L2_FIELD_TOP: 2435 case V4L2_FIELD_TOP:
1964 case V4L2_FIELD_BOTTOM: 2436 case V4L2_FIELD_BOTTOM:
1965 maxh = maxh / 2;
1966 break;
1967 case V4L2_FIELD_INTERLACED: 2437 case V4L2_FIELD_INTERLACED:
1968 break; 2438 break;
1969 default: 2439 default:
1970 return -EINVAL; 2440 return -EINVAL;
1971 } 2441 }
1972 2442
1973 if (!fixup && (win->w.width > maxw || win->w.height > maxh)) 2443 /* 4-byte alignment. */
2444 if (NULL == fh->ovfmt)
1974 return -EINVAL; 2445 return -EINVAL;
2446 width_mask = ~0;
2447 switch (fh->ovfmt->depth) {
2448 case 8:
2449 case 24:
2450 width_mask = ~3;
2451 break;
2452 case 16:
2453 width_mask = ~1;
2454 break;
2455 case 32:
2456 break;
2457 default:
2458 BUG();
2459 }
2460
2461 win->w.width -= win->w.left & ~width_mask;
2462 win->w.left = (win->w.left - width_mask - 1) & width_mask;
2463
2464 rc = limit_scaled_size(fh, &win->w.width, &win->w.height,
2465 field, width_mask,
2466 /* width_bias: round down */ 0,
2467 adjust_size, adjust_crop);
2468 if (0 != rc)
2469 return rc;
1975 2470
1976 if (win->w.width > maxw)
1977 win->w.width = maxw;
1978 if (win->w.height > maxh)
1979 win->w.height = maxh;
1980 win->field = field; 2471 win->field = field;
1981 return 0; 2472 return 0;
1982} 2473}
@@ -1991,7 +2482,9 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv,
1991 return -EINVAL; 2482 return -EINVAL;
1992 if (!(fh->ovfmt->flags & FORMAT_FLAGS_PACKED)) 2483 if (!(fh->ovfmt->flags & FORMAT_FLAGS_PACKED))
1993 return -EINVAL; 2484 return -EINVAL;
1994 retval = verify_window(&bttv_tvnorms[btv->tvnorm],win,fixup); 2485 retval = verify_window(fh, win,
2486 /* adjust_size */ fixup,
2487 /* adjust_crop */ fixup);
1995 if (0 != retval) 2488 if (0 != retval)
1996 return retval; 2489 return retval;
1997 2490
@@ -2048,6 +2541,7 @@ static int setup_window(struct bttv_fh *fh, struct bttv *btv,
2048 struct bttv_buffer *new; 2541 struct bttv_buffer *new;
2049 2542
2050 new = videobuf_alloc(sizeof(*new)); 2543 new = videobuf_alloc(sizeof(*new));
2544 new->crop = btv->crop[!!fh->do_crop].rect;
2051 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new); 2545 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2052 retval = bttv_switch_overlay(btv,fh,new); 2546 retval = bttv_switch_overlay(btv,fh,new);
2053 } 2547 }
@@ -2080,7 +2574,7 @@ static int bttv_resource(struct bttv_fh *fh)
2080 2574
2081 switch (fh->type) { 2575 switch (fh->type) {
2082 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 2576 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
2083 res = RESOURCE_VIDEO; 2577 res = RESOURCE_VIDEO_STREAM;
2084 break; 2578 break;
2085 case V4L2_BUF_TYPE_VBI_CAPTURE: 2579 case V4L2_BUF_TYPE_VBI_CAPTURE:
2086 res = RESOURCE_VBI; 2580 res = RESOURCE_VBI;
@@ -2138,7 +2632,7 @@ static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f)
2138 f->fmt.win.field = fh->ov.field; 2632 f->fmt.win.field = fh->ov.field;
2139 return 0; 2633 return 0;
2140 case V4L2_BUF_TYPE_VBI_CAPTURE: 2634 case V4L2_BUF_TYPE_VBI_CAPTURE:
2141 bttv_vbi_get_fmt(fh,f); 2635 bttv_vbi_get_fmt(fh, &f->fmt.vbi);
2142 return 0; 2636 return 0;
2143 default: 2637 default:
2144 return -EINVAL; 2638 return -EINVAL;
@@ -2146,35 +2640,35 @@ static int bttv_g_fmt(struct bttv_fh *fh, struct v4l2_format *f)
2146} 2640}
2147 2641
2148static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv, 2642static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv,
2149 struct v4l2_format *f) 2643 struct v4l2_format *f, int adjust_crop)
2150{ 2644{
2151 switch (f->type) { 2645 switch (f->type) {
2152 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 2646 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
2153 { 2647 {
2154 const struct bttv_format *fmt; 2648 const struct bttv_format *fmt;
2155 enum v4l2_field field; 2649 enum v4l2_field field;
2156 unsigned int maxw,maxh; 2650 __s32 width, height;
2651 int rc;
2157 2652
2158 fmt = format_by_fourcc(f->fmt.pix.pixelformat); 2653 fmt = format_by_fourcc(f->fmt.pix.pixelformat);
2159 if (NULL == fmt) 2654 if (NULL == fmt)
2160 return -EINVAL; 2655 return -EINVAL;
2161 2656
2162 /* fixup format */
2163 maxw = bttv_tvnorms[btv->tvnorm].swidth;
2164 maxh = bttv_tvnorms[btv->tvnorm].sheight;
2165 field = f->fmt.pix.field; 2657 field = f->fmt.pix.field;
2166 if (V4L2_FIELD_ANY == field) 2658 if (V4L2_FIELD_ANY == field) {
2167 field = (f->fmt.pix.height > maxh/2) 2659 __s32 height2;
2660
2661 height2 = btv->crop[!!fh->do_crop].rect.height >> 1;
2662 field = (f->fmt.pix.height > height2)
2168 ? V4L2_FIELD_INTERLACED 2663 ? V4L2_FIELD_INTERLACED
2169 : V4L2_FIELD_BOTTOM; 2664 : V4L2_FIELD_BOTTOM;
2665 }
2170 if (V4L2_FIELD_SEQ_BT == field) 2666 if (V4L2_FIELD_SEQ_BT == field)
2171 field = V4L2_FIELD_SEQ_TB; 2667 field = V4L2_FIELD_SEQ_TB;
2172 switch (field) { 2668 switch (field) {
2173 case V4L2_FIELD_TOP: 2669 case V4L2_FIELD_TOP:
2174 case V4L2_FIELD_BOTTOM: 2670 case V4L2_FIELD_BOTTOM:
2175 case V4L2_FIELD_ALTERNATE: 2671 case V4L2_FIELD_ALTERNATE:
2176 maxh = maxh/2;
2177 break;
2178 case V4L2_FIELD_INTERLACED: 2672 case V4L2_FIELD_INTERLACED:
2179 break; 2673 break;
2180 case V4L2_FIELD_SEQ_TB: 2674 case V4L2_FIELD_SEQ_TB:
@@ -2185,28 +2679,29 @@ static int bttv_try_fmt(struct bttv_fh *fh, struct bttv *btv,
2185 return -EINVAL; 2679 return -EINVAL;
2186 } 2680 }
2187 2681
2682 width = f->fmt.pix.width;
2683 height = f->fmt.pix.height;
2684
2685 rc = limit_scaled_size(fh, &width, &height, field,
2686 /* width_mask: 4 pixels */ ~3,
2687 /* width_bias: nearest */ 2,
2688 /* adjust_size */ 1,
2689 adjust_crop);
2690 if (0 != rc)
2691 return rc;
2692
2188 /* update data for the application */ 2693 /* update data for the application */
2189 f->fmt.pix.field = field; 2694 f->fmt.pix.field = field;
2190 if (f->fmt.pix.width < 48) 2695 pix_format_set_size(&f->fmt.pix, fmt, width, height);
2191 f->fmt.pix.width = 48;
2192 if (f->fmt.pix.height < 32)
2193 f->fmt.pix.height = 32;
2194 if (f->fmt.pix.width > maxw)
2195 f->fmt.pix.width = maxw;
2196 if (f->fmt.pix.height > maxh)
2197 f->fmt.pix.height = maxh;
2198 pix_format_set_size (&f->fmt.pix, fmt,
2199 f->fmt.pix.width & ~3,
2200 f->fmt.pix.height);
2201 2696
2202 return 0; 2697 return 0;
2203 } 2698 }
2204 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 2699 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
2205 return verify_window(&bttv_tvnorms[btv->tvnorm], 2700 return verify_window(fh, &f->fmt.win,
2206 &f->fmt.win, 1); 2701 /* adjust_size */ 1,
2702 /* adjust_crop */ 0);
2207 case V4L2_BUF_TYPE_VBI_CAPTURE: 2703 case V4L2_BUF_TYPE_VBI_CAPTURE:
2208 bttv_vbi_try_fmt(fh,f); 2704 return bttv_vbi_try_fmt(fh, &f->fmt.vbi);
2209 return 0;
2210 default: 2705 default:
2211 return -EINVAL; 2706 return -EINVAL;
2212 } 2707 }
@@ -2225,7 +2720,7 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv,
2225 retval = bttv_switch_type(fh,f->type); 2720 retval = bttv_switch_type(fh,f->type);
2226 if (0 != retval) 2721 if (0 != retval)
2227 return retval; 2722 return retval;
2228 retval = bttv_try_fmt(fh,btv,f); 2723 retval = bttv_try_fmt(fh,btv,f, /* adjust_crop */ 1);
2229 if (0 != retval) 2724 if (0 != retval)
2230 return retval; 2725 return retval;
2231 fmt = format_by_fourcc(f->fmt.pix.pixelformat); 2726 fmt = format_by_fourcc(f->fmt.pix.pixelformat);
@@ -2254,12 +2749,7 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv,
2254 retval = bttv_switch_type(fh,f->type); 2749 retval = bttv_switch_type(fh,f->type);
2255 if (0 != retval) 2750 if (0 != retval)
2256 return retval; 2751 return retval;
2257 if (locked_btres(fh->btv, RESOURCE_VBI)) 2752 return bttv_vbi_set_fmt(fh, &f->fmt.vbi);
2258 return -EBUSY;
2259 bttv_vbi_try_fmt(fh,f);
2260 bttv_vbi_setlines(fh,btv,f->fmt.vbi.count[0]);
2261 bttv_vbi_get_fmt(fh,f);
2262 return 0;
2263 default: 2753 default:
2264 return -EINVAL; 2754 return -EINVAL;
2265 } 2755 }
@@ -2517,6 +3007,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2517 if (*on) { 3007 if (*on) {
2518 fh->ov.tvnorm = btv->tvnorm; 3008 fh->ov.tvnorm = btv->tvnorm;
2519 new = videobuf_alloc(sizeof(*new)); 3009 new = videobuf_alloc(sizeof(*new));
3010 new->crop = btv->crop[!!fh->do_crop].rect;
2520 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new); 3011 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2521 } else { 3012 } else {
2522 new = NULL; 3013 new = NULL;
@@ -2551,10 +3042,16 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2551 struct video_mmap *vm = arg; 3042 struct video_mmap *vm = arg;
2552 struct bttv_buffer *buf; 3043 struct bttv_buffer *buf;
2553 enum v4l2_field field; 3044 enum v4l2_field field;
3045 __s32 height2;
3046 int res;
2554 3047
2555 if (vm->frame >= VIDEO_MAX_FRAME) 3048 if (vm->frame >= VIDEO_MAX_FRAME)
2556 return -EINVAL; 3049 return -EINVAL;
2557 3050
3051 res = bttv_resource(fh);
3052 if (!check_alloc_btres(btv, fh, res))
3053 return -EBUSY;
3054
2558 mutex_lock(&fh->cap.lock); 3055 mutex_lock(&fh->cap.lock);
2559 retval = -EINVAL; 3056 retval = -EINVAL;
2560 buf = (struct bttv_buffer *)fh->cap.bufs[vm->frame]; 3057 buf = (struct bttv_buffer *)fh->cap.bufs[vm->frame];
@@ -2566,7 +3063,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2566 buf->vb.state == STATE_ACTIVE) 3063 buf->vb.state == STATE_ACTIVE)
2567 goto fh_unlock_and_return; 3064 goto fh_unlock_and_return;
2568 3065
2569 field = (vm->height > bttv_tvnorms[btv->tvnorm].sheight/2) 3066 height2 = btv->crop[!!fh->do_crop].rect.height >> 1;
3067 field = (vm->height > height2)
2570 ? V4L2_FIELD_INTERLACED 3068 ? V4L2_FIELD_INTERLACED
2571 : V4L2_FIELD_BOTTOM; 3069 : V4L2_FIELD_BOTTOM;
2572 retval = bttv_prepare_buffer(&fh->cap,btv,buf, 3070 retval = bttv_prepare_buffer(&fh->cap,btv,buf,
@@ -2613,54 +3111,17 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2613 } 3111 }
2614 3112
2615 case VIDIOCGVBIFMT: 3113 case VIDIOCGVBIFMT:
2616 {
2617 struct vbi_format *fmt = (void *) arg;
2618 struct v4l2_format fmt2;
2619
2620 if (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE) { 3114 if (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE) {
2621 retval = bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE); 3115 retval = bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE);
2622 if (0 != retval) 3116 if (0 != retval)
2623 return retval; 3117 return retval;
2624 } 3118 }
2625 bttv_vbi_get_fmt(fh, &fmt2);
2626
2627 memset(fmt,0,sizeof(*fmt));
2628 fmt->sampling_rate = fmt2.fmt.vbi.sampling_rate;
2629 fmt->samples_per_line = fmt2.fmt.vbi.samples_per_line;
2630 fmt->sample_format = VIDEO_PALETTE_RAW;
2631 fmt->start[0] = fmt2.fmt.vbi.start[0];
2632 fmt->count[0] = fmt2.fmt.vbi.count[0];
2633 fmt->start[1] = fmt2.fmt.vbi.start[1];
2634 fmt->count[1] = fmt2.fmt.vbi.count[1];
2635 if (fmt2.fmt.vbi.flags & V4L2_VBI_UNSYNC)
2636 fmt->flags |= VBI_UNSYNC;
2637 if (fmt2.fmt.vbi.flags & V4L2_VBI_INTERLACED)
2638 fmt->flags |= VBI_INTERLACED;
2639 return 0;
2640 }
2641 case VIDIOCSVBIFMT:
2642 {
2643 struct vbi_format *fmt = (void *) arg;
2644 struct v4l2_format fmt2;
2645 3119
2646 retval = bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE); 3120 /* fall through */
2647 if (0 != retval)
2648 return retval;
2649 bttv_vbi_get_fmt(fh, &fmt2);
2650
2651 if (fmt->sampling_rate != fmt2.fmt.vbi.sampling_rate ||
2652 fmt->samples_per_line != fmt2.fmt.vbi.samples_per_line ||
2653 fmt->sample_format != VIDEO_PALETTE_RAW ||
2654 fmt->start[0] != fmt2.fmt.vbi.start[0] ||
2655 fmt->start[1] != fmt2.fmt.vbi.start[1] ||
2656 fmt->count[0] != fmt->count[1] ||
2657 fmt->count[0] < 1 ||
2658 fmt->count[0] > 32 /* VBI_MAXLINES */)
2659 return -EINVAL;
2660 3121
2661 bttv_vbi_setlines(fh,btv,fmt->count[0]); 3122 case VIDIOCSVBIFMT:
2662 return 0; 3123 return v4l_compat_translate_ioctl(inode, file, cmd,
2663 } 3124 arg, bttv_do_ioctl);
2664 3125
2665 case BTTV_VERSION: 3126 case BTTV_VERSION:
2666 case VIDIOCGFREQ: 3127 case VIDIOCGFREQ:
@@ -2753,7 +3214,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2753 case VIDIOC_TRY_FMT: 3214 case VIDIOC_TRY_FMT:
2754 { 3215 {
2755 struct v4l2_format *f = arg; 3216 struct v4l2_format *f = arg;
2756 return bttv_try_fmt(fh,btv,f); 3217 return bttv_try_fmt(fh,btv,f, /* adjust_crop */ 0);
2757 } 3218 }
2758 case VIDIOC_G_FMT: 3219 case VIDIOC_G_FMT:
2759 { 3220 {
@@ -2792,16 +3253,23 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2792 if (0 == (fmt->flags & FORMAT_FLAGS_PACKED)) 3253 if (0 == (fmt->flags & FORMAT_FLAGS_PACKED))
2793 return -EINVAL; 3254 return -EINVAL;
2794 3255
2795 mutex_lock(&fh->cap.lock);
2796 retval = -EINVAL; 3256 retval = -EINVAL;
2797 if (fb->flags & V4L2_FBUF_FLAG_OVERLAY) { 3257 if (fb->flags & V4L2_FBUF_FLAG_OVERLAY) {
2798 if (fb->fmt.width > bttv_tvnorms[btv->tvnorm].swidth) 3258 __s32 width = fb->fmt.width;
2799 goto fh_unlock_and_return; 3259 __s32 height = fb->fmt.height;
2800 if (fb->fmt.height > bttv_tvnorms[btv->tvnorm].sheight) 3260
2801 goto fh_unlock_and_return; 3261 retval = limit_scaled_size(fh, &width, &height,
3262 V4L2_FIELD_INTERLACED,
3263 /* width_mask */ ~3,
3264 /* width_bias */ 2,
3265 /* adjust_size */ 0,
3266 /* adjust_crop */ 0);
3267 if (0 != retval)
3268 return retval;
2802 } 3269 }
2803 3270
2804 /* ok, accept it */ 3271 /* ok, accept it */
3272 mutex_lock(&fh->cap.lock);
2805 btv->fbuf.base = fb->base; 3273 btv->fbuf.base = fb->base;
2806 btv->fbuf.fmt.width = fb->fmt.width; 3274 btv->fbuf.fmt.width = fb->fmt.width;
2807 btv->fbuf.fmt.height = fb->fmt.height; 3275 btv->fbuf.fmt.height = fb->fmt.height;
@@ -2828,6 +3296,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2828 struct bttv_buffer *new; 3296 struct bttv_buffer *new;
2829 3297
2830 new = videobuf_alloc(sizeof(*new)); 3298 new = videobuf_alloc(sizeof(*new));
3299 new->crop = btv->crop[!!fh->do_crop].rect;
2831 bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new); 3300 bttv_overlay_risc(btv,&fh->ov,fh->ovfmt,new);
2832 retval = bttv_switch_overlay(btv,fh,new); 3301 retval = bttv_switch_overlay(btv,fh,new);
2833 } 3302 }
@@ -2843,7 +3312,13 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2843 return videobuf_querybuf(bttv_queue(fh),arg); 3312 return videobuf_querybuf(bttv_queue(fh),arg);
2844 3313
2845 case VIDIOC_QBUF: 3314 case VIDIOC_QBUF:
3315 {
3316 int res = bttv_resource(fh);
3317
3318 if (!check_alloc_btres(btv, fh, res))
3319 return -EBUSY;
2846 return videobuf_qbuf(bttv_queue(fh),arg); 3320 return videobuf_qbuf(bttv_queue(fh),arg);
3321 }
2847 3322
2848 case VIDIOC_DQBUF: 3323 case VIDIOC_DQBUF:
2849 return videobuf_dqbuf(bttv_queue(fh),arg, 3324 return videobuf_dqbuf(bttv_queue(fh),arg,
@@ -2942,6 +3417,122 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2942 return v4l2_prio_change(&btv->prio, &fh->prio, *prio); 3417 return v4l2_prio_change(&btv->prio, &fh->prio, *prio);
2943 } 3418 }
2944 3419
3420 case VIDIOC_CROPCAP:
3421 {
3422 struct v4l2_cropcap *cap = arg;
3423 enum v4l2_buf_type type;
3424
3425 type = cap->type;
3426
3427 if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&
3428 type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
3429 return -EINVAL;
3430
3431 *cap = bttv_tvnorms[btv->tvnorm].cropcap;
3432 cap->type = type;
3433
3434 return 0;
3435 }
3436 case VIDIOC_G_CROP:
3437 {
3438 struct v4l2_crop * crop = arg;
3439
3440 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&
3441 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
3442 return -EINVAL;
3443
3444 /* No fh->do_crop = 1; because btv->crop[1] may be
3445 inconsistent with fh->width or fh->height and apps
3446 do not expect a change here. */
3447
3448 crop->c = btv->crop[!!fh->do_crop].rect;
3449
3450 return 0;
3451 }
3452 case VIDIOC_S_CROP:
3453 {
3454 struct v4l2_crop *crop = arg;
3455 const struct v4l2_rect *b;
3456 struct bttv_crop c;
3457 __s32 b_left;
3458 __s32 b_top;
3459 __s32 b_right;
3460 __s32 b_bottom;
3461
3462 if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&
3463 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
3464 return -EINVAL;
3465
3466 retval = v4l2_prio_check(&btv->prio,&fh->prio);
3467 if (0 != retval)
3468 return retval;
3469
3470 /* Make sure tvnorm, vbi_end and the current cropping
3471 parameters remain consistent until we're done. Note
3472 read() may change vbi_end in check_alloc_btres(). */
3473 mutex_lock(&btv->lock);
3474
3475 retval = -EBUSY;
3476
3477 if (locked_btres(fh->btv, VIDEO_RESOURCES))
3478 goto btv_unlock_and_return;
3479
3480 b = &bttv_tvnorms[btv->tvnorm].cropcap.bounds;
3481
3482 b_left = b->left;
3483 b_right = b_left + b->width;
3484 b_bottom = b->top + b->height;
3485
3486 b_top = max(b->top, btv->vbi_end);
3487 if (b_top + 32 >= b_bottom)
3488 goto btv_unlock_and_return;
3489
3490 /* Min. scaled size 48 x 32. */
3491 c.rect.left = clamp(crop->c.left, b_left, b_right - 48);
3492 c.rect.left = min(c.rect.left, (__s32) MAX_HDELAY);
3493
3494 c.rect.width = clamp(crop->c.width,
3495 48, b_right - c.rect.left);
3496
3497 c.rect.top = clamp(crop->c.top, b_top, b_bottom - 32);
3498 /* Top and height must be a multiple of two. */
3499 c.rect.top = (c.rect.top + 1) & ~1;
3500
3501 c.rect.height = clamp(crop->c.height,
3502 32, b_bottom - c.rect.top);
3503 c.rect.height = (c.rect.height + 1) & ~1;
3504
3505 bttv_crop_calc_limits(&c);
3506
3507 btv->crop[1] = c;
3508
3509 mutex_unlock(&btv->lock);
3510
3511 fh->do_crop = 1;
3512
3513 mutex_lock(&fh->cap.lock);
3514
3515 if (fh->width < c.min_scaled_width) {
3516 fh->width = c.min_scaled_width;
3517 btv->init.width = c.min_scaled_width;
3518 } else if (fh->width > c.max_scaled_width) {
3519 fh->width = c.max_scaled_width;
3520 btv->init.width = c.max_scaled_width;
3521 }
3522
3523 if (fh->height < c.min_scaled_height) {
3524 fh->height = c.min_scaled_height;
3525 btv->init.height = c.min_scaled_height;
3526 } else if (fh->height > c.max_scaled_height) {
3527 fh->height = c.max_scaled_height;
3528 btv->init.height = c.max_scaled_height;
3529 }
3530
3531 mutex_unlock(&fh->cap.lock);
3532
3533 return 0;
3534 }
3535
2945 case VIDIOC_ENUMSTD: 3536 case VIDIOC_ENUMSTD:
2946 case VIDIOC_G_STD: 3537 case VIDIOC_G_STD:
2947 case VIDIOC_S_STD: 3538 case VIDIOC_S_STD:
@@ -2963,6 +3554,10 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2963 fh_unlock_and_return: 3554 fh_unlock_and_return:
2964 mutex_unlock(&fh->cap.lock); 3555 mutex_unlock(&fh->cap.lock);
2965 return retval; 3556 return retval;
3557
3558 btv_unlock_and_return:
3559 mutex_unlock(&btv->lock);
3560 return retval;
2966} 3561}
2967 3562
2968static int bttv_ioctl(struct inode *inode, struct file *file, 3563static int bttv_ioctl(struct inode *inode, struct file *file,
@@ -2972,8 +3567,26 @@ static int bttv_ioctl(struct inode *inode, struct file *file,
2972 3567
2973 switch (cmd) { 3568 switch (cmd) {
2974 case BTTV_VBISIZE: 3569 case BTTV_VBISIZE:
3570 {
3571 const struct bttv_tvnorm *tvnorm;
3572
3573 tvnorm = fh->vbi_fmt.tvnorm;
3574
3575 if (fh->vbi_fmt.fmt.start[0] != tvnorm->vbistart[0] ||
3576 fh->vbi_fmt.fmt.start[1] != tvnorm->vbistart[1] ||
3577 fh->vbi_fmt.fmt.count[0] != fh->vbi_fmt.fmt.count[1]) {
3578 /* BTTV_VBISIZE cannot express these parameters,
3579 however open() resets the paramters to defaults
3580 and apps shouldn't call BTTV_VBISIZE after
3581 VIDIOC_S_FMT. */
3582 return -EINVAL;
3583 }
3584
2975 bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE); 3585 bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE);
2976 return fh->lines * 2 * 2048; 3586 return (fh->vbi_fmt.fmt.count[0] * 2
3587 * fh->vbi_fmt.fmt.samples_per_line);
3588 }
3589
2977 default: 3590 default:
2978 return video_usercopy(inode, file, cmd, arg, bttv_do_ioctl); 3591 return video_usercopy(inode, file, cmd, arg, bttv_do_ioctl);
2979 } 3592 }
@@ -2992,10 +3605,14 @@ static ssize_t bttv_read(struct file *file, char __user *data,
2992 3605
2993 switch (fh->type) { 3606 switch (fh->type) {
2994 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 3607 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
2995 if (locked_btres(fh->btv,RESOURCE_VIDEO)) 3608 if (!check_alloc_btres(fh->btv, fh, RESOURCE_VIDEO_READ)) {
3609 /* VIDEO_READ in use by another fh,
3610 or VIDEO_STREAM by any fh. */
2996 return -EBUSY; 3611 return -EBUSY;
3612 }
2997 retval = videobuf_read_one(&fh->cap, data, count, ppos, 3613 retval = videobuf_read_one(&fh->cap, data, count, ppos,
2998 file->f_flags & O_NONBLOCK); 3614 file->f_flags & O_NONBLOCK);
3615 free_btres(fh->btv, fh, RESOURCE_VIDEO_READ);
2999 break; 3616 break;
3000 case V4L2_BUF_TYPE_VBI_CAPTURE: 3617 case V4L2_BUF_TYPE_VBI_CAPTURE:
3001 if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI)) 3618 if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI))
@@ -3021,7 +3638,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3021 return videobuf_poll_stream(file, &fh->vbi, wait); 3638 return videobuf_poll_stream(file, &fh->vbi, wait);
3022 } 3639 }
3023 3640
3024 if (check_btres(fh,RESOURCE_VIDEO)) { 3641 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) {
3025 /* streaming capture */ 3642 /* streaming capture */
3026 if (list_empty(&fh->cap.stream)) 3643 if (list_empty(&fh->cap.stream))
3027 return POLLERR; 3644 return POLLERR;
@@ -3031,7 +3648,7 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3031 mutex_lock(&fh->cap.lock); 3648 mutex_lock(&fh->cap.lock);
3032 if (NULL == fh->cap.read_buf) { 3649 if (NULL == fh->cap.read_buf) {
3033 /* need to capture a new frame */ 3650 /* need to capture a new frame */
3034 if (locked_btres(fh->btv,RESOURCE_VIDEO)) { 3651 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM)) {
3035 mutex_unlock(&fh->cap.lock); 3652 mutex_unlock(&fh->cap.lock);
3036 return POLLERR; 3653 return POLLERR;
3037 } 3654 }
@@ -3117,8 +3734,23 @@ static int bttv_open(struct inode *inode, struct file *file)
3117 i2c_vidiocschan(btv); 3734 i2c_vidiocschan(btv);
3118 3735
3119 btv->users++; 3736 btv->users++;
3120 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) 3737
3121 bttv_vbi_setlines(fh,btv,16); 3738 /* The V4L2 spec requires one global set of cropping parameters
3739 which only change on request. These are stored in btv->crop[1].
3740 However for compatibility with V4L apps and cropping unaware
3741 V4L2 apps we now reset the cropping parameters as seen through
3742 this fh, which is to say VIDIOC_G_CROP and scaling limit checks
3743 will use btv->crop[0], the default cropping parameters for the
3744 current video standard, and VIDIOC_S_FMT will not implicitely
3745 change the cropping parameters until VIDIOC_S_CROP has been
3746 called. */
3747 fh->do_crop = !reset_crop; /* module parameter */
3748
3749 /* Likewise there should be one global set of VBI capture
3750 parameters, but for compatibility with V4L apps and earlier
3751 driver versions each fh has its own parameters. */
3752 bttv_vbi_fmt_reset(&fh->vbi_fmt, btv->tvnorm);
3753
3122 bttv_field_count(btv); 3754 bttv_field_count(btv);
3123 return 0; 3755 return 0;
3124} 3756}
@@ -3133,14 +3765,17 @@ static int bttv_release(struct inode *inode, struct file *file)
3133 bttv_switch_overlay(btv,fh,NULL); 3765 bttv_switch_overlay(btv,fh,NULL);
3134 3766
3135 /* stop video capture */ 3767 /* stop video capture */
3136 if (check_btres(fh, RESOURCE_VIDEO)) { 3768 if (check_btres(fh, RESOURCE_VIDEO_STREAM)) {
3137 videobuf_streamoff(&fh->cap); 3769 videobuf_streamoff(&fh->cap);
3138 free_btres(btv,fh,RESOURCE_VIDEO); 3770 free_btres(btv,fh,RESOURCE_VIDEO_STREAM);
3139 } 3771 }
3140 if (fh->cap.read_buf) { 3772 if (fh->cap.read_buf) {
3141 buffer_release(&fh->cap,fh->cap.read_buf); 3773 buffer_release(&fh->cap,fh->cap.read_buf);
3142 kfree(fh->cap.read_buf); 3774 kfree(fh->cap.read_buf);
3143 } 3775 }
3776 if (check_btres(fh, RESOURCE_VIDEO_READ)) {
3777 free_btres(btv, fh, RESOURCE_VIDEO_READ);
3778 }
3144 3779
3145 /* stop vbi capture */ 3780 /* stop vbi capture */
3146 if (check_btres(fh, RESOURCE_VBI)) { 3781 if (check_btres(fh, RESOURCE_VBI)) {
@@ -3997,7 +4632,6 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3997 4632
3998 /* initialize structs / fill in defaults */ 4633 /* initialize structs / fill in defaults */
3999 mutex_init(&btv->lock); 4634 mutex_init(&btv->lock);
4000 mutex_init(&btv->reslock);
4001 spin_lock_init(&btv->s_lock); 4635 spin_lock_init(&btv->s_lock);
4002 spin_lock_init(&btv->gpio_lock); 4636 spin_lock_init(&btv->gpio_lock);
4003 init_waitqueue_head(&btv->gpioq); 4637 init_waitqueue_head(&btv->gpioq);
@@ -4095,7 +4729,6 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4095 btv->init.fmt = format_by_palette(VIDEO_PALETTE_RGB24); 4729 btv->init.fmt = format_by_palette(VIDEO_PALETTE_RGB24);
4096 btv->init.width = 320; 4730 btv->init.width = 320;
4097 btv->init.height = 240; 4731 btv->init.height = 240;
4098 btv->init.lines = 16;
4099 btv->input = 0; 4732 btv->input = 0;
4100 4733
4101 /* initialize hardware */ 4734 /* initialize hardware */
@@ -4130,6 +4763,10 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4130 bt848_sat(btv,32768); 4763 bt848_sat(btv,32768);
4131 audio_mute(btv, 1); 4764 audio_mute(btv, 1);
4132 set_input(btv,0); 4765 set_input(btv,0);
4766 bttv_crop_reset(&btv->crop[0], btv->tvnorm);
4767 btv->crop[1] = btv->crop[0]; /* current = default */
4768 disclaim_vbi_lines(btv);
4769 disclaim_video_lines(btv);
4133 } 4770 }
4134 4771
4135 /* add subdevices */ 4772 /* add subdevices */
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index afcfe71e3792..e7104d9cb4bd 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -43,7 +43,8 @@ int
43bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, 43bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
44 struct scatterlist *sglist, 44 struct scatterlist *sglist,
45 unsigned int offset, unsigned int bpl, 45 unsigned int offset, unsigned int bpl,
46 unsigned int padding, unsigned int lines) 46 unsigned int padding, unsigned int skip_lines,
47 unsigned int store_lines)
47{ 48{
48 u32 instructions,line,todo; 49 u32 instructions,line,todo;
49 struct scatterlist *sg; 50 struct scatterlist *sg;
@@ -54,9 +55,11 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
54 one write per scan line + sync + jump (all 2 dwords). padding 55 one write per scan line + sync + jump (all 2 dwords). padding
55 can cause next bpl to start close to a page border. First DMA 56 can cause next bpl to start close to a page border. First DMA
56 region may be smaller than PAGE_SIZE */ 57 region may be smaller than PAGE_SIZE */
57 instructions = 1 + ((bpl + padding) * lines) / PAGE_SIZE + lines; 58 instructions = skip_lines * 4;
58 instructions += 2; 59 instructions += (1 + ((bpl + padding) * store_lines)
59 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) 60 / PAGE_SIZE + store_lines) * 8;
61 instructions += 2 * 8;
62 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions)) < 0)
60 return rc; 63 return rc;
61 64
62 /* sync instruction */ 65 /* sync instruction */
@@ -64,11 +67,16 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
64 *(rp++) = cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); 67 *(rp++) = cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1);
65 *(rp++) = cpu_to_le32(0); 68 *(rp++) = cpu_to_le32(0);
66 69
70 while (skip_lines-- > 0) {
71 *(rp++) = cpu_to_le32(BT848_RISC_SKIP | BT848_RISC_SOL |
72 BT848_RISC_EOL | bpl);
73 }
74
67 /* scan lines */ 75 /* scan lines */
68 sg = sglist; 76 sg = sglist;
69 for (line = 0; line < lines; line++) { 77 for (line = 0; line < store_lines; line++) {
70 if ((btv->opt_vcr_hack) && 78 if ((btv->opt_vcr_hack) &&
71 (line >= (lines - VCR_HACK_LINES))) 79 (line >= (store_lines - VCR_HACK_LINES)))
72 continue; 80 continue;
73 while (offset && offset >= sg_dma_len(sg)) { 81 while (offset && offset >= sg_dma_len(sg)) {
74 offset -= sg_dma_len(sg); 82 offset -= sg_dma_len(sg);
@@ -130,7 +138,8 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
130 /* estimate risc mem: worst case is one write per page border + 138 /* estimate risc mem: worst case is one write per page border +
131 one write per scan line (5 dwords) 139 one write per scan line (5 dwords)
132 plus sync + jump (2 dwords) */ 140 plus sync + jump (2 dwords) */
133 instructions = (ybpl * ylines * 2) / PAGE_SIZE + ylines; 141 instructions = ((3 + (ybpl + ypadding) * ylines * 2)
142 / PAGE_SIZE) + ylines;
134 instructions += 2; 143 instructions += 2;
135 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*4*5)) < 0) 144 if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*4*5)) < 0)
136 return rc; 145 return rc;
@@ -317,10 +326,10 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
317/* ---------------------------------------------------------- */ 326/* ---------------------------------------------------------- */
318 327
319static void 328static void
320bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo, 329bttv_calc_geo_old(struct bttv *btv, struct bttv_geometry *geo,
321 int width, int height, int interleaved, int norm) 330 int width, int height, int interleaved,
331 const struct bttv_tvnorm *tvnorm)
322{ 332{
323 const struct bttv_tvnorm *tvnorm = &bttv_tvnorms[norm];
324 u32 xsf, sr; 333 u32 xsf, sr;
325 int vdelay; 334 int vdelay;
326 335
@@ -361,6 +370,62 @@ bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
361} 370}
362 371
363static void 372static void
373bttv_calc_geo (struct bttv * btv,
374 struct bttv_geometry * geo,
375 unsigned int width,
376 unsigned int height,
377 int both_fields,
378 const struct bttv_tvnorm * tvnorm,
379 const struct v4l2_rect * crop)
380{
381 unsigned int c_width;
382 unsigned int c_height;
383 u32 sr;
384
385 if ((crop->left == tvnorm->cropcap.defrect.left
386 && crop->top == tvnorm->cropcap.defrect.top
387 && crop->width == tvnorm->cropcap.defrect.width
388 && crop->height == tvnorm->cropcap.defrect.height
389 && width <= tvnorm->swidth /* see PAL-Nc et al */)
390 || bttv_tvcards[btv->c.type].muxsel[btv->input] < 0) {
391 bttv_calc_geo_old(btv, geo, width, height,
392 both_fields, tvnorm);
393 return;
394 }
395
396 /* For bug compatibility the image size checks permit scale
397 factors > 16. See bttv_crop_calc_limits(). */
398 c_width = min((unsigned int) crop->width, width * 16);
399 c_height = min((unsigned int) crop->height, height * 16);
400
401 geo->width = width;
402 geo->hscale = (c_width * 4096U + (width >> 1)) / width - 4096;
403 /* Even to store Cb first, odd for Cr. */
404 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1;
405
406 geo->sheight = c_height;
407 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY;
408 sr = c_height >> !both_fields;
409 sr = (sr * 512U + (height >> 1)) / height - 512;
410 geo->vscale = (0x10000UL - sr) & 0x1fff;
411 geo->vscale |= both_fields ? (BT848_VSCALE_INT << 8) : 0;
412 geo->vtotal = tvnorm->vtotal;
413
414 geo->crop = (((geo->width >> 8) & 0x03) |
415 ((geo->hdelay >> 6) & 0x0c) |
416 ((geo->sheight >> 4) & 0x30) |
417 ((geo->vdelay >> 2) & 0xc0));
418
419 if (btv->opt_combfilter) {
420 geo->vtc = (width < 193) ? 2 : ((width < 385) ? 1 : 0);
421 geo->comb = (width < 769) ? 1 : 0;
422 } else {
423 geo->vtc = 0;
424 geo->comb = 0;
425 }
426}
427
428static void
364bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd) 429bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd)
365{ 430{
366 int off = odd ? 0x80 : 0x00; 431 int off = odd ? 0x80 : 0x00;
@@ -522,16 +587,51 @@ int
522bttv_buffer_activate_vbi(struct bttv *btv, 587bttv_buffer_activate_vbi(struct bttv *btv,
523 struct bttv_buffer *vbi) 588 struct bttv_buffer *vbi)
524{ 589{
525 /* vbi capture */ 590 struct btcx_riscmem *top;
591 struct btcx_riscmem *bottom;
592 int top_irq_flags;
593 int bottom_irq_flags;
594
595 top = NULL;
596 bottom = NULL;
597 top_irq_flags = 0;
598 bottom_irq_flags = 0;
599
526 if (vbi) { 600 if (vbi) {
601 unsigned int crop, vdelay;
602
527 vbi->vb.state = STATE_ACTIVE; 603 vbi->vb.state = STATE_ACTIVE;
528 list_del(&vbi->vb.queue); 604 list_del(&vbi->vb.queue);
529 bttv_risc_hook(btv, RISC_SLOT_O_VBI, &vbi->top, 0); 605
530 bttv_risc_hook(btv, RISC_SLOT_E_VBI, &vbi->bottom, 4); 606 /* VDELAY is start of video, end of VBI capturing. */
531 } else { 607 crop = btread(BT848_E_CROP);
532 bttv_risc_hook(btv, RISC_SLOT_O_VBI, NULL, 0); 608 vdelay = btread(BT848_E_VDELAY_LO) + ((crop & 0xc0) << 2);
533 bttv_risc_hook(btv, RISC_SLOT_E_VBI, NULL, 0); 609
610 if (vbi->geo.vdelay > vdelay) {
611 vdelay = vbi->geo.vdelay & 0xfe;
612 crop = (crop & 0x3f) | ((vbi->geo.vdelay >> 2) & 0xc0);
613
614 btwrite(vdelay, BT848_E_VDELAY_LO);
615 btwrite(crop, BT848_E_CROP);
616 btwrite(vdelay, BT848_O_VDELAY_LO);
617 btwrite(crop, BT848_O_CROP);
618 }
619
620 if (vbi->vbi_count[0] > 0) {
621 top = &vbi->top;
622 top_irq_flags = 4;
623 }
624
625 if (vbi->vbi_count[1] > 0) {
626 top_irq_flags = 0;
627 bottom = &vbi->bottom;
628 bottom_irq_flags = 4;
629 }
534 } 630 }
631
632 bttv_risc_hook(btv, RISC_SLOT_O_VBI, top, top_irq_flags);
633 bttv_risc_hook(btv, RISC_SLOT_E_VBI, bottom, bottom_irq_flags);
634
535 return 0; 635 return 0;
536} 636}
537 637
@@ -611,28 +711,31 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
611 int bpf = bpl * (buf->vb.height >> 1); 711 int bpf = bpl * (buf->vb.height >> 1);
612 712
613 bttv_calc_geo(btv,&buf->geo,buf->vb.width,buf->vb.height, 713 bttv_calc_geo(btv,&buf->geo,buf->vb.width,buf->vb.height,
614 V4L2_FIELD_HAS_BOTH(buf->vb.field),buf->tvnorm); 714 V4L2_FIELD_HAS_BOTH(buf->vb.field),
715 tvnorm,&buf->crop);
615 716
616 switch (buf->vb.field) { 717 switch (buf->vb.field) {
617 case V4L2_FIELD_TOP: 718 case V4L2_FIELD_TOP:
618 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 719 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist,
619 0,bpl,0,buf->vb.height); 720 /* offset */ 0,bpl,
721 /* padding */ 0,/* skip_lines */ 0,
722 buf->vb.height);
620 break; 723 break;
621 case V4L2_FIELD_BOTTOM: 724 case V4L2_FIELD_BOTTOM:
622 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 725 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist,
623 0,bpl,0,buf->vb.height); 726 0,bpl,0,0,buf->vb.height);
624 break; 727 break;
625 case V4L2_FIELD_INTERLACED: 728 case V4L2_FIELD_INTERLACED:
626 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 729 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist,
627 0,bpl,bpl,buf->vb.height >> 1); 730 0,bpl,bpl,0,buf->vb.height >> 1);
628 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 731 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist,
629 bpl,bpl,bpl,buf->vb.height >> 1); 732 bpl,bpl,bpl,0,buf->vb.height >> 1);
630 break; 733 break;
631 case V4L2_FIELD_SEQ_TB: 734 case V4L2_FIELD_SEQ_TB:
632 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist, 735 bttv_risc_packed(btv,&buf->top,buf->vb.dma.sglist,
633 0,bpl,0,buf->vb.height >> 1); 736 0,bpl,0,0,buf->vb.height >> 1);
634 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist, 737 bttv_risc_packed(btv,&buf->bottom,buf->vb.dma.sglist,
635 bpf,bpl,0,buf->vb.height >> 1); 738 bpf,bpl,0,0,buf->vb.height >> 1);
636 break; 739 break;
637 default: 740 default:
638 BUG(); 741 BUG();
@@ -662,7 +765,8 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
662 switch (buf->vb.field) { 765 switch (buf->vb.field) {
663 case V4L2_FIELD_TOP: 766 case V4L2_FIELD_TOP:
664 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 767 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
665 buf->vb.height,0,buf->tvnorm); 768 buf->vb.height,/* both_fields */ 0,
769 tvnorm,&buf->crop);
666 bttv_risc_planar(btv, &buf->top, buf->vb.dma.sglist, 770 bttv_risc_planar(btv, &buf->top, buf->vb.dma.sglist,
667 0,buf->vb.width,0,buf->vb.height, 771 0,buf->vb.width,0,buf->vb.height,
668 uoffset,voffset,buf->fmt->hshift, 772 uoffset,voffset,buf->fmt->hshift,
@@ -670,7 +774,8 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
670 break; 774 break;
671 case V4L2_FIELD_BOTTOM: 775 case V4L2_FIELD_BOTTOM:
672 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 776 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
673 buf->vb.height,0,buf->tvnorm); 777 buf->vb.height,0,
778 tvnorm,&buf->crop);
674 bttv_risc_planar(btv, &buf->bottom, buf->vb.dma.sglist, 779 bttv_risc_planar(btv, &buf->bottom, buf->vb.dma.sglist,
675 0,buf->vb.width,0,buf->vb.height, 780 0,buf->vb.width,0,buf->vb.height,
676 uoffset,voffset,buf->fmt->hshift, 781 uoffset,voffset,buf->fmt->hshift,
@@ -678,7 +783,8 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
678 break; 783 break;
679 case V4L2_FIELD_INTERLACED: 784 case V4L2_FIELD_INTERLACED:
680 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 785 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
681 buf->vb.height,1,buf->tvnorm); 786 buf->vb.height,1,
787 tvnorm,&buf->crop);
682 lines = buf->vb.height >> 1; 788 lines = buf->vb.height >> 1;
683 ypadding = buf->vb.width; 789 ypadding = buf->vb.width;
684 cpadding = buf->vb.width >> buf->fmt->hshift; 790 cpadding = buf->vb.width >> buf->fmt->hshift;
@@ -700,7 +806,8 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
700 break; 806 break;
701 case V4L2_FIELD_SEQ_TB: 807 case V4L2_FIELD_SEQ_TB:
702 bttv_calc_geo(btv,&buf->geo,buf->vb.width, 808 bttv_calc_geo(btv,&buf->geo,buf->vb.width,
703 buf->vb.height,1,buf->tvnorm); 809 buf->vb.height,1,
810 tvnorm,&buf->crop);
704 lines = buf->vb.height >> 1; 811 lines = buf->vb.height >> 1;
705 ypadding = buf->vb.width; 812 ypadding = buf->vb.width;
706 cpadding = buf->vb.width >> buf->fmt->hshift; 813 cpadding = buf->vb.width >> buf->fmt->hshift;
@@ -731,11 +838,12 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
731 /* build risc code */ 838 /* build risc code */
732 buf->vb.field = V4L2_FIELD_SEQ_TB; 839 buf->vb.field = V4L2_FIELD_SEQ_TB;
733 bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight, 840 bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight,
734 1,buf->tvnorm); 841 1,tvnorm,&buf->crop);
735 bttv_risc_packed(btv, &buf->top, buf->vb.dma.sglist, 842 bttv_risc_packed(btv, &buf->top, buf->vb.dma.sglist,
736 0, RAW_BPL, 0, RAW_LINES); 843 /* offset */ 0, RAW_BPL, /* padding */ 0,
844 /* skip_lines */ 0, RAW_LINES);
737 bttv_risc_packed(btv, &buf->bottom, buf->vb.dma.sglist, 845 bttv_risc_packed(btv, &buf->bottom, buf->vb.dma.sglist,
738 buf->vb.size/2 , RAW_BPL, 0, RAW_LINES); 846 buf->vb.size/2 , RAW_BPL, 0, 0, RAW_LINES);
739 } 847 }
740 848
741 /* copy format info */ 849 /* copy format info */
@@ -761,7 +869,8 @@ bttv_overlay_risc(struct bttv *btv,
761 869
762 /* calculate geometry */ 870 /* calculate geometry */
763 bttv_calc_geo(btv,&buf->geo,ov->w.width,ov->w.height, 871 bttv_calc_geo(btv,&buf->geo,ov->w.width,ov->w.height,
764 V4L2_FIELD_HAS_BOTH(ov->field), ov->tvnorm); 872 V4L2_FIELD_HAS_BOTH(ov->field),
873 &bttv_tvnorms[ov->tvnorm],&buf->crop);
765 874
766 /* build risc code */ 875 /* build risc code */
767 switch (ov->field) { 876 switch (ov->field) {
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c
index 6fc6b0260056..754f66bfdf46 100644
--- a/drivers/media/video/bt8xx/bttv-vbi.c
+++ b/drivers/media/video/bt8xx/bttv-vbi.c
@@ -5,6 +5,9 @@
5 5
6 (c) 2002 Gerd Knorr <kraxel@bytesex.org> 6 (c) 2002 Gerd Knorr <kraxel@bytesex.org>
7 7
8 Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at>
9 Sponsored by OPQ Systems AB
10
8 This program is free software; you can redistribute it and/or modify 11 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 12 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 13 the Free Software Foundation; either version 2 of the License, or
@@ -41,8 +44,15 @@
41 to be about 244. */ 44 to be about 244. */
42#define VBI_OFFSET 244 45#define VBI_OFFSET 244
43 46
47/* 2048 for compatibility with earlier driver versions. The driver
48 really stores 1024 + tvnorm->vbipack * 4 samples per line in the
49 buffer. Note tvnorm->vbipack is <= 0xFF (limit of VBIPACK_LO + HI
50 is 0x1FF DWORDs) and VBI read()s store a frame counter in the last
51 four bytes of the VBI image. */
52#define VBI_BPL 2048
53
54/* Compatibility. */
44#define VBI_DEFLINES 16 55#define VBI_DEFLINES 16
45#define VBI_MAXLINES 32
46 56
47static unsigned int vbibufs = 4; 57static unsigned int vbibufs = 4;
48static unsigned int vbi_debug = 0; 58static unsigned int vbi_debug = 0;
@@ -58,21 +68,12 @@ MODULE_PARM_DESC(vbi_debug,"vbi code debug messages, default is 0 (no)");
58#define dprintk(fmt, arg...) if (vbi_debug) \ 68#define dprintk(fmt, arg...) if (vbi_debug) \
59 printk(KERN_DEBUG "bttv%d/vbi: " fmt, btv->c.nr , ## arg) 69 printk(KERN_DEBUG "bttv%d/vbi: " fmt, btv->c.nr , ## arg)
60 70
71#define IMAGE_SIZE(fmt) \
72 (((fmt)->count[0] + (fmt)->count[1]) * (fmt)->samples_per_line)
73
61/* ----------------------------------------------------------------------- */ 74/* ----------------------------------------------------------------------- */
62/* vbi risc code + mm */ 75/* vbi risc code + mm */
63 76
64static int
65vbi_buffer_risc(struct bttv *btv, struct bttv_buffer *buf, int lines)
66{
67 int bpl = 2048;
68
69 bttv_risc_packed(btv, &buf->top, buf->vb.dma.sglist,
70 0, bpl-4, 4, lines);
71 bttv_risc_packed(btv, &buf->bottom, buf->vb.dma.sglist,
72 lines * bpl, bpl-4, 4, lines);
73 return 0;
74}
75
76static int vbi_buffer_setup(struct videobuf_queue *q, 77static int vbi_buffer_setup(struct videobuf_queue *q,
77 unsigned int *count, unsigned int *size) 78 unsigned int *count, unsigned int *size)
78{ 79{
@@ -81,8 +82,16 @@ static int vbi_buffer_setup(struct videobuf_queue *q,
81 82
82 if (0 == *count) 83 if (0 == *count)
83 *count = vbibufs; 84 *count = vbibufs;
84 *size = fh->lines * 2 * 2048; 85
85 dprintk("setup: lines=%d\n",fh->lines); 86 *size = IMAGE_SIZE(&fh->vbi_fmt.fmt);
87
88 dprintk("setup: samples=%u start=%d,%d count=%u,%u\n",
89 fh->vbi_fmt.fmt.samples_per_line,
90 fh->vbi_fmt.fmt.start[0],
91 fh->vbi_fmt.fmt.start[1],
92 fh->vbi_fmt.fmt.count[0],
93 fh->vbi_fmt.fmt.count[1]);
94
86 return 0; 95 return 0;
87} 96}
88 97
@@ -93,18 +102,93 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
93 struct bttv_fh *fh = q->priv_data; 102 struct bttv_fh *fh = q->priv_data;
94 struct bttv *btv = fh->btv; 103 struct bttv *btv = fh->btv;
95 struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); 104 struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
105 const struct bttv_tvnorm *tvnorm;
106 unsigned int skip_lines0, skip_lines1, min_vdelay;
107 int redo_dma_risc;
96 int rc; 108 int rc;
97 109
98 buf->vb.size = fh->lines * 2 * 2048; 110 buf->vb.size = IMAGE_SIZE(&fh->vbi_fmt.fmt);
99 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) 111 if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
100 return -EINVAL; 112 return -EINVAL;
101 113
114 tvnorm = fh->vbi_fmt.tvnorm;
115
116 /* There's no VBI_VDELAY register, RISC must skip the lines
117 we don't want. With default parameters we skip zero lines
118 as earlier driver versions did. The driver permits video
119 standard changes while capturing, so we use vbi_fmt.tvnorm
120 instead of btv->tvnorm to skip zero lines after video
121 standard changes as well. */
122
123 skip_lines0 = 0;
124 skip_lines1 = 0;
125
126 if (fh->vbi_fmt.fmt.count[0] > 0)
127 skip_lines0 = max(0, (fh->vbi_fmt.fmt.start[0]
128 - tvnorm->vbistart[0]));
129 if (fh->vbi_fmt.fmt.count[1] > 0)
130 skip_lines1 = max(0, (fh->vbi_fmt.fmt.start[1]
131 - tvnorm->vbistart[1]));
132
133 redo_dma_risc = 0;
134
135 if (buf->vbi_skip[0] != skip_lines0 ||
136 buf->vbi_skip[1] != skip_lines1 ||
137 buf->vbi_count[0] != fh->vbi_fmt.fmt.count[0] ||
138 buf->vbi_count[1] != fh->vbi_fmt.fmt.count[1]) {
139 buf->vbi_skip[0] = skip_lines0;
140 buf->vbi_skip[1] = skip_lines1;
141 buf->vbi_count[0] = fh->vbi_fmt.fmt.count[0];
142 buf->vbi_count[1] = fh->vbi_fmt.fmt.count[1];
143 redo_dma_risc = 1;
144 }
145
102 if (STATE_NEEDS_INIT == buf->vb.state) { 146 if (STATE_NEEDS_INIT == buf->vb.state) {
147 redo_dma_risc = 1;
103 if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL))) 148 if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL)))
104 goto fail; 149 goto fail;
105 if (0 != (rc = vbi_buffer_risc(btv,buf,fh->lines)))
106 goto fail;
107 } 150 }
151
152 if (redo_dma_risc) {
153 unsigned int bpl, padding, offset;
154
155 bpl = 2044; /* max. vbipack */
156 padding = VBI_BPL - bpl;
157
158 if (fh->vbi_fmt.fmt.count[0] > 0) {
159 rc = bttv_risc_packed(btv, &buf->top,
160 buf->vb.dma.sglist,
161 /* offset */ 0, bpl,
162 padding, skip_lines0,
163 fh->vbi_fmt.fmt.count[0]);
164 if (0 != rc)
165 goto fail;
166 }
167
168 if (fh->vbi_fmt.fmt.count[1] > 0) {
169 offset = fh->vbi_fmt.fmt.count[0] * VBI_BPL;
170
171 rc = bttv_risc_packed(btv, &buf->bottom,
172 buf->vb.dma.sglist,
173 offset, bpl,
174 padding, skip_lines1,
175 fh->vbi_fmt.fmt.count[1]);
176 if (0 != rc)
177 goto fail;
178 }
179 }
180
181 /* VBI capturing ends at VDELAY, start of video capturing,
182 no matter where the RISC program ends. VDELAY minimum is 2,
183 bounds.top is the corresponding first field line number
184 times two. VDELAY counts half field lines. */
185 min_vdelay = MIN_VDELAY;
186 if (fh->vbi_fmt.end >= tvnorm->cropcap.bounds.top)
187 min_vdelay += fh->vbi_fmt.end - tvnorm->cropcap.bounds.top;
188
189 /* For bttv_buffer_activate_vbi(). */
190 buf->geo.vdelay = min_vdelay;
191
108 buf->vb.state = STATE_PREPARED; 192 buf->vb.state = STATE_PREPARED;
109 buf->vb.field = field; 193 buf->vb.field = field;
110 dprintk("buf prepare %p: top=%p bottom=%p field=%s\n", 194 dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
@@ -152,69 +236,215 @@ struct videobuf_queue_ops bttv_vbi_qops = {
152 236
153/* ----------------------------------------------------------------------- */ 237/* ----------------------------------------------------------------------- */
154 238
155void bttv_vbi_setlines(struct bttv_fh *fh, struct bttv *btv, int lines) 239static int
240try_fmt (struct v4l2_vbi_format * f,
241 const struct bttv_tvnorm * tvnorm,
242 __s32 crop_start)
156{ 243{
157 int vdelay; 244 __s32 min_start, max_start, max_end, f2_offset;
158 245 unsigned int i;
159 if (lines < 1) 246
160 lines = 1; 247 /* For compatibility with earlier driver versions we must pretend
161 if (lines > VBI_MAXLINES) 248 the VBI and video capture window may overlap. In reality RISC
162 lines = VBI_MAXLINES; 249 magic aborts VBI capturing at the first line of video capturing,
163 fh->lines = lines; 250 leaving the rest of the buffer unchanged, usually all zero.
164 251 VBI capturing must always start before video capturing. >> 1
165 vdelay = btread(BT848_E_VDELAY_LO); 252 because cropping counts field lines times two. */
166 if (vdelay < lines*2) { 253 min_start = tvnorm->vbistart[0];
167 vdelay = lines*2; 254 max_start = (crop_start >> 1) - 1;
168 btwrite(vdelay,BT848_E_VDELAY_LO); 255 max_end = (tvnorm->cropcap.bounds.top
169 btwrite(vdelay,BT848_O_VDELAY_LO); 256 + tvnorm->cropcap.bounds.height) >> 1;
257
258 if (min_start > max_start)
259 return -EBUSY;
260
261 BUG_ON(max_start >= max_end);
262
263 f->sampling_rate = tvnorm->Fsc;
264 f->samples_per_line = VBI_BPL;
265 f->sample_format = V4L2_PIX_FMT_GREY;
266 f->offset = VBI_OFFSET;
267
268 f2_offset = tvnorm->vbistart[1] - tvnorm->vbistart[0];
269
270 for (i = 0; i < 2; ++i) {
271 if (0 == f->count[i]) {
272 /* No data from this field. We leave f->start[i]
273 alone because VIDIOCSVBIFMT is w/o and EINVALs
274 when a driver does not support exactly the
275 requested parameters. */
276 } else {
277 s64 start, count;
278
279 start = clamp(f->start[i], min_start, max_start);
280 /* s64 to prevent overflow. */
281 count = (s64) f->start[i] + f->count[i] - start;
282 f->start[i] = start;
283 f->count[i] = clamp(count, (s64) 1,
284 max_end - start);
285 }
286
287 min_start += f2_offset;
288 max_start += f2_offset;
289 max_end += f2_offset;
170 } 290 }
291
292 if (0 == (f->count[0] | f->count[1])) {
293 /* As in earlier driver versions. */
294 f->start[0] = tvnorm->vbistart[0];
295 f->start[1] = tvnorm->vbistart[1];
296 f->count[0] = 1;
297 f->count[1] = 1;
298 }
299
300 f->flags = 0;
301
302 f->reserved[0] = 0;
303 f->reserved[1] = 0;
304
305 return 0;
171} 306}
172 307
173void bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_format *f) 308int
309bttv_vbi_try_fmt (struct bttv_fh * fh,
310 struct v4l2_vbi_format * f)
174{ 311{
312 struct bttv *btv = fh->btv;
175 const struct bttv_tvnorm *tvnorm; 313 const struct bttv_tvnorm *tvnorm;
176 s64 count0,count1,count; 314 __s32 crop_start;
177 315
178 tvnorm = &bttv_tvnorms[fh->btv->tvnorm]; 316 mutex_lock(&btv->lock);
179 f->type = V4L2_BUF_TYPE_VBI_CAPTURE; 317
180 f->fmt.vbi.sampling_rate = tvnorm->Fsc; 318 tvnorm = &bttv_tvnorms[btv->tvnorm];
181 f->fmt.vbi.samples_per_line = 2048; 319 crop_start = btv->crop_start;
182 f->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY; 320
183 f->fmt.vbi.offset = VBI_OFFSET; 321 mutex_unlock(&btv->lock);
184 f->fmt.vbi.flags = 0; 322
185 323 return try_fmt(f, tvnorm, crop_start);
186 /* s64 to prevent overflow. */
187 count0 = (s64) f->fmt.vbi.start[0] + f->fmt.vbi.count[0]
188 - tvnorm->vbistart[0];
189 count1 = (s64) f->fmt.vbi.start[1] + f->fmt.vbi.count[1]
190 - tvnorm->vbistart[1];
191 count = clamp (max (count0, count1), (s64) 1, (s64) VBI_MAXLINES);
192
193 f->fmt.vbi.start[0] = tvnorm->vbistart[0];
194 f->fmt.vbi.start[1] = tvnorm->vbistart[1];
195 f->fmt.vbi.count[0] = count;
196 f->fmt.vbi.count[1] = count;
197
198 f->fmt.vbi.reserved[0] = 0;
199 f->fmt.vbi.reserved[1] = 0;
200} 324}
201 325
202void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_format *f) 326int
327bttv_vbi_set_fmt (struct bttv_fh * fh,
328 struct v4l2_vbi_format * f)
203{ 329{
330 struct bttv *btv = fh->btv;
204 const struct bttv_tvnorm *tvnorm; 331 const struct bttv_tvnorm *tvnorm;
332 __s32 start1, end;
333 int rc;
334
335 mutex_lock(&btv->lock);
336
337 rc = -EBUSY;
338 if (fh->resources & RESOURCE_VBI)
339 goto fail;
340
341 tvnorm = &bttv_tvnorms[btv->tvnorm];
342
343 rc = try_fmt(f, tvnorm, btv->crop_start);
344 if (0 != rc)
345 goto fail;
346
347 start1 = f->start[1] - tvnorm->vbistart[1] + tvnorm->vbistart[0];
348
349 /* First possible line of video capturing. Should be
350 max(f->start[0] + f->count[0], start1 + f->count[1]) * 2
351 when capturing both fields. But for compatibility we must
352 pretend the VBI and video capture window may overlap,
353 so end = start + 1, the lowest possible value, times two
354 because vbi_fmt.end counts field lines times two. */
355 end = max(f->start[0], start1) * 2 + 2;
356
357 mutex_lock(&fh->vbi.lock);
358
359 fh->vbi_fmt.fmt = *f;
360 fh->vbi_fmt.tvnorm = tvnorm;
361 fh->vbi_fmt.end = end;
362
363 mutex_unlock(&fh->vbi.lock);
364
365 rc = 0;
366
367 fail:
368 mutex_unlock(&btv->lock);
369
370 return rc;
371}
372
373void
374bttv_vbi_get_fmt (struct bttv_fh * fh,
375 struct v4l2_vbi_format * f)
376{
377 const struct bttv_tvnorm *tvnorm;
378
379 *f = fh->vbi_fmt.fmt;
205 380
206 tvnorm = &bttv_tvnorms[fh->btv->tvnorm]; 381 tvnorm = &bttv_tvnorms[fh->btv->tvnorm];
207 memset(f,0,sizeof(*f)); 382
208 f->type = V4L2_BUF_TYPE_VBI_CAPTURE; 383 if (tvnorm != fh->vbi_fmt.tvnorm) {
209 f->fmt.vbi.sampling_rate = tvnorm->Fsc; 384 __s32 max_end;
210 f->fmt.vbi.samples_per_line = 2048; 385 unsigned int i;
211 f->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY; 386
212 f->fmt.vbi.offset = VBI_OFFSET; 387 /* As in vbi_buffer_prepare() this imitates the
213 f->fmt.vbi.start[0] = tvnorm->vbistart[0]; 388 behaviour of earlier driver versions after video
214 f->fmt.vbi.start[1] = tvnorm->vbistart[1]; 389 standard changes, with default parameters anyway. */
215 f->fmt.vbi.count[0] = fh->lines; 390
216 f->fmt.vbi.count[1] = fh->lines; 391 max_end = (tvnorm->cropcap.bounds.top
217 f->fmt.vbi.flags = 0; 392 + tvnorm->cropcap.bounds.height) >> 1;
393
394 f->sampling_rate = tvnorm->Fsc;
395
396 for (i = 0; i < 2; ++i) {
397 __s32 new_start;
398
399 new_start = f->start[i]
400 + tvnorm->vbistart[i]
401 - fh->vbi_fmt.tvnorm->vbistart[i];
402
403 f->start[i] = min(new_start, max_end - 1);
404 f->count[i] = min((__s32) f->count[i],
405 max_end - f->start[i]);
406
407 max_end += tvnorm->vbistart[1]
408 - tvnorm->vbistart[0];
409 }
410 }
411}
412
413void
414bttv_vbi_fmt_reset (struct bttv_vbi_fmt * f,
415 int norm)
416{
417 const struct bttv_tvnorm *tvnorm;
418 unsigned int real_samples_per_line;
419 unsigned int real_count;
420
421 tvnorm = &bttv_tvnorms[norm];
422
423 f->fmt.sampling_rate = tvnorm->Fsc;
424 f->fmt.samples_per_line = VBI_BPL;
425 f->fmt.sample_format = V4L2_PIX_FMT_GREY;
426 f->fmt.offset = VBI_OFFSET;
427 f->fmt.start[0] = tvnorm->vbistart[0];
428 f->fmt.start[1] = tvnorm->vbistart[1];
429 f->fmt.count[0] = VBI_DEFLINES;
430 f->fmt.count[1] = VBI_DEFLINES;
431 f->fmt.flags = 0;
432 f->fmt.reserved[0] = 0;
433 f->fmt.reserved[1] = 0;
434
435 /* For compatibility the buffer size must be 2 * VBI_DEFLINES *
436 VBI_BPL regardless of the current video standard. */
437 real_samples_per_line = 1024 + tvnorm->vbipack * 4;
438 real_count = ((tvnorm->cropcap.defrect.top >> 1)
439 - tvnorm->vbistart[0]);
440
441 BUG_ON(real_samples_per_line > VBI_BPL);
442 BUG_ON(real_count > VBI_DEFLINES);
443
444 f->tvnorm = tvnorm;
445
446 /* See bttv_vbi_fmt_set(). */
447 f->end = tvnorm->vbistart[0] * 2 + 2;
218} 448}
219 449
220/* ----------------------------------------------------------------------- */ 450/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 3802cafc9e41..ad79b8d53430 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -26,7 +26,7 @@
26#define _BTTVP_H_ 26#define _BTTVP_H_
27 27
28#include <linux/version.h> 28#include <linux/version.h>
29#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,16) 29#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,17)
30 30
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/wait.h> 32#include <linux/wait.h>
@@ -66,14 +66,22 @@
66#define RISC_SLOT_LOOP 14 66#define RISC_SLOT_LOOP 14
67 67
68#define RESOURCE_OVERLAY 1 68#define RESOURCE_OVERLAY 1
69#define RESOURCE_VIDEO 2 69#define RESOURCE_VIDEO_STREAM 2
70#define RESOURCE_VBI 4 70#define RESOURCE_VBI 4
71#define RESOURCE_VIDEO_READ 8
71 72
72#define RAW_LINES 640 73#define RAW_LINES 640
73#define RAW_BPL 1024 74#define RAW_BPL 1024
74 75
75#define UNSET (-1U) 76#define UNSET (-1U)
76 77
78/* Min. value in VDELAY register. */
79#define MIN_VDELAY 2
80/* Even to get Cb first, odd for Cr. */
81#define MAX_HDELAY (0x3FF & -2)
82/* Limits scaled width, which must be a multiple of 4. */
83#define MAX_HACTIVE (0x3FF & -4)
84
77#define clamp(x, low, high) min (max (low, x), high) 85#define clamp(x, low, high) min (max (low, x), high)
78 86
79/* ---------------------------------------------------------- */ 87/* ---------------------------------------------------------- */
@@ -92,8 +100,13 @@ struct bttv_tvnorm {
92 u16 vtotal; 100 u16 vtotal;
93 int sram; 101 int sram;
94 /* ITU-R frame line number of the first VBI line we can 102 /* ITU-R frame line number of the first VBI line we can
95 capture, of the first and second field. */ 103 capture, of the first and second field. The last possible line
104 is determined by cropcap.bounds. */
96 u16 vbistart[2]; 105 u16 vbistart[2];
106 /* Horizontally this counts fCLKx1 samples following the leading
107 edge of the horizontal sync pulse, vertically ITU-R frame line
108 numbers of the first field times two (2, 4, 6, ... 524 or 624). */
109 struct v4l2_cropcap cropcap;
97}; 110};
98extern const struct bttv_tvnorm bttv_tvnorms[]; 111extern const struct bttv_tvnorm bttv_tvnorms[];
99 112
@@ -128,6 +141,9 @@ struct bttv_buffer {
128 struct bttv_geometry geo; 141 struct bttv_geometry geo;
129 struct btcx_riscmem top; 142 struct btcx_riscmem top;
130 struct btcx_riscmem bottom; 143 struct btcx_riscmem bottom;
144 struct v4l2_rect crop;
145 unsigned int vbi_skip[2];
146 unsigned int vbi_count[2];
131}; 147};
132 148
133struct bttv_buffer_set { 149struct bttv_buffer_set {
@@ -146,6 +162,34 @@ struct bttv_overlay {
146 int setup_ok; 162 int setup_ok;
147}; 163};
148 164
165struct bttv_vbi_fmt {
166 struct v4l2_vbi_format fmt;
167
168 /* fmt.start[] and count[] refer to this video standard. */
169 const struct bttv_tvnorm *tvnorm;
170
171 /* Earliest possible start of video capturing with this
172 v4l2_vbi_format, in struct bttv_crop.rect units. */
173 __s32 end;
174};
175
176/* bttv-vbi.c */
177void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm);
178
179struct bttv_crop {
180 /* A cropping rectangle in struct bttv_tvnorm.cropcap units. */
181 struct v4l2_rect rect;
182
183 /* Scaled image size limits with this crop rect. Divide
184 max_height, but not min_height, by two when capturing
185 single fields. See also bttv_crop_reset() and
186 bttv_crop_adjust() in bttv-driver.c. */
187 __s32 min_scaled_width;
188 __s32 min_scaled_height;
189 __s32 max_scaled_width;
190 __s32 max_scaled_height;
191};
192
149struct bttv_fh { 193struct bttv_fh {
150 struct bttv *btv; 194 struct bttv *btv;
151 int resources; 195 int resources;
@@ -160,13 +204,19 @@ struct bttv_fh {
160 int width; 204 int width;
161 int height; 205 int height;
162 206
163 /* current settings */ 207 /* video overlay */
164 const struct bttv_format *ovfmt; 208 const struct bttv_format *ovfmt;
165 struct bttv_overlay ov; 209 struct bttv_overlay ov;
166 210
167 /* video overlay */ 211 /* Application called VIDIOC_S_CROP. */
212 int do_crop;
213
214 /* vbi capture */
168 struct videobuf_queue vbi; 215 struct videobuf_queue vbi;
169 int lines; 216 /* Current VBI capture window as seen through this fh (cannot
217 be global for compatibility with earlier drivers). Protected
218 by struct bttv.lock and struct bttv_fh.vbi.lock. */
219 struct bttv_vbi_fmt vbi_fmt;
170}; 220};
171 221
172/* ---------------------------------------------------------- */ 222/* ---------------------------------------------------------- */
@@ -176,7 +226,8 @@ struct bttv_fh {
176int bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, 226int bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
177 struct scatterlist *sglist, 227 struct scatterlist *sglist,
178 unsigned int offset, unsigned int bpl, 228 unsigned int offset, unsigned int bpl,
179 unsigned int pitch, unsigned int lines); 229 unsigned int pitch, unsigned int skip_lines,
230 unsigned int store_lines);
180 231
181/* control dma register + risc main loop */ 232/* control dma register + risc main loop */
182void bttv_set_dma(struct bttv *btv, int override); 233void bttv_set_dma(struct bttv *btv, int override);
@@ -202,9 +253,9 @@ int bttv_overlay_risc(struct bttv *btv, struct bttv_overlay *ov,
202/* ---------------------------------------------------------- */ 253/* ---------------------------------------------------------- */
203/* bttv-vbi.c */ 254/* bttv-vbi.c */
204 255
205void bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_format *f); 256int bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
206void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_format *f); 257void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
207void bttv_vbi_setlines(struct bttv_fh *fh, struct bttv *btv, int lines); 258int bttv_vbi_set_fmt(struct bttv_fh *fh, struct v4l2_vbi_format *f);
208 259
209extern struct videobuf_queue_ops bttv_vbi_qops; 260extern struct videobuf_queue_ops bttv_vbi_qops;
210 261
@@ -233,7 +284,6 @@ extern int fini_bttv_i2c(struct bttv *btv);
233#define d2printk if (bttv_debug >= 2) printk 284#define d2printk if (bttv_debug >= 2) printk
234 285
235#define BTTV_MAX_FBUF 0x208000 286#define BTTV_MAX_FBUF 0x208000
236#define VBIBUF_SIZE (2048*VBI_MAXLINES*2)
237#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */ 287#define BTTV_TIMEOUT (HZ/2) /* 0.5 seconds */
238#define BTTV_FREE_IDLE (HZ) /* one second */ 288#define BTTV_FREE_IDLE (HZ) /* one second */
239 289
@@ -314,7 +364,6 @@ struct bttv {
314 spinlock_t s_lock; 364 spinlock_t s_lock;
315 struct mutex lock; 365 struct mutex lock;
316 int resources; 366 int resources;
317 struct mutex reslock;
318#ifdef VIDIOC_G_PRIORITY 367#ifdef VIDIOC_G_PRIORITY
319 struct v4l2_prio_state prio; 368 struct v4l2_prio_state prio;
320#endif 369#endif
@@ -384,6 +433,21 @@ struct bttv {
384 433
385 unsigned int users; 434 unsigned int users;
386 struct bttv_fh init; 435 struct bttv_fh init;
436
437 /* Default (0) and current (1) video capturing and overlay
438 cropping parameters in bttv_tvnorm.cropcap units. Protected
439 by bttv.lock. */
440 struct bttv_crop crop[2];
441
442 /* Earliest possible start of video capturing in
443 bttv_tvnorm.cropcap line units. Set by check_alloc_btres()
444 and free_btres(). Protected by bttv.lock. */
445 __s32 vbi_end;
446
447 /* Latest possible end of VBI capturing (= crop[x].rect.top when
448 VIDEO_RESOURCES are locked). Set by check_alloc_btres()
449 and free_btres(). Protected by bttv.lock. */
450 __s32 crop_start;
387}; 451};
388 452
389/* our devices */ 453/* our devices */
48'>18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087 20088 20089 20090 20091 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 20107 20108 20109 20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 20124 20125 20126 20127 20128 20129 20130 20131 20132 20133 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 20280 20281 20282 20283 20284 20285 20286 20287 20288 20289 20290 20291 20292 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 20561 20562 20563 20564 20565 20566 20567 20568 20569 20570 20571 20572 20573 20574 20575 20576 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 20646 20647 20648 20649 20650 20651 20652 20653 20654 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 20688 20689 20690 20691 20692 20693 20694 20695 20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 20720 20721 20722 20723 20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 20817 20818 20819 20820 20821 20822 20823 20824 20825 20826 20827 20828 20829 20830 20831 20832 20833 20834 20835 20836 20837 20838 20839 20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 21027 21028 21029 21030 21031 21032 21033 21034 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 21050 21051 21052 21053 21054 21055 21056 21057 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 21073 21074 21075 21076 21077 21078 21079 21080 21081 21082 21083 21084 21085 21086 21087 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 21161 21162 21163 21164 21165 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 21351 21352 21353 21354 21355 21356 21357 21358 21359 21360 21361 21362 21363 21364 21365 21366 21367 21368 21369 21370 21371 21372 21373 21374 21375 21376 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406 21407 21408 21409 21410 21411 21412 21413 21414 21415 21416 21417 21418 21419 21420 21421 21422 21423 21424 21425 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 21597 21598 21599 21600 21601 21602 21603 21604 21605 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 21661 21662 21663 21664 21665 21666 21667 21668 21669 21670 21671 21672 21673 21674 21675 21676 21677 21678 21679 21680 21681 21682 21683 21684 21685 21686 21687 21688 21689 21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 21708 21709 21710 21711 21712 21713 21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 21728 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 21825 21826 21827 21828 21829 21830 21831 21832 21833 21834 21835 21836 21837 21838 21839 21840 21841 21842 21843 21844 21845 21846 21847 21848 21849 21850 21851 21852 21853 21854 21855 21856 21857 21858 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868 21869 21870 21871 21872 21873 21874 21875 21876 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 21969 21970 21971 21972 21973 21974 21975 21976 21977 21978 21979 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 22044 22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 22385 22386 22387 22388 22389 22390 22391 22392 22393 22394 22395 22396 22397 22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 22427 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 22491 22492 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 22520 22521 22522 22523 22524 22525 22526 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 22540 22541 22542 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 22570 22571 22572 22573 22574 22575 22576 22577 22578 22579 22580 22581 22582 22583 22584 22585 22586 22587 22588 22589 22590 22591 22592 22593 22594 22595 22596 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 22626 22627 22628 22629 22630 22631 22632 22633 22634 22635 22636 22637 22638 22639 22640 22641 22642 22643 22644 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 22689 22690 22691 22692 22693 22694 22695 22696 22697 22698 22699 22700 22701 22702 22703 22704 22705 22706 22707 22708 22709 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 22731 22732 22733 22734 22735 22736 22737 22738 22739 22740 22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 22777 22778 22779 22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 22807 22808 22809 22810 22811 22812 22813 22814 22815 22816 22817 22818 22819 22820 22821 22822 22823 22824 22825 22826 22827 22828 22829 22830 22831 22832 22833 22834 22835 22836 22837 22838 22839 22840 22841 22842 22843 22844 22845 22846 22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 22861 22862 22863 22864 22865 22866 22867 22868 22869 22870 22871 22872 22873 22874 22875 22876 22877 22878 22879 22880 22881 22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989 22990 22991 22992 22993 22994 22995 22996 22997 22998 22999 23000 23001 23002 23003 23004 23005 23006 23007 23008 23009 23010 23011 23012 23013 23014 23015 23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 23045 23046 23047 23048 23049 23050 23051 23052 23053 23054 23055 23056 23057 23058 23059 23060 23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 23141 23142 23143 23144 23145 23146 23147 23148 23149 23150 23151 23152 23153 23154 23155 23156 23157 23158 23159 23160 23161 23162 23163 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 23239 23240 23241 23242 23243 23244 23245 23246 23247 23248 23249 23250 23251 23252 23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 23282 23283 23284 23285 23286 23287 23288 23289 23290 23291 23292 23293 23294 23295 23296 23297 23298 23299 23300 23301 23302 23303 23304 23305 23306 23307 23308 23309 23310 23311 23312 23313 23314 23315 23316 23317 23318 23319 23320 23321 23322 23323 23324 23325 23326 23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 23339 23340 23341 23342 23343 23344 23345 23346 23347 23348 23349 23350 23351 23352 23353 23354 23355 23356 23357 23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 23374 23375 23376 23377 23378 23379 23380 23381 23382 23383 23384 23385 23386 23387 23388 23389 23390 23391 23392 23393 23394 23395 23396 23397 23398 23399 23400 23401 23402 23403 23404 23405 23406 23407 23408 23409 23410 23411 23412 23413 23414 23415 23416 23417 23418 23419 23420 23421 23422 23423 23424 23425 23426 23427 23428 23429 23430 23431 23432 23433 23434 23435 23436 23437 23438 23439 23440 23441 23442 23443 23444 23445 23446 23447 23448 23449 23450 23451 23452 23453 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 23479 23480 23481 23482 23483 23484 23485 23486 23487 23488 23489 23490 23491 23492 23493 23494 23495 23496 23497 23498 23499 23500 23501 23502 23503 23504 23505 23506 23507 23508 23509 23510 23511 23512 23513 23514 23515 23516 23517 23518 23519 23520 23521 23522 23523 23524 23525 23526 23527 23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 23540 23541 23542 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556 23557 23558 23559 23560 23561 23562 23563 23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 23576 23577 23578 23579 23580 23581 23582 23583 23584 23585 23586 23587 23588 23589 23590 23591 23592 23593 23594 23595 23596 23597 23598 23599 23600 23601 23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 23612 23613 23614 23615 23616 23617 23618 23619 23620 23621 23622 23623 23624 23625 23626 23627 23628 23629 23630 23631 23632 23633 23634 23635 23636 23637 23638 23639 23640 23641 23642 23643 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23664 23665 23666 23667 23668 23669 23670 23671 23672 23673 23674 23675 23676 23677 23678 23679 23680 23681 23682 23683 23684 23685 23686 23687 23688 23689 23690 23691 23692 23693 23694 23695 23696 23697 23698 23699 23700 23701 23702 23703 23704 23705 23706 23707 23708 23709 23710 23711 23712 23713 23714 23715 23716 23717 23718 23719 23720 23721 23722 23723 23724 23725 23726 23727 23728 23729 23730 23731 23732 23733 23734 23735 23736 23737 23738 23739 23740 23741 23742 23743 23744 23745 23746 23747 23748 23749 23750 23751 23752 23753 23754 23755 23756 23757 23758 23759 23760 23761 23762 23763 23764 23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 23834 23835 23836 23837 23838 23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 24131 24132 24133 24134 24135 24136 24137 24138 24139 24140 24141 24142 24143 24144 24145 24146 24147 24148 24149 24150 24151 24152 24153 24154 24155 24156 24157 24158 24159 24160 24161 24162 24163 24164 24165 24166 24167 24168 24169 24170 24171 24172 24173 24174 24175 24176 24177 24178 24179 24180 24181 24182 24183 24184 24185 24186 24187 24188 24189 24190 24191 24192 24193 24194 24195 24196 24197 24198 24199 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 24286 24287 24288 24289 24290 24291 24292 24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 24309 24310 24311 24312 24313 24314 24315 24316 24317 24318 24319 24320 24321 24322 24323 24324 24325 24326 24327 24328 24329 24330 24331 24332 24333 24334 24335 24336 24337 24338 24339 24340 24341 24342 24343 24344 24345 24346 24347 24348 24349 24350 24351 24352 24353 24354 24355 24356 24357 24358 24359 24360 24361 24362 24363 24364 24365 24366 24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 24381 24382 24383 24384 24385 24386 24387 24388 24389 24390 24391 24392 24393 24394 24395 24396 24397 24398 24399 24400 24401 24402 24403 24404 24405 24406 24407 24408 24409 24410 24411 24412 24413 24414 24415 24416 24417 24418 24419 24420 24421 24422 24423 24424 24425 24426 24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 24437 24438 24439 24440 24441 24442 24443 24444 24445 24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 24457 24458 24459 24460 24461 24462 24463 24464 24465 24466 24467 24468 24469 24470 24471 24472 24473 24474 24475 24476 24477 24478 24479 24480 24481 24482 24483 24484 24485 24486 24487 24488 24489 24490 24491 24492 24493 24494 24495 24496 24497 24498 24499 24500 24501 24502 24503 24504 24505 24506 24507 24508 24509 24510 24511 24512 24513 24514 24515 24516 24517 24518 24519 24520 24521 24522 24523 24524 24525 24526 24527 24528 24529 24530 24531 24532 24533 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 24548 24549 24550 24551 24552 24553 24554 24555 24556 24557 24558 24559 24560 24561 24562 24563 24564 24565 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 24579 24580 24581 24582 24583 24584 24585 24586 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24607 24608 24609 24610 24611 24612 24613 24614 24615 24616 24617 24618 24619 24620 24621 24622 24623 24624 24625 24626 24627 24628 24629 24630 24631 24632 24633 24634 24635 24636 24637 24638 24639 24640 24641 24642 24643 24644 24645 24646 24647 24648 24649 24650 24651 24652 24653 24654 24655 24656 24657 24658 24659 24660 24661 24662 24663 24664 24665 24666 24667 24668 24669 24670 24671 24672 24673 24674 24675 24676 24677 24678 24679 24680 24681 24682 24683 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 24704 24705 24706 24707 24708 24709 24710 24711 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 24732 24733 24734 24735 24736 24737 24738 24739 24740 24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 24755 24756 24757 24758 24759 24760 24761 24762 24763 24764 24765 24766 24767 24768 24769 24770 24771 24772 24773 24774 24775 24776 24777 24778 24779 24780 24781 24782 24783 24784 24785 24786 24787 24788 24789 24790 24791 24792 24793 24794 24795 24796 24797 24798 24799 24800 24801 24802 24803 24804 24805 24806 24807 24808 24809 24810 24811 24812 24813 24814 24815 24816 24817 24818 24819 24820 24821 24822 24823 24824 24825 24826 24827 24828 24829 24830 24831 24832 24833 24834 24835 24836 24837 24838 24839 24840 24841 24842 24843 24844 24845 24846 24847 24848 24849 24850 24851 24852 24853 24854 24855 24856 24857 24858 24859 24860 24861 24862 24863 24864 24865 24866 24867 24868 24869 24870 24871 24872 24873 24874 24875 24876 24877 24878 24879 24880 24881 24882 24883 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 24911 24912 24913 24914 24915 24916 24917 24918 24919 24920 24921 24922 24923 24924 24925 24926 24927 24928 24929 24930 24931 24932 24933 24934 24935 24936 24937 24938 24939 24940 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034 25035 25036 25037 25038 25039 25040 25041 25042 25043 25044 25045 25046 25047 25048 25049 25050 25051 25052 25053 25054 25055 25056 25057 25058 25059 25060 25061 25062 25063 25064 25065 25066 25067 25068 25069 25070 25071 25072 25073 25074 25075 25076 25077 25078 25079 25080 25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092 25093 25094 25095 25096 25097 25098 25099 25100 25101 25102 25103 25104 25105 25106 25107 25108 25109 25110 25111 25112 25113 25114 25115 25116 25117 25118 25119 25120 25121 25122 25123 25124 25125 25126 25127 25128 25129 25130 25131 25132 25133 25134 25135 25136 25137 25138 25139 25140 25141 25142 25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212 25213 25214 25215 25216 25217 25218 25219 25220 25221 25222 25223 25224 25225 25226 25227 25228 25229 25230 25231 25232 25233 25234 25235 25236 25237 25238 25239 25240 25241 25242 25243 25244 25245 25246 25247 25248 25249 25250 25251 25252 25253 25254 25255 25256 25257 25258 25259 25260 25261 25262 25263 25264 25265 25266 25267 25268 25269 25270 25271 25272 25273 25274 25275 25276 25277 25278 25279 25280 25281 25282 25283 25284 25285 25286 25287 25288 25289 25290 25291 25292 25293 25294 25295 25296 25297 25298 25299 25300 25301 25302 25303 25304 25305 25306 25307 25308 25309 25310 25311 25312 25313 25314 25315 25316 25317 25318 25319 25320 25321 25322 25323 25324 25325 25326 25327 25328 25329 25330 25331 25332 25333 25334 25335 25336 25337 25338 25339 25340 25341 25342 25343 25344 25345 25346 25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418 25419 25420 25421 25422 25423 25424 25425 25426 25427 25428 25429 25430 25431 25432 25433 25434 25435 25436 25437 25438 25439 25440 25441 25442 25443 25444 25445 25446 25447 25448 25449 25450 25451 25452 25453 25454 25455 25456 25457 25458 25459 25460 25461 25462 25463 25464 25465 25466 25467 25468 25469 25470 25471 25472 25473 25474 25475 25476 25477 25478 25479 25480 25481 25482 25483 25484 25485 25486 25487 25488 25489 25490 25491 25492 25493 25494 25495 25496 25497 25498 25499 25500 25501 25502 25503 25504 25505 25506 25507 25508 25509 25510 25511 25512 25513 25514 25515 25516 25517 25518 25519 25520 25521 25522 25523 25524 25525 25526 25527 25528 25529 25530 25531 25532 25533 25534 25535 25536 25537 25538 25539 25540 25541 25542 25543 25544 25545 25546 25547 25548 25549 25550 25551 25552 25553 25554 25555 25556 25557 25558 25559 25560 25561 25562 25563 25564 25565 25566 25567 25568 25569 25570 25571 25572 25573 25574 25575 25576 25577 25578 25579 25580 25581 25582 25583 25584 25585 25586 25587 25588 25589 25590 25591 25592 25593 25594 25595 25596 25597 25598 25599 25600 25601 25602 25603 25604 25605 25606 25607 25608 25609 25610 25611 25612 25613 25614 25615 25616 25617 25618 25619 25620 25621 25622 25623 25624 25625 25626 25627 25628 25629 25630 25631 25632 25633 25634 25635 25636 25637 25638 25639 25640 25641 25642 25643 25644 25645 25646 25647 25648 25649 25650 25651 25652 25653 25654 25655 25656 25657 25658 25659 25660 25661 25662 25663 25664 25665 25666 25667 25668 25669 25670 25671 25672 25673 25674 25675 25676 25677 25678 25679 25680 25681 25682 25683 25684 25685 25686 25687 25688 25689 25690 25691 25692 25693 25694 25695 25696 25697 25698 25699 25700 25701 25702 25703 25704 25705 25706 25707 25708 25709 25710 25711 25712 25713 25714 25715 25716 25717 25718 25719 25720 25721 25722 25723 25724 25725 25726 25727 25728 25729 25730 25731 25732 25733 25734 25735 25736 25737 25738 25739 25740 25741 25742 25743 25744 25745 25746 25747 25748 25749 25750 25751 25752 25753 25754 25755 25756 25757 25758 25759 25760 25761 25762 25763 25764 25765 25766 25767 25768 25769 25770 25771 25772 25773 25774 25775 25776 25777 25778 25779 25780 25781 25782 25783 25784 25785 25786 25787 25788 25789 25790 25791 25792 25793 25794 25795 25796 25797 25798 25799 25800 25801 25802 25803 25804 25805 25806 25807 25808 25809 25810 25811 25812 25813 25814 25815 25816 25817 25818 25819 25820 25821 25822 25823 25824 25825 25826 25827 25828 25829 25830 25831 25832 25833 25834 25835 25836 25837 25838 25839 25840 25841 25842 25843 25844 25845 25846 25847 25848 25849 25850 25851 25852 25853 25854 25855 25856 25857 25858 25859 25860 25861 25862 25863 25864 25865 25866 25867 25868 25869 25870 25871 25872 25873 25874 25875 25876 25877 25878 25879 25880 25881 25882 25883 25884 25885 25886 25887 25888 25889 25890 25891 25892 25893 25894 25895 25896 25897 25898 25899 25900 25901 25902 25903 25904 25905 25906 25907 25908 25909 25910 25911 25912 25913 25914 25915 25916 25917 25918 25919 25920 25921 25922 25923 25924 25925 25926 25927 25928 25929 25930 25931 25932 25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 25949 25950 25951 25952 25953 25954 25955 25956 25957 25958 25959 25960 25961 25962 25963 25964 25965 25966 25967 25968 25969 25970 25971 25972 25973 25974 25975 25976 25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039 26040 26041 26042 26043 26044 26045 26046 26047 26048 26049 26050 26051 26052 26053 26054 26055 26056 26057 26058 26059 26060 26061 26062 26063 26064 26065 26066 26067 26068 26069 26070 26071 26072 26073 26074 26075 26076 26077 26078 26079 26080 26081 26082 26083 26084 26085 26086 26087 26088 26089 26090 26091 26092 26093 26094 26095 26096 26097 26098 26099 26100 26101 26102 26103 26104 26105 26106 26107 26108 26109 26110 26111 26112 26113 26114 26115 26116 26117 26118 26119 26120 26121 26122 26123 26124 26125 26126 26127 26128 26129 26130 26131 26132 26133 26134 26135 26136 26137 26138 26139 26140 26141 26142 26143 26144 26145 26146 26147 26148 26149 26150 26151 26152 26153 26154 26155 26156 26157 26158 26159 26160 26161 26162 26163 26164 26165 26166 26167 26168 26169 26170 26171 26172 26173 26174 26175 26176 26177 26178 26179 26180 26181 26182 26183 26184 26185 26186 26187 26188 26189 26190 26191 26192 26193 26194 26195 26196 26197 26198 26199 26200 26201 26202 26203 26204 26205 26206 26207 26208 26209 26210 26211 26212 26213 26214 26215 26216 26217 26218 26219 26220 26221 26222 26223 26224 26225 26226 26227 26228 26229 26230 26231 26232 26233 26234 26235 26236 26237 26238 26239 26240 26241 26242 26243 26244 26245 26246 26247 26248 26249 26250 26251 26252 26253 26254 26255 26256 26257 26258 26259 26260 26261 26262 26263 26264 26265 26266 26267 26268 26269 26270 26271 26272 26273 26274 26275 26276 26277 26278 26279 26280 26281 26282 26283 26284 26285 26286 26287 26288 26289 26290 26291 26292 26293 26294 26295 26296 26297 26298 26299 26300 26301 26302 26303 26304 26305 26306 26307 26308 26309 26310 26311 26312 26313 26314 26315 26316 26317 26318 26319 26320 26321 26322 26323 26324 26325 26326 26327 26328 26329 26330 26331 26332 26333 26334 26335 26336 26337 26338 26339 26340 26341 26342 26343 26344 26345 26346 26347 26348 26349 26350 26351 26352 26353 26354 26355 26356 26357 26358 26359 26360 26361 26362 26363 26364 26365 26366 26367 26368 26369 26370 26371 26372 26373 26374 26375 26376 26377 26378 26379 26380 26381 26382 26383 26384 26385 26386 26387 26388 26389 26390 26391 26392 26393 26394 26395 26396 26397 26398 26399 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26412 26413 26414 26415 26416 26417 26418 26419 26420 26421 26422 26423 26424 26425 26426 26427 26428 26429 26430 26431 26432 26433 26434 26435 26436 26437 26438 26439 26440 26441 26442 26443 26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26456 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26468 26469 26470 26471 26472 26473 26474 26475 26476 26477 26478 26479 26480 26481 26482 26483 26484 26485 26486 26487 26488 26489 26490 26491 26492 26493 26494 26495 26496 26497 26498 26499 26500 26501 26502 26503 26504 26505 26506 26507 26508 26509 26510 26511 26512 26513 26514 26515 26516 26517 26518 26519 26520 26521 26522 26523 26524 26525 26526 26527 26528 26529 26530 26531 26532 26533 26534 26535 26536 26537 26538 26539 26540 26541 26542 26543 26544 26545 26546 26547 26548 26549 26550 26551 26552 26553 26554 26555 26556 26557 26558 26559 26560 26561 26562 26563 26564 26565 26566 26567 26568 26569 26570 26571 26572 26573 26574 26575 26576 26577 26578 26579 26580 26581 26582 26583 26584 26585 26586 26587 26588 26589 26590 26591 26592 26593 26594 26595 26596 26597 26598 26599 26600 26601 26602 26603 26604 26605 26606 26607 26608 26609 26610 26611 26612 26613 26614 26615 26616 26617 26618 26619 26620 26621 26622 26623 26624 26625 26626 26627 26628 26629 26630 26631 26632 26633 26634 26635 26636 26637 26638 26639 26640 26641 26642 26643 26644 26645 26646 26647 26648 26649 26650 26651 26652 26653 26654 26655 26656 26657 26658 26659 26660 26661 26662 26663 26664 26665 26666 26667 26668 26669 26670 26671 26672 26673 26674 26675 26676 26677 26678 26679 26680 26681 26682 26683 26684 26685 26686 26687 26688 26689 26690 26691 26692 26693 26694 26695 26696 26697 26698 26699 26700 26701 26702 26703 26704 26705 26706 26707 26708 26709 26710 26711 26712 26713 26714 26715 26716 26717 26718 26719 26720 26721 26722 26723 26724 26725 26726 26727 26728 26729 26730 26731 26732 26733 26734 26735 26736 26737 26738 26739 26740 26741 26742 26743 26744 26745 26746 26747 26748 26749 26750 26751 26752 26753 26754 26755 26756 26757 26758 26759 26760 26761 26762 26763 26764 26765 26766 26767 26768 26769 26770 26771 26772 26773 26774 26775 26776 26777 26778 26779 26780 26781 26782 26783 26784 26785 26786 26787 26788 26789 26790 26791 26792 26793 26794 26795 26796 26797 26798 26799 26800 26801 26802 26803 26804 26805 26806 26807 26808 26809 26810 26811 26812 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 26825 26826 26827 26828 26829 26830 26831 26832 26833 26834 26835 26836 26837 26838 26839 26840 26841 26842 26843 26844 26845 26846 26847 26848 26849 26850 26851 26852 26853 26854 26855 26856 26857 26858 26859 26860 26861 26862 26863 26864 26865 26866 26867 26868 26869 26870 26871 26872 26873 26874 26875 26876 26877 26878 26879 26880 26881 26882 26883 26884 26885 26886 26887 26888 26889 26890 26891 26892 26893 26894 26895 26896 26897 26898 26899 26900 26901 26902 26903 26904 26905 26906 26907 26908 26909 26910 26911 26912 26913 26914 26915 26916 26917 26918 26919 26920 26921 26922 26923 26924 26925 26926 26927 26928 26929 26930 26931 26932 26933 26934 26935 26936 26937 26938 26939 26940 26941 26942 26943 26944 26945 26946 26947 26948 26949 26950 26951 26952 26953 26954 26955 26956 26957 26958 26959 26960 26961 26962 26963 26964 26965 26966 26967 26968 26969 26970 26971 26972 26973 26974 26975 26976 26977 26978 26979 26980 26981 26982 26983 26984 26985 26986 26987 26988 26989 26990 26991 26992 26993 26994 26995 26996 26997 26998 26999 27000 27001 27002 27003 27004 27005 27006 27007 27008 27009 27010 27011 27012 27013 27014 27015 27016 27017 27018 27019 27020 27021 27022 27023 27024 27025 27026 27027 27028 27029 27030 27031 27032 27033 27034 27035 27036 27037 27038 27039 27040 27041 27042 27043 27044 27045 27046 27047 27048 27049 27050 27051 27052 27053 27054 27055 27056 27057 27058 27059 27060 27061 27062 27063 27064 27065 27066 27067 27068 27069 27070 27071 27072 27073 27074 27075 27076 27077 27078 27079 27080 27081 27082 27083 27084 27085 27086 27087 27088 27089 27090 27091 27092 27093 27094 27095 27096 27097 27098 27099 27100 27101 27102 27103 27104 27105 27106 27107 27108 27109 27110 27111 27112 27113 27114 27115 27116 27117 27118 27119 27120 27121 27122 27123 27124 27125 27126 27127 27128 27129 27130 27131 27132 27133 27134 27135 27136 27137 27138 27139 27140 27141 27142 27143 27144 27145 27146 27147 27148 27149 27150 27151 27152 27153 27154 27155 27156 27157 27158 27159 27160 27161 27162 27163 27164 27165 27166 27167 27168 27169 27170 27171 27172 27173 27174 27175 27176 27177 27178 27179 27180 27181 27182 27183 27184 27185 27186 27187 27188 27189 27190 27191 27192 27193 27194 27195 27196 27197 27198 27199 27200 27201 27202 27203 27204 27205 27206 27207 27208 27209 27210 27211 27212 27213 27214 27215 27216 27217 27218 27219 27220 27221 27222 27223 27224 27225 27226 27227 27228 27229 27230 27231 27232 27233 27234 27235 27236 27237 27238 27239 27240 27241 27242 27243 27244 27245 27246 27247 27248 27249 27250 27251 27252 27253 27254 27255 27256 27257 27258 27259 27260 27261 27262 27263 27264 27265 27266 27267 27268 27269 27270 27271 27272 27273 27274 27275 27276 27277 27278 27279 27280 27281 27282 27283 27284 27285 27286 27287 27288 27289 27290 27291 27292 27293 27294 27295 27296 27297 27298 27299 27300 27301 27302 27303 27304 27305 27306 27307 27308 27309 27310 27311 27312 27313 27314 27315 27316 27317 27318 27319 27320 27321 27322 27323 27324 27325 27326 27327 27328 27329 27330 27331 27332 27333 27334 27335 27336 27337 27338 27339 27340 27341 27342 27343 27344 27345 27346 27347 27348 27349 27350 27351 27352 27353 27354 27355 27356 27357 27358 27359 27360 27361 27362 27363 27364 27365 27366 27367 27368 27369 27370 27371 27372 27373 27374 27375 27376 27377 27378 27379 27380 27381 27382 27383 27384 27385 27386 27387 27388 27389 27390 27391 27392 27393 27394 27395 27396 27397 27398 27399 27400 27401 27402 27403 27404 27405 27406 27407 27408 27409 27410 27411 27412 27413 27414 27415 27416 27417 27418 27419 27420 27421 27422 27423 27424 27425 27426 27427 27428 27429 27430 27431 27432 27433 27434 27435 27436 27437 27438 27439 27440 27441 27442 27443 27444 27445 27446 27447 27448 27449 27450 27451 27452 27453 27454 27455 27456 27457 27458 27459 27460 27461 27462 27463 27464 27465 27466 27467 27468 27469 27470 27471 27472 27473 27474 27475 27476 27477 27478 27479 27480 27481 27482 27483 27484 27485 27486 27487 27488 27489 27490 27491 27492 27493 27494 27495 27496 27497 27498 27499 27500 27501 27502 27503 27504 27505 27506 27507 27508 27509 27510 27511 27512 27513 27514 27515 27516 27517 27518 27519 27520 27521 27522 27523 27524 27525 27526 27527 27528 27529 27530 27531 27532 27533 27534 27535 27536 27537 27538 27539 27540 27541 27542 27543 27544 27545 27546 27547 27548 27549 27550 27551 27552 27553 27554 27555 27556 27557 27558 27559 27560 27561 27562 27563 27564 27565 27566 27567 27568 27569 27570 27571 27572 27573 27574 27575 27576 27577 27578 27579 27580 27581 27582 27583 27584 27585 27586 27587 27588 27589 27590 27591 27592 27593 27594 27595 27596 27597 27598 27599 27600 27601 27602 27603 27604 27605 27606 27607 27608 27609 27610 27611 27612 27613 27614 27615 27616 27617 27618 27619 27620 27621 27622 27623 27624 27625 27626 27627 27628 27629 27630 27631 27632 27633 27634 27635 27636 27637 27638 27639 27640 27641 27642 27643 27644 27645 27646 27647 27648 27649 27650 27651 27652 27653 27654 27655 27656 27657 27658 27659 27660 27661 27662 27663 27664 27665 27666 27667 27668 27669 27670 27671 27672 27673 27674 27675 27676 27677 27678 27679 27680 27681 27682 27683 27684 27685 27686 27687 27688 27689 27690 27691 27692 27693 27694 27695 27696 27697 27698 27699 27700 27701 27702 27703 27704 27705 27706 27707 27708 27709 27710 27711 27712 27713 27714 27715 27716 27717 27718 27719 27720 27721 27722 27723 27724 27725 27726 27727 27728 27729 27730 27731 27732 27733 27734 27735 27736 27737 27738 27739 27740 27741 27742 27743 27744 27745 27746 27747 27748 27749 27750 27751 27752 27753 27754 27755 27756 27757 27758 27759 27760 27761 27762 27763 27764 27765 27766 27767 27768 27769 27770 27771 27772 27773 27774 27775 27776 27777 27778 27779 27780 27781 27782 27783 27784 27785 27786 27787 27788 27789 27790 27791 27792 27793 27794 27795 27796 27797 27798 27799 27800 27801 27802 27803 27804 27805 27806 27807 27808 27809 27810 27811 27812 27813 27814 27815 27816 27817 27818 27819 27820 27821 27822 27823 27824 27825 27826 27827 27828 27829 27830 27831 27832 27833 27834 27835 27836 27837 27838 27839 27840 27841 27842 27843 27844 27845 27846 27847 27848 27849 27850 27851 27852 27853 27854 27855 27856 27857 27858 27859 27860 27861 27862 27863 27864 27865 27866 27867 27868 27869 27870 27871 27872 27873 27874 27875 27876 27877 27878 27879 27880 27881 27882 27883 27884 27885 27886 27887 27888 27889 27890 27891 27892 27893 27894 27895 27896 27897 27898 27899 27900 27901 27902 27903 27904 27905 27906 27907 27908 27909 27910 27911 27912 27913 27914 27915 27916 27917 27918 27919 27920 27921 27922 27923 27924 27925 27926 27927 27928 27929 27930 27931 27932 27933 27934 27935 27936 27937 27938 27939 27940 27941 27942 27943 27944 27945 27946 27947 27948 27949 27950 27951 27952 27953 27954 27955 27956 27957 27958 27959 27960 27961 27962 27963 27964 27965 27966 27967 27968 27969 27970 27971 27972 27973 27974 27975 27976 27977 27978 27979 27980 27981 27982 27983 27984 27985 27986 27987 27988 27989 27990 27991 27992 27993 27994 27995 27996 27997 27998 27999 28000 28001 28002 28003 28004 28005 28006 28007 28008 28009 28010 28011 28012 28013 28014 28015 28016 28017 28018 28019 28020 28021 28022 28023 28024 28025 28026 28027 28028 28029 28030 28031 28032 28033 28034 28035 28036 28037 28038 28039 28040 28041 28042 28043 28044 28045 28046 28047 28048 28049 28050 28051 28052 28053 28054 28055 28056 28057 28058 28059 28060 28061 28062 28063 28064 28065 28066 28067 28068 28069 28070 28071 28072 28073 28074 28075 28076 28077 28078 28079 28080 28081 28082 28083 28084 28085 28086 28087 28088 28089 28090 28091 28092 28093 28094 28095 28096 28097 28098 28099 28100 28101 28102 28103 28104 28105 28106 28107 28108 28109 28110 28111 28112 28113 28114 28115 28116 28117 28118 28119 28120 28121 28122 28123 28124 28125 28126 28127 28128 28129 28130 28131 28132 28133 28134 28135 28136 28137 28138 28139 28140 28141 28142 28143 28144 28145 28146 28147 28148 28149 28150 28151 28152 28153 28154 28155 28156 28157 28158 28159 28160 28161 28162 28163 28164 28165 28166 28167 28168 28169 28170 28171 28172 28173 28174 28175 28176 28177 28178 28179 28180 28181 28182 28183 28184 28185 28186 28187 28188 28189 28190 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28210 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 28259 28260 28261 28262 28263 28264 28265 28266 28267 28268 28269 28270 28271 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28314 28315 28316 28317 28318 28319 28320 28321 28322 28323 28324 28325 28326 28327 28328 28329 28330 28331 28332 28333 28334 28335 28336 28337 28338 28339 28340 28341 28342 28343 28344 28345 28346 28347 28348 28349 28350 28351 28352 28353 28354 28355 28356 28357 28358 28359 28360 28361 28362 28363 28364 28365 28366 28367 28368 28369 28370 28371 28372 28373 28374 28375 28376 28377 28378 28379 28380 28381 28382 28383 28384 28385 28386 28387 28388 28389 28390 28391 28392 28393 28394 28395 28396 28397 28398 28399 28400 28401 28402 28403 28404 28405 28406 28407 28408 28409 28410 28411 28412 28413 28414 28415 28416 28417 28418 28419 28420 28421 28422 28423 28424 28425 28426 28427 28428 28429 28430 28431 28432 28433 28434 28435 28436 28437 28438 28439 28440 28441 28442 28443 28444 28445 28446 28447 28448 28449 28450 28451 28452 28453 28454 28455 28456 28457 28458 28459 28460 28461 28462 28463 28464 28465 28466 28467 28468 28469 28470 28471 28472 28473 28474 28475 28476 28477 28478 28479 28480 28481 28482 28483 28484 28485 28486 28487 28488 28489 28490 28491 28492 28493 28494 28495 28496 28497 28498 28499 28500 28501 28502 28503 28504 28505 28506 28507 28508 28509 28510 28511 28512 28513 28514 28515 28516 28517 28518 28519 28520 28521 28522 28523 28524 28525 28526 28527 28528 28529 28530 28531 28532 28533 28534 28535 28536 28537 28538 28539 28540 28541 28542 28543 28544 28545 28546 28547 28548 28549 28550 28551 28552 28553 28554 28555 28556 28557 28558 28559 28560 28561 28562 28563 28564 28565 28566 28567 28568 28569 28570 28571 28572 28573 28574 28575 28576 28577 28578 28579 28580 28581 28582 28583 28584 28585 28586 28587 28588 28589 28590 28591 28592 28593 28594 28595 28596 28597 28598 28599 28600 28601 28602 28603 28604 28605 28606 28607 28608 28609 28610 28611 28612 28613 28614 28615 28616 28617 28618 28619 28620 28621 28622 28623 28624 28625 28626 28627 28628 28629 28630 28631 28632 28633 28634 28635 28636 28637 28638 28639 28640 28641 28642 28643 28644 28645 28646 28647 28648 28649 28650 28651 28652 28653 28654 28655 28656 28657 28658 28659 28660 28661 28662 28663 28664 28665 28666 28667 28668 28669 28670 28671 28672 28673 28674 28675 28676 28677 28678 28679 28680 28681 28682 28683 28684 28685 28686 28687 28688 28689 28690 28691 28692 28693 28694 28695 28696 28697 28698 28699 28700 28701 28702 28703 28704 28705 28706 28707 28708 28709 28710 28711 28712 28713 28714 28715 28716 28717 28718 28719 28720 28721 28722 28723 28724 28725 28726 28727 28728 28729 28730 28731 28732 28733 28734 28735 28736 28737 28738 28739 28740 28741 28742 28743 28744 28745 28746 28747 28748 28749 28750 28751 28752 28753 28754 28755 28756 28757 28758 28759 28760 28761 28762 28763 28764 28765 28766 28767 28768 28769 28770 28771 28772 28773 28774 28775 28776 28777 28778 28779 28780 28781 28782 28783 28784 28785 28786 28787 28788 28789 28790 28791 28792 28793 28794 28795 28796 28797 28798 28799 28800 28801 28802 28803 28804 28805 28806 28807 28808 28809 28810 28811 28812 28813 28814 28815 28816 28817 28818 28819 28820 28821 28822 28823 28824 28825 28826 28827 28828 28829 28830 28831 28832 28833 28834 28835 28836 28837 28838 28839 28840 28841 28842 28843 28844 28845 28846 28847 28848 28849 28850 28851 28852 28853 28854 28855 28856 28857 28858 28859 28860 28861 28862 28863 28864 28865 28866 28867 28868 28869 28870 28871 28872 28873 28874 28875 28876 28877 28878 28879 28880 28881 28882 28883 28884 28885 28886 28887 28888 28889 28890 28891 28892 28893 28894 28895 28896 28897 28898 28899 28900 28901 28902 28903 28904 28905 28906 28907 28908 28909 28910 28911 28912 28913 28914 28915 28916 28917 28918 28919 28920 28921 28922 28923 28924 28925 28926 28927 28928 28929 28930 28931 28932 28933 28934 28935 28936 28937 28938 28939 28940 28941 28942 28943 28944 28945 28946 28947 28948 28949 28950 28951 28952 28953 28954 28955 28956 28957 28958 28959 28960 28961 28962 28963 28964 28965 28966 28967 28968 28969 28970 28971 28972 28973 28974 28975 28976 28977 28978 28979 28980 28981 28982 28983 28984 28985 28986 28987 28988 28989 28990 28991 28992 28993 28994 28995 28996 28997 28998 28999 29000 29001 29002 29003 29004 29005 29006 29007 29008 29009 29010 29011 29012 29013 29014 29015 29016 29017 29018 29019 29020 29021 29022 29023 29024 29025 29026 29027 29028 29029 29030 29031 29032 29033 29034 29035 29036 29037 29038 29039 29040 29041 29042 29043 29044 29045 29046 29047 29048 29049 29050 29051 29052 29053 29054 29055 29056 29057 29058 29059 29060 29061 29062 29063 29064 29065 29066 29067 29068 29069 29070 29071 29072 29073 29074 29075 29076 29077 29078 29079 29080 29081 29082 29083 29084 29085 29086 29087 29088 29089 29090 29091 29092 29093 29094 29095 29096 29097 29098 29099 29100 29101 29102 29103 29104 29105 29106 29107 29108 29109 29110 29111 29112 29113 29114 29115 29116 29117 29118 29119 29120 29121 29122 29123 29124 29125 29126 29127 29128 29129 29130 29131 29132 29133 29134 29135 29136 29137 29138 29139 29140 29141 29142 29143 29144 29145 29146 29147 29148 29149 29150 29151 29152 29153 29154 29155 29156 29157 29158 29159 29160 29161 29162 29163 29164 29165 29166 29167 29168















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
%PDF-1.3
%Äåòåë§ó ÐÄÆ
4 0 obj
<< /Length 5 0 R /Filter /FlateDecode >>
stream
x+T