Fix lines ending with open parenthesis. Issue detected by checkpatch tool.
In the process, change driver functions name in the multiple files from:
vchiq_mmal_port_parameter_set to vmp_prmtr_set
vchiq_mmal_component_disable to vm_cmpnt_disable
vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel
vchiq_mmal_component_enable to vm_cmpnt_enable
Signed-off-by: Jules Irenge <[email protected]>
---
.../bcm2835-camera/bcm2835-camera.c | 191 ++++++++----------
1 file changed, 89 insertions(+), 102 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index beb6a0063bb8..0ffe95b3bfb2 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -337,12 +337,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
if (is_capturing(dev)) {
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"Grab another frame");
- vchiq_mmal_port_parameter_set(
- instance,
- dev->capture.camera_port,
- MMAL_PARAMETER_CAPTURE,
- &dev->capture.frame_count,
- sizeof(dev->capture.frame_count));
+ vmp_prmtr_set(instance,
+ dev->capture.camera_port,
+ MMAL_PARAMETER_CAPTURE,
+ &dev->capture.frame_count,
+ sizeof(dev->capture.frame_count));
}
if (vchiq_mmal_submit_buffer(instance, port, buf))
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
@@ -392,12 +391,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
is_capturing(dev)) {
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"Grab another frame as buffer has EOS");
- vchiq_mmal_port_parameter_set(
- instance,
- dev->capture.camera_port,
- MMAL_PARAMETER_CAPTURE,
- &dev->capture.frame_count,
- sizeof(dev->capture.frame_count));
+ vmp_prmtr_set(instance,
+ dev->capture.camera_port,
+ MMAL_PARAMETER_CAPTURE,
+ &dev->capture.frame_count,
+ sizeof(dev->capture.frame_count));
}
}
@@ -406,20 +404,18 @@ static int enable_camera(struct bm2835_mmal_dev *dev)
int ret;
if (!dev->camera_use_count) {
- ret = vchiq_mmal_port_parameter_set(
- dev->instance,
- &dev->component[COMP_CAMERA]->control,
- MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
- sizeof(dev->camera_num));
+ ret = vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_CAMERA]->control,
+ MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
+ sizeof(dev->camera_num));
if (ret < 0) {
v4l2_err(&dev->v4l2_dev,
"Failed setting camera num, ret %d\n", ret);
return -EINVAL;
}
- ret = vchiq_mmal_component_enable(
- dev->instance,
- dev->component[COMP_CAMERA]);
+ ret = vm_cmpnt_enable(dev->instance,
+ dev->component[COMP_CAMERA]);
if (ret < 0) {
v4l2_err(&dev->v4l2_dev,
"Failed enabling camera, ret %d\n", ret);
@@ -449,19 +445,17 @@ static int disable_camera(struct bm2835_mmal_dev *dev)
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"Disabling camera\n");
ret =
- vchiq_mmal_component_disable(
- dev->instance,
- dev->component[COMP_CAMERA]);
+ vm_cmpnt_disable(dev->instance,
+ dev->component[COMP_CAMERA]);
if (ret < 0) {
v4l2_err(&dev->v4l2_dev,
"Failed disabling camera, ret %d\n", ret);
return -EINVAL;
}
- vchiq_mmal_port_parameter_set(
- dev->instance,
- &dev->component[COMP_CAMERA]->control,
- MMAL_PARAMETER_CAMERA_NUM, &i,
- sizeof(i));
+ vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_CAMERA]->control,
+ MMAL_PARAMETER_CAMERA_NUM, &i,
+ sizeof(i));
}
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"Camera refcount now %d\n", dev->camera_use_count);
@@ -569,11 +563,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
}
/* capture the first frame */
- vchiq_mmal_port_parameter_set(dev->instance,
- dev->capture.camera_port,
- MMAL_PARAMETER_CAPTURE,
- &dev->capture.frame_count,
- sizeof(dev->capture.frame_count));
+ vmp_prmtr_set(dev->instance,
+ dev->capture.camera_port,
+ MMAL_PARAMETER_CAPTURE,
+ &dev->capture.frame_count,
+ sizeof(dev->capture.frame_count));
return 0;
}
@@ -601,11 +595,11 @@ static void stop_streaming(struct vb2_queue *vq)
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "stopping capturing\n");
/* stop capturing frames */
- vchiq_mmal_port_parameter_set(dev->instance,
- dev->capture.camera_port,
- MMAL_PARAMETER_CAPTURE,
- &dev->capture.frame_count,
- sizeof(dev->capture.frame_count));
+ vmp_prmtr_set(dev->instance,
+ dev->capture.camera_port,
+ MMAL_PARAMETER_CAPTURE,
+ &dev->capture.frame_count,
+ sizeof(dev->capture.frame_count));
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"disabling connection\n");
@@ -675,9 +669,10 @@ static int set_overlay_params(struct bm2835_mmal_dev *dev,
.height = dev->overlay.w.height,
},
};
- return vchiq_mmal_port_parameter_set(dev->instance, port,
- MMAL_PARAMETER_DISPLAYREGION,
- &prev_config, sizeof(prev_config));
+ return vmp_prmtr_set(dev->instance,
+ port,
+ MMAL_PARAMETER_DISPLAYREGION,
+ &prev_config, sizeof(prev_config));
}
/* overlay ioctl */
@@ -772,12 +767,12 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
ret = vchiq_mmal_port_disable(dev->instance, src);
if (!ret)
ret =
- vchiq_mmal_port_connect_tunnel(dev->instance, src,
- NULL);
+ vmp_cnnct_tunnel(dev->instance,
+ src,
+ NULL);
if (ret >= 0)
- ret = vchiq_mmal_component_disable(
- dev->instance,
- dev->component[COMP_PREVIEW]);
+ ret = vm_cmpnt_disable(dev->instance,
+ dev->component[COMP_PREVIEW]);
disable_camera(dev);
return ret;
@@ -797,15 +792,14 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
if (enable_camera(dev) < 0)
return -EINVAL;
- ret = vchiq_mmal_component_enable(
- dev->instance,
- dev->component[COMP_PREVIEW]);
+ ret = vm_cmpnt_enable(dev->instance,
+ dev->component[COMP_PREVIEW]);
if (ret < 0)
return ret;
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "connecting %p to %p\n",
src, dst);
- ret = vchiq_mmal_port_connect_tunnel(dev->instance, src, dst);
+ ret = vmp_cnnct_tunnel(dev->instance, src, dst);
if (ret)
return ret;
@@ -1015,11 +1009,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
"vid_cap - disconnect previous tunnel\n");
/* Disconnect any previous connection */
- vchiq_mmal_port_connect_tunnel(dev->instance,
- dev->capture.camera_port, NULL);
+ vmp_cnnct_tunnel(dev->instance,
+ dev->capture.camera_port, NULL);
dev->capture.camera_port = NULL;
- ret = vchiq_mmal_component_disable(dev->instance,
- dev->capture.encode_component);
+ ret = vm_cmpnt_disable(dev->instance,
+ dev->capture.encode_component);
if (ret)
v4l2_err(&dev->v4l2_dev,
"Failed to disable encode component %d\n",
@@ -1072,10 +1066,10 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
}
remove_padding = mfmt->remove_padding;
- vchiq_mmal_port_parameter_set(dev->instance,
- camera_port,
- MMAL_PARAMETER_NO_IMAGE_PADDING,
- &remove_padding, sizeof(remove_padding));
+ vmp_prmtr_set(dev->instance,
+ camera_port,
+ MMAL_PARAMETER_NO_IMAGE_PADDING,
+ &remove_padding, sizeof(remove_padding));
camera_port->format.encoding_variant = 0;
camera_port->es.video.width = f->fmt.pix.width;
@@ -1107,10 +1101,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
preview_port);
if (!ret)
ret =
- vchiq_mmal_port_connect_tunnel(
- dev->instance,
- preview_port,
- NULL);
+ vmp_cnnct_tunnel(dev->instance,
+ preview_port,
+ NULL);
}
preview_port->es.video.width = f->fmt.pix.width;
preview_port->es.video.height = f->fmt.pix.height;
@@ -1124,9 +1117,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
dev->capture.timeperframe.numerator;
ret = vchiq_mmal_port_set_format(dev->instance, preview_port);
if (overlay_enabled) {
- ret = vchiq_mmal_port_connect_tunnel(
- dev->instance,
- preview_port,
+ ret = vmp_cnnct_tunnel(dev->instance,
+ preview_port,
&dev->component[COMP_PREVIEW]->input[0]);
if (!ret)
ret = vchiq_mmal_port_enable(dev->instance,
@@ -1154,10 +1146,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
camera_port->recommended_buffer.num;
ret =
- vchiq_mmal_port_connect_tunnel(
- dev->instance,
- camera_port,
- &encode_component->input[0]);
+ vmp_cnnct_tunnel(dev->instance,
+ camera_port,
+ &encode_component->input[0]);
if (ret) {
v4l2_dbg(1, bcm2835_v4l2_debug,
&dev->v4l2_dev,
@@ -1205,9 +1196,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
}
if (!ret) {
- ret = vchiq_mmal_component_enable(
- dev->instance,
- encode_component);
+ ret = vm_cmpnt_enable(dev->instance,
+ encode_component);
if (ret) {
v4l2_dbg(1, bcm2835_v4l2_debug,
&dev->v4l2_dev,
@@ -1530,7 +1520,7 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance,
.use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC
};
- return vchiq_mmal_port_parameter_set(instance, &camera->control,
+ return vmp_prmtr_set(instance, &camera->control,
MMAL_PARAMETER_CAMERA_CONFIG,
&cam_config, sizeof(cam_config));
}
@@ -1655,9 +1645,9 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0;
/* get the preview component ready */
- ret = vchiq_mmal_component_init(
- dev->instance, "ril.video_render",
- &dev->component[COMP_PREVIEW]);
+ ret = vchiq_mmal_component_init(dev->instance,
+ "ril.video_render",
+ &dev->component[COMP_PREVIEW]);
if (ret < 0)
goto unreg_camera;
@@ -1669,9 +1659,9 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
}
/* get the image encoder component ready */
- ret = vchiq_mmal_component_init(
- dev->instance, "ril.image_encode",
- &dev->component[COMP_IMAGE_ENCODE]);
+ ret = vchiq_mmal_component_init(dev->instance,
+ "ril.image_encode",
+ &dev->component[COMP_IMAGE_ENCODE]);
if (ret < 0)
goto unreg_preview;
@@ -1708,17 +1698,16 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
{
unsigned int enable = 1;
- vchiq_mmal_port_parameter_set(
- dev->instance,
- &dev->component[COMP_VIDEO_ENCODE]->control,
- MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
- &enable, sizeof(enable));
-
- vchiq_mmal_port_parameter_set(dev->instance,
- &dev->component[COMP_VIDEO_ENCODE]->control,
- MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
- &enable,
- sizeof(enable));
+ vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_VIDEO_ENCODE]->control,
+ MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
+ &enable, sizeof(enable));
+
+ vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_VIDEO_ENCODE]->control,
+ MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
+ &enable,
+ sizeof(enable));
}
ret = bm2835_mmal_set_all_camera_controls(dev);
if (ret < 0) {
@@ -1731,15 +1720,13 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
unreg_vid_encoder:
pr_err("Cleanup: Destroy video encoder\n");
- vchiq_mmal_component_finalise(
- dev->instance,
- dev->component[COMP_VIDEO_ENCODE]);
+ vchiq_mmal_component_finalise(dev->instance,
+ dev->component[COMP_VIDEO_ENCODE]);
unreg_image_encoder:
pr_err("Cleanup: Destroy image encoder\n");
- vchiq_mmal_component_finalise(
- dev->instance,
- dev->component[COMP_IMAGE_ENCODE]);
+ vchiq_mmal_component_finalise(dev->instance,
+ dev->component[COMP_IMAGE_ENCODE]);
unreg_preview:
pr_err("Cleanup: Destroy video render\n");
@@ -1799,13 +1786,13 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev)
if (dev->capture.encode_component) {
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"mmal_exit - disconnect tunnel\n");
- vchiq_mmal_port_connect_tunnel(dev->instance,
- dev->capture.camera_port, NULL);
- vchiq_mmal_component_disable(dev->instance,
- dev->capture.encode_component);
+ vmp_cnnct_tunnel(dev->instance,
+ dev->capture.camera_port, NULL);
+ vm_cmpnt_disable(dev->instance,
+ dev->capture.encode_component);
}
- vchiq_mmal_component_disable(dev->instance,
- dev->component[COMP_CAMERA]);
+ vm_cmpnt_disable(dev->instance,
+ dev->component[COMP_CAMERA]);
vchiq_mmal_component_finalise(dev->instance,
dev->component[COMP_VIDEO_ENCODE]);
--
2.21.0
Fix lines ending with open parenthesis. Issue detected by checkpatch tool.
Within "controls.c", "mmal-vchiq.c" and" mmal-vchiq.h" files.
Signed-off-by: Jules Irenge <[email protected]>
---
.../vc04_services/bcm2835-camera/controls.c | 208 +++++++++---------
.../vc04_services/bcm2835-camera/mmal-vchiq.c | 20 +-
.../vc04_services/bcm2835-camera/mmal-vchiq.h | 54 ++---
3 files changed, 138 insertions(+), 144 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c
index 89786c264867..015ace1e9506 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
@@ -67,10 +67,9 @@ enum bm2835_mmal_ctrl_type {
struct bm2835_mmal_v4l2_ctrl;
-typedef int(bm2835_mmal_v4l2_ctrl_cb)(
- struct bm2835_mmal_dev *dev,
- struct v4l2_ctrl *ctrl,
- const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl);
+typedef int(bm2835_mmal_v4l2_ctrl_cb)(struct bm2835_mmal_dev *dev,
+ struct v4l2_ctrl *ctrl,
+ const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl);
struct bm2835_mmal_v4l2_ctrl {
u32 id; /* v4l2 control identifier */
@@ -169,7 +168,7 @@ static int ctrl_set_rational(struct bm2835_mmal_dev *dev,
rational_value.num = ctrl->val;
rational_value.den = 100;
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&rational_value,
sizeof(rational_value));
@@ -186,7 +185,7 @@ static int ctrl_set_value(struct bm2835_mmal_dev *dev,
u32_value = ctrl->val;
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -214,7 +213,7 @@ static int ctrl_set_iso(struct bm2835_mmal_dev *dev,
else
u32_value = 0;
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
MMAL_PARAMETER_ISO,
&u32_value, sizeof(u32_value));
}
@@ -230,7 +229,7 @@ static int ctrl_set_value_ev(struct bm2835_mmal_dev *dev,
s32_value = (ctrl->val - 12) * 2; /* Convert from index to 1/6ths */
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&s32_value, sizeof(s32_value));
}
@@ -247,19 +246,19 @@ static int ctrl_set_rotate(struct bm2835_mmal_dev *dev,
u32_value = ((ctrl->val % 360) / 90) * 90;
- ret = vchiq_mmal_port_parameter_set(dev->instance, &camera->output[0],
- mmal_ctrl->mmal_id,
- &u32_value, sizeof(u32_value));
+ ret = vmp_prmtr_set(dev->instance, &camera->output[0],
+ mmal_ctrl->mmal_id,
+ &u32_value, sizeof(u32_value));
if (ret < 0)
return ret;
- ret = vchiq_mmal_port_parameter_set(dev->instance, &camera->output[1],
- mmal_ctrl->mmal_id,
- &u32_value, sizeof(u32_value));
+ ret = vmp_prmtr_set(dev->instance, &camera->output[1],
+ mmal_ctrl->mmal_id,
+ &u32_value, sizeof(u32_value));
if (ret < 0)
return ret;
- return vchiq_mmal_port_parameter_set(dev->instance, &camera->output[2],
+ return vmp_prmtr_set(dev->instance, &camera->output[2],
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -288,21 +287,24 @@ static int ctrl_set_flip(struct bm2835_mmal_dev *dev,
else
u32_value = MMAL_PARAM_MIRROR_NONE;
- ret = vchiq_mmal_port_parameter_set(dev->instance, &camera->output[0],
- mmal_ctrl->mmal_id,
- &u32_value, sizeof(u32_value));
+ ret = vmp_prmtr_set(dev->instance,
+ &camera->output[0],
+ mmal_ctrl->mmal_id,
+ &u32_value, sizeof(u32_value));
if (ret < 0)
return ret;
- ret = vchiq_mmal_port_parameter_set(dev->instance, &camera->output[1],
- mmal_ctrl->mmal_id,
- &u32_value, sizeof(u32_value));
+ ret = vmp_prmtr_set(dev->instance,
+ &camera->output[1],
+ mmal_ctrl->mmal_id,
+ &u32_value, sizeof(u32_value));
if (ret < 0)
return ret;
- return vchiq_mmal_port_parameter_set(dev->instance, &camera->output[2],
- mmal_ctrl->mmal_id,
- &u32_value, sizeof(u32_value));
+ return vmp_prmtr_set(dev->instance,
+ &camera->output[2],
+ mmal_ctrl->mmal_id,
+ &u32_value, sizeof(u32_value));
}
static int ctrl_set_exposure(struct bm2835_mmal_dev *dev,
@@ -341,16 +343,16 @@ static int ctrl_set_exposure(struct bm2835_mmal_dev *dev,
if (exp_mode == MMAL_PARAM_EXPOSUREMODE_OFF)
shutter_speed = dev->manual_shutter_speed;
- ret = vchiq_mmal_port_parameter_set(dev->instance,
- control,
- MMAL_PARAMETER_SHUTTER_SPEED,
- &shutter_speed,
- sizeof(shutter_speed));
- ret += vchiq_mmal_port_parameter_set(dev->instance,
- control,
- MMAL_PARAMETER_EXPOSURE_MODE,
- &exp_mode,
- sizeof(u32));
+ ret = vmp_prmtr_set(dev->instance,
+ control,
+ MMAL_PARAMETER_SHUTTER_SPEED,
+ &shutter_speed,
+ sizeof(shutter_speed));
+ ret += vmp_prmtr_set(dev->instance,
+ control,
+ MMAL_PARAMETER_EXPOSURE_MODE,
+ &exp_mode,
+ sizeof(u32));
dev->exposure_mode_active = exp_mode;
}
/* exposure_dynamic_framerate (V4L2_CID_EXPOSURE_AUTO_PRIORITY) should
@@ -391,7 +393,7 @@ static int ctrl_set_metering_mode(struct bm2835_mmal_dev *dev,
control = &dev->component[COMP_CAMERA]->control;
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
} else {
@@ -423,7 +425,7 @@ static int ctrl_set_flicker_avoidance(struct bm2835_mmal_dev *dev,
break;
}
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -479,7 +481,7 @@ static int ctrl_set_awb_mode(struct bm2835_mmal_dev *dev,
break;
}
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -502,7 +504,7 @@ static int ctrl_set_awb_gains(struct bm2835_mmal_dev *dev,
gains.b_gain.num = dev->blue_gain;
gains.r_gain.den = gains.b_gain.den = 1000;
- return vchiq_mmal_port_parameter_set(dev->instance, control,
+ return vmp_prmtr_set(dev->instance, control,
mmal_ctrl->mmal_id,
&gains, sizeof(gains));
}
@@ -541,17 +543,15 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
control = &dev->component[COMP_CAMERA]->control;
- ret = vchiq_mmal_port_parameter_set(
- dev->instance, control,
- MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS,
- &imagefx, sizeof(imagefx));
+ ret = vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS,
+ &imagefx, sizeof(imagefx));
if (ret)
goto exit;
- ret = vchiq_mmal_port_parameter_set(
- dev->instance, control,
- MMAL_PARAMETER_COLOUR_EFFECT,
- &dev->colourfx, sizeof(dev->colourfx));
+ ret = vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_COLOUR_EFFECT,
+ &dev->colourfx, sizeof(dev->colourfx));
}
}
@@ -577,10 +577,10 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
dev->colourfx.u = (ctrl->val & 0xff00) >> 8;
dev->colourfx.v = ctrl->val & 0xff;
- ret = vchiq_mmal_port_parameter_set(dev->instance, control,
- MMAL_PARAMETER_COLOUR_EFFECT,
- &dev->colourfx,
- sizeof(dev->colourfx));
+ ret = vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_COLOUR_EFFECT,
+ &dev->colourfx,
+ sizeof(dev->colourfx));
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n",
@@ -600,9 +600,9 @@ static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev,
encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0];
- ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
- mmal_ctrl->mmal_id, &ctrl->val,
- sizeof(ctrl->val));
+ ret = vmp_prmtr_set(dev->instance, encoder_out,
+ mmal_ctrl->mmal_id, &ctrl->val,
+ sizeof(ctrl->val));
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
"%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n",
@@ -637,10 +637,10 @@ static int ctrl_set_bitrate_mode(struct bm2835_mmal_dev *dev,
break;
}
- vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
- mmal_ctrl->mmal_id,
- &bitrate_mode,
- sizeof(bitrate_mode));
+ vmp_prmtr_set(dev->instance, encoder_out,
+ mmal_ctrl->mmal_id,
+ &bitrate_mode,
+ sizeof(bitrate_mode));
return 0;
}
@@ -655,7 +655,7 @@ static int ctrl_set_image_encode_output(struct bm2835_mmal_dev *dev,
u32_value = ctrl->val;
- return vchiq_mmal_port_parameter_set(dev->instance, jpeg_out,
+ return vmp_prmtr_set(dev->instance, jpeg_out,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -671,7 +671,7 @@ static int ctrl_set_video_encode_param_output(struct bm2835_mmal_dev *dev,
u32_value = ctrl->val;
- return vchiq_mmal_port_parameter_set(dev->instance, vid_enc_ctl,
+ return vmp_prmtr_set(dev->instance, vid_enc_ctl,
mmal_ctrl->mmal_id,
&u32_value, sizeof(u32_value));
}
@@ -779,8 +779,8 @@ static int ctrl_set_video_encode_profile_level(struct bm2835_mmal_dev *dev,
break;
}
- ret = vchiq_mmal_port_parameter_set(dev->instance,
- &dev->component[COMP_VIDEO_ENCODE]->output[0],
+ ret = vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_VIDEO_ENCODE]->output[0],
mmal_ctrl->mmal_id,
¶m, sizeof(param));
}
@@ -816,22 +816,22 @@ static int ctrl_set_scene_mode(struct bm2835_mmal_dev *dev,
"%s: scene mode none: shut_speed %d, exp_mode %d, metering %d\n",
__func__, shutter_speed, dev->exposure_mode_user,
dev->metering_mode);
- ret = vchiq_mmal_port_parameter_set(dev->instance,
- control,
- MMAL_PARAMETER_SHUTTER_SPEED,
- &shutter_speed,
- sizeof(shutter_speed));
- ret += vchiq_mmal_port_parameter_set(dev->instance,
- control,
- MMAL_PARAMETER_EXPOSURE_MODE,
- &dev->exposure_mode_user,
- sizeof(u32));
+ ret = vmp_prmtr_set(dev->instance,
+ control,
+ MMAL_PARAMETER_SHUTTER_SPEED,
+ &shutter_speed,
+ sizeof(shutter_speed));
+ ret += vmp_prmtr_set(dev->instance,
+ control,
+ MMAL_PARAMETER_EXPOSURE_MODE,
+ &dev->exposure_mode_user,
+ sizeof(u32));
dev->exposure_mode_active = dev->exposure_mode_user;
- ret += vchiq_mmal_port_parameter_set(dev->instance,
- control,
- MMAL_PARAMETER_EXP_METERING_MODE,
- &dev->metering_mode,
- sizeof(u32));
+ ret += vmp_prmtr_set(dev->instance,
+ control,
+ MMAL_PARAMETER_EXP_METERING_MODE,
+ &dev->metering_mode,
+ sizeof(u32));
ret += set_framerate_params(dev);
} else {
/* Set up scene mode */
@@ -867,23 +867,23 @@ static int ctrl_set_scene_mode(struct bm2835_mmal_dev *dev,
"%s: scene mode none: shut_speed %d, exp_mode %d, metering %d\n",
__func__, shutter_speed, exposure_mode, metering_mode);
- ret = vchiq_mmal_port_parameter_set(dev->instance, control,
- MMAL_PARAMETER_SHUTTER_SPEED,
- &shutter_speed,
- sizeof(shutter_speed));
- ret += vchiq_mmal_port_parameter_set(dev->instance, control,
- MMAL_PARAMETER_EXPOSURE_MODE,
- &exposure_mode,
- sizeof(u32));
+ ret = vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_SHUTTER_SPEED,
+ &shutter_speed,
+ sizeof(shutter_speed));
+ ret += vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_EXPOSURE_MODE,
+ &exposure_mode,
+ sizeof(u32));
dev->exposure_mode_active = exposure_mode;
- ret += vchiq_mmal_port_parameter_set(dev->instance, control,
- MMAL_PARAMETER_EXPOSURE_MODE,
- &exposure_mode,
- sizeof(u32));
- ret += vchiq_mmal_port_parameter_set(dev->instance, control,
- MMAL_PARAMETER_EXP_METERING_MODE,
- &metering_mode,
- sizeof(u32));
+ ret += vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_EXPOSURE_MODE,
+ &exposure_mode,
+ sizeof(u32));
+ ret += vmp_prmtr_set(dev->instance, control,
+ MMAL_PARAMETER_EXP_METERING_MODE,
+ &metering_mode,
+ sizeof(u32));
ret += set_framerate_params(dev);
}
if (ret) {
@@ -1208,18 +1208,18 @@ int set_framerate_params(struct bm2835_mmal_dev *dev)
fps_range.fps_high.num,
fps_range.fps_high.den);
- ret = vchiq_mmal_port_parameter_set(dev->instance,
- &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW],
- MMAL_PARAMETER_FPS_RANGE,
- &fps_range, sizeof(fps_range));
- ret += vchiq_mmal_port_parameter_set(dev->instance,
- &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO],
- MMAL_PARAMETER_FPS_RANGE,
- &fps_range, sizeof(fps_range));
- ret += vchiq_mmal_port_parameter_set(dev->instance,
- &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE],
- MMAL_PARAMETER_FPS_RANGE,
- &fps_range, sizeof(fps_range));
+ ret = vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW],
+ MMAL_PARAMETER_FPS_RANGE,
+ &fps_range, sizeof(fps_range));
+ ret += vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO],
+ MMAL_PARAMETER_FPS_RANGE,
+ &fps_range, sizeof(fps_range));
+ ret += vmp_prmtr_set(dev->instance,
+ &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE],
+ MMAL_PARAMETER_FPS_RANGE,
+ &fps_range, sizeof(fps_range));
if (ret)
v4l2_dbg(0, bcm2835_v4l2_debug, &dev->v4l2_dev,
"Failed to set fps ret %d\n", ret);
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
index 1c180ead4a20..8ff21a90d5ef 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -1397,9 +1397,9 @@ int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance,
return ret;
}
-int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *port,
- u32 parameter, void *value, u32 value_size)
+int vmp_prmtr_set(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *port,
+ u32 parameter, void *value, u32 value_size)
{
int ret;
@@ -1482,9 +1482,9 @@ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
/* ports will be connected in a tunneled manner so data buffers
* are not handled by client.
*/
-int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *src,
- struct vchiq_mmal_port *dst)
+int vmp_cnnct_tunnel(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *src,
+ struct vchiq_mmal_port *dst)
{
int ret;
@@ -1718,8 +1718,8 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
/*
* cause a mmal component to be enabled
*/
-int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_component *component)
+int vm_cmpnt_enable(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_component *component)
{
int ret;
@@ -1743,8 +1743,8 @@ int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
/*
* cause a mmal component to be enabled
*/
-int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_component *component)
+int vm_cmpnt_disable(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_component *component)
{
int ret;
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
index 47897e81ec58..a24caab09784 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
@@ -41,11 +41,10 @@ struct vchiq_mmal_port_buffer {
struct vchiq_mmal_port;
-typedef void (*vchiq_mmal_buffer_cb)(
- struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *port,
- int status, struct mmal_buffer *buffer,
- unsigned long length, u32 mmal_flags, s64 dts, s64 pts);
+typedef void (*vchiq_mmal_buffer_cb)(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *port,
+ int status, struct mmal_buffer *buffer,
+ unsigned long length, u32 mmal_flags, s64 dts, s64 pts);
struct vchiq_mmal_port {
u32 enabled:1;
@@ -99,32 +98,27 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance);
/* Initialise a mmal component and its ports
*
*/
-int vchiq_mmal_component_init(
- struct vchiq_mmal_instance *instance,
- const char *name,
- struct vchiq_mmal_component **component_out);
+int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
+ const char *name,
+ struct vchiq_mmal_component **component_out);
-int vchiq_mmal_component_finalise(
- struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_component *component);
+int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_component *component);
-int vchiq_mmal_component_enable(
- struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_component *component);
+int vm_cmpnt_enable(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_component *component);
-int vchiq_mmal_component_disable(
- struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_component *component);
+int vm_cmpnt_disable(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_component *component);
/* enable a mmal port
*
* enables a port and if a buffer callback provided enque buffer
* headers as appropriate for the port.
*/
-int vchiq_mmal_port_enable(
- struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *port,
- vchiq_mmal_buffer_cb buffer_cb);
+int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *port,
+ vchiq_mmal_buffer_cb buffer_cb);
/* disable a port
*
@@ -133,11 +127,11 @@ int vchiq_mmal_port_enable(
int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port);
-int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *port,
- u32 parameter,
- void *value,
- u32 value_size);
+int vmp_prmtr_set(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *port,
+ u32 parameter,
+ void *value,
+ u32 value_size);
int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
@@ -148,9 +142,9 @@ int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port);
-int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
- struct vchiq_mmal_port *src,
- struct vchiq_mmal_port *dst);
+int vmp_cnnct_tunnel(struct vchiq_mmal_instance *instance,
+ struct vchiq_mmal_port *src,
+ struct vchiq_mmal_port *dst);
int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
u32 *major_out,
--
2.21.0
On Sun, 13 Oct 2019, Jules Irenge wrote:
> Fix lines ending with open parenthesis. Issue detected by checkpatch tool.
> In the process, change driver functions name in the multiple files from:
> vchiq_mmal_port_parameter_set to vmp_prmtr_set
> vchiq_mmal_component_disable to vm_cmpnt_disable
> vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel
> vchiq_mmal_component_enable to vm_cmpnt_enable
You should say why you change the names.
As far as I can see, there is no change to the actual function
definitions, so the code can't compile. Perhaps that comes later in the
series, but the elements of the series have to be ordered such that
compilation is possible after each patch.
julia
>
> Signed-off-by: Jules Irenge <[email protected]>
> ---
> .../bcm2835-camera/bcm2835-camera.c | 191 ++++++++----------
> 1 file changed, 89 insertions(+), 102 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index beb6a0063bb8..0ffe95b3bfb2 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -337,12 +337,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
> if (is_capturing(dev)) {
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "Grab another frame");
> - vchiq_mmal_port_parameter_set(
> - instance,
> - dev->capture.camera_port,
> - MMAL_PARAMETER_CAPTURE,
> - &dev->capture.frame_count,
> - sizeof(dev->capture.frame_count));
> + vmp_prmtr_set(instance,
> + dev->capture.camera_port,
> + MMAL_PARAMETER_CAPTURE,
> + &dev->capture.frame_count,
> + sizeof(dev->capture.frame_count));
> }
> if (vchiq_mmal_submit_buffer(instance, port, buf))
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> @@ -392,12 +391,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
> is_capturing(dev)) {
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "Grab another frame as buffer has EOS");
> - vchiq_mmal_port_parameter_set(
> - instance,
> - dev->capture.camera_port,
> - MMAL_PARAMETER_CAPTURE,
> - &dev->capture.frame_count,
> - sizeof(dev->capture.frame_count));
> + vmp_prmtr_set(instance,
> + dev->capture.camera_port,
> + MMAL_PARAMETER_CAPTURE,
> + &dev->capture.frame_count,
> + sizeof(dev->capture.frame_count));
> }
> }
>
> @@ -406,20 +404,18 @@ static int enable_camera(struct bm2835_mmal_dev *dev)
> int ret;
>
> if (!dev->camera_use_count) {
> - ret = vchiq_mmal_port_parameter_set(
> - dev->instance,
> - &dev->component[COMP_CAMERA]->control,
> - MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
> - sizeof(dev->camera_num));
> + ret = vmp_prmtr_set(dev->instance,
> + &dev->component[COMP_CAMERA]->control,
> + MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
> + sizeof(dev->camera_num));
> if (ret < 0) {
> v4l2_err(&dev->v4l2_dev,
> "Failed setting camera num, ret %d\n", ret);
> return -EINVAL;
> }
>
> - ret = vchiq_mmal_component_enable(
> - dev->instance,
> - dev->component[COMP_CAMERA]);
> + ret = vm_cmpnt_enable(dev->instance,
> + dev->component[COMP_CAMERA]);
> if (ret < 0) {
> v4l2_err(&dev->v4l2_dev,
> "Failed enabling camera, ret %d\n", ret);
> @@ -449,19 +445,17 @@ static int disable_camera(struct bm2835_mmal_dev *dev)
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "Disabling camera\n");
> ret =
> - vchiq_mmal_component_disable(
> - dev->instance,
> - dev->component[COMP_CAMERA]);
> + vm_cmpnt_disable(dev->instance,
> + dev->component[COMP_CAMERA]);
> if (ret < 0) {
> v4l2_err(&dev->v4l2_dev,
> "Failed disabling camera, ret %d\n", ret);
> return -EINVAL;
> }
> - vchiq_mmal_port_parameter_set(
> - dev->instance,
> - &dev->component[COMP_CAMERA]->control,
> - MMAL_PARAMETER_CAMERA_NUM, &i,
> - sizeof(i));
> + vmp_prmtr_set(dev->instance,
> + &dev->component[COMP_CAMERA]->control,
> + MMAL_PARAMETER_CAMERA_NUM, &i,
> + sizeof(i));
> }
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "Camera refcount now %d\n", dev->camera_use_count);
> @@ -569,11 +563,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
> }
>
> /* capture the first frame */
> - vchiq_mmal_port_parameter_set(dev->instance,
> - dev->capture.camera_port,
> - MMAL_PARAMETER_CAPTURE,
> - &dev->capture.frame_count,
> - sizeof(dev->capture.frame_count));
> + vmp_prmtr_set(dev->instance,
> + dev->capture.camera_port,
> + MMAL_PARAMETER_CAPTURE,
> + &dev->capture.frame_count,
> + sizeof(dev->capture.frame_count));
> return 0;
> }
>
> @@ -601,11 +595,11 @@ static void stop_streaming(struct vb2_queue *vq)
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "stopping capturing\n");
>
> /* stop capturing frames */
> - vchiq_mmal_port_parameter_set(dev->instance,
> - dev->capture.camera_port,
> - MMAL_PARAMETER_CAPTURE,
> - &dev->capture.frame_count,
> - sizeof(dev->capture.frame_count));
> + vmp_prmtr_set(dev->instance,
> + dev->capture.camera_port,
> + MMAL_PARAMETER_CAPTURE,
> + &dev->capture.frame_count,
> + sizeof(dev->capture.frame_count));
>
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "disabling connection\n");
> @@ -675,9 +669,10 @@ static int set_overlay_params(struct bm2835_mmal_dev *dev,
> .height = dev->overlay.w.height,
> },
> };
> - return vchiq_mmal_port_parameter_set(dev->instance, port,
> - MMAL_PARAMETER_DISPLAYREGION,
> - &prev_config, sizeof(prev_config));
> + return vmp_prmtr_set(dev->instance,
> + port,
> + MMAL_PARAMETER_DISPLAYREGION,
> + &prev_config, sizeof(prev_config));
> }
>
> /* overlay ioctl */
> @@ -772,12 +767,12 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
> ret = vchiq_mmal_port_disable(dev->instance, src);
> if (!ret)
> ret =
> - vchiq_mmal_port_connect_tunnel(dev->instance, src,
> - NULL);
> + vmp_cnnct_tunnel(dev->instance,
> + src,
> + NULL);
> if (ret >= 0)
> - ret = vchiq_mmal_component_disable(
> - dev->instance,
> - dev->component[COMP_PREVIEW]);
> + ret = vm_cmpnt_disable(dev->instance,
> + dev->component[COMP_PREVIEW]);
>
> disable_camera(dev);
> return ret;
> @@ -797,15 +792,14 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
> if (enable_camera(dev) < 0)
> return -EINVAL;
>
> - ret = vchiq_mmal_component_enable(
> - dev->instance,
> - dev->component[COMP_PREVIEW]);
> + ret = vm_cmpnt_enable(dev->instance,
> + dev->component[COMP_PREVIEW]);
> if (ret < 0)
> return ret;
>
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "connecting %p to %p\n",
> src, dst);
> - ret = vchiq_mmal_port_connect_tunnel(dev->instance, src, dst);
> + ret = vmp_cnnct_tunnel(dev->instance, src, dst);
> if (ret)
> return ret;
>
> @@ -1015,11 +1009,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> "vid_cap - disconnect previous tunnel\n");
>
> /* Disconnect any previous connection */
> - vchiq_mmal_port_connect_tunnel(dev->instance,
> - dev->capture.camera_port, NULL);
> + vmp_cnnct_tunnel(dev->instance,
> + dev->capture.camera_port, NULL);
> dev->capture.camera_port = NULL;
> - ret = vchiq_mmal_component_disable(dev->instance,
> - dev->capture.encode_component);
> + ret = vm_cmpnt_disable(dev->instance,
> + dev->capture.encode_component);
> if (ret)
> v4l2_err(&dev->v4l2_dev,
> "Failed to disable encode component %d\n",
> @@ -1072,10 +1066,10 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> }
>
> remove_padding = mfmt->remove_padding;
> - vchiq_mmal_port_parameter_set(dev->instance,
> - camera_port,
> - MMAL_PARAMETER_NO_IMAGE_PADDING,
> - &remove_padding, sizeof(remove_padding));
> + vmp_prmtr_set(dev->instance,
> + camera_port,
> + MMAL_PARAMETER_NO_IMAGE_PADDING,
> + &remove_padding, sizeof(remove_padding));
>
> camera_port->format.encoding_variant = 0;
> camera_port->es.video.width = f->fmt.pix.width;
> @@ -1107,10 +1101,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> preview_port);
> if (!ret)
> ret =
> - vchiq_mmal_port_connect_tunnel(
> - dev->instance,
> - preview_port,
> - NULL);
> + vmp_cnnct_tunnel(dev->instance,
> + preview_port,
> + NULL);
> }
> preview_port->es.video.width = f->fmt.pix.width;
> preview_port->es.video.height = f->fmt.pix.height;
> @@ -1124,9 +1117,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> dev->capture.timeperframe.numerator;
> ret = vchiq_mmal_port_set_format(dev->instance, preview_port);
> if (overlay_enabled) {
> - ret = vchiq_mmal_port_connect_tunnel(
> - dev->instance,
> - preview_port,
> + ret = vmp_cnnct_tunnel(dev->instance,
> + preview_port,
> &dev->component[COMP_PREVIEW]->input[0]);
> if (!ret)
> ret = vchiq_mmal_port_enable(dev->instance,
> @@ -1154,10 +1146,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> camera_port->recommended_buffer.num;
>
> ret =
> - vchiq_mmal_port_connect_tunnel(
> - dev->instance,
> - camera_port,
> - &encode_component->input[0]);
> + vmp_cnnct_tunnel(dev->instance,
> + camera_port,
> + &encode_component->input[0]);
> if (ret) {
> v4l2_dbg(1, bcm2835_v4l2_debug,
> &dev->v4l2_dev,
> @@ -1205,9 +1196,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> }
>
> if (!ret) {
> - ret = vchiq_mmal_component_enable(
> - dev->instance,
> - encode_component);
> + ret = vm_cmpnt_enable(dev->instance,
> + encode_component);
> if (ret) {
> v4l2_dbg(1, bcm2835_v4l2_debug,
> &dev->v4l2_dev,
> @@ -1530,7 +1520,7 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance,
> .use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC
> };
>
> - return vchiq_mmal_port_parameter_set(instance, &camera->control,
> + return vmp_prmtr_set(instance, &camera->control,
> MMAL_PARAMETER_CAMERA_CONFIG,
> &cam_config, sizeof(cam_config));
> }
> @@ -1655,9 +1645,9 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
> dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0;
>
> /* get the preview component ready */
> - ret = vchiq_mmal_component_init(
> - dev->instance, "ril.video_render",
> - &dev->component[COMP_PREVIEW]);
> + ret = vchiq_mmal_component_init(dev->instance,
> + "ril.video_render",
> + &dev->component[COMP_PREVIEW]);
> if (ret < 0)
> goto unreg_camera;
>
> @@ -1669,9 +1659,9 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
> }
>
> /* get the image encoder component ready */
> - ret = vchiq_mmal_component_init(
> - dev->instance, "ril.image_encode",
> - &dev->component[COMP_IMAGE_ENCODE]);
> + ret = vchiq_mmal_component_init(dev->instance,
> + "ril.image_encode",
> + &dev->component[COMP_IMAGE_ENCODE]);
> if (ret < 0)
> goto unreg_preview;
>
> @@ -1708,17 +1698,16 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
> {
> unsigned int enable = 1;
>
> - vchiq_mmal_port_parameter_set(
> - dev->instance,
> - &dev->component[COMP_VIDEO_ENCODE]->control,
> - MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
> - &enable, sizeof(enable));
> -
> - vchiq_mmal_port_parameter_set(dev->instance,
> - &dev->component[COMP_VIDEO_ENCODE]->control,
> - MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
> - &enable,
> - sizeof(enable));
> + vmp_prmtr_set(dev->instance,
> + &dev->component[COMP_VIDEO_ENCODE]->control,
> + MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
> + &enable, sizeof(enable));
> +
> + vmp_prmtr_set(dev->instance,
> + &dev->component[COMP_VIDEO_ENCODE]->control,
> + MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
> + &enable,
> + sizeof(enable));
> }
> ret = bm2835_mmal_set_all_camera_controls(dev);
> if (ret < 0) {
> @@ -1731,15 +1720,13 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
>
> unreg_vid_encoder:
> pr_err("Cleanup: Destroy video encoder\n");
> - vchiq_mmal_component_finalise(
> - dev->instance,
> - dev->component[COMP_VIDEO_ENCODE]);
> + vchiq_mmal_component_finalise(dev->instance,
> + dev->component[COMP_VIDEO_ENCODE]);
>
> unreg_image_encoder:
> pr_err("Cleanup: Destroy image encoder\n");
> - vchiq_mmal_component_finalise(
> - dev->instance,
> - dev->component[COMP_IMAGE_ENCODE]);
> + vchiq_mmal_component_finalise(dev->instance,
> + dev->component[COMP_IMAGE_ENCODE]);
>
> unreg_preview:
> pr_err("Cleanup: Destroy video render\n");
> @@ -1799,13 +1786,13 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev)
> if (dev->capture.encode_component) {
> v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
> "mmal_exit - disconnect tunnel\n");
> - vchiq_mmal_port_connect_tunnel(dev->instance,
> - dev->capture.camera_port, NULL);
> - vchiq_mmal_component_disable(dev->instance,
> - dev->capture.encode_component);
> + vmp_cnnct_tunnel(dev->instance,
> + dev->capture.camera_port, NULL);
> + vm_cmpnt_disable(dev->instance,
> + dev->capture.encode_component);
> }
> - vchiq_mmal_component_disable(dev->instance,
> - dev->component[COMP_CAMERA]);
> + vm_cmpnt_disable(dev->instance,
> + dev->component[COMP_CAMERA]);
>
> vchiq_mmal_component_finalise(dev->instance,
> dev->component[COMP_VIDEO_ENCODE]);
> --
> 2.21.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191013183420.13785-1-jbi.octave%40gmail.com.
>
On Sun, 13 Oct 2019, Julia Lawall wrote:
>
>
> On Sun, 13 Oct 2019, Jules Irenge wrote:
>
> > Fix lines ending with open parenthesis. Issue detected by checkpatch tool.
> > In the process, change driver functions name in the multiple files from:
> > vchiq_mmal_port_parameter_set to vmp_prmtr_set
> > vchiq_mmal_component_disable to vm_cmpnt_disable
> > vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel
> > vchiq_mmal_component_enable to vm_cmpnt_enable
>
> You should say why you change the names.
>
> As far as I can see, there is no change to the actual function
> definitions, so the code can't compile. Perhaps that comes later in the
> series, but the elements of the series have to be ordered such that
> compilation is possible after each patch.
>
> julia
>
Thanks for the feedback, I am updating it and will be compiling
each point.
Jules
Hi Jules,
Am 13.10.19 um 20:34 schrieb Jules Irenge:
> Fix lines ending with open parenthesis. Issue detected by checkpatch tool.
> In the process, change driver functions name in the multiple files from:
> vchiq_mmal_port_parameter_set to vmp_prmtr_set
> vchiq_mmal_component_disable to vm_cmpnt_disable
> vchiq_mmal_port_connect_tunnel to vmp_cnnct_tunnel
> vchiq_mmal_component_enable to vm_cmpnt_enable
please no. Changing random function names into something unreadable
doesn't increase code readability. We need to keep an eye on the whole
interface. Maybe you better start with the 2nd part of Joe's suggestion
first.
Stefan