Skip to content

Commit 4f88cfd

Browse files
committed
Merge tag 'mediatek-drm-next-6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next
Mediatek DRM Next for Linux 6.8 1. Use devm_platform_ioremap_resource() 2. Stop using iommu_present() 3. Add display driver for MT8188 VDOSYS1 4. Add phy_mtk_dp module as pre-dependency Signed-off-by: Dave Airlie <airlied@redhat.com> From: Chun-Kuang Hu <chunkuang.hu@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20231218145826.5643-1-chunkuang.hu@kernel.org
2 parents 22a2dec + c8048dd commit 4f88cfd

20 files changed

+461
-143
lines changed

Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ description:
2323

2424
properties:
2525
compatible:
26-
const: mediatek,mt8195-disp-ethdr
26+
oneOf:
27+
- const: mediatek,mt8195-disp-ethdr
28+
- items:
29+
- const: mediatek,mt8188-disp-ethdr
30+
- const: mediatek,mt8195-disp-ethdr
2731

2832
reg:
2933
maxItems: 7

Documentation/devicetree/bindings/display/mediatek/mediatek,mdp-rdma.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ description:
2121

2222
properties:
2323
compatible:
24-
const: mediatek,mt8195-vdo1-rdma
24+
oneOf:
25+
- const: mediatek,mt8195-vdo1-rdma
26+
- items:
27+
- const: mediatek,mt8188-vdo1-rdma
28+
- const: mediatek,mt8195-vdo1-rdma
2529

2630
reg:
2731
maxItems: 1

Documentation/devicetree/bindings/display/mediatek/mediatek,merge.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ properties:
2727
- items:
2828
- const: mediatek,mt6795-disp-merge
2929
- const: mediatek,mt8173-disp-merge
30+
- items:
31+
- const: mediatek,mt8188-disp-merge
32+
- const: mediatek,mt8195-disp-merge
3033

3134
reg:
3235
maxItems: 1
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/mediatek/mediatek,padding.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek Display Padding
8+
9+
maintainers:
10+
- Chun-Kuang Hu <chunkuang.hu@kernel.org>
11+
- Philipp Zabel <p.zabel@pengutronix.de>
12+
13+
description:
14+
Padding provides ability to add pixels to width and height of a layer with
15+
specified colors. Due to hardware design, Mixer in VDOSYS1 requires
16+
width of a layer to be 2-pixel-align, or 4-pixel-align when ETHDR is enabled,
17+
we need Padding to deal with odd width.
18+
Please notice that even if the Padding is in bypass mode, settings in
19+
register must be cleared to 0, or undefined behaviors could happen.
20+
21+
properties:
22+
compatible:
23+
const: mediatek,mt8188-disp-padding
24+
25+
reg:
26+
maxItems: 1
27+
28+
power-domains:
29+
maxItems: 1
30+
31+
clocks:
32+
items:
33+
- description: Padding's clocks
34+
35+
mediatek,gce-client-reg:
36+
description:
37+
GCE (Global Command Engine) is a multi-core micro processor that helps
38+
its clients to execute commands without interrupting CPU. This property
39+
describes GCE client's information that is composed by 4 fields.
40+
1. Phandle of the GCE (there may be several GCE processors)
41+
2. Sub-system ID defined in the dt-binding like a user ID
42+
(Please refer to include/dt-bindings/gce/<chip>-gce.h)
43+
3. Offset from base address of the subsys you are at
44+
4. Size of the register the client needs
45+
$ref: /schemas/types.yaml#/definitions/phandle-array
46+
items:
47+
items:
48+
- description: Phandle of the GCE
49+
- description: Subsys ID defined in the dt-binding
50+
- description: Offset from base address of the subsys
51+
- description: Size of register
52+
maxItems: 1
53+
54+
required:
55+
- compatible
56+
- reg
57+
- power-domains
58+
- clocks
59+
- mediatek,gce-client-reg
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
#include <dt-bindings/interrupt-controller/arm-gic.h>
66+
#include <dt-bindings/clock/mediatek,mt8188-clk.h>
67+
#include <dt-bindings/power/mediatek,mt8188-power.h>
68+
#include <dt-bindings/gce/mt8195-gce.h>
69+
70+
soc {
71+
#address-cells = <2>;
72+
#size-cells = <2>;
73+
74+
padding0: padding@1c11d000 {
75+
compatible = "mediatek,mt8188-disp-padding";
76+
reg = <0 0x1c11d000 0 0x1000>;
77+
clocks = <&vdosys1 CLK_VDO1_PADDING0>;
78+
power-domains = <&spm MT8188_POWER_DOMAIN_VDOSYS1>;
79+
mediatek,gce-client-reg = <&gce0 SUBSYS_1c11XXXX 0xd000 0x1000>;
80+
};
81+
};

drivers/gpu/drm/mediatek/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ mediatek-drm-y := mtk_disp_aal.o \
1616
mtk_dsi.o \
1717
mtk_dpi.o \
1818
mtk_ethdr.o \
19-
mtk_mdp_rdma.o
19+
mtk_mdp_rdma.o \
20+
mtk_padding.o
2021

