<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/mediatek, branch for-next</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=for-next</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=for-next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-10T06:57:59Z</updated>
<entry>
<title>Merge tag 'mediatek-drm-fixes-20250104' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes</title>
<updated>2025-01-10T06:57:59Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2025-01-10T06:57:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fddb4fd91a955636baa451fe82ad0266f55c7ede'/>
<id>urn:sha1:fddb4fd91a955636baa451fe82ad0266f55c7ede</id>
<content type='text'>
Mediatek DRM Fixes - 20250104

1. Revert "drm/mediatek: dsi: Correct calculation formula of PHY Timing"
2. Set private-&gt;all_drm_private[i]-&gt;drm to NULL if mtk_drm_bind returns err
3. Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb()
4. Only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported
5. Add support for 180-degree rotation in the display driver
6. Stop selecting foreign drivers
7. Revert "drm/mediatek: Switch to for_each_child_of_node_scoped()"
8. Fix YCbCr422 color format issue for DP
9. Fix mode valid issue for dp
10. dp: Reference common DAI properties
11. dsi: Add registers to pdata to fix MT8186/MT8188
12. Remove unneeded semicolon
13. Add return value check when reading DPCD
14. Initialize pointer in mtk_drm_of_ddp_path_build_one()

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;

From: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250104124227.45505-1-chunkuang.hu@kernel.org
</content>
</entry>
<entry>
<title>drm/mediatek: Initialize pointer in mtk_drm_of_ddp_path_build_one()</title>
<updated>2025-01-04T12:15:19Z</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2024-11-12T10:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f563dd9ca6cb6ed52c5fb6e4285d1ef26cfa7e8a'/>
<id>urn:sha1:f563dd9ca6cb6ed52c5fb6e4285d1ef26cfa7e8a</id>
<content type='text'>
The struct device_node *next pointer is not initialized, and it is
used in an error path in which it may have never been modified by
function mtk_drm_of_get_ddp_ep_cid().

Since the error path is relying on that pointer being NULL for the
OVL Adaptor and/or invalid component check and since said pointer
is being used in prints for %pOF, in the case that it points to a
bogus address, the print may cause a KP.

To resolve that, initialize the *next pointer to NULL before usage.

Fixes: 4c932840db1d ("drm/mediatek: Implement OF graphs support for display paths")
Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Closes: https://lore.kernel.org/dri-devel/633f3c6d-d09f-447c-95f1-dfb4114c50e6@stanley.mountain/
Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: CK Hu &lt;ck.hu@mediatek.com&gt;
Reviewed-by: Alexandre Mergnat &lt;amergnat@baylibre.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241112105030.93337-1-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: Add return value check when reading DPCD</title>
<updated>2025-01-04T12:15:08Z</updated>
<author>
<name>Liankun Yang</name>
<email>liankun.yang@mediatek.com</email>
</author>
<published>2024-12-18T11:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=522908140645865dc3e2fac70fd3b28834dfa7be'/>
<id>urn:sha1:522908140645865dc3e2fac70fd3b28834dfa7be</id>
<content type='text'>
Check the return value of drm_dp_dpcd_readb() to confirm that
AUX communication is successful. To simplify the code, replace
drm_dp_dpcd_readb() and DP_GET_SINK_COUNT() with drm_dp_read_sink_count().

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Liankun Yang &lt;liankun.yang@mediatek.com&gt;
Reviewed-by: Guillaume Ranquet &lt;granquet@baylibre.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241218113448.2992-1-liankun.yang@mediatek.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: Remove unneeded semicolon</title>
<updated>2025-01-02T13:36:18Z</updated>
<author>
<name>Chun-Kuang Hu</name>
<email>chunkuang.hu@kernel.org</email>
</author>
<published>2024-12-30T13:53:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c4bd13be1949020e3b1c9ed6889988e0b30c3d3b'/>
<id>urn:sha1:c4bd13be1949020e3b1c9ed6889988e0b30c3d3b</id>
<content type='text'>
cocci warnings: (new ones prefixed by &gt;&gt;)
&gt;&gt; drivers/gpu/drm/mediatek/mtk_drm_drv.c:1092:2-3: Unneeded semicolon

