aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLad, Prabhakar <prabhakar.csengg@gmail.com>2014-05-16 09:33:47 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-17 11:04:44 -0400
commit4015bef6495f5153fccbb8d4476f71511af82f4d (patch)
tree8408068f6d74c136d4d401b8f698e953f9b67e0f
parent619c027da030c532fb9a94911a117ffaa5d844b6 (diff)
[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>
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c54
-rw-r--r--drivers/media/platform/davinci/vpif_capture.h11
2 files changed, 1 insertions, 64 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a7ed16497903..cb746e9a73f6 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -39,32 +39,10 @@ MODULE_VERSION(VPIF_CAPTURE_VERSION);
39 v4l2_dbg(level, debug, &vpif_obj.v4l2_dev, fmt, ## arg) 39 v4l2_dbg(level, debug, &vpif_obj.v4l2_dev, fmt, ## arg)
40 40
41static int debug = 1; 41static int debug = 1;
42static u32 ch0_numbuffers = 3;
43static u32 ch1_numbuffers = 3;
44static u32 ch0_bufsize = 1920 * 1080 * 2;
45static u32 ch1_bufsize = 720 * 576 * 2;
46 42
47module_param(debug, int, 0644); 43module_param(debug, int, 0644);
48module_param(ch0_numbuffers, uint, S_IRUGO);
49module_param(ch1_numbuffers, uint, S_IRUGO);
50module_param(ch0_bufsize, uint, S_IRUGO);
51module_param(ch1_bufsize, uint, S_IRUGO);
52 44
53MODULE_PARM_DESC(debug, "Debug level 0-1"); 45MODULE_PARM_DESC(debug, "Debug level 0-1");
54MODULE_PARM_DESC(ch2_numbuffers, "Channel0 buffer count (default:3)");
55MODULE_PARM_DESC(ch3_numbuffers, "Channel1 buffer count (default:3)");
56MODULE_PARM_DESC(ch2_bufsize, "Channel0 buffer size (default:1920 x 1080 x 2)");
57MODULE_PARM_DESC(ch3_bufsize, "Channel1 buffer size (default:720 x 576 x 2)");
58
59static 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#define VPIF_DRIVER_NAME "vpif_capture" 47#define VPIF_DRIVER_NAME "vpif_capture"
70 48
@@ -610,9 +588,6 @@ static void vpif_config_format(struct channel_obj *ch)
610 vpif_dbg(2, debug, "vpif_config_format\n"); 588 vpif_dbg(2, debug, "vpif_config_format\n");
611 589
612 common->fmt.fmt.pix.field = V4L2_FIELD_ANY; 590 common->fmt.fmt.pix.field = V4L2_FIELD_ANY;
613 common->fmt.fmt.pix.sizeimage
614 = config_params.channel_bufsize[ch->channel_id];
615
616 if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) 591 if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER)
617 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; 592 common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8;
618 else 593 else
@@ -1410,36 +1385,9 @@ static struct v4l2_file_operations vpif_fops = {
1410 */ 1385 */
1411static int initialize_vpif(void) 1386static int initialize_vpif(void)
1412{ 1387{
1413 int err = 0, i, j; 1388 int err, i, j;
1414 int free_channel_objects_index; 1389 int free_channel_objects_index;
1415 1390
1416 /* Default number of buffers should be 3 */
1417 if ((ch0_numbuffers > 0) &&
1418 (ch0_numbuffers < config_params.min_numbuffers))
1419 ch0_numbuffers = config_params.min_numbuffers;
1420 if ((ch1_numbuffers > 0) &&
1421 (ch1_numbuffers < config_params.min_numbuffers))
1422 ch1_numbuffers = config_params.min_numbuffers;
1423
1424 /* Set buffer size to min buffers size if it is invalid */
1425 if (ch0_bufsize < config_params.min_bufsize[VPIF_CHANNEL0_VIDEO])
1426 ch0_bufsize =
1427 config_params.min_bufsize[VPIF_CHANNEL0_VIDEO];
1428 if (ch1_bufsize < config_params.min_bufsize[VPIF_CHANNEL1_VIDEO])
1429 ch1_bufsize =
1430 config_params.min_bufsize[VPIF_CHANNEL1_VIDEO];
1431
1432 config_params.numbuffers[VPIF_CHANNEL0_VIDEO] = ch0_numbuffers;
1433 config_params.numbuffers[VPIF_CHANNEL1_VIDEO] = ch1_numbuffers;
1434 if (ch0_numbuffers) {
1435 config_params.channel_bufsize[VPIF_CHANNEL0_VIDEO]
1436 = ch0_bufsize;
1437 }
1438 if (ch1_numbuffers) {
1439 config_params.channel_bufsize[VPIF_CHANNEL1_VIDEO]
1440 = ch1_bufsize;
1441 }
1442
1443 /* Allocate memory for six channel objects */ 1391 /* Allocate memory for six channel objects */
1444 for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { 1392 for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) {
1445 vpif_obj.dev[i] = 1393 vpif_obj.dev[i] =
diff --git a/drivers/media/platform/davinci/vpif_capture.h b/drivers/media/platform/davinci/vpif_capture.h
index 1ee17824f484..f65d28d38e66 100644
--- a/drivers/media/platform/davinci/vpif_capture.h
+++ b/drivers/media/platform/davinci/vpif_capture.h
@@ -119,15 +119,4 @@ struct vpif_device {
119 struct vpif_capture_config *config; 119 struct vpif_capture_config *config;
120}; 120};
121 121
122struct 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#endif /* VPIF_CAPTURE_H */ 122#endif /* VPIF_CAPTURE_H */