[PATCH v8 02/13] drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common()

2023-08-01 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.Lin Revie

[PATCH v8 01/13] drm/mediatek: gamma: Adjust mtk_drm_gamma_set_common parameters

2023-08-01 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 v8 00/13] MediaTek DDP GAMMA - 12-bit LUT support

2023-08-01 Thread AngeloGioacchino Del Regno
was tested on MT8195, MT8192, MT8173, MT6795: * MT6795, MT8192, MT8173: No regression, works fine. * MT8195: Color correction is finally working! AngeloGioacchino Del Regno (12): drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common() drm/mediatek: gamma: Support SoC specific LUT size

[PATCH v7 10/13] drm/mediatek: gamma: Make sure relay mode is disabled

2023-07-31 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 Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 1 file changed, 4 insertions

[PATCH v7 02/13] drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common()

2023-07-31 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.Lin Revie

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

2023-07-31 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 Reviewed

[PATCH v7 01/13] drm/mediatek: gamma: Adjust mtk_drm_gamma_set_common parameters

2023-07-31 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 v7 13/13] drm/mediatek: gamma: Add kerneldoc for struct mtk_disp_gamma

2023-07-31 Thread AngeloGioacchino Del Regno
The mtk_disp_gamma structure was completely undocumented: add some kerneldoc documentation to it. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek

[PATCH v7 04/13] drm/mediatek: gamma: Improve and simplify HW LUT calculation

2023-07-31 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 Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 30 +++ 1 file changed, 20 insertions(+), 10

[PATCH v7 08/13] drm/mediatek: gamma: Support multi-bank gamma LUT

2023-07-31 Thread AngeloGioacchino Del Regno
] Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat --- 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

[PATCH v7 12/13] drm/mediatek: aal: Rewrite kerneldoc for struct mtk_disp_aal

2023-07-31 Thread AngeloGioacchino Del Regno
The kerneldoc for struct mtk_disp_aal was entirely wrong: rewrite it to actually document the structure. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_disp_aal.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek

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

2023-07-31 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 v7 07/13] drm/mediatek: gamma: Support specifying number of bits per LUT component

2023-07-31 Thread AngeloGioacchino Del Regno
Del Regno Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat --- 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

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

2023-07-31 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 Reviewed-by: Alexandre Mergnat --- drivers

[PATCH v7 03/13] drm/mediatek: gamma: Support SoC specific LUT size

2023-07-31 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 v7 06/13] drm/mediatek: gamma: Use bitfield macros

2023-07-31 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 Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm

[PATCH v7 00/13] MediaTek DDP GAMMA - 12-bit LUT support

2023-07-31 Thread AngeloGioacchino Del Regno
is finally working! AngeloGioacchino Del Regno (12): 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 LUT calculation drm/mediatek: gamma: Enable the Gamma LUT table only after

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

2023-07-31 Thread AngeloGioacchino Del Regno
Il 31/07/23 12:40, AngeloGioacchino Del Regno ha scritto: Il 31/07/23 09:49, CK Hu (胡俊光) ha scritto: Hi, Angelo: On Thu, 2023-07-27 at 11:46 +0200, AngeloGioacchino Del Regno wrote: Newer SoCs support a bigger Gamma LUT table: wire up a callback to retrieve the correct LUT size for each

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

2023-07-31 Thread AngeloGioacchino Del Regno
Il 31/07/23 09:49, CK Hu (胡俊光) ha scritto: Hi, Angelo: On Thu, 2023-07-27 at 11:46 +0200, AngeloGioacchino Del Regno wrote: 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

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

2023-07-31 Thread AngeloGioacchino Del Regno
Il 28/07/23 14:58, Alexandre Mergnat ha scritto: Hi Angelo On 27/07/2023 15:06, AngeloGioacchino Del Regno wrote: +/* For 10 bit LUT layout, R/G/B are in the same register */   #define DISP_GAMMA_LUT_10BIT_R    GENMASK(29, 20)   #define DISP_GAMMA_LUT_10BIT_G    GENMASK(19, 10

Re: [PATCH v7 4/4] drm/mediatek: Add DSI support for mt8188 vdosys0

2023-07-28 Thread AngeloGioacchino Del Regno
Il 27/07/23 18:41, Jason-JH.Lin ha scritto: Add DSI as main display output for mt8188 vdosys0. I would split this commit in two: 1. drm/mediatek: dsi: Support dynamic connector selection 2. drm/mediatek: Support DSI on MT8188 VDOSYS0 Where the first one sets up the mtk_dsi driver for

Re: [PATCH v7 2/4] drm/mediatek: Fix using wrong drm private data to bind mediatek-drm

2023-07-28 Thread AngeloGioacchino Del Regno
Gioacchino Del Regno

Re: [PATCH v7 3/4] drm/mediatek: Add ability to support dynamic connector selection

2023-07-28 Thread AngeloGioacchino Del Regno
Il 27/07/23 18:41, Jason-JH.Lin ha scritto: 1. Move output drm connector from each ddp_path array to connector array. 2. Add dynamic select available connector flow in crtc create and enable. Signed-off-by: Nancy Lin Signed-off-by: Nathan Lu Signed-off-by: Jason-JH.Lin ---