Fixes: 4c932840db1d ("drm/mediatek: Implement OF graphs support for display paths")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202412022048.kY2ZhxZ4-lkp@intel.com/
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241230135314.5419-1-chunkuang.hu@kernel.org/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: mtk_dsi: Add registers to pdata to fix MT8186/MT8188</title>
<updated>2024-12-30T14:50:38Z</updated>
<author>
<name>AngeloGioacchino Del Regno</name>
<email>angelogioacchino.delregno@collabora.com</email>
</author>
<published>2024-12-19T11:27:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76aed5e00ff2625e0ec4b40c75f3514bdb27fae4'/>
<id>urn:sha1:76aed5e00ff2625e0ec4b40c75f3514bdb27fae4</id>
<content type='text'>
Registers DSI_VM_CMD and DSI_SHADOW_DEBUG start at different
addresses in both MT8186 and MT8188 compared to the older IPs.

Add two members in struct mtk_dsi_driver_data to specify the
offsets for these two registers on a per-SoC basis, then do
specify those in all of the currently present SoC driver data.

This fixes writes to the Video Mode Command Packet Control
register, fixing enablement of command packet transmission
(VM_CMD_EN) and allowance of this transmission during the
VFP period (TS_VFP_EN) on both MT8186 and MT8188.

Fixes: 03d7adc41027 ("drm/mediatek: Add mt8186 dsi compatible to mtk_dsi.c")
Fixes: 814d5341f314 ("drm/mediatek: Add mt8188 dsi compatible to mtk_dsi.c")
Signed-off-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: CK Hu &lt;ck.hu@mediatek.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241219112733.47907-1-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: Fix mode valid issue for dp</title>
<updated>2024-12-30T14:25:03Z</updated>
<author>
<name>Liankun Yang</name>
<email>liankun.yang@mediatek.com</email>
</author>
<published>2024-10-25T08:28:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d68b55887cedc7487036ed34cb4c2097c4228f1'/>
<id>urn:sha1:0d68b55887cedc7487036ed34cb4c2097c4228f1</id>
<content type='text'>
Fix dp mode valid issue to avoid abnormal display of limit state.

After DP passes link training, it can express the lane count of the
current link status is good. Calculate the maximum bandwidth supported
by DP using the current lane count.

The color format will select the best one based on the bandwidth
requirements of the current timing mode. If the current timing mode
uses RGB and meets the DP link bandwidth requirements, RGB will be used.

If the timing mode uses RGB but does not meet the DP link bandwidthi
requirements, it will continue to check whether YUV422 meets
the DP link bandwidth.

FEC overhead is approximately 2.4% from DP 1.4a spec 2.2.1.4.2.
The down-spread amplitude shall either be disabled (0.0%) or up
to 0.5% from 1.4a 3.5.2.6. Add up to approximately 3% total overhead.

Because rate is already divided by 10,
mode-&gt;clock does not need to be multiplied by 10.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Liankun Yang &lt;liankun.yang@mediatek.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241025083036.8829-3-liankun.yang@mediatek.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: Fix YCbCr422 color format issue for DP</title>
<updated>2024-12-30T14:10:27Z</updated>
<author>
<name>Liankun Yang</name>
<email>liankun.yang@mediatek.com</email>
</author>
<published>2024-10-25T08:28:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef24fbd8f12015ff827973fffefed3902ffd61cc'/>
<id>urn:sha1:ef24fbd8f12015ff827973fffefed3902ffd61cc</id>
<content type='text'>
Setting up misc0 for Pixel Encoding Format.

According to the definition of YCbCr in spec 1.2a Table 2-96,
0x1 &lt;&lt; 1 should be written to the register.

Use switch case to distinguish RGB, YCbCr422,
and unsupported color formats.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Liankun Yang &lt;liankun.yang@mediatek.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241025083036.8829-2-liankun.yang@mediatek.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "drm/mediatek: Switch to for_each_child_of_node_scoped()"</title>
<updated>2024-12-30T13:21:16Z</updated>
<author>
<name>Chun-Kuang Hu</name>
<email>chunkuang.hu@kernel.org</email>
</author>
<published>2024-12-23T15:12:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a10f26062a9973c38c0a11ea91757f9228e200f2'/>
<id>urn:sha1:a10f26062a9973c38c0a11ea91757f9228e200f2</id>
<content type='text'>
This reverts commit fd620fc25d88a1e490eaa9f72bc31962be1b4741.

