Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-25 Thread AngeloGioacchino Del Regno
Il 24/07/23 19:58, Justin Green ha scritto: Add a check to mtk_drm_mode_fb_create() that rejects any modifier that is not the AFBC mode supported by MT8195's display overlays. Tested by booting ChromeOS and verifying the UI works, and by running the ChromeOS kms_addfb_basic binary, which has a

Re: [PATCH v2] drm/panfrost: Sync IRQ by job's timeout handler

2023-07-24 Thread AngeloGioacchino Del Regno
fence signal status in order to prevent spurious job timeouts due to a slow IRQ processing. Signed-off-by: Dmitry Osipenko Reviewed-by: AngeloGioacchino Del Regno Also, on MediaTek MT8192 and MT8195 Chromebooks: Tested-by: AngeloGioacchino Del Regno

Re: [PATCH v3,3/3] drm/mediatek: dp: Add the audio divider to mtk_dp_data struct

2023-07-20 Thread AngeloGioacchino Del Regno
Il 20/07/23 14:29, Alexandre Mergnat ha scritto: On 20/07/2023 14:08, AngeloGioacchino Del Regno wrote: Il 20/07/23 14:07, Alexandre Mergnat ha scritto: On 20/07/2023 13:54, AngeloGioacchino Del Regno wrote: Il 20/07/23 12:14, Alexandre Mergnat ha scritto: On 20/07/2023 10:26, Shuijing

Re: [PATCH v3,3/3] drm/mediatek: dp: Add the audio divider to mtk_dp_data struct

2023-07-20 Thread AngeloGioacchino Del Regno
Il 20/07/23 14:07, Alexandre Mergnat ha scritto: On 20/07/2023 13:54, AngeloGioacchino Del Regno wrote: Il 20/07/23 12:14, Alexandre Mergnat ha scritto: On 20/07/2023 10:26, Shuijing Li wrote: Due to the difference of HW, different dividers need to be set. Signed-off-by: Shuijing Li

Re: [PATCH v3,3/3] drm/mediatek: dp: Add the audio divider to mtk_dp_data struct

2023-07-20 Thread AngeloGioacchino Del Regno
Il 20/07/23 12:14, Alexandre Mergnat ha scritto: On 20/07/2023 10:26, Shuijing Li wrote: Due to the difference of HW, different dividers need to be set. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi --- Changes in v3: Separate these two things into two different patches. per

Re: [PATCH v3,3/3] drm/mediatek: dp: Add the audio divider to mtk_dp_data struct

2023-07-20 Thread AngeloGioacchino Del Regno
Il 20/07/23 10:26, Shuijing Li ha scritto: Due to the difference of HW, different dividers need to be set. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH v3,2/3] drm/mediatek: dp: Add the audio packet flag to mtk_dp_data struct

2023-07-20 Thread AngeloGioacchino Del Regno
Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH v3 02/15] arm64: dts: qcom: sm6125: Sort spmi_bus node numerically by reg

2023-07-20 Thread AngeloGioacchino Del Regno
Il 19/07/23 23:54, Marijn Suijten ha scritto: On 2023-07-19 01:02:56, Dmitry Baryshkov wrote: On 19/07/2023 00:24, Marijn Suijten wrote: This node has always resided in the wrong spot, making it somewhat harder to contribute new node entries while maintaining proper sorting around it. Move

[PATCH v2 2/6] drm/mediatek: mtk_dpi: Simplify with dev_err_probe()

2023-07-19 Thread AngeloGioacchino Del Regno
Use dev_err_probe() across the entire probe function of this driver to shrink the size. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Fei Shao --- drivers/gpu/drm/mediatek/mtk_dpi.c | 44 ++ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git

[PATCH v2 5/6] drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource()

2023-07-19 Thread AngeloGioacchino Del Regno
Instead of the open-coded platform_get_resource, devm_ioremap_resource switch to devm_platform_ioremap_resource(), also dropping the useless struct resource pointer, which becomes unused. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dpi.c | 4 +--- 1 file changed