2122
obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o
2223

drivers/gpu/drm/mediatek/mtk_cec.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
185185
{
186186
struct device *dev = &pdev->dev;
187187
struct mtk_cec *cec;
188-
struct resource *res;
189188
int ret;
190189

191190
cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
@@ -195,8 +194,7 @@ static int mtk_cec_probe(struct platform_device *pdev)
195194
platform_set_drvdata(pdev, cec);
196195
spin_lock_init(&cec->lock);
197196

198-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
199-
cec->regs = devm_ioremap_resource(dev, res);
197+
cec->regs = devm_platform_ioremap_resource(pdev, 0);
200198
if (IS_ERR(cec->regs)) {
201199
ret = PTR_ERR(cec->regs);
202200
dev_err(dev, "Failed to ioremap cec: %d\n", ret);

drivers/gpu/drm/mediatek/mtk_disp_aal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
168168
{
169169
struct device *dev = &pdev->dev;
170170
struct mtk_disp_aal *priv;
171-
struct resource *res;
172171
int ret;
173172

174173
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -181,8 +180,7 @@ static int mtk_disp_aal_probe(struct platform_device *pdev)
181180
return PTR_ERR(priv->clk);
182181
}
183182

184-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
185-
priv->regs = devm_ioremap_resource(dev, res);
183+
priv->regs = devm_platform_ioremap_resource(pdev, 0);
186184
if (IS_ERR(priv->regs)) {
187185
dev_err(dev, "failed to ioremap aal\n");
188186
return PTR_ERR(priv->regs);

drivers/gpu/drm/mediatek/mtk_disp_ccorr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
153153
{
154154
struct device *dev = &pdev->dev;
155155
struct mtk_disp_ccorr *priv;
156-
struct resource *res;
157156
int ret;
158157

159158
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -166,8 +165,7 @@ static int mtk_disp_ccorr_probe(struct platform_device *pdev)
166165
return PTR_ERR(priv->clk);
167166
}
168167

169-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
170-
priv->regs = devm_ioremap_resource(dev, res);
168+
priv->regs = devm_platform_ioremap_resource(pdev, 0);
171169
if (IS_ERR(priv->regs)) {
172170
dev_err(dev, "failed to ioremap ccorr\n");
173171
return PTR_ERR(priv->regs);

drivers/gpu/drm/mediatek/mtk_disp_drv.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ void mtk_ovl_adaptor_connect(struct device *dev, struct device *mmsys_dev,
110110
unsigned int next);
111111
void mtk_ovl_adaptor_disconnect(struct device *dev, struct device *mmsys_dev,
112112
unsigned int next);
113+
int mtk_ovl_adaptor_power_on(struct device *dev);
114+
void mtk_ovl_adaptor_power_off(struct device *dev);
113115
int mtk_ovl_adaptor_clk_enable(struct device *dev);
114116
void mtk_ovl_adaptor_clk_disable(struct device *dev);
115117
void mtk_ovl_adaptor_config(struct device *dev, unsigned int w,
@@ -151,6 +153,8 @@ void mtk_rdma_disable_vblank(struct device *dev);
151153
const u32 *mtk_rdma_get_formats(struct device *dev);
152154
size_t mtk_rdma_get_num_formats(struct device *dev);
153155

156+
int mtk_mdp_rdma_power_on(struct device *dev);
157+
void mtk_mdp_rdma_power_off(struct device *dev);
154158
int mtk_mdp_rdma_clk_enable(struct device *dev);
155159
void mtk_mdp_rdma_clk_disable(struct device *dev);
156160
void mtk_mdp_rdma_start(struct device *dev, struct cmdq_pkt *cmdq_pkt);
@@ -160,4 +164,8 @@ void mtk_mdp_rdma_config(struct device *dev, struct mtk_mdp_rdma_cfg *cfg,
160164
const u32 *mtk_mdp_rdma_get_formats(struct device *dev);
161165
size_t mtk_mdp_rdma_get_num_formats(struct device *dev);
162166

167+
int mtk_padding_clk_enable(struct device *dev);
168+
void mtk_padding_clk_disable(struct device *dev);
169+
void mtk_padding_start(struct device *dev);
170+
void mtk_padding_stop(struct device *dev);
163171
#endif

drivers/gpu/drm/mediatek/mtk_disp_merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void mtk_merge_stop_cmdq(struct device *dev, struct cmdq_pkt *cmdq_pkt)
103103
mtk_ddp_write(cmdq_pkt, 0, &priv->cmdq_reg, priv->regs,
104104
DISP_REG_MERGE_CTRL);
105105

106-
if (priv->async_clk)
106+
if (!cmdq_pkt && priv->async_clk)
107107
reset_control_reset(priv->reset_ctl);
108108
}
109109

0 commit comments

Comments
 (0)