Boot failures reported by
KernelCI:

[    4.395400] mediatek-drm mediatek-drm.5.auto: bound 1c014000.merge (ops 0xffffd35fd12975f8)
[    4.396155] mediatek-drm mediatek-drm.5.auto: bound 1c000000.ovl (ops 0xffffd35fd12977b8)
[    4.411951] mediatek-drm mediatek-drm.5.auto: bound 1c002000.rdma (ops 0xffffd35fd12989c0)
[    4.536837] mediatek-drm mediatek-drm.5.auto: bound 1c004000.ccorr (ops 0xffffd35fd1296cf0)
[    4.545181] mediatek-drm mediatek-drm.5.auto: bound 1c005000.aal (ops 0xffffd35fd1296a80)
[    4.553344] mediatek-drm mediatek-drm.5.auto: bound 1c006000.gamma (ops 0xffffd35fd12972b0)
[    4.561680] mediatek-drm mediatek-drm.5.auto: bound 1c014000.merge (ops 0xffffd35fd12975f8)
[    4.570025] ------------[ cut here ]------------
[    4.574630] refcount_t: underflow; use-after-free.
[    4.579416] WARNING: CPU: 6 PID: 81 at lib/refcount.c:28 refcount_warn_saturate+0xf4/0x148
[    4.587670] Modules linked in:
[    4.590714] CPU: 6 UID: 0 PID: 81 Comm: kworker/u32:3 Tainted: G        W          6.12.0 #1 cab58e2e59020ebd4be8ada89a65f465a316c742
[    4.602695] Tainted: [W]=WARN
[    4.605649] Hardware name: Acer Tomato (rev2) board (DT)
[    4.610947] Workqueue: events_unbound deferred_probe_work_func
[    4.616768] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    4.623715] pc : refcount_warn_saturate+0xf4/0x148
[    4.628493] lr : refcount_warn_saturate+0xf4/0x148
[    4.633270] sp : ffff8000807639c0
[    4.636571] x29: ffff8000807639c0 x28: ffff34ff4116c640 x27: ffff34ff4368e080
[    4.643693] x26: ffffd35fd1299ac8 x25: ffff34ff46c8c410 x24: 0000000000000000
[    4.650814] x23: ffff34ff4368e080 x22: 00000000fffffdfb x21: 0000000000000002
[    4.657934] x20: ffff34ff470c6000 x19: ffff34ff410c7c10 x18: 0000000000000006
[    4.665055] x17: 666678302073706f x16: 2820656772656d2e x15: ffff800080763440
[    4.672176] x14: 0000000000000000 x13: 2e656572662d7265 x12: ffffd35fd2ed14f0
[    4.679297] x11: 0000000000000001 x10: 0000000000000001 x9 : ffffd35fd0342150
[    4.686418] x8 : c0000000ffffdfff x7 : ffffd35fd2e21450 x6 : 00000000000affa8
[    4.693539] x5 : ffffd35fd2ed1498 x4 : 0000000000000000 x3 : 0000000000000000
[    4.700660] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff34ff40932580
[    4.707781] Call trace:
[    4.710216]  refcount_warn_saturate+0xf4/0x148 (P)
[    4.714993]  refcount_warn_saturate+0xf4/0x148 (L)
[    4.719772]  kobject_put+0x110/0x118
[    4.723335]  put_device+0x1c/0x38
[    4.726638]  mtk_drm_bind+0x294/0x5c0
[    4.730289]  try_to_bring_up_aggregate_device+0x16c/0x1e0
[    4.735673]  __component_add+0xbc/0x1c0
[    4.739495]  component_add+0x1c/0x30
[    4.743058]  mtk_disp_rdma_probe+0x140/0x210
[    4.747314]  platform_probe+0x70/0xd0
[    4.750964]  really_probe+0xc4/0x2a8
[    4.754527]  __driver_probe_device+0x80/0x140
[    4.758870]  driver_probe_device+0x44/0x120
[    4.763040]  __device_attach_driver+0xc0/0x108
[    4.767470]  bus_for_each_drv+0x8c/0xf0
[    4.771294]  __device_attach+0xa4/0x198
[    4.775117]  device_initial_probe+0x1c/0x30
[    4.779286]  bus_probe_device+0xb4/0xc0
[    4.783109]  deferred_probe_work_func+0xb0/0x100
[    4.787714]  process_one_work+0x18c/0x420
[    4.791712]  worker_thread+0x30c/0x418
[    4.795449]  kthread+0x128/0x138
[    4.798665]  ret_from_fork+0x10/0x20
[    4.802229] ---[ end trace 0000000000000000 ]---

