Thread (17 messages) 17 messages, 3 authors, 2021-07-22

Re: [PATCH v1 06/10] drm/mediatek: add ETHDR support for MT8195

From: CK Hu <hidden>
Date: 2021-07-22 05:28:07
Also in: dri-devel, linux-mediatek

Hi, Nancy:

On Thu, 2021-07-22 at 09:32 +0800, Nancy.Lin wrote:
Hi Chun-Kuang,

On Mon, 2021-07-19 at 07:56 +0800, Chun-Kuang Hu wrote:
quoted
Hi, Nancy:

Nancy.Lin [off-list ref] 於 2021年7月17日 週六 下午5:04寫道:
quoted
Add ETHDR module files:
ETHDR is designed for HDR video and graphics conversion in the
external
display path. It handles multiple HDR input types and performs tone
mapping, color space/color format conversion, and then combines
different layers, output the required HDR or SDR signal to the
subsequent display path.

Signed-off-by: Nancy.Lin <redacted>
---
 drivers/gpu/drm/mediatek/Makefile           |   3 +-
 drivers/gpu/drm/mediatek/mtk_disp_drv.h     |   8 +
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c |  11 +
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h |   1 +
 drivers/gpu/drm/mediatek/mtk_drm_drv.c      |   4 +
 drivers/gpu/drm/mediatek/mtk_drm_drv.h      |   1 +
 drivers/gpu/drm/mediatek/mtk_ethdr.c        | 537
++++++++++++++++++++
 drivers/gpu/drm/mediatek/mtk_ethdr.h        |  20 +
 8 files changed, 584 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/mediatek/mtk_ethdr.c
 create mode 100644 drivers/gpu/drm/mediatek/mtk_ethdr.h

+
+void mtk_ethdr_layer_on(struct device *dev, unsigned int idx,
+                       struct cmdq_pkt *cmdq_pkt)
+{
+       struct mtk_ethdr *priv = dev_get_drvdata(dev);
+       struct mtk_ethdr_comp *mixer = &priv-
quoted
ethdr_comp[ETHDR_MIXER];
+
+       dev_dbg(dev, "%s+ idx:%d", __func__, idx);
+
+       if (idx < 4)
+               mtk_ddp_write_mask(cmdq_pkt, BIT(idx), &mixer-
quoted
cmdq_base,
+                                  mixer->regs, MIX_SRC_CON,
BIT(idx));
+}
+
+void mtk_ethdr_layer_off(struct device *dev, unsigned int idx,
+                        struct cmdq_pkt *cmdq_pkt)
+{
+       struct mtk_ethdr *priv = dev_get_drvdata(dev);
+       struct mtk_ethdr_comp *mixer = &priv-
quoted
ethdr_comp[ETHDR_MIXER];
+
+       dev_dbg(dev, "%s+ idx:%d", __func__, idx);
+
+       switch (idx) {
+       case 0:
+               mtk_ddp_write_mask(cmdq_pkt, 0, &mixer->cmdq_base,
+                                  mixer->regs, MIX_L0_SRC_SIZE,
~0);
+               break;
+       case 1:
+               mtk_ddp_write_mask(cmdq_pkt, 0, &mixer->cmdq_base,
+                                  mixer->regs, MIX_L1_SRC_SIZE,
~0);
+               break;
+       case 2:
+               mtk_ddp_write_mask(cmdq_pkt, 0, &mixer->cmdq_base,
+                                  mixer->regs, MIX_L2_SRC_SIZE,
~0);
+               break;
+       case 3:
+               mtk_ddp_write_mask(cmdq_pkt, 0, &mixer->cmdq_base,
+                                  mixer->regs, MIX_L3_SRC_SIZE,
~0);
+               break;
+       default:
+               dev_dbg(dev, "%s Wrong layer ID\n", __func__);
+               break;
+       }
Why not just

               mtk_ddp_write_mask(cmdq_pkt, 0, &mixer->cmdq_base,
                                  mixer->regs, MIX_SRC_CON,
BIT(idx));
There are two modes in Mixer.
1. Background relay mode: all layers off
2. Normal mix mode: at least one layer on
The timing of the two modes is different, so keep using the normal mix
mode.
Just set the layer region to 0 when the layer off.
layer_on() and layer_off() does different things. Comparing before turn
on a layer with after turn on->off a layer, the register setting are
different. I would like just restore the register. 

Regards,
CK
quoted
quoted
+}
+

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help