Re: [PATCH v7 1/4] drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data

2023-07-28 Thread AngeloGioacchino Del Regno
Il 27/07/23 18:41, Jason-JH.Lin ha scritto: Add missing mmsys_dev_num to mt8188 vdosys0 driver data. Fixes: 54b48080278a ("drm/mediatek: Add mediatek-drm of vdosys0 support for mt8188") Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno

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

2023-07-27 Thread AngeloGioacchino Del Regno
Il 27/07/23 13:03, Alexandre Mergnat ha scritto: Hi Angelo ! On 27/07/2023 11:46, AngeloGioacchino Del Regno wrote: 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

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

2023-07-27 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 RESEND v6 11/11] drm/mediatek: gamma: Program gamma LUT type for descending or rising

2023-07-27 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 RESEND v6 09/11] drm/mediatek: gamma: Add support for 12-bit LUT and MT8195

2023-07-27 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 RESEND v6 10/11] drm/mediatek: gamma: Make sure relay mode is disabled

2023-07-27 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 RESEND v6 04/11] drm/mediatek: gamma: Improve and simplify HW LUT calculation

2023-07-27 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 RESEND v6 07/11] drm/mediatek: gamma: Support specifying number of bits per LUT component

2023-07-27 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 RESEND v6 02/11] drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common()

2023-07-27 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 RESEND v6 06/11] drm/mediatek: gamma: Use bitfield macros

2023-07-27 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 RESEND v6 05/11] drm/mediatek: gamma: Enable the Gamma LUT table only after programming

2023-07-27 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 RESEND v6 03/11] drm/mediatek: gamma: Support SoC specific LUT size

2023-07-27 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 RESEND v6 01/11] drm/mediatek: gamma: Adjust mtk_drm_gamma_set_common parameters

2023-07-27 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 RESEND v6 00/11] MediaTek DDP GAMMA - 12-bit LUT support

2023-07-27 Thread AngeloGioacchino Del Regno
on MT8195, MT8192, MT8173, MT6795: * 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

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

2023-07-27 Thread AngeloGioacchino Del Regno
Il 26/07/23 21:44, Justin Green ha scritto: Would it make more sense to commmonize function mtk_plane_format_mod_supported() and call that one here instead? I had considered that, but mtk_plane_format_mod_supported() is required to take a drm_plane as a parameter in order to conform to the type

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

2023-07-27 Thread AngeloGioacchino Del Regno
Alexandre Mergnat Signed-off-by: Sui Jingfeng Reviewed-by: AngeloGioacchino Del Regno

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

2023-07-26 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 Reviewed-by: Fei Shao Reviewed-by: CK Hu --- drivers/gpu/drm

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

2023-07-26 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 Reviewed-by: Fei Shao Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dpi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

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

2023-07-26 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 | 8

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

2023-07-26 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 Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dpi.c | 44 ++ 1 file changed, 14 insertions(+), 30

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

2023-07-26 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 Reviewed-by: Fei Shao Reviewed-by: CK Hu --- drivers/gpu/drm

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

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

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

2023-07-26 Thread AngeloGioacchino Del Regno
and where it made sense, and reducing lines while retaining and improving human readability. AngeloGioacchino Del Regno (6): drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() drm/mediatek: mtk_dpi: Simplify with dev_err_probe() drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge() drm

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

2023-07-25 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 Tested-by: Chen-Yu Tsai Reviewed-by: Alexandre Mergnat --- drivers

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

2023-07-25 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 Reviewed

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

2023-07-25 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 Tested-by: Chen-Yu

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

2023-07-25 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 Reviewed-by: CK Hu Reviewed-by: Alexandre Mergnat

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

2023-07-25 Thread AngeloGioacchino Del Regno
-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu --- 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

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

2023-07-25 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 Tested-by: Chen-Yu Tsai Reviewed-by: Alexand

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

2023-07-25 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 Tested-by: Chen-Yu Tsai

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

2023-07-25 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 Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions

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

2023-07-25 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 Reviewed-by: CK Hu Reviewed

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

2023-07-25 Thread AngeloGioacchino Del Regno
iatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai Reviewed-by: Alexandre Mergnat --- drivers/gpu/drm/mediatek/mtk_dp.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/dr

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

2023-07-25 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 v7 00/11] MediaTek DisplayPort: support eDP and aux-bus

2023-07-25 Thread AngeloGioacchino Del Regno
}; }; aux-bus { panel: panel { compatible = "edp-panel"; power-supply = <_disp_x>; backlight = <_lcd0>; port { panel_in: endpoint

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

2023-07-25 Thread AngeloGioacchino Del Regno
Il 25/07/23 08:37, CK Hu (胡俊光) ha scritto: Hi, Angelo: On Mon, 2023-07-17 at 16:14 +0200, AngeloGioacchino Del Regno wrote: External email : Please do not click links or open attachments until you have verified the sender or the content. The interrupt handler for HPD is useful only

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

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