Lines Matching full:mdp

105 static struct img_config *__get_config_offset(struct mdp_dev *mdp,  in __get_config_offset()  argument
109 const int p_id = mdp->mdp_data->mdp_plat_id; in __get_config_offset()
110 struct device *dev = &mdp->pdev->dev; in __get_config_offset()
112 long bound = mdp->vpu.config_size; in __get_config_offset()
114 if (pp_idx >= mdp->mdp_data->pp_used) in __get_config_offset()
131 if ((long)cfg_n - (long)mdp->vpu.config > bound) { in __get_config_offset()
261 static int mdp_path_ctx_init(struct mdp_dev *mdp, struct mdp_path *path) in mdp_path_ctx_init() argument
263 const int p_id = mdp->mdp_data->mdp_plat_id; in mdp_path_ctx_init()
290 ret = mdp_comp_ctx_config(mdp, &path->comps[index], in mdp_path_ctx_init()
391 static int mdp_path_config(struct mdp_dev *mdp, struct mdp_cmdq_cmd *cmd, in mdp_path_config() argument
394 const int p_id = mdp->mdp_data->mdp_plat_id; in mdp_path_config()
514 struct mdp_dev *mdp; in mdp_auto_release_work() local
519 mdp = cmd->mdp; in mdp_auto_release_work()
521 pipe_id = __get_pipe(mdp, cmd->comps[0].public_id); in mdp_auto_release_work()
522 mutex = __get_mutex(mdp, &mdp->mdp_data->pipe_info[pipe_id]); in mdp_auto_release_work()
524 mdp_comp_clocks_off(&mdp->pdev->dev, cmd->comps, in mdp_auto_release_work()
527 if (refcount_dec_and_test(&mdp->job_count)) { in mdp_auto_release_work()
538 wake_up(&mdp->callback_wq); in mdp_auto_release_work()
552 struct mdp_dev *mdp; in mdp_handle_cmdq_callback() local
564 mdp = cmd->mdp; in mdp_handle_cmdq_callback()
565 dev = &mdp->pdev->dev; in mdp_handle_cmdq_callback()
568 if (!queue_work(mdp->clock_wq, &cmd->auto_release_work)) { in mdp_handle_cmdq_callback()
572 pipe_id = __get_pipe(mdp, cmd->comps[0].public_id); in mdp_handle_cmdq_callback()
573 mutex = __get_mutex(mdp, &mdp->mdp_data->pipe_info[pipe_id]); in mdp_handle_cmdq_callback()
575 mdp_comp_clocks_off(&mdp->pdev->dev, cmd->comps, in mdp_handle_cmdq_callback()
578 if (refcount_dec_and_test(&mdp->job_count)) in mdp_handle_cmdq_callback()
579 wake_up(&mdp->callback_wq); in mdp_handle_cmdq_callback()
589 static struct mdp_cmdq_cmd *mdp_cmdq_prepare(struct mdp_dev *mdp, in mdp_cmdq_prepare() argument
596 struct device *dev = &mdp->pdev->dev; in mdp_cmdq_prepare()
597 const int p_id = mdp->mdp_data->mdp_plat_id; in mdp_cmdq_prepare()
604 config = __get_config_offset(mdp, param, pp_idx); in mdp_cmdq_prepare()
623 ret = mdp_cmdq_pkt_create(mdp->cmdq_clt[pp_idx], &cmd->pkt, SZ_16K); in mdp_cmdq_prepare()
647 path->mdp_dev = mdp; in mdp_cmdq_prepare()
660 ret = mdp_path_ctx_init(mdp, path); in mdp_cmdq_prepare()
666 pipe_id = __get_pipe(mdp, path->comps[0].comp->public_id); in mdp_cmdq_prepare()
667 mutex = __get_mutex(mdp, &mdp->mdp_data->pipe_info[pipe_id]); in mdp_cmdq_prepare()
674 ret = mdp_path_config(mdp, cmd, path); in mdp_cmdq_prepare()
689 if (mdp_cfg_comp_is_dummy(mdp, inner_id)) in mdp_cmdq_prepare()
695 mdp->cmdq_clt[pp_idx]->client.rx_callback = mdp_handle_cmdq_callback; in mdp_cmdq_prepare()
696 cmd->mdp = mdp; in mdp_cmdq_prepare()
720 int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) in mdp_cmdq_send() argument
723 struct device *dev = &mdp->pdev->dev; in mdp_cmdq_send()
727 refcount_set(&mdp->job_count, pp_used); in mdp_cmdq_send()
728 if (atomic_read(&mdp->suspended)) { in mdp_cmdq_send()
729 refcount_set(&mdp->job_count, 0); in mdp_cmdq_send()
734 cmd[i] = mdp_cmdq_prepare(mdp, param, i); in mdp_cmdq_send()
742 ret = mdp_comp_clocks_on(&mdp->pdev->dev, cmd[i]->comps, cmd[i]->num_comps); in mdp_cmdq_send()
748 dma_sync_single_for_device(mdp->cmdq_clt[i]->chan->mbox->dev, in mdp_cmdq_send()
752 ret = mbox_send_message(mdp->cmdq_clt[i]->chan, &cmd[i]->pkt); in mdp_cmdq_send()
758 mbox_client_txdone(mdp->cmdq_clt[i]->chan, 0); in mdp_cmdq_send()
764 mdp_comp_clocks_off(&mdp->pdev->dev, cmd[i]->comps, in mdp_cmdq_send()
767 refcount_set(&mdp->job_count, 0); in mdp_cmdq_send()