cmdq_client
mtk_crtc->cmdq_client.client.dev = mtk_crtc->mmsys_dev;
mtk_crtc->cmdq_client.client.tx_block = false;
mtk_crtc->cmdq_client.client.knows_txdone = true;
mtk_crtc->cmdq_client.client.rx_callback = ddp_cmdq_cb;
mtk_crtc->cmdq_client.chan =
mbox_request_channel(&mtk_crtc->cmdq_client.client, i);
if (IS_ERR(mtk_crtc->cmdq_client.chan)) {
mtk_crtc->cmdq_client.chan = NULL;
if (mtk_crtc->cmdq_client.chan) {
mbox_free_channel(mtk_crtc->cmdq_client.chan);
mtk_crtc->cmdq_client.chan = NULL;
ret = cmdq_pkt_create(&mtk_crtc->cmdq_client,
mbox_free_channel(mtk_crtc->cmdq_client.chan);
mtk_crtc->cmdq_client.chan = NULL;
if (mtk_crtc->cmdq_client.chan)
if (mtk_crtc->cmdq_client.chan) {
cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle);
mbox_free_channel(mtk_crtc->cmdq_client.chan);
mtk_crtc->cmdq_client.chan = NULL;
struct cmdq_client *cmdq_cl = container_of(cl, struct cmdq_client, client);
struct mtk_crtc *mtk_crtc = container_of(cmdq_cl, struct mtk_crtc, cmdq_client);
struct cmdq_client cmdq_client;
if (mtk_crtc->cmdq_client.chan) {
mbox_flush(mtk_crtc->cmdq_client.chan, 2000);
dma_sync_single_for_device(mtk_crtc->cmdq_client.chan->mbox->dev,
if (pm_runtime_resume_and_get(mtk_crtc->cmdq_client.chan->mbox->dev) < 0)
mbox_send_message(mtk_crtc->cmdq_client.chan, cmdq_handle);
mbox_client_txdone(mtk_crtc->cmdq_client.chan, 0);
if (!priv->data->shadow_register && !mtk_crtc->cmdq_client.chan)
if (!mtk_crtc->cmdq_client.chan)
if (mtk_crtc->cmdq_client.chan)
struct cmdq_client *cmdq_clt[MDP_PP_MAX];
struct cmdq_client *cmdq_mbox_create(struct device *dev, int index)
struct cmdq_client *client;
return (struct cmdq_client *)-ENOMEM;
void cmdq_mbox_destroy(struct cmdq_client *client)
int cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, size_t size)
void cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt)
struct cmdq_client *cmdq_mbox_create(struct device *dev, int index);
void cmdq_mbox_destroy(struct cmdq_client *client);
int cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, size_t size);
void cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt);
static inline struct cmdq_client *cmdq_mbox_create(struct device *dev, int index)
static inline void cmdq_mbox_destroy(struct cmdq_client *client) { }
static inline int cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, size_t size)
static inline void cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt) { }