Commit 85b606e0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: get rid of a bunch of other wrappers

There are too many wrapper functions at atomisp_compat_css20.c.

Get rid of another set of such wrappers.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d9ab8395
......@@ -243,30 +243,6 @@ int atomisp_css_input_configure_port(struct atomisp_sub_device *asd,
unsigned int metadata_width,
unsigned int metadata_height);
int atomisp_css_frame_allocate(struct ia_css_frame **frame,
unsigned int width, unsigned int height,
enum ia_css_frame_format format,
unsigned int padded_width,
unsigned int raw_bit_depth);
int atomisp_css_frame_allocate_from_info(struct ia_css_frame **frame,
const struct ia_css_frame_info *info);
void atomisp_css_frame_free(struct ia_css_frame *frame);
int atomisp_css_frame_map(struct ia_css_frame **frame,
const struct ia_css_frame_info *info,
const void __user *data, uint16_t attribute,
unsigned int pgnr);
int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
const struct ia_css_frame *raw_black_frame);
int atomisp_css_allocate_continuous_frames(bool init_time,
struct atomisp_sub_device *asd);
void atomisp_css_update_continuous_frames(struct atomisp_sub_device *asd);
void atomisp_create_pipes_stream(struct atomisp_sub_device *asd);
void atomisp_destroy_pipes_stream_force(struct atomisp_sub_device *asd);
......@@ -277,9 +253,6 @@ int atomisp_css_continuous_set_num_raw_frames(
struct atomisp_sub_device *asd,
int num_frames);
void atomisp_css_disable_vf_pp(struct atomisp_sub_device *asd,
bool disable);
int atomisp_css_copy_configure_output(struct atomisp_sub_device *asd,
unsigned int stream_index,
unsigned int width, unsigned int height,
......@@ -388,61 +361,9 @@ int atomisp_css_exp_id_unlock(struct atomisp_sub_device *asd, int exp_id);
int atomisp_css_capture_enable_xnr(struct atomisp_sub_device *asd,
bool enable);
void atomisp_css_send_input_frame(struct atomisp_sub_device *asd,
unsigned short *data, unsigned int width,
unsigned int height);
bool atomisp_css_isp_has_started(void);
void atomisp_css_request_flash(struct atomisp_sub_device *asd);
void atomisp_css_set_wb_config(struct atomisp_sub_device *asd,
struct ia_css_wb_config *wb_config);
void atomisp_css_set_ob_config(struct atomisp_sub_device *asd,
struct ia_css_ob_config *ob_config);
void atomisp_css_set_dp_config(struct atomisp_sub_device *asd,
struct ia_css_dp_config *dp_config);
void atomisp_css_set_de_config(struct atomisp_sub_device *asd,
struct ia_css_de_config *de_config);
void atomisp_css_set_dz_config(struct atomisp_sub_device *asd,
struct ia_css_dz_config *dz_config);
void atomisp_css_set_default_de_config(struct atomisp_sub_device *asd);
void atomisp_css_set_ce_config(struct atomisp_sub_device *asd,
struct ia_css_ce_config *ce_config);
void atomisp_css_set_nr_config(struct atomisp_sub_device *asd,
struct ia_css_nr_config *nr_config);
void atomisp_css_set_ee_config(struct atomisp_sub_device *asd,
struct ia_css_ee_config *ee_config);
void atomisp_css_set_tnr_config(struct atomisp_sub_device *asd,
struct ia_css_tnr_config *tnr_config);
void atomisp_css_set_cc_config(struct atomisp_sub_device *asd,
struct ia_css_cc_config *cc_config);
void atomisp_css_set_macc_table(struct atomisp_sub_device *asd,
struct ia_css_macc_table *macc_table);
void atomisp_css_set_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_gamma_table *gamma_table);
void atomisp_css_set_ctc_table(struct atomisp_sub_device *asd,
struct ia_css_ctc_table *ctc_table);
void atomisp_css_set_gc_config(struct atomisp_sub_device *asd,
struct ia_css_gc_config *gc_config);
void atomisp_css_set_3a_config(struct atomisp_sub_device *asd,
struct ia_css_3a_config *s3a_config);
void atomisp_css_video_set_dis_vector(struct atomisp_sub_device *asd,
struct atomisp_dis_vector *vector);
......
......@@ -2099,72 +2099,6 @@ int atomisp_css_input_configure_port(
return 0;
}
int atomisp_css_frame_allocate(struct ia_css_frame **frame,
unsigned int width, unsigned int height,
enum ia_css_frame_format format,
unsigned int padded_width,
unsigned int raw_bit_depth)
{
if (ia_css_frame_allocate(frame, width, height, format,
padded_width, raw_bit_depth) != 0)
return -ENOMEM;
return 0;
}
int atomisp_css_frame_allocate_from_info(struct ia_css_frame **frame,
const struct ia_css_frame_info *info)
{
if (ia_css_frame_allocate_from_info(frame, info))
return -ENOMEM;
return 0;
}
void atomisp_css_frame_free(struct ia_css_frame *frame)
{
ia_css_frame_free(frame);
}
int atomisp_css_frame_map(struct ia_css_frame **frame,
const struct ia_css_frame_info *info,
const void __user *data, uint16_t attribute,
unsigned int pgnr)
{
if (ia_css_frame_map(frame, info, data, attribute, pgnr)
!= 0)
return -ENOMEM;
return 0;
}
int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
const struct ia_css_frame *raw_black_frame)
{
if (sh_css_set_black_frame(
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream,
raw_black_frame) != 0)
return -ENOMEM;
return 0;
}
int atomisp_css_allocate_continuous_frames(bool init_time,
struct atomisp_sub_device *asd)
{
if (ia_css_alloc_continuous_frame_remain(
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream)
!= 0)
return -EINVAL;
return 0;
}
void atomisp_css_update_continuous_frames(struct atomisp_sub_device *asd)
{
ia_css_update_continuous_frames(
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream);
}
int atomisp_css_stop(struct atomisp_sub_device *asd,
enum ia_css_pipe_id pipe_id, bool in_reset)
{
......@@ -2287,16 +2221,6 @@ int atomisp_css_continuous_set_num_raw_frames(
return 0;
}
void atomisp_css_disable_vf_pp(struct atomisp_sub_device *asd,
bool disable)
{
int i;
for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]
.pipe_extra_configs[i].disable_vf_pp = !!disable;
}
static enum ia_css_pipe_mode __pipe_id_to_pipe_mode(
struct atomisp_sub_device *asd,
enum ia_css_pipe_id pipe_id)
......@@ -3298,199 +3222,6 @@ int atomisp_css_capture_enable_xnr(struct atomisp_sub_device *asd,
return 0;
}
void atomisp_css_send_input_frame(struct atomisp_sub_device *asd,
unsigned short *data, unsigned int width,
unsigned int height)
{
ia_css_stream_send_input_frame(
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream,
data, width, height);
}
bool atomisp_css_isp_has_started(void)
{
return ia_css_isp_has_started();
}
void atomisp_css_request_flash(struct atomisp_sub_device *asd)
{
ia_css_stream_request_flash(
asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream);
}
void atomisp_css_set_wb_config(struct atomisp_sub_device *asd,
struct ia_css_wb_config *wb_config)
{
asd->params.config.wb_config = wb_config;
}
void atomisp_css_set_ob_config(struct atomisp_sub_device *asd,
struct ia_css_ob_config *ob_config)
{
asd->params.config.ob_config = ob_config;
}
void atomisp_css_set_dp_config(struct atomisp_sub_device *asd,
struct ia_css_dp_config *dp_config)
{
asd->params.config.dp_config = dp_config;
}
void atomisp_css_set_de_config(struct atomisp_sub_device *asd,
struct ia_css_de_config *de_config)
{
asd->params.config.de_config = de_config;
}
void atomisp_css_set_dz_config(struct atomisp_sub_device *asd,
struct ia_css_dz_config *dz_config)
{
asd->params.config.dz_config = dz_config;
}
void atomisp_css_set_default_de_config(struct atomisp_sub_device *asd)
{
asd->params.config.de_config = NULL;
}
void atomisp_css_set_ce_config(struct atomisp_sub_device *asd,
struct ia_css_ce_config *ce_config)
{
asd->params.config.ce_config = ce_config;
}
void atomisp_css_set_nr_config(struct atomisp_sub_device *asd,
struct ia_css_nr_config *nr_config)
{
asd->params.config.nr_config = nr_config;
}
void atomisp_css_set_ee_config(struct atomisp_sub_device *asd,
struct ia_css_ee_config *ee_config)
{
asd->params.config.ee_config = ee_config;
}
void atomisp_css_set_tnr_config(struct atomisp_sub_device *asd,
struct ia_css_tnr_config *tnr_config)
{
asd->params.config.tnr_config = tnr_config;
}
void atomisp_css_set_cc_config(struct atomisp_sub_device *asd,
struct ia_css_cc_config *cc_config)
{
asd->params.config.cc_config = cc_config;
}
void atomisp_css_set_macc_table(struct atomisp_sub_device *asd,
struct ia_css_macc_table *macc_table)
{
asd->params.config.macc_table = macc_table;
}
void atomisp_css_set_macc_config(struct atomisp_sub_device *asd,
struct ia_css_macc_config *macc_config)
{
asd->params.config.macc_config = macc_config;
}
void atomisp_css_set_ecd_config(struct atomisp_sub_device *asd,
struct ia_css_ecd_config *ecd_config)
{
asd->params.config.ecd_config = ecd_config;
}
void atomisp_css_set_ynr_config(struct atomisp_sub_device *asd,
struct ia_css_ynr_config *ynr_config)
{
asd->params.config.ynr_config = ynr_config;
}
void atomisp_css_set_fc_config(struct atomisp_sub_device *asd,
struct ia_css_fc_config *fc_config)
{
asd->params.config.fc_config = fc_config;
}
void atomisp_css_set_ctc_config(struct atomisp_sub_device *asd,
struct ia_css_ctc_config *ctc_config)
{
asd->params.config.ctc_config = ctc_config;
}
void atomisp_css_set_cnr_config(struct atomisp_sub_device *asd,
struct ia_css_cnr_config *cnr_config)
{
asd->params.config.cnr_config = cnr_config;
}
void atomisp_css_set_aa_config(struct atomisp_sub_device *asd,
struct ia_css_aa_config *aa_config)
{
asd->params.config.aa_config = aa_config;
}
void atomisp_css_set_baa_config(struct atomisp_sub_device *asd,
struct ia_css_aa_config *baa_config)
{
asd->params.config.baa_config = baa_config;
}
void atomisp_css_set_anr_config(struct atomisp_sub_device *asd,
struct ia_css_anr_config *anr_config)
{
asd->params.config.anr_config = anr_config;
}
void atomisp_css_set_xnr_config(struct atomisp_sub_device *asd,
struct ia_css_xnr_config *xnr_config)
{
asd->params.config.xnr_config = xnr_config;
}
void atomisp_css_set_yuv2rgb_cc_config(struct atomisp_sub_device *asd,
struct ia_css_cc_config *yuv2rgb_cc_config)
{
asd->params.config.yuv2rgb_cc_config = yuv2rgb_cc_config;
}
void atomisp_css_set_rgb2yuv_cc_config(struct atomisp_sub_device *asd,
struct ia_css_cc_config *rgb2yuv_cc_config)
{
asd->params.config.rgb2yuv_cc_config = rgb2yuv_cc_config;
}
void atomisp_css_set_xnr_table(struct atomisp_sub_device *asd,
struct ia_css_xnr_table *xnr_table)
{
asd->params.config.xnr_table = xnr_table;
}
void atomisp_css_set_r_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *r_gamma_table)
{
asd->params.config.r_gamma_table = r_gamma_table;
}
void atomisp_css_set_g_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *g_gamma_table)
{
asd->params.config.g_gamma_table = g_gamma_table;
}
void atomisp_css_set_b_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *b_gamma_table)
{
asd->params.config.b_gamma_table = b_gamma_table;
}
void atomisp_css_set_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_gamma_table *gamma_table)
{
asd->params.config.gamma_table = gamma_table;
}
void atomisp_css_set_ctc_table(struct atomisp_sub_device *asd,
struct ia_css_ctc_table *ctc_table)
{
......@@ -3530,18 +3261,6 @@ void atomisp_css_set_dvs_6axis(struct atomisp_sub_device *asd,
asd->params.config.dvs_6axis_config = dvs_6axis;
}
void atomisp_css_set_gc_config(struct atomisp_sub_device *asd,
struct ia_css_gc_config *gc_config)
{
asd->params.config.gc_config = gc_config;
}
void atomisp_css_set_3a_config(struct atomisp_sub_device *asd,
struct ia_css_3a_config *s3a_config)
{
asd->params.config.s3a_config = s3a_config;
}
void atomisp_css_video_set_dis_vector(struct atomisp_sub_device *asd,
struct atomisp_dis_vector *vector)
{
......
......@@ -140,18 +140,6 @@ void atomisp_css_set_yuv2rgb_cc_config(struct atomisp_sub_device *asd,
void atomisp_css_set_rgb2yuv_cc_config(struct atomisp_sub_device *asd,
struct ia_css_cc_config *rgb2yuv_cc_config);
void atomisp_css_set_xnr_table(struct atomisp_sub_device *asd,
struct ia_css_xnr_table *xnr_table);
void atomisp_css_set_r_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *r_gamma_table);
void atomisp_css_set_g_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *g_gamma_table);
void atomisp_css_set_b_gamma_table(struct atomisp_sub_device *asd,
struct ia_css_rgb_gamma_table *b_gamma_table);
void atomisp_css_set_anr_thres(struct atomisp_sub_device *asd,
struct ia_css_anr_thres *anr_thres);
......
......@@ -50,11 +50,12 @@ static void file_work(struct work_struct *work)
V4L2_SUBDEV_FORMAT_ACTIVE,
ATOMISP_SUBDEV_PAD_SINK);
while (!atomisp_css_isp_has_started())
while (!ia_css_isp_has_started())
usleep_range(1000, 1500);
atomisp_css_send_input_frame(asd, buf, isp_sink_fmt.width,
isp_sink_fmt.height);
ia_css_stream_send_input_frame(asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream,
buf, isp_sink_fmt.width,
isp_sink_fmt.height);
dev_dbg(isp->dev, "<%s: streaming done\n", __func__);
}
......
......@@ -252,8 +252,7 @@ int atomisp_q_video_buffers_to_css(struct atomisp_sub_device *asd,
err = atomisp_calculate_real_zoom_region(asd,
&param->params.dz_config, css_pipe_id);
if (!err)
atomisp_css_set_dz_config(asd,
&param->params.dz_config);
asd->params.config.dz_config = &param->params.dz_config;
}
atomisp_css_set_isp_config_applied_frame(asd,
vm_mem->vaddr);
......
......@@ -891,7 +891,7 @@ void atomisp_videobuf_free_buf(struct videobuf_buffer *vb)
vm_mem = vb->priv;
if (vm_mem && vm_mem->vaddr) {
atomisp_css_frame_free(vm_mem->vaddr);
ia_css_frame_free(vm_mem->vaddr);
vm_mem->vaddr = NULL;
}
}
......@@ -1067,7 +1067,7 @@ int __atomisp_reqbufs(struct file *file, void *fh,
* memory management function
*/
for (i = 0; i < req->count; i++) {
if (atomisp_css_frame_allocate_from_info(&frame, &frame_info))
if (ia_css_frame_allocate_from_info(&frame, &frame_info))
goto error;
vm_mem = pipe->capq.bufs[i]->priv;
vm_mem->vaddr = frame;
......@@ -1078,11 +1078,11 @@ int __atomisp_reqbufs(struct file *file, void *fh,
error:
while (i--) {
vm_mem = pipe->capq.bufs[i]->priv;
atomisp_css_frame_free(vm_mem->vaddr);
ia_css_frame_free(vm_mem->vaddr);
}
if (asd->vf_frame)
atomisp_css_frame_free(asd->vf_frame);
ia_css_frame_free(asd->vf_frame);
return -ENOMEM;
}
......@@ -1200,7 +1200,7 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
goto error;
}
ret = atomisp_css_frame_map(&handle, &frame_info,
ret = ia_css_frame_map(&handle, &frame_info,
(void __user *)buf->m.userptr,
0, pgnr);
if (ret) {
......@@ -1210,7 +1210,7 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
if (vm_mem->vaddr) {
mutex_lock(&pipe->capq.vb_lock);
atomisp_css_frame_free(vm_mem->vaddr);
ia_css_frame_free(vm_mem->vaddr);
vm_mem->vaddr = NULL;
vb->state = VIDEOBUF_NEEDS_INIT;
mutex_unlock(&pipe->capq.vb_lock);
......@@ -1758,8 +1758,7 @@ static int atomisp_streamon(struct file *file, void *fh,
if (asd->params.css_update_params_needed) {
atomisp_apply_css_parameters(asd, &asd->params.css_param);
if (asd->params.css_param.update_flag.dz_config)
atomisp_css_set_dz_config(asd,
&asd->params.css_param.dz_config);
asd->params.config.dz_config = &asd->params.css_param.dz_config;
atomisp_css_update_isp_params(asd);
asd->params.css_update_params_needed = false;
memset(&asd->params.css_param.update_flag, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment