Commit 1ee07a68 authored by Chun-Kuang Hu's avatar Chun-Kuang Hu

drm/mediatek: Use mailbox rx_callback instead of cmdq_task_cb

rx_callback is a standard mailbox callback mechanism and could cover the
function of proprietary cmdq_task_cb, so use the standard one instead of
the proprietary one.
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: default avatarjason-jh.lin <jason-jh.lin@mediatek.com>
parent 01365f54
......@@ -4,6 +4,8 @@
*/
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/mailbox_controller.h>
#include <linux/pm_runtime.h>
#include <linux/soc/mediatek/mtk-cmdq.h>
#include <linux/soc/mediatek/mtk-mmsys.h>
......@@ -222,9 +224,11 @@ struct mtk_ddp_comp *mtk_drm_ddp_comp_for_plane(struct drm_crtc *crtc,
}
#if IS_REACHABLE(CONFIG_MTK_CMDQ)
static void ddp_cmdq_cb(struct cmdq_cb_data data)
static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
{
cmdq_pkt_destroy(data.data);
struct cmdq_cb_data *data = mssg;
cmdq_pkt_destroy(data->pkt);
}
#endif
......@@ -475,7 +479,12 @@ static void mtk_drm_crtc_update_config(struct mtk_drm_crtc *mtk_crtc,
cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event, false);
mtk_crtc_ddp_config(crtc, cmdq_handle);
cmdq_pkt_finalize(cmdq_handle);
cmdq_pkt_flush_async(cmdq_handle, ddp_cmdq_cb, cmdq_handle);
dma_sync_single_for_device(mtk_crtc->cmdq_client->chan->mbox->dev,
cmdq_handle->pa_base,
cmdq_handle->cmd_buf_size,
DMA_TO_DEVICE);
mbox_send_message(mtk_crtc->cmdq_client->chan, cmdq_handle);
mbox_client_txdone(mtk_crtc->cmdq_client->chan, 0);
}
#endif
mtk_crtc->config_updating = false;
......@@ -839,6 +848,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
}
if (mtk_crtc->cmdq_client) {
mtk_crtc->cmdq_client->client.rx_callback = ddp_cmdq_cb;
ret = of_property_read_u32_index(priv->mutex_node,
"mediatek,gce-events",
drm_crtc_index(&mtk_crtc->base),
......
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