Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media: davinci: vpif_capture: drop unneeded module params

Remove bogus 'numbuffers' and 'bufsize' module options. The number of buffers and
buffer sizes are determined by VIDIOC_REQBUFS and VIDIOC_S_FMT and the amount of
available memory (in the case of the MMAP stream I/O mode) and not by module
options.

These module params are a left-over from the original montavista code that used
these parameters to pre-allocate the memory needed for the buffers. The code that
allocated those buffers was never upstreamed since by the time the drivers were
added to the kernel the TI cmem module could be used in combination with the
USERPTR mode to reserve and pass physically contiguous memory pointers around.

These days of course CMA is used instead of cmem.

This patch removes these module options altogether since they no longer do what
they originally were designed for. They should never have been part of the
upstreamed code in the first place, so they've been pointless ever since
2.6.32 when this driver first appeared in the mainline kernel.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Lad, Prabhakar and committed by
Mauro Carvalho Chehab
4015bef6 619c027d

+1 -64
+1 -53
drivers/media/platform/davinci/vpif_capture.c
··· 39 39 v4l2_dbg(level, debug, &vpif_obj.v4l2_dev, fmt, ## arg) 40 40 41 41 static int debug = 1; 42 - static u32 ch0_numbuffers = 3; 43 - static u32 ch1_numbuffers = 3; 44 - static u32 ch0_bufsize = 1920 * 1080 * 2; 45 - static u32 ch1_bufsize = 720 * 576 * 2; 46 42 47 43 module_param(debug, int, 0644); 48 - module_param(ch0_numbuffers, uint, S_IRUGO); 49 - module_param(ch1_numbuffers, uint, S_IRUGO); 50 - module_param(ch0_bufsize, uint, S_IRUGO); 51 - module_param(ch1_bufsize, uint, S_IRUGO); 52 44 53 45 MODULE_PARM_DESC(debug, "Debug level 0-1"); 54 - MODULE_PARM_DESC(ch2_numbuffers, "Channel0 buffer count (default:3)"); 55 - MODULE_PARM_DESC(ch3_numbuffers, "Channel1 buffer count (default:3)"); 56 - MODULE_PARM_DESC(ch2_bufsize, "Channel0 buffer size (default:1920 x 1080 x 2)"); 57 - MODULE_PARM_DESC(ch3_bufsize, "Channel1 buffer size (default:720 x 576 x 2)"); 58 - 59 - static struct vpif_config_params config_params = { 60 - .min_numbuffers = 3, 61 - .numbuffers[0] = 3, 62 - .numbuffers[1] = 3, 63 - .min_bufsize[0] = 720 * 480 * 2, 64 - .min_bufsize[1] = 720 * 480 * 2, 65 - .channel_bufsize[0] = 1920 * 1080 * 2, 66 - .channel_bufsize[1] = 720 * 576 * 2, 67 - }; 68 46 69 47 #define VPIF_DRIVER_NAME "vpif_capture" 70 48 ··· 588 610 vpif_dbg(2, debug, "vpif_config_format\n"); 589 611 590 612 common->fmt.fmt.pix.field = V4L2_FIELD_ANY; 591 - common->fmt.fmt.pix.sizeimage 592 - = config_params.channel_bufsize[ch->channel_id]; 593 - 594 613 if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) 595 614 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; 596 615 else ··· 1385 1410 */ 1386 1411 static int initialize_vpif(void) 1387 1412 { 1388 - int err = 0, i, j; 1413 + int err, i, j; 1389 1414 int free_channel_objects_index; 1390 - 1391 - /* Default number of buffers should be 3 */ 1392 - if ((ch0_numbuffers > 0) && 1393 - (ch0_numbuffers < config_params.min_numbuffers)) 1394 - ch0_numbuffers = config_params.min_numbuffers; 1395 - if ((ch1_numbuffers > 0) && 1396 - (ch1_numbuffers < config_params.min_numbuffers)) 1397 - ch1_numbuffers = config_params.min_numbuffers; 1398 - 1399 - /* Set buffer size to min buffers size if it is invalid */ 1400 - if (ch0_bufsize < config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]) 1401 - ch0_bufsize = 1402 - config_params.min_bufsize[VPIF_CHANNEL0_VIDEO]; 1403 - if (ch1_bufsize < config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]) 1404 - ch1_bufsize = 1405 - config_params.min_bufsize[VPIF_CHANNEL1_VIDEO]; 1406 - 1407 - config_params.numbuffers[VPIF_CHANNEL0_VIDEO] = ch0_numbuffers; 1408 - config_params.numbuffers[VPIF_CHANNEL1_VIDEO] = ch1_numbuffers; 1409 - if (ch0_numbuffers) { 1410 - config_params.channel_bufsize[VPIF_CHANNEL0_VIDEO] 1411 - = ch0_bufsize; 1412 - } 1413 - if (ch1_numbuffers) { 1414 - config_params.channel_bufsize[VPIF_CHANNEL1_VIDEO] 1415 - = ch1_bufsize; 1416 - } 1417 1415 1418 1416 /* Allocate memory for six channel objects */ 1419 1417 for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
-11
drivers/media/platform/davinci/vpif_capture.h
··· 119 119 struct vpif_capture_config *config; 120 120 }; 121 121 122 - struct vpif_config_params { 123 - u8 min_numbuffers; 124 - u8 numbuffers[VPIF_CAPTURE_NUM_CHANNELS]; 125 - s8 device_type; 126 - u32 min_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; 127 - u32 channel_bufsize[VPIF_CAPTURE_NUM_CHANNELS]; 128 - u8 default_device[VPIF_CAPTURE_NUM_CHANNELS]; 129 - u32 video_limit[VPIF_CAPTURE_NUM_CHANNELS]; 130 - u8 max_device_type; 131 - }; 132 - 133 122 #endif /* VPIF_CAPTURE_H */