[PATCH v2 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()

2023-07-19 Thread AngeloGioacchino Del Regno
Function drm_of_find_panel_or_bridge() is marked as deprecated: since the usage of that in this driver exactly corresponds to the new function devm_drm_of_get_bridge(), switch to it. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Fei Shao --- drivers/gpu/drm/mediatek/mtk_dpi.c | 10

[PATCH v2 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()

2023-07-19 Thread AngeloGioacchino Del Regno
Change drm_bridge_add() to its devm variant to slightly simplify the probe function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm

[PATCH v2 4/6] drm/mediatek: mtk_dpi: Switch to .remove_new() void callback

2023-07-19 Thread AngeloGioacchino Del Regno
The .remove() callback cannot fail: switch to .remove_new() and change mtk_dpi_remove() to void. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dpi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b

[PATCH v2 6/6] drm/mediatek: mtk_dpi: Compress struct of_device_id entries

2023-07-19 Thread AngeloGioacchino Del Regno
Reduce line count by compressing the entries of struct of_device_id; while at it, also add the usual /* sentinel */ comment to the last entry. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dpi.c | 30

[PATCH v2 0/6] drm/mediatek: Small mtk-dpi cleanups

2023-07-19 Thread AngeloGioacchino Del Regno
of_device_id entries - Added a commit to switch to .remove_new() callback This is a small cleanup of the mtk-dpi driver, switching it to devm variants where possible and where it made sense, and reducing lines while retaining and improving human readability. AngeloGioacchino Del Regno (6): drm

Re: [PATCH 0/3] MediaTek DRM: Clean up CMDQ support and ifdefs

2023-07-19 Thread AngeloGioacchino Del Regno
Il 23/06/23 14:49, Alexandre Mergnat ha scritto: On 23/06/2023 11:49, AngeloGioacchino Del Regno wrote: This series changes MediaTek CMDQ support to use the mtk-cmdq-helper functions, removing duplicated cmdq setup code in mtk-drm and also removing all instances of `#if IS_REACHABLE

Re: [PATCH] drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling

2023-07-19 Thread AngeloGioacchino Del Regno
Il 23/06/23 13:29, Alexandre Mergnat ha scritto: On 23/06/2023 11:47, AngeloGioacchino Del Regno wrote: Il 23/05/23 12:42, AngeloGioacchino Del Regno ha scritto: Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its

[PATCH v6 07/11] drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled

2023-07-17 Thread AngeloGioacchino Del Regno
in mtk_dp_update_plugged_status(): if not, we simply return immediately. While at it, since the update_plugged_status_lock mutex would not be used if the controller doesn't support audio at all, initialize it only if `audio_supported` is true. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm

[PATCH v6 08/11] drm/mediatek: dp: Move PHY registration to new function

2023-07-17 Thread AngeloGioacchino Del Regno
In preparation for adding support for eDP, move the PHY registration code to a new mtk_dp_register_phy() function for better readability. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dp.c | 43

[PATCH v6 10/11] drm/mediatek: dp: Add .wait_hpd_asserted() for AUX bus

2023-07-17 Thread AngeloGioacchino Del Regno
-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dp.c | 45 ++- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index acdd457b5449..e74295ba9707 100644 --- a/drivers

[PATCH v6 09/11] drm/mediatek: dp: Add support for embedded DisplayPort aux-bus

2023-07-17 Thread AngeloGioacchino Del Regno
arated aux-bus, it was necessary to add an exclusion for the cable_plugged_in check in `mtk_dp_aux_transfer()` and the easiest way to do this is to simply ignore checking that when the bridge type is eDP. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/Kconfig | 1 + drive

[PATCH v6 06/11] drm/mediatek: dp: Enable event interrupt only when bridge attached

2023-07-17 Thread AngeloGioacchino Del Regno
and manage the enablement of the ISR in the .attach() and .detach() handlers for the DP bridge. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v6 11/11] drm/mediatek: dp: Don't register HPD interrupt handler for eDP case

2023-07-17 Thread AngeloGioacchino Del Regno
altogether and rely on HPD polling only for the suspend/resume case, saving us some spinlocking action and the overhead of interrupts firing at every suspend/resume cycle, achieving a faster (even if just slightly) display resume. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm

[PATCH v6 05/11] drm/mediatek: dp: Move AUX_P0 setting to mtk_dp_initialize_aux_settings()

2023-07-17 Thread AngeloGioacchino Del Regno
Move the register write to MTK_DP_AUX_P0_3690 to set the AUX reply mode to function mtk_dp_initialize_aux_settings(), as this is effectively part of the DPTX AUX setup sequence. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 9

[PATCH v6 03/11] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer()

2023-07-17 Thread AngeloGioacchino Del Regno
potentially start happening in a later commit implementing aux-bus support, as AUX transfers will be triggered from the panel driver (for EDID) before the mtk-dp bridge gets attached, and it's done in preparation for the same. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai

[PATCH v6 01/11] drm/mediatek: dp: Add missing error checks in mtk_dp_parse_capabilities

2023-07-17 Thread AngeloGioacchino Del Regno
iatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 64

[PATCH v6 02/11] drm/mediatek: dp: Move AUX and panel poweron/off sequence to function

2023-07-17 Thread AngeloGioacchino Del Regno
or not, it takes the same time and anyway the DP hardware won't produce any error (or, if it does, it's ignorable because it won't block further commands) - Second, training the link between a sleeping/standby/unpowered display makes little sense. Signed-off-by: AngeloGioacchino Del Regno

[PATCH v6 04/11] drm/mediatek: dp: Use devm variant of drm_bridge_add()

2023-07-17 Thread AngeloGioacchino Del Regno
In preparation for adding support for aux-bus, which will add a code path that may fail after the drm_bridge_add() call, change that to devm_drm_bridge_add() to simplify failure paths later. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek

[PATCH v6 00/11] MediaTek DisplayPort: support eDP and aux-bus

2023-07-17 Thread AngeloGioacchino Del Regno
backlight = <_lcd0>; port { panel_in: endpoint { remote-endpoint = <_out>; }; }; }; }; }; AngeloG

Re: [PATCH v4 3/4] drm/mediatek: Fix unintentional integer overflow in multiplying different types

2023-07-17 Thread AngeloGioacchino Del Regno
variable directly. Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update") Signed-off-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH 1/4] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()

2023-07-13 Thread AngeloGioacchino Del Regno
Il 13/07/23 09:55, Fei Shao ha scritto: Hi Angelo, On Wed, Apr 12, 2023 at 7:53 PM AngeloGioacchino Del Regno wrote: Change drm_bridge_add() to its devm variant to slightly simplify the probe function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dpi.c | 5

Re: [PATCH 4/4] drm/mediatek: mtk_dpi: Use devm_platform_get_and_ioremap_resource()

2023-07-13 Thread AngeloGioacchino Del Regno
Il 13/07/23 10:34, Fei Shao ha scritto: Hi Angelo, On Wed, Apr 12, 2023 at 7:53 PM AngeloGioacchino Del Regno wrote: Instead of the open-coded platform_get_resource, devm_ioremap_resource switch to devm_platform_get_and_ioremap_resource(), doing exactly the same. Signed-off

Re: [PATCH 3/4] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()

2023-07-13 Thread AngeloGioacchino Del Regno
Il 13/07/23 10:24, Fei Shao ha scritto: Hi Angelo, On Wed, Apr 12, 2023 at 7:53 PM AngeloGioacchino Del Regno wrote: Function drm_of_find_panel_or_bridge() is marked as deprecated: since the usage of that in this driver exactly corresponds to the new function devm_drm_of_get_bridge(), switch

Re: [PATCH v5 00/10] MediaTek DisplayPort: support eDP and aux-bus

2023-07-13 Thread AngeloGioacchino Del Regno
Il 13/07/23 11:54, Chen-Yu Tsai ha scritto: On Thu, Jul 13, 2023 at 5:01 PM AngeloGioacchino Del Regno wrote: Changes in v5: - Added .wait_hpd_asserted() callback for aux-bus - Avoid enabling and registering HPD interrupt + handlers for eDP case only (keeps HPD interrupts enabled

[PATCH v5 03/10] drm/mediatek: dp: Use devm variant of drm_bridge_add()

2023-07-13 Thread AngeloGioacchino Del Regno
In preparation for adding support for aux-bus, which will add a code path that may fail after the drm_bridge_add() call, change that to devm_drm_bridge_add() to simplify failure paths later. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek

[PATCH v5 09/10] drm/mediatek: dp: Add .wait_hpd_asserted() for AUX bus

2023-07-13 Thread AngeloGioacchino Del Regno
of this driver, assign the DRM_BRIDGE_OP_{DETECT, EDID, HPD} ops only if we're probing full DisplayPort and not eDP. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dp.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH v5 08/10] drm/mediatek: dp: Add support for embedded DisplayPort aux-bus

2023-07-13 Thread AngeloGioacchino Del Regno
arated aux-bus, it was necessary to add an exclusion for the cable_plugged_in check in `mtk_dp_aux_transfer()` and the easiest way to do this is to simply ignore checking that when the bridge type is eDP. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/Kconfig | 1 + drive

[PATCH v5 05/10] drm/mediatek: dp: Enable event interrupt only when bridge attached

2023-07-13 Thread AngeloGioacchino Del Regno
and manage the enablement of the ISR in the .attach() and .detach() handlers for the DP bridge. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v5 07/10] drm/mediatek: dp: Move PHY registration to new function

2023-07-13 Thread AngeloGioacchino Del Regno
In preparation for adding support for eDP, move the PHY registration code to a new mtk_dp_register_phy() function for better readability. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_dp.c | 43

[PATCH v5 10/10] drm/mediatek: dp: Don't register HPD interrupt handler for eDP case

2023-07-13 Thread AngeloGioacchino Del Regno
altogether and rely on HPD polling only for the suspend/resume case, saving us some spinlocking action and the overhead of interrupts firing at every suspend/resume cycle, achieving a faster (even if just slightly) display resume. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm

[PATCH v5 06/10] drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled

2023-07-13 Thread AngeloGioacchino Del Regno
in mtk_dp_update_plugged_status(): if not, we simply return immediately. While at it, since the update_plugged_status_lock mutex would not be used if the controller doesn't support audio at all, initialize it only if `audio_supported` is true. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm

[PATCH v5 04/10] drm/mediatek: dp: Move AUX_P0 setting to mtk_dp_initialize_aux_settings()

2023-07-13 Thread AngeloGioacchino Del Regno
Move the register write to MTK_DP_AUX_P0_3690 to set the AUX reply mode to function mtk_dp_initialize_aux_settings(), as this is effectively part of the DPTX AUX setup sequence. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 9

[PATCH v5 00/10] MediaTek DisplayPort: support eDP and aux-bus

2023-07-13 Thread AngeloGioacchino Del Regno
backlight = <_lcd0>; port { panel_in: endpoint { remote-endpoint = <_out>; }; }; }; }; }; AngeloGioacchino De

[PATCH v5 01/10] drm/mediatek: dp: Move AUX and panel poweron/off sequence to function

2023-07-13 Thread AngeloGioacchino Del Regno
or not, it takes the same time and anyway the DP hardware won't produce any error (or, if it does, it's ignorable because it won't block further commands) - Second, training the link between a sleeping/standby/unpowered display makes little sense. Signed-off-by: AngeloGioacchino Del Regno

[PATCH v5 02/10] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer()

2023-07-13 Thread AngeloGioacchino Del Regno
potentially start happening in a later commit implementing aux-bus support, as AUX transfers will be triggered from the panel driver (for EDID) before the mtk-dp bridge gets attached, and it's done in preparation for the same. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai

Re: [PATCH 0/4] drm/mediatek: Small mtk-dpi cleanups

2023-07-13 Thread AngeloGioacchino Del Regno
Il 12/04/23 13:52, AngeloGioacchino Del Regno ha scritto: This is a small cleanup of the mtk-dpi driver, switching it to devm variants where possible and where it made sense, and reducing lines while retaining and improving human readability. AngeloGioacchino Del Regno (4): drm/mediatek

Re: [PATCH] phy: phy-mtk-dp: Fix an error code in probe()

2023-07-11 Thread AngeloGioacchino Del Regno
Il 11/07/23 08:13, Dan Carpenter ha scritto: Negative -EINVAL was intended instead of positive EINVAL. Fixes: 6a23afad443a ("phy: phy-mtk-dp: Add driver for DP phy") Signed-off-by: Dan Carpenter Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH v3 2/2] drm/mediatek: Fix iommu fault during crtc enabling

2023-07-10 Thread AngeloGioacchino Del Regno
river for Mediatek SoC MT8173.") Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_cr

Re: [PATCH v2 2/2] drm/mediatek: Fix iommu fault during crtc enabling

2023-07-10 Thread AngeloGioacchino Del Regno
Il 09/07/23 18:26, Jason-JH.Lin ha scritto: OVL layer should not be enabled before crtc is enabled. The plane_state of drm_atomic_state is not sync to the plane_state stored in mtk_crtc during crtc enabling, so just set all planes to disabled. Please add the relevant Fixes tag and resend.

Re: [PATCH v2 1/2] drm/mediatek: Fix iommu fault by swapping FBs after updating plane state

2023-07-10 Thread AngeloGioacchino Del Regno
(), to avoid using the old FB which could be freed. Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update") Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH v4 0/9] MediaTek DisplayPort: support eDP and aux-bus

2023-07-10 Thread AngeloGioacchino Del Regno
Il 07/07/23 10:23, Chen-Yu Tsai ha scritto: On Thu, Jul 6, 2023 at 8:30 PM AngeloGioacchino Del Regno wrote: Changes in v4: - Set data lanes to idle to prevent stalls if bootloader didn't properly close the eDP port - Now using the .done_probing() callback for AUX bus to prevent

Re: [PATCH] drm/mediatek: Fix potential memory leak if vmap() fail

2023-07-06 Thread AngeloGioacchino Del Regno
Il 26/06/23 20:58, Sui Jingfeng ha scritto: Also return -ENOMEM if such a failure happens, the implement should take responsibility for the error handling. Signed-off-by: Sui Jingfeng This commit needs a Fixes tag. Please add the relevant one and resend. Thanks, Angelo ---

[PATCH v4 9/9] drm/mediatek: dp: Add support for embedded DisplayPort aux-bus

2023-07-06 Thread AngeloGioacchino Del Regno
arated aux-bus, it was necessary to add an exclusion for the cable_plugged_in check in `mtk_dp_aux_transfer()` and the easiest way to do this is to simply ignore checking that when the bridge type is eDP. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk

[PATCH v4 2/9] drm/mediatek: dp: Move AUX and panel poweron/off sequence to function

2023-07-06 Thread AngeloGioacchino Del Regno
or not, it takes the same time and anyway the DP hardware won't produce any error (or, if it does, it's ignorable because it won't block further commands) - Second, training the link between a sleeping/standby/unpowered display makes little sense. Signed-off-by: AngeloGioacchino Del Regno

[PATCH v4 7/9] drm/mediatek: dp: Use devm variant of drm_bridge_add()

2023-07-06 Thread AngeloGioacchino Del Regno
In preparation for adding support for aux-bus, which will add a code path that may fail after the drm_bridge_add() call, change that to devm_drm_bridge_add() to simplify failure paths later. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek

[PATCH v4 6/9] drm/mediatek: dp: Enable event interrupt only when bridge attached

2023-07-06 Thread AngeloGioacchino Del Regno
remains unpowered until resources are made available. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm

[PATCH v4 4/9] drm/mediatek: dp: Always set cable_plugged_in at resume for eDP panel

2023-07-06 Thread AngeloGioacchino Del Regno
eDP panels are not removable: at PM resume, the cable will obviously still be plugged in. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers

[PATCH v4 8/9] drm/mediatek: dp: Move AUX_P0 setting to mtk_dp_initialize_aux_settings()

2023-07-06 Thread AngeloGioacchino Del Regno
Move the register write to MTK_DP_AUX_P0_3690 to set the AUX reply mode to function mtk_dp_initialize_aux_settings(), as this is effectively part of the DPTX AUX setup sequence. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 9

[PATCH v4 5/9] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer()

2023-07-06 Thread AngeloGioacchino Del Regno
potentially start happening in a later commit implementing aux-bus support, as AUX transfers will be triggered from the panel driver (for EDID) before the mtk-dp bridge gets attached, and it's done in preparation for the same. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai

[PATCH v4 3/9] drm/mediatek: dp: Always return connected status for eDP in .detect()

2023-07-06 Thread AngeloGioacchino Del Regno
If this is an eDP panel it's not removable, hence it's always connected: as a shortcut, always return connector_status_connected in the .detect() callback for eDP connector, avoiding a poweron, a check for sink count and a poweroff. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu

[PATCH v4 0/9] MediaTek DisplayPort: support eDP and aux-bus

2023-07-06 Thread AngeloGioacchino Del Regno
port { panel_in: endpoint { remote-endpoint = <_out>; }; }; }; }; }; AngeloGioacchino Del Regno (9): drm/mediatek: dp: Cache EDID for eDP panel drm/mediatek: dp: Move AUX and panel poweron/off sequence to function drm/m

[PATCH v4 1/9] drm/mediatek: dp: Cache EDID for eDP panel

2023-07-06 Thread AngeloGioacchino Del Regno
k training. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Tested-by: Chen-Yu Tsai --- drivers/gpu/drm/mediatek/mtk_dp.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_

Re: [PATCH v2,2/2] drm/mediatek: dp: Add the audio control to mtk_dp_data struct

2023-07-06 Thread AngeloGioacchino Del Regno
Il 06/07/23 04:14, Shuijing Li ha scritto: Mainly add the following two flag: 1.The audio packet arrangement function is to only arrange audio packets into the Hblanking area. In order to align with the HW default setting of g1200, this function needs to be turned off. 2.Due to the difference

Re: [PATCH v2, 1/2] dt-bindings: display: mediatek: dp: Add compatible for MediaTek MT8188

2023-07-06 Thread AngeloGioacchino Del Regno
Il 06/07/23 04:14, Shuijing Li ha scritto: Add dt-binding documentation of dp-tx for MediaTek MT8188 SoC. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi Reviewed-by: AngeloGioacchino Del Regno

[PATCH v2 2/3] drm/mediatek: Use dev_err_probe() in probe functions

2023-07-05 Thread AngeloGioacchino Del Regno
Convert all instances of dev_err() -> return to dev_err_probe() and where it makes sense to, change instances of `return ret` at the end of probe functions to `return 0`, as errors are returned earlier. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Reviewed-by: CK

[PATCH v2 1/3] drm/mediatek: Use devm_platform_ioremap_resource()

2023-07-05 Thread AngeloGioacchino Del Regno
a dev_dbg() in mtk_hdmi_ddc.c that was printing the iospace start/end. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_cec.c| 3 +-- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_ccorr.c

[PATCH v2 3/3] drm/mediatek: Use devm variant for pm_runtime_enable() when possible

2023-07-05 Thread AngeloGioacchino Del Regno
Simplify the error path of return functions and drop the call to pm_runtime_disable() in remove functions by switching to devm_pm_runtime_enable() where possible. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek

[PATCH v2 0/3] drm/mediatek: General cleanups

2023-07-05 Thread AngeloGioacchino Del Regno
devm_platform_get_and_ioremap_resource() to dropping struct resource pointer with using devm_platform_ioremap_resource() AngeloGioacchino Del Regno (3): drm/mediatek: Use devm_platform_ioremap_resource() drm/mediatek: Use dev_err_probe() in probe functions drm/mediatek: Use devm variant for pm_runtime_enable() when

Re: [v4, PATCH] drm/mediatek: add dma buffer control for drm plane disable

2023-07-04 Thread AngeloGioacchino Del Regno
Il 04/07/23 11:04, Yongqiang Niu ha scritto: dma buffer release before overlay disable, that will cause m4u translation fault warning. add dma buffer control flow in mediatek driver: get dma buffer when drm plane disable put dma buffer when overlay really disable Fixes: 41016fe1028e4 ("drm:

[PATCH 3/3] drm/mediatek: Move CMDQ setup to mtk_drm_cmdq_init() function

2023-06-23 Thread AngeloGioacchino Del Regno
In order to enhance human readability, separating the optional CMDQ mailbox initialization from the rest of the CRTC creation machinery, move it to a new mtk_drm_cmdq_init() function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 83

[PATCH 2/3] drm/mediatek: Remove all preprocessor ifs for CONFIG_MTK_CMDQ

2023-06-23 Thread AngeloGioacchino Del Regno
all instances of `#if IS_REACHABLE(CONFIG_MTK_CMDQ)` from all drivers in drm/mediatek. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 2 -- drivers/gpu/drm/mediatek/mtk_disp_ccorr.c | 2 -- drivers/gpu/drm/mediatek/mtk_disp_color.c | 2

[PATCH 1/3] drm/mediatek: Dynamically allocate CMDQ and use helper functions

2023-06-23 Thread AngeloGioacchino Del Regno
to pass (in this case) a mtk_crtc handle to the ddp_cmdq_cb() mailbox RX callback function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 107 +++- include/linux/soc/mediatek/mtk-cmdq.h | 1 + 2 files changed, 32 insertions(+), 76

[PATCH 0/3] MediaTek DRM: Clean up CMDQ support and ifdefs

2023-06-23 Thread AngeloGioacchino Del Regno
] and [2]. [1]: https://lore.kernel.org/lkml/20230524093412.92211-1-angelogioacchino.delre...@collabora.com [2]: https://lore.kernel.org/lkml/20230608084727.74403-1-angelogioacchino.delre...@collabora.com AngeloGioacchino Del Regno (3): drm/mediatek: Dynamically allocate CMDQ and use helper functions

Re: [PATCH] drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling

2023-06-23 Thread AngeloGioacchino Del Regno
Il 23/05/23 12:42, AngeloGioacchino Del Regno ha scritto: Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the later calculation

Re: [PATCH v2 4/4] drm/mediatek: Fix dereference before null check

2023-06-14 Thread AngeloGioacchino Del Regno
-off-by: Jason-JH.Lin Fixes: 5ddb0bd4ddc3 ("drm/atomic: Pass the full state to planes async atomic check and update") Fixes before S-o-b... Reviewed-by: AngeloGioacchino Del Regno

Re: [PATCH v2 3/4] drm/mediatek: Add casting before assign

2023-06-14 Thread AngeloGioacchino Del Regno
Il 13/06/23 13:32, Jason-JH.Lin ha scritto: 1. Add casting before assign to avoid the unintentional integer overflow or unintended sign extension. 2. Add a int varriable for multiplier calculation instead of calculating different types multiplier with dma_addr_t varriable directly.

Re: [PATCH v2 1/4] drm/mediatek: Remove freeing not dynamic allocated memory

2023-06-14 Thread AngeloGioacchino Del Regno
fore your S-o-b tag. Anyway, Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index d40142842f85.

Re: [PATCH v2 2/4] drm/mediatek: Add cnt checking for coverity issue

2023-06-14 Thread AngeloGioacchino Del Regno
terminator. So change cnt to unsigned int and check its max value. Signed-off-by: Jason-JH.Lin Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support") Fixes tag goes before your S-o-b tag. Anyway, Reviewed-by: AngeloGioacchino Del Regno --- d

Re: [PATCH v6 00/11] MediaTek DDP GAMMA - 12-bit LUT support

2023-06-14 Thread AngeloGioacchino Del Regno
Il 12/06/23 11:01, AngeloGioacchino Del Regno ha scritto: Changes in v6: - Fixed smatch warning in patch 11/11, ref.: https://lore.kernel.org/all/202306101458.lrxhee0z-...@intel.com/ This series is fully ready. CK, can we get this one and the mtk-dp series [1] in -next for this cycle

Re: [PATCH] drm/bridge: ps8640: Drop the ability of ps8640 to fetch the EDID

2023-06-14 Thread AngeloGioacchino Del Regno
Il 13/06/23 01:32, Douglas Anderson ha scritto: In order to read the EDID from an eDP panel, you not only need to power on the bridge chip itself but also the panel. In the ps8640 driver, this was made to work by having the bridge chip manually power the panel on by calling pre_enable() on

[PATCH v6 11/11] drm/mediatek: gamma: Program gamma LUT type for descending or rising

2023-06-12 Thread AngeloGioacchino Del Regno
All of the SoCs that don't have dithering control in the gamma IP have got a GAMMA_LUT_TYPE bit that tells to the IP if the LUT is "descending" (bit set) or "rising" (bit cleared): make sure to set it correctly after programming the LUT. Signed-off-by: AngeloGioacchino

[PATCH v6 05/11] drm/mediatek: gamma: Enable the Gamma LUT table only after programming

2023-06-12 Thread AngeloGioacchino Del Regno
all of the writes to make use of CMDQ instead of cpu writes and that's not trivial. For this reason, this patch only moves the LUT enable. The CMDQ rework will come at a later time. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c

[PATCH v6 09/11] drm/mediatek: gamma: Add support for 12-bit LUT and MT8195

2023-06-12 Thread AngeloGioacchino Del Regno
Add support for 12-bit gamma lookup tables and introduce the first user for it: MT8195. While at it, also reorder the variables in mtk_gamma_set_common() and rename `lut_base` to `lut0_base` to improve readability. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin

[PATCH v6 07/11] drm/mediatek: gamma: Support specifying number of bits per LUT component

2023-06-12 Thread AngeloGioacchino Del Regno
Del Regno Reviewed-by: Jason-JH.Lin --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index f4bf5b37992c..407fb0264b80 100644

[PATCH v6 02/11] drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common()

2023-06-12 Thread AngeloGioacchino Del Regno
Invert the check for state->gamma_lut and move it at the beginning of the function to reduce indentation: this prepares the code for keeping readability on later additions. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.

[PATCH v6 06/11] drm/mediatek: gamma: Use bitfield macros

2023-06-12 Thread AngeloGioacchino Del Regno
Make the code more robust and improve readability by using bitfield macros instead of open coding bit operations. While at it, also add a definition for LUT_BITS_DEFAULT. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 41

[PATCH v6 03/11] drm/mediatek: gamma: Support SoC specific LUT size

2023-06-12 Thread AngeloGioacchino Del Regno
Newer SoCs support a bigger Gamma LUT table: wire up a callback to retrieve the correct LUT size for each different Gamma IP. Co-developed-by: Jason-JH.Lin Signed-off-by: Jason-JH.Lin [Angelo: Rewritten commit message/description + porting] Signed-off-by: AngeloGioacchino Del Regno Reviewed

[PATCH v6 08/11] drm/mediatek: gamma: Support multi-bank gamma LUT

2023-06-12 Thread AngeloGioacchino Del Regno
] Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 74 ++- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index 407fb0264b80

