Skip to content

Commit

Permalink
[media] usbvision: remove broken testpattern
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ondrej Zary authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 240d57b commit 5998343
Showing 1 changed file with 0 additions and 92 deletions.
92 changes: 0 additions & 92 deletions drivers/media/video/usbvision/usbvision-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ static unsigned int core_debug;
module_param(core_debug, int, 0644);
MODULE_PARM_DESC(core_debug, "enable debug messages [core]");

static unsigned int force_testpattern;
module_param(force_testpattern, int, 0644);
MODULE_PARM_DESC(force_testpattern, "enable test pattern display [core]");

static int adjust_compression = 1; /* Set the compression to be adaptive */
module_param(adjust_compression, int, 0444);
MODULE_PARM_DESC(adjust_compression, " Set the ADPCM compression for the device. Default: 1 (On)");
Expand Down Expand Up @@ -387,90 +383,6 @@ void usbvision_scratch_free(struct usb_usbvision *usbvision)
usbvision->scratch = NULL;
}

/*
* usbvision_testpattern()
*
* Procedure forms a test pattern (yellow grid on blue background).
*
* Parameters:
* fullframe: if TRUE then entire frame is filled, otherwise the procedure
* continues from the current scanline.
* pmode 0: fill the frame with solid blue color (like on VCR or TV)
* 1: Draw a colored grid
*
*/
static void usbvision_testpattern(struct usb_usbvision *usbvision,
int fullframe, int pmode)
{
static const char proc[] = "usbvision_testpattern";
struct usbvision_frame *frame;
unsigned char *f;
int num_cell = 0;
int scan_length = 0;
static int num_pass;

if (usbvision == NULL) {
printk(KERN_ERR "%s: usbvision == NULL\n", proc);
return;
}
if (usbvision->cur_frame == NULL) {
printk(KERN_ERR "%s: usbvision->cur_frame is NULL.\n", proc);
return;
}

/* Grab the current frame */
frame = usbvision->cur_frame;

/* Optionally start at the beginning */
if (fullframe) {
frame->curline = 0;
frame->scanlength = 0;
}

/* Form every scan line */
for (; frame->curline < frame->frmheight; frame->curline++) {
int i;

f = frame->data + (usbvision->curwidth * 3 * frame->curline);
for (i = 0; i < usbvision->curwidth; i++) {
unsigned char cb = 0x80;
unsigned char cg = 0;
unsigned char cr = 0;

if (pmode == 1) {
if (frame->curline % 32 == 0)
cb = 0, cg = cr = 0xFF;
else if (i % 32 == 0) {
if (frame->curline % 32 == 1)
num_cell++;
cb = 0, cg = cr = 0xFF;
} else {
cb =
((num_cell * 7) +
num_pass) & 0xFF;
cg =
((num_cell * 5) +
num_pass * 2) & 0xFF;
cr =
((num_cell * 3) +
num_pass * 3) & 0xFF;
}
} else {
/* Just the blue screen */
}

*f++ = cb;
*f++ = cg;
*f++ = cr;
scan_length += 3;
}
}

frame->grabstate = frame_state_done;
frame->scanlength += scan_length;
++num_pass;
}

/*
* usbvision_decompress_alloc()
*
Expand Down Expand Up @@ -571,10 +483,6 @@ static enum parse_state usbvision_find_header(struct usb_usbvision *usbvision)
frame->scanstate = scan_state_lines;
frame->curline = 0;

if (force_testpattern) {
usbvision_testpattern(usbvision, 1, 1);
return parse_state_next_frame;
}
return parse_state_continue;
}

Expand Down

0 comments on commit 5998343

Please sign in to comment.