static void hist_set_params(struct ispstat *hist, void *new_conf) { struct omap3isp_hist_config *user_cfg = new_conf; struct omap3isp_hist_config *cur_cfg = hist->priv; if (!hist->configured || hist_comp_params(hist, user_cfg)) { memcpy(cur_cfg, user_cfg, sizeof(*user_cfg)); if (user_cfg->num_acc_frames == 0) user_cfg->num_acc_frames = 1; hist->inc_config++; hist->update = 1; cur_cfg->buf_size = hist_get_buf_size(cur_cfg); } }
/* * hist_update_params - Helper function to check and store user given params. * @new_conf: Pointer to user configuration structure. */ static void hist_set_params(struct ispstat *hist, void *new_conf) { struct omap3isp_hist_config *user_cfg = new_conf; struct omap3isp_hist_config *cur_cfg = hist->priv; if (!hist->configured || hist_comp_params(hist, user_cfg)) { memcpy(cur_cfg, user_cfg, sizeof(*user_cfg)); if (user_cfg->num_acc_frames == 0) user_cfg->num_acc_frames = 1; hist->inc_config++; hist->update = 1; /* * User might be asked for a bigger buffer than necessary for * this configuration. In order to return the right amount of * data during buffer request, let's calculate the size here * instead of stick with user_cfg->buf_size. */ cur_cfg->buf_size = hist_get_buf_size(cur_cfg); } }