Fixes: fd620fc25d88 ("drm/mediatek: Switch to for_each_child_of_node_scoped()")
Cc: stable@vger.kernel.org
Cc: Javier Carrasco &lt;javier.carrasco.cruz@gmail.com&gt;
Reported-by: Sasha Levin &lt;sashal@kernel.org&gt;
Closes: https://lore.kernel.org/lkml/Z0lNHdwQ3rODHQ2c@sashalap/T/#mfaa6343cfd4d59aae5912b095c0693c0553e746c
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241223151218.7958-1-chunkuang.hu@kernel.org/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: stop selecting foreign drivers</title>
<updated>2024-12-25T15:29:57Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2024-12-18T08:58:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=924d66011f2401a4145e2e814842c5c4572e439f'/>
<id>urn:sha1:924d66011f2401a4145e2e814842c5c4572e439f</id>
<content type='text'>
The PHY portion of the mediatek hdmi driver was originally part of
the driver it self and later split out into drivers/phy, which a
'select' to keep the prior behavior.

However, this leads to build failures when the PHY driver cannot
be built:

WARNING: unmet direct dependencies detected for PHY_MTK_HDMI
  Depends on [n]: (ARCH_MEDIATEK || COMPILE_TEST [=y]) &amp;&amp; COMMON_CLK [=y] &amp;&amp; OF [=y] &amp;&amp; REGULATOR [=n]
  Selected by [m]:
  - DRM_MEDIATEK_HDMI [=m] &amp;&amp; HAS_IOMEM [=y] &amp;&amp; DRM [=m] &amp;&amp; DRM_MEDIATEK [=m]
ERROR: modpost: "devm_regulator_register" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!
ERROR: modpost: "rdev_get_drvdata" [drivers/phy/mediatek/phy-mtk-hdmi-drv.ko] undefined!

The best option here is to just not select the phy driver and leave that
up to the defconfig. Do the same for the other PHY and memory drivers
selected here as well for consistency.

Fixes: a481bf2f0ca4 ("drm/mediatek: Separate mtk_hdmi_phy to an independent module")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: CK Hu &lt;ck.hu@mediatek.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241218085837.2670434-1-arnd@kernel.org/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/mediatek: Add support for 180-degree rotation in the display driver</title>
<updated>2024-12-25T15:27:32Z</updated>
<author>
<name>Jason-JH.Lin</name>
<email>jason-jh.lin@mediatek.com</email>
</author>
<published>2024-11-18T02:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c9d7e79ba154e8e1f0bfdeb7b495f454c1a3eba'/>
<id>urn:sha1:5c9d7e79ba154e8e1f0bfdeb7b495f454c1a3eba</id>
<content type='text'>
mediatek-drm driver reported the capability of 180-degree rotation by
adding `DRM_MODE_ROTATE_180` to the plane property, as flip-x combined
with flip-y equals a 180-degree rotation. However, we did not handle
the rotation property in the driver and lead to rotation issues.

Fixes: 74608d8feefd ("drm/mediatek: Add DRM_MODE_ROTATE_0 to rotation property")
Signed-off-by: Jason-JH.Lin &lt;jason-jh.lin@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: CK Hu &lt;ck.hu@mediatek.com&gt;
Link: https://patchwork.kernel.org/project/dri-devel/patch/20241118025126.30808-1-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
</content>
</entry>
</feed>
