"README.md" did not exist on "fd9dc809f2a84199a3457fee0c1b72792e3e1660"
- Feb 06, 2025
-
-
AngeloGioacchino Del Regno authored
Now that all of the mmsys routing tables have been fixed, migrate all of them to use the MMSYS_ROUTE() macro: this will make sure that future additions to any of the tables for the currently supported SoCs are compile-time sanity checked, greatly reducing room for (way too common) mistakes. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The mmsys driver reads the routing table and writes to the hardware `val & mask`, but multiple entries in the mmsys routing table for the MT8365 SoC are setting a 0x0 mask: this effectively writes .. nothing .. to the hardware. That would never work, and if the display controller was actually working with the mmsys doing no routing at all, that was only because the bootloader was correctly setting the display controller routing registers before booting the kernel, and the mmsys was never reset. Make this table to actually set the routing by adding the correct register masks to it. While at it, also change MOUT val definitions to BIT(x), as the MOUT registers are effectively checking for each bit to enable output to the corresponding HW. Please note that, for this SoC, only the MOUT registers are checking bits (as those can enable multiple outputs), while the others are purely reading a number to select an input. Fixes: bc3fc5c0 ("soc: mediatek: mmsys: add MT8365 support") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The mmsys routing table for this SoC was effectively missing initialization of the val variable of struct mtk_mmsys_routes: this means that `val` was incorrectly initialized to zero, hence the registers were wrongly initialized. Add the required regval to all of the entries of the routing table for this SoC to fix display controller functionality. Fixes: 060f7875 ("soc: mediatek: mmsys: Add support for MT8167 SoC") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
- Feb 04, 2025
-
-
AngeloGioacchino Del Regno authored
During probe, the TCPC alert interrupts are getting masked to avoid unwanted interrupts during chip setup: this is ok to do but there is no unmasking happening at any later time, which means that the chip will not raise any interrupt, essentially making it not functional as, while internally it does perform all of the intended functions, it won't signal anything to the outside. Unmask the alert interrupts to fix functionality. Fixes: ce08eaeb ("staging: typec: rt1711h typec chip driver") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add routing paths to support Display Stream Compression on the VDOSYS0 pipelines ending with DSI or DisplayPort (DP_INTF). Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
MT8188 uses DPI1 to output to the HDMI controller: add the Start of Frame and End of Frame configuration for the DPI1 IP to the tables to unblock generation and sending of these signals to the GCE. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add the MediaTek CEC v2 Controller driver, found in SoCs equipped with the HDMIv2 Controller IP, like MT8195 and MT8188. In the MT8195 SoC the (single) CEC Controller is shared between the HDMI-TX and the HDMI-RX controllers, while in MT8188 this is used only for HDMI-TX (as there is no receiver in the latter). Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add a missing clock found in the VDO1 controller for the HDMI TX controller over DPI1. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The str_read_write() helper function is defined in the missing string_choices.h header: include it to resolve build failures. Fixes: f2c77f6e ("iommu/arm-smmu-v3: Use str_read_write helper w/ logs") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
- Jan 16, 2025
-
-
AngeloGioacchino Del Regno authored
Add a driver for the Himax HX8279-D MIPI-DSI DriverIC with support for the Startek KX070FHFID078 7.0" 1200x1920 IPS panel, found on various MediaTek Genio Evaluation Kit boards. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Cristian Ciocaltea authored
drm_atomic_helper_connector_hdmi_check() helper makes use of connector_state_get_mode() to obtain a drm_display_mode pointer, but it doesn't validate it, which may lead to a NULL pointer dereference in some cases, i.e. unloading a DRM module: [ 1002.910414] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [...] [ 1002.923833] Hardware name: Radxa ROCK 5B (DT) [ 1002.924819] pc : drm_match_cea_mode+0x30/0x280 [drm] [ 1002.925318] lr : hdmi_try_format_bpc+0x7c/0x580 [drm_display_helper] [...] [ 1002.932411] Call trace: [ 1002.932626] drm_match_cea_mode+0x30/0x280 [drm] (P) [ 1002.933120] hdmi_try_format_bpc+0x7c/0x580 [drm_display_helper] [ 1002.933662] drm_atomic_helper_connector_hdmi_check+0x10c/0x478 [drm_display_helper] [ 1002.934355] drm_bridge_connector_atomic_check+0x20/0x40 [drm_display_helper] [ 1002.934993] drm_atomic_helper_check_modeset+0x698/0xd28 [drm_kms_helper] [ 1002.935607] drm_atomic_helper_check+0x28/0xb8 [drm_kms_helper] [ 1002.936143] drm_atomic_check_only+0x794/0x988 [drm] [ 1002.936635] drm_atomic_commit+0x60/0xe0 [drm] [ 1002.937082] drm_atomic_helper_disable_all+0x184/0x218 [drm_kms_helper] [ 1002.937678] drm_atomic_helper_shutdown+0x90/0x150 [drm_kms_helper] [ 1002.938243] rockchip_drm_unbind+0x38/0x80 [rockchipdrm] [ 1002.938720] component_master_del+0xac/0xf8 [ 1002.939089] rockchip_drm_platform_remove+0x34/0x78 [rockchipdrm] [...] Add the missing NULL check before passing the mode pointer further. Fixes: f035f409 ("drm/connector: hdmi: Calculate TMDS character rate") Reviewed-by:
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by:
Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
-
- Jan 15, 2025
-
-
AngeloGioacchino Del Regno authored
Change the initialization data in the arrays of structure mtk_mmsys_routes to make use of the MMSYS_ROUTE() macro: this will make sure that each array entry's SEL value fits in its corresponding register mask with a compile time check. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Every MediaTek SoC with multimedia capabilities has an array of structure mtk_mmsys_routes that defines a multimedia connection between hardware components. This connection is activated by writing a (masked) value in each specific register, and the association between from->to path and value to write is expressed as an entry in that array. Failing to set the right path does not give any meaningful error and makes things to simply not work as the data will either not be retrieved from the right input port, or will be written to the wrong output port (or both): since a misconfiguration may effectively still be a possibly correct configuration at the HW level, this may be only giving side effects in terms of simply getting no functionality but, again, no errors. In order to reduce room for mistakes in declarations of the mmsys routes, add a macro that compile-time checks that the provided value does at least fit in the register mask. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
- Jan 14, 2025
-
-
AngeloGioacchino Del Regno authored
The VDO1_MERGE4 hardware (merge5 software component) should be set to enable output to DPI1_SEL by setting BIT(2) but, despite the intention being exactly that, this won't work because the declared register mask is wrong as it is set as GENMASK(1, 0). Register MERGE4_MOUT_EN in VDO1 has four used bits [3, 0] so fix the mask to reflect that. That, in turn, allows the mmsys driver to actually set BIT(2) in this register, fixing the MERGE4 output to DPI1 selection. Fixes: c0349314 ("soc: mediatek: Support MT8188 VDOSYS1 in mtk-mmsys") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Implement the Automated Built-In Self-Test ABIST functionality provided by the HDMIv2 IP and expose it through the "hdmi_abist" debugfs file. Write "1" to this file to activate ABIST, or "0" to deactivate. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add an interlace_allowed bool member to struct mtk_hdmi_ver_conf which will be used to signal whether interlaced modes are supported by the bridge (in our case, the HDMI IP), and enable it for HDMIv2. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add support for the newer HDMI-TX (Encoder) v2 and DDC v2 IPs found in MediaTek's MT8195, MT8188 SoC and their variants, and including support for display modes up to 4k60 and for HDMI Audio, as per the HDMI 2.0 spec. HDCP and CEC functionalities are also supported by this hardware, but are not included in this commit and that also poses a slight difference between the V2 and V1 controllers in how they handle Hotplug Detection (HPD). While the v1 controller was using the CEC controller to check HDMI cable connection and disconnection, in this driver the v2 one does not. This is due to the fact that on parts with v2 designs, like the MT8195 SoC, there is one CEC controller shared between the HDMI Transmitter (HDMI-TX) and Receiver (HDMI-RX): before eventually adding support to use the CEC HW to wake up the HDMI controllers it is necessary to have support for one TX, one RX *and* for both at the same time. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for adding the HDMI TX v2 driver, and to allow a future modernization of the HDMI v1 one, perform changes that enable the usage of the HDMI Helpers provided by DRM. Check if the HDMI driver provides the function pointers to hdmi_{clear,write}_infoframe used by the HDMI Helper API and, if present, add DRM_BRIDGE_OP_HDMI to the drm_bridge ops, enabling the drm API to register the bridge as HDMI and to use the HDMI Helper functions. If the hdmi_{write,clear}_infoframe pointers are not assigned, vendor and product strings and HDMI helpers will not be used, hence this commit brings no functional changes to drivers that have not been refactored to use the new helpers. This also means that, in the current state, there is effectively no functional change to mtk_hdmi and its other components. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for adding the new HDMI TX v2 IP driver, assign the pointer to the DDC adapter to struct drm_bridge during probe. This commit brings no functional changes. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for adding a new driver for the HDMI TX v2 IP, split out the functions that will be common between the already present mtk_hdmi (v1) driver and the new one. Since the probe flow for both drivers is 90% similar, add a common probe function that will be called from each driver's .probe() callback, avoiding lots of code duplication. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting common bits of this driver and for introducing a new version of the MediaTek HDMI Encoder IP, improve the flexibility of function mtk_hdmi_get_all_clk() by adding a pointer to the clock names array and size of it to its parameters. Also change the array of struct clock pointers in the mtk_hdmi structure to be dynamically allocated, and allocate it in probe. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Remove the error print in case of mtk_hdmi_clk_enable_audio() failures: since the APIs will already print on their own, having one in there is redundant. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
If the clk_prepare_enable() call for the SPDIF clock fails, just disable and unprepare the clock in the error check branch and return immediately instead of jumping to the end with a goto, slightly reducing code size. This commit brings no functional changes. Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Since the SIMPLE_DEV_PM_OPS macro and the pm pointer are anyway defined when CONFIG_PM_SLEEP is not set, remove the ifdef for it and indicate that the mtk_hdmi_{remove,suspend} functions may be unused (as they are, in case PM support is not built-in). While at it, to improve readability, also compress the SIMPLE_DEV_PM_OPS declaration as it even fits in less than 80 columns. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Simplify the probe/remove functions by using devm_drm_bridge_add() as now there is no more need to manually remove the bridge. Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for moving the common bits of this driver, merge the contents of mtk_hdmi_output_init in mtk_hdmi_register_audio_driver function to aggregate all of the initial audio setup together in the same function and to make it clear that all of the setup that is performed in mtk_hdmi_output_init is specifically related only to audio and not video. While at it, also remove the "%s driver bound to HDMI" debugging print disguised as informative. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The hdmi_colorspace csp member of struct mtk_hdmi is initialized once but then it's never used at all. Remove said member and the only assignment to it as a cleanup. Also remove the ibias, ibias_up, min_clock, max_clock, min_hdisplay and max_vdisplay members, as those were really completely unused. This commit brings no functional changes. Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Move the CEC device parsing logic to a new function called mtk_hdmi_get_cec_dev(), and move the parsing action to the end of mtk_hdmi_dt_parse_pdata(), allowing to remove gotos in this function, reducing code size and improving readability. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Change error prints to use dev_err_probe() instead of dev_err() where possible in function mtk_hdmi_dt_parse_pdata(), used only during device probe. While at it, also beautify some prints. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Move the vendor and product strings to the appropriate entries of struct drm_bridge and use that in mtk_hdmi_setup_spd_infoframe instead of having the same as function parameters. While at it, also beautify the strings, setting them to read "MediaTek On-Chip HDMI". Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting common bits of this driver, moving the hdmi_rec_n_table struct array, and the hdmi_recommended_n(), hdmi_mode_clock_to_hz(), hdmi_expected_cts() functions, add one function called mtk_hdmi_get_ncts() that sets both N and CTS in a single call. Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting common bits of this driver, move the mutex-protected cable plugged callback and codec device setting to a new function called mtk_hdmi_audio_set_plugged_cb(). Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting common bits of this driver, move the audio params (codec, sample rate/size, input type, i2s format, etc) selection to a new function called mtk_hdmi_audio_params(). While at it, also rename "hdmi_params" to "aud_params" both to match the mtk_hdmi struct member name and to clarify that those parameters are for HDMI Audio and not for HDMI Video configuration. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
As a cleanup, and in preparation for splitting common bits of this driver, disgregate the code in function mtk_hdmi_audio_set_param() to the beginning and end of function mtk_hdmi_audio_hw_params(). In a later commit, the hw_params callback function will also be disgregated so that the code will get two functions: one that performs the generic hdmi_audio_param copy, and one that performs IP specific setup, both of which will be called in the callback, allowing all of the non IP version specific code to get moved in a common file. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Rename member aud_sampe_size of struct hdmi_audio_param to aud_sample_size to fix a typo and enhance readability. This commit brings no functional changes. Fixes: 8f83f268 ("drm/mediatek: Add HDMI support") Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Guillaume Ranquet authored
In preparation for the addition of a new version of the HDMI IP which will need to share its iospace between multiple subdrivers, and in preparation for moving out the common bits between the two, migrate this driver to fully use regmap. Signed-off-by:
Guillaume Ranquet <granquet@baylibre.com> Reviewed-by:
CK Hu <ck.hu@mediatek.com> Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The probe function of this driver may fail after registering the audio platform device: in that case, the state is not getting cleaned up, leaving this device registered. Adding up to the mix, should the probe function of this driver return a probe deferral for N times, we're registering up to N audio platform devices and, again, never freeing them up. To fix this, add a pointer to the audio platform device in the mtk_hdmi structure, and add a devm action to unregister it upon driver removal or probe failure. Fixes: 8f83f268 ("drm/mediatek: Add HDMI support") Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Now that all of the mtk_hdmi subdrivers are a platform driver on their own it is possible to remove the custom init/exit functions in this driver and just use the module_platform_driver() macro. While at it, also compress struct of_device_id entries and remove stray commas in mtk_hdmi_driver assignments. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting out the common bits from the HDMI driver, change the mtk_cec driver from being registered from the HDMI driver itself to be a module_platform_driver of its own. With this change, there are no more users of the mtk_hdmi.h header so, while at it, also remove it. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
In preparation for splitting out the common bits from the HDMI driver, change the mtk_cec driver from being registered from the HDMI driver itself to be a module_platform_driver of its own. Signed-off-by:
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-