[PATCH v6 10/11] drm/mediatek: gamma: Make sure relay mode is disabled

2023-06-12 Thread AngeloGioacchino Del Regno
Disable relay mode at the end of LUT programming to make sure that the processed image goes through. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm

[PATCH v6 04/11] drm/mediatek: gamma: Improve and simplify HW LUT calculation

2023-06-12 Thread AngeloGioacchino Del Regno
the subtractions on the 16-bits values and doing the 10 bits conversion later. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jason-JH.Lin --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 30 +++ 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v6 01/11] drm/mediatek: gamma: Adjust mtk_drm_gamma_set_common parameters

2023-06-12 Thread AngeloGioacchino Del Regno
From: "Jason-JH.Lin" Adjust the parameters in mtk_drm_gamma_set_common() - add (struct device *dev) to get lut_diff from gamma's driver data - remove (bool lut_diff) and use false as default value in the function Signed-off-by: Jason-JH.Lin Signed-off-by: AngeloGioacchino

[PATCH v6 00/11] MediaTek DDP GAMMA - 12-bit LUT support

2023-06-12 Thread AngeloGioacchino Del Regno
: * MT6795, MT8192, MT8173: No regression, works fine. * MT8195: Color correction is finally working! AngeloGioacchino Del Regno (10): drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common() drm/mediatek: gamma: Support SoC specific LUT size drm/mediatek: gamma: Improve and simplify HW

