Skip to content

Commit 73646ba

Browse files
committed
Merge tag 'mediatek-drm-fixes-6.0' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes
Mediatek DRM Fixes for Linux 6.0 1. dsi: Add atomic {destroy,duplicate}_state, reset callbacks 2. drm/mediatek: Fix wrong dither settings 3. dsi: Move mtk_dsi_stop() call back to mtk_dsi_poweroff() Signed-off-by: Dave Airlie <[email protected]> From: Chun-Kuang Hu <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 387df87 + 90144dd commit 73646ba

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static void mtk_dither_config(struct device *dev, unsigned int w,
157157
{
158158
struct mtk_ddp_comp_dev *priv = dev_get_drvdata(dev);
159159

160-
mtk_ddp_write(cmdq_pkt, h << 16 | w, &priv->cmdq_reg, priv->regs, DISP_REG_DITHER_SIZE);
160+
mtk_ddp_write(cmdq_pkt, w << 16 | h, &priv->cmdq_reg, priv->regs, DISP_REG_DITHER_SIZE);
161161
mtk_ddp_write(cmdq_pkt, DITHER_RELAY_MODE, &priv->cmdq_reg, priv->regs,
162162
DISP_REG_DITHER_CFG);
163163
mtk_dither_set_common(priv->regs, &priv->cmdq_reg, bpc, DISP_REG_DITHER_CFG,

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,16 @@ static void mtk_dsi_poweroff(struct mtk_dsi *dsi)
685685
if (--dsi->refcount != 0)
686686
return;
687687

688+
/*
689+
* mtk_dsi_stop() and mtk_dsi_start() is asymmetric, since
690+
* mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(),
691+
* which needs irq for vblank, and mtk_dsi_stop() will disable irq.
692+
* mtk_dsi_start() needs to be called in mtk_output_dsi_enable(),
693+
* after dsi is fully set.
694+
*/
695+
mtk_dsi_stop(dsi);
696+
697+
mtk_dsi_switch_to_cmd_mode(dsi, VM_DONE_INT_FLAG, 500);
688698
mtk_dsi_reset_engine(dsi);
689699
mtk_dsi_lane0_ulp_mode_enter(dsi);
690700
mtk_dsi_clk_ulp_mode_enter(dsi);
@@ -735,17 +745,6 @@ static void mtk_output_dsi_disable(struct mtk_dsi *dsi)
735745
if (!dsi->enabled)
736746
return;
737747

738-
/*
739-
* mtk_dsi_stop() and mtk_dsi_start() is asymmetric, since
740-
* mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(),
741-
* which needs irq for vblank, and mtk_dsi_stop() will disable irq.
742-
* mtk_dsi_start() needs to be called in mtk_output_dsi_enable(),
743-
* after dsi is fully set.
744-
*/
745-
mtk_dsi_stop(dsi);
746-
747-
mtk_dsi_switch_to_cmd_mode(dsi, VM_DONE_INT_FLAG, 500);
748-
749748
dsi->enabled = false;
750749
}
751750

@@ -808,10 +807,13 @@ static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
808807

809808
static const struct drm_bridge_funcs mtk_dsi_bridge_funcs = {
810809
.attach = mtk_dsi_bridge_attach,
810+
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
811811
.atomic_disable = mtk_dsi_bridge_atomic_disable,
812+
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
812813
.atomic_enable = mtk_dsi_bridge_atomic_enable,
813814
.atomic_pre_enable = mtk_dsi_bridge_atomic_pre_enable,
814815
.atomic_post_disable = mtk_dsi_bridge_atomic_post_disable,
816+
.atomic_reset = drm_atomic_helper_bridge_reset,
815817
.mode_set = mtk_dsi_bridge_mode_set,
816818
};
817819

0 commit comments

Comments
 (0)