aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2011-04-27 16:35:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 08:29:31 -0400
commit59983439c09f0d319cd288d27c0f70cf8764e09a (patch)
tree4122f45a0f20cfc707182b943e8268b08f79069b /drivers/media/video/usbvision
parent240d57bb8238d6998644c7f696c27076956ff653 (diff)
[media] usbvision: remove broken testpattern
Enabling force_testpattern module parameter in usbvision causes kernel panic. Things like that does not belong to the kernel anyway so the fix is easy. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/usbvision')
-rw-r--r--drivers/media/video/usbvision/usbvision-core.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index 89ac46277031..f344411a4578 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -49,10 +49,6 @@ static unsigned int core_debug;
49module_param(core_debug, int, 0644); 49module_param(core_debug, int, 0644);
50MODULE_PARM_DESC(core_debug, "enable debug messages [core]"); 50MODULE_PARM_DESC(core_debug, "enable debug messages [core]");
51 51
52static unsigned int force_testpattern;
53module_param(force_testpattern, int, 0644);
54MODULE_PARM_DESC(force_testpattern, "enable test pattern display [core]");
55
56static int adjust_compression = 1; /* Set the compression to be adaptive */ 52static int adjust_compression = 1; /* Set the compression to be adaptive */
57module_param(adjust_compression, int, 0444); 53module_param(adjust_compression, int, 0444);
58MODULE_PARM_DESC(adjust_compression, " Set the ADPCM compression for the device. Default: 1 (On)"); 54MODULE_PARM_DESC(adjust_compression, " Set the ADPCM compression for the device. Default: 1 (On)");
@@ -388,90 +384,6 @@ void usbvision_scratch_free(struct usb_usbvision *usbvision)
388} 384}
389 385
390/* 386/*
391 * usbvision_testpattern()
392 *
393 * Procedure forms a test pattern (yellow grid on blue background).
394 *
395 * Parameters:
396 * fullframe: if TRUE then entire frame is filled, otherwise the procedure
397 * continues from the current scanline.
398 * pmode 0: fill the frame with solid blue color (like on VCR or TV)
399 * 1: Draw a colored grid
400 *
401 */
402static void usbvision_testpattern(struct usb_usbvision *usbvision,
403 int fullframe, int pmode)
404{
405 static const char proc[] = "usbvision_testpattern";
406 struct usbvision_frame *frame;
407 unsigned char *f;
408 int num_cell = 0;
409 int scan_length = 0;
410 static int num_pass;
411
412 if (usbvision == NULL) {
413 printk(KERN_ERR "%s: usbvision == NULL\n", proc);
414 return;
415 }
416 if (usbvision->cur_frame == NULL) {
417 printk(KERN_ERR "%s: usbvision->cur_frame is NULL.\n", proc);
418 return;
419 }
420
421 /* Grab the current frame */
422 frame = usbvision->cur_frame;
423
424 /* Optionally start at the beginning */
425 if (fullframe) {
426 frame->curline = 0;
427 frame->scanlength = 0;
428 }
429
430 /* Form every scan line */
431 for (; frame->curline < frame->frmheight; frame->curline++) {
432 int i;
433
434 f = frame->data + (usbvision->curwidth * 3 * frame->curline);
435 for (i = 0; i < usbvision->curwidth; i++) {
436 unsigned char cb = 0x80;
437 unsigned char cg = 0;
438 unsigned char cr = 0;
439
440 if (pmode == 1) {
441 if (frame->curline % 32 == 0)
442 cb = 0, cg = cr = 0xFF;
443 else if (i % 32 == 0) {
444 if (frame->curline % 32 == 1)
445 num_cell++;
446 cb = 0, cg = cr = 0xFF;
447 } else {
448 cb =
449 ((num_cell * 7) +
450 num_pass) & 0xFF;
451 cg =
452 ((num_cell * 5) +
453 num_pass * 2) & 0xFF;
454 cr =
455 ((num_cell * 3) +
456 num_pass * 3) & 0xFF;
457 }
458 } else {
459 /* Just the blue screen */
460 }
461
462 *f++ = cb;
463 *f++ = cg;
464 *f++ = cr;
465 scan_length += 3;
466 }
467 }
468
469 frame->grabstate = frame_state_done;
470 frame->scanlength += scan_length;
471 ++num_pass;
472}
473
474/*
475 * usbvision_decompress_alloc() 387 * usbvision_decompress_alloc()
476 * 388 *
477 * allocates intermediate buffer for decompression 389 * allocates intermediate buffer for decompression
@@ -571,10 +483,6 @@ static enum parse_state usbvision_find_header(struct usb_usbvision *usbvision)
571 frame->scanstate = scan_state_lines; 483 frame->scanstate = scan_state_lines;
572 frame->curline = 0; 484 frame->curline = 0;
573 485
574 if (force_testpattern) {
575 usbvision_testpattern(usbvision, 1, 1);
576 return parse_state_next_frame;
577 }
578 return parse_state_continue; 486 return parse_state_continue;
579} 487}
580 488