Re: [RESEND 05/15] drm/mediatek/mtk_disp_ccorr: Remove half completed incorrect struct header

2023-06-09 Thread AngeloGioacchino Del Regno
in 'mtk_disp_ccorr' Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org Cc: linux-media...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Lee Jones Reviewed

Re: [RESEND 04/15] drm/mediatek/mtk_disp_aal: Remove half completed incorrect struct header

2023-06-09 Thread AngeloGioacchino Del Regno
: Chun-Kuang Hu Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org Cc: linux-media...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Lee Jones Reviewed-by: AngeloGioacchino

[PATCH 3/3] drm/mediatek: Use devm variant for pm_runtime_enable() when possible

2023-06-08 Thread AngeloGioacchino Del Regno
Simplify the error path of return functions and drop the call to pm_runtime_disable() in remove functions by switching to devm_pm_runtime_enable() where possible. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 9 - drivers/gpu/drm

[PATCH 2/3] drm/mediatek: Use dev_err_probe() in probe functions

2023-06-08 Thread AngeloGioacchino Del Regno
Convert all instances of dev_err() -> return to dev_err_probe() and where it makes sense to, change instances of `return ret` at the end of probe functions to `return 0`, as errors are returned earlier. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_ce

[PATCH 1/3] drm/mediatek: Use devm_platform_get_and_ioremap_resource()

