From patchwork Wed Apr 27 20:35:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 737591 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3RKbBfD010471 for ; Wed, 27 Apr 2011 20:37:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757671Ab1D0UgL (ORCPT ); Wed, 27 Apr 2011 16:36:11 -0400 Received: from mail1-out1.atlantis.sk ([80.94.52.55]:42423 "EHLO mail.atlantis.sk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755637Ab1D0UgK (ORCPT ); Wed, 27 Apr 2011 16:36:10 -0400 Received: (qmail 29350 invoked from network); 27 Apr 2011 20:36:08 -0000 Received: from unknown (HELO pentium) (rainbow@rainbow-software.org@85.216.180.141) by mail.atlantis.sk with AES256-SHA encrypted SMTP; 27 Apr 2011 20:36:08 -0000 From: Ondrej Zary To: "Hans Verkuil" Subject: [PATCH 3/4] usbvision: remove broken testpattern Date: Wed, 27 Apr 2011 22:35:45 +0200 User-Agent: KMail/1.9.10 Cc: "Hans de Goede" , "Joerg Heckenbach" , "Dwaine Garden" , linux-media@vger.kernel.org, "Kernel development list" MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201104272235.51076.linux@rainbow-software.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 20:37:18 +0000 (UTC) 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 diff -up linux-2.6.39-rc2-/drivers/media/video/usbvision/usbvision-core.c linux-2.6.39-rc2/drivers/media/video/usbvision/usbvision-core.c --- linux-2.6.39-rc2-/drivers/media/video/usbvision/usbvision-core.c 2011-04-27 22:08:32.000000000 +0200 +++ linux-2.6.39-rc2/drivers/media/video/usbvision/usbvision-core.c 2011-04-27 22:08:53.000000000 +0200 @@ -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)"); @@ -388,90 +384,6 @@ void usbvision_scratch_free(struct usb_u } /* - * 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() * * allocates intermediate buffer for decompression @@ -571,10 +483,6 @@ static enum parse_state usbvision_find_h 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; }