2023-06-08 Thread AngeloGioacchino Del Regno
Instead of open coding calls to platform_get_resource() followed by devm_ioremap_resource(), perform a single call to the helper devm_platform_get_and_ioremap_resource(). This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_cec.c

[PATCH 0/3] drm/mediatek: General cleanups

2023-06-08 Thread AngeloGioacchino Del Regno
This series performs some cleanups in drm/mediatek; specifically, changes it to use devm_platform_get_and_ioremap_resource(), dev_err_probe() and devm_pm_runtime_enable, hence harmonizing log formats and removing some unneeded lines of code. AngeloGioacchino Del Regno (3): drm/mediatek: Use

Re: [PATCH] drm/panel-edp: Add AUO B116XAB01.4 edp panel entry

2023-06-07 Thread AngeloGioacchino Del Regno
Il 07/06/23 12:21, Laura Nao ha scritto: Add a panel entry for the AUO B116XAB01.4 edp panel, found in the Acer Chromebook Spin 311 (CP311-3H) laptop. Signed-off-by: Laura Nao Reviewed-by: AngeloGioacchino Del Regno

[PATCH v5 11/11] drm/mediatek: gamma: Program gamma LUT type for descending or rising

2023-06-01 Thread AngeloGioacchino Del Regno
All of the SoCs that don't have dithering control in the gamma IP have got a GAMMA_LUT_TYPE bit that tells to the IP if the LUT is "descending" (bit set) or "rising" (bit cleared): make sure to set it correctly after programming the LUT. Signed-off-by: AngeloGioacchino

<    2   3   4   5   6   7   8   9   10   11   >