- Jun 30, 2021
-
-
Bilal Wasim authored
da9211 regulator needs to be enabled before enabling the mfg_async power domain. Otherwise the subdomain is not enabled and causes failure in imgtec gpu driver boot. Add the "domain-supply" property to the "mfg_async" node in DT. Signed-off-by:
Bilal Wasim <Bilal.Wasim@imgtec.com> Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I9e27871bb700c807a564957302b292e9935dae0b
-
Bilal Wasim authored
The mfg_async power domain in mt8173 is used to power up imgtec gpu. This domain requires the da9211 regulator to be enabled before the power domain can be enabled successfully. Signed-off-by:
Bilal Wasim <Bilal.Wasim@imgtec.com> Reviewed-by:
Hsin-Yi Wang <hsinyi@chromium.org> Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I2e1bf1b589f9138ba6f89791ed9f1e9f3ddd0a5d
-
Bilal Wasim authored
When "bus_prot_reg_update" is true, the driver should use INFRA_TOPAXI_PROTECTEN for both setting and clearing the bus protection. However, the driver does not use this mask for clearing bus protection which causes failure when booting the imgtec gpu. Corrected and tested with mt8173 chromebook. Signed-off-by:
Bilal Wasim <Bilal.Wasim@imgtec.com> Reviewed-by:
Hsin-Yi Wang <hsinyi@chromium.org> Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I27436c29c3bede46dcf86df696f48683662d1ec1
-
Enric Balletbo i Serra authored
The UFOE (data compression engine) component needs to be enabled to have the imgtec gpu driver working. If we don't enable it we see a black screen. Looks like when we switched to use and array for setting the routing registers in commit 44014763 ("soc: mediatek: mmsys: Use an array for setting the routing registers") we missed to add this component in the new routing table, it was present before taht commit, so fix it by adding this component in the mt8173 routing table. Fixes: 44014763 ("soc: mediatek: mmsys: Use an array for setting the routing registers") Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I3a4195aa7927c13de7eb2a1fb05bb58a627b64e4
-
Enric Balletbo i Serra authored
Reset dsi0 HW to default when power on. This prevents to have different settingbetween the bootloader and the kernel. As not all Mediatek boards have the reset consumer configured in their board description, also is not needed on all of them, the reset is optional, so the change is compatible with all boards. Cc: Jitao Shi <jitao.shi@mediatek.com> Suggested-by:
Chun-Kuang Hu <chunkuang.hu@kernel.org> Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: Idbb4727ddf00ba2fe796b630906baff10d994d89
-
Enric Balletbo i Serra authored
Among other features the mmsys driver should implement a reset controller to be able to reset different bits from their space. Cc: Jitao Shi <jitao.shi@mediatek.com> Suggested-by:
Chun-Kuang Hu <chunkuang.hu@kernel.org> Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I15e2419141a69b2e5c7e700c34d92a69df47e04d
-
Enric Balletbo i Serra authored
Reset the DSI hardware is needed to prevent different settings between the bootloader and the kernel. While here, also remove the undocumented and also not used 'mediatek,syscon-dsi' property. Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I933f1532d7a1b2910843a9644c86a7d94a4b44e1
-
Enric Balletbo i Serra authored
Reset the DSI hardware is needed to prevent different settings between the bootloader and the kernel. Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I7bd7d9a8da5e2894711b700a1127e6902a2b2f1d
-
Enric Balletbo i Serra authored
The mmsys system controller exposes a set of memory client resets and needs to specify the #reset-cells property in order to advertise the number of cells needed to describe each of the resets. Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Change-Id: I3f7f1c9a8e46be07d1757ddf4e0097535f3a7d41
-
Enric Balletbo i Serra authored
The DT binding includes for reset controllers are located in include/dt-bindings/reset/. Move the Mediatek reset constants in there. Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Series-to: linux-kernel@vger.kernel.org Series-cc: linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, drinkcat@chromium.org, hsinyi@chromium.org, kernel@collabora.com, eizan@chromium.org, jitao.shi@mediatek.com, chunkuang.hu@kernel.org Cover-letter: Add support to the mmsys driver to be a reset controller Dear all, The following patchset is a reimplementation of the patch sent by Jitao Shi [1] some time ago. As suggested by Chun-Kuang Hu, this time the reset is done using the reset API, where the mmsys driver is the reset controller and the mtk_dsi driver is the reset consumer. Note that the first patch is kind of unrelated change, it's just a cleanup but is needed if you want to apply all the following patches cleanly. This patchset is important in order to have the DSI panel working on some kukui MT8183 Chromebooks (i.e Lenovo IdeaPad Duet). Without it, you just get a black screen. Best regards, Enric [1] https://lore.kernel.org/linux-arm-kernel/20210420132614.150242-4-jitao.shi@mediatek.com/ END Change-Id: I514d9aafff3a062f751b37d3fea7402f67595b86
-
Douglas Anderson authored
The PM Runtime docs specifically call out the need to call pm_runtime_dont_use_autosuspend() in the remove() callback if pm_runtime_use_autosuspend() was called in probe(): > Drivers in ->remove() callback should undo the runtime PM changes done > in ->probe(). Usually this means calling pm_runtime_disable(), > pm_runtime_dont_use_autosuspend() etc. We should do this. This fixes a warning splat that I saw when I was testing out the panel-simple's remove(). Fixes: 3235b0f2 ("drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare") Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210517130450.v7.1.I9e947183e95c9bd067c9c1d51208ac6a96385139@changeid (cherry picked from commit a596fcd9) Change-Id: I681ee71b573aec3c4d1ec323aea516ca591ffe39
-
Douglas Anderson authored
It doesn't make sense to go out to the bus and read the EDID over and over again. Let's cache it and throw away the cache when we turn power off from the panel. Autosuspend means that even if there are several calls to read the EDID before we officially turn the power on then we should get good use out of this cache. Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.18.If050957eaa85cf45b10bcf61e6f7fa61c9750ebf@changeid (cherry picked from commit 63358e24) Change-Id: I0213cc13d58683340c859e1f843a5c264cd9b54b
-
Douglas Anderson authored
I don't believe that it ever makes sense to read the EDID when a panel is not powered and the powering on of the panel is the job of prepare(). Let's make sure that this happens before we try to read the EDID. We use the pm_runtime functions directly rather than directly calling the normal prepare() function because the pm_runtime functions are definitely refcounted whereas it's less clear if the prepare() one is. NOTE: I'm not 100% sure how EDID reading was working for folks in the past, but I can only assume that it was failing on the initial attempt and then working only later. This patch, presumably, will fix that. If some panel out there really can read the EDID without powering up and it's a big advantage to preserve the old behavior we can add a per-panel flag. It appears that providing the DDC bus to the panel in the past was somewhat uncommon in any case. Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.17.Ibd31b8f7c73255d68c5c9f5b611b4bfaa036f727@changeid (cherry picked from commit 31e25395) Change-Id: I9ab8c8de4581b9c25b10f73f1e9b38b528e89218
-
Douglas Anderson authored
As of commit 5186421c ("drm: Introduce epoch counter to drm_connector") the drm_get_edid() function calls drm_connector_update_edid_property() for us. There's no reason for us to call it again. Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.16.Icb581b0273d95cc33ca38676c61ae6d7d2e75357@changeid (cherry picked from commit 4318ea40) Change-Id: I61157042489ad5a421e734599af0c1a273377c26
-
Douglas Anderson authored
When I added support for the hpd-gpio to simple-panel in commit 48834e60 ("drm/panel-simple: Support hpd-gpios for delaying prepare()"), I added a special case to handle a circular dependency I was running into on the ti-sn65dsi86 bridge chip. On my board the hpd-gpio is actually provided by the bridge chip. That was causing some circular dependency problems that I had to work around by getting the hpd-gpio late. I've now reorganized the ti-sn65dsi86 bridge chip driver to be a collection of sub-drivers. Now the GPIO part can probe separately and that breaks the chain. Let's get rid of the old code to clean things up. Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.10.I40eeedc23459d1e3fc96fa6cdad775d88c6e706c@changeid (cherry picked from commit 5c4381ee) Change-Id: I52f87110d61b1e40bf88c436b00a5faba06ea85d
-
Douglas Anderson authored
In commit 3235b0f2 ("drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare") we started using pm_runtime, but my patch neglected to add the proper pm_runtime_disable(). Doh! Add them now. Fixes: 3235b0f2 ("drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare") Reported-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.1.I9e6af2529d6c61e5daf86a15a1211121c5223b9a@changeid (cherry picked from commit 70e12560) Change-Id: Ifdcaa85ada4ad1485f8f5049af0ecd0fd7c3f02a
-
Douglas Anderson authored
Unpreparing and re-preparing a panel can be a really heavy operation. Panels datasheets often specify something on the order of 500ms as the delay you should insert after turning off the panel before turning it on again. In addition, turning on a panel can have delays on the order of 100ms - 200ms before the panel will assert HPD (AKA "panel ready"). The above means that we should avoid turning a panel off if we're going to turn it on again shortly. The above becomes a problem when we want to read the EDID of a panel. The way that ordering works is that userspace wants to read the EDID of the panel _before_ fully enabling it so that it can set the initial mode correctly. However, we can't read the EDID until we power it up. This leads to code that does this dance (like ps8640_bridge_get_edid()): 1. When userspace requests EDID / the panel modes (through an ioctl), we power on the panel just enough to read the EDID and then power it off. 2. Userspace then turns the panel on. There's likely not much time between step #1 and #2 and so we want to avoid powering the panel off and on again between those two steps. Let's use Runtime PM to help us. We'll move the existing prepare() and unprepare() to be runtime resume() and runtime suspend(). Now when we want to prepare() or unprepare() we just increment or decrement the refcount. We'll default to a 1 second autosuspend delay which seems sane given the typical delays we see for panels. A few notes: - It seems the existing unprepare() and prepare() are defined to be no-ops if called extra times. We'll preserve that behavior but may try to remove it in a future patch. - This is a slight change in the ABI of simple panel. If something was absolutely relying on the unprepare() to happen instantly that simply won't be the case anymore. I'm not aware of anyone relying on that behavior, but if there is someone then we'll need to figure out how to enable (or disable) this new delayed behavior selectively. - In order for this to work we now have a hard dependency on "PM". From memory this is a legit thing to assume these days and we don't have to find some fallback to keep working if someone wants to build their system without "PM". Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210416153909.v4.7.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid (cherry picked from commit 3235b0f2) Change-Id: I03831c820941dfd173d14151e068ef4eb8b7cf81
-
Douglas Anderson authored
The drm_bridge_chain_pre_enable() is not the proper opposite of drm_bridge_chain_post_disable(). It continues along the chain to _before_ the starting bridge. Let's fix that. Fixes: 05193dc3 ("drm/bridge: Make the bridge chain a double-linked list") Signed-off-by:
Douglas Anderson <dianders@chromium.org> Reviewed-by:
Andrzej Hajda <a.hajda@samsung.com> Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210416153909.v4.1.If62a003f76a2bc4ccc6c53565becc05d2aad4430@changeid (cherry picked from commit bab5cca7) Change-Id: I5bdc04891ade08293dcf671f4c0b2ada2b0885b7
-
Nicolas Boichat authored
Add support for MT8183's G72 Bifrost. Signed-off-by:
Nicolas Boichat <drinkcat@chromium.org> Reviewed-by:
Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by:
Steven Price <steven.price@arm.com>
-
Nicolas Boichat authored
GPUs with more than a single regulator (e.g. G72 on MT8183) will require platform-specific handling for devfreq, for 2 reasons: 1. The opp core (drivers/opp/core.c:_generic_set_opp_regulator) does not support multiple regulators, so we'll need custom handlers. 2. Generally, platforms with 2 regulators have platform-specific constraints on how the voltages should be set (e.g. minimum/maximum voltage difference between them), so we should not just create generic handlers that simply change the voltages without taking care of those constraints. Disable devfreq for now on those GPUs. Signed-off-by:
Nicolas Boichat <drinkcat@chromium.org> Reviewed-by:
Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by:
Steven Price <steven.price@arm.com>
-
Nicolas Boichat authored
Add a basic GPU node for mt8183. Signed-off-by:
Nicolas Boichat <drinkcat@chromium.org> Reviewed-by:
Ezequiel Garcia <ezequiel@collabora.com>
-
Nicolas Boichat authored
Define a compatible string for the Mali Bifrost GPU found in Mediatek's MT8183 SoCs. Signed-off-by:
Nicolas Boichat <drinkcat@chromium.org> Reviewed-by:
Rob Herring <robh@kernel.org>
-
Gwendal Grignou authored
Add trace event to report samples and their timestamp coming from the EC. It allows to check if the timestamps are correct and the filter is working correctly without introducing too much latency. To enable these events: cd /sys/kernel/debug/tracing/ echo 1 > events/cros_ec/enable echo 0 > events/cros_ec/cros_ec_request_start/enable echo 0 > events/cros_ec/cros_ec_request_done/enable echo 1 > tracing_on cat trace_pipe Observe event flowing: irq/105-chromeo-95 [000] .... 613.659758: cros_ec_sensorhub_timestamp: ... irq/105-chromeo-95 [000] .... 613.665219: cros_ec_sensorhub_filter: dx: ... Signed-off-by:
Gwendal Grignou <gwendal@chromium.org>
-
Ikjoon Jang authored
mfgcfg clock is under MFG_ASYNC power domain Signed-off-by:
Weiyi Lu <weiyi.lu@mediatek.com> Signed-off-by:
Ikjoon Jang <ikjn@chromium.org> Reviewed-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com>
-
Enric Balletbo i Serra authored
The AXI ID is an AXI bus configuration for improve bus performance. If read and write operations use different ID the operations can be paralleled, whereas when they have the same ID the operations will be serialized. Right now, the write ID is fixed to 0 but we can set it to 0xff to get auto generated ID to avoid possible conflicts. This change has no functional changes, but seems reasonable to let the hardware to autogenerate the ID instead of hardcoding in software. Signed-off-by:
Enric Balletbo i Serra <enric.balletbo@collabora.com> Series-to: lkml Series-cc: collabora, dianders@google.com, fbuergisser@google.com, tfiga@google.com, acourbot@google.com
-
Hsin-Yi Wang authored
It is possible that empty_flush_buf is removed in mtk_venc_worker() and then again in vb2ops_venc_stop_streaming(). However, there's no empty list check in v4l2_m2m_buf_remove_by_buf(). Double remove causes a kernel crash. Signed-off-by:
Hsin-Yi Wang <hsinyi@chromium.org> [acourbot: fix commit log a bit] Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
The V4L2 encoder specification requires encoders to support the V4L2_ENC_CMD_START and V4L2_ENC_CMD_STOP commands. Add support for these to the mtk-vcodec encoder by reusing the same flush buffer as used by the decoder driver. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
The flush buffer is a special buffer that tells the decoder driver to send an empty CAPTURE frame to the client with V4L2_BUF_FLAG_LAST set. We need similar functionality for the encoder ; however currently the flush buffer depends on decoder-specific structures and thus cannot be reused with the encoder. Fix this by testing for this buffer by its VB2 address, and not through a dedicated flag stored in a higher-level decoder structure. This also allows us to remove said flag and simplify the code a bit. Since the flush buffer should never be used in the stateless decoder, also add safeguards to check against it. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
Calling S_FMT or TRY_FMT on the OUTPUT queue should adjust the resolution to the limits supported by the hardware. Until now this was only done on the CAPTURE queue, which could make clients believe that unsupported resolutions can be used when they set the coded size on the OUTPUT queue. In the case of the stateless decoder, the problem was even bigger since subsequently calling G_FMT on the CAPTURE queue would result in the unclamped resolution being returned, further inducing the client into error. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Hirokazu Honda authored
Add H264 profiles supported by the MediaTek 8173 decoder. Signed-off-by:
Hirokazu Honda <hiroh@chromium.org> [acourbot: fix commit log a bit] Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
Let's use the dedicated helpers to make sure we get the expected behavior on stateful decoders as well. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Yunfei Dong authored
Now that all the supporting blocks are present, enable decoder for MT8183. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> [acourbot: refactor, cleanup and split] Co-developed-by:
Alexandre Courbot <acourbot@chromium.org> Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
MT8183's decoder is instantiated similarly to MT8173's. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Yunfei Dong authored
The stateless API requires a media device for issuing requests. Add one if we are being instantiated as a stateless decoder. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> [acourbot: refactor, cleanup and split] Co-developed-by:
Alexandre Courbot <acourbot@chromium.org> Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Yunfei Dong authored
Add support for H.264 decoding using the stateless API, as supported by MT8183. This support takes advantage of the V4L2 H.264 reference list builders. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> [acourbot: refactor, cleanup and split] Co-developed-by:
Alexandre Courbot <acourbot@chromium.org> Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Yunfei Dong authored
Support the stateless codec API that will be used by MT8183. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> [acourbot: refactor, cleanup and split] Co-developed-by:
Alexandre Courbot <acourbot@chromium.org> Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
Add Mediatek's non-compressed 8 bit block video mode. This format is produced by the MT8183 codec and can be converted to a non-proprietary format by the MDP3 component. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
Add support for decoder firmware version 2, which makes the kernel responsible for managing the VSI context and is used for stateless codecs. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Alexandre Courbot authored
Firmwares for decoders newer than MT8173 will include an ABI version number in their initialization ack message. Add the capacity to manage it and make initialization fail if the firmware ABI is of a version that we don't support. For MT8173, this ABI version field does not exist ; thus ignore it on this chip. There should only be one firmware version available for it anyway. Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-
Yunfei Dong authored
We are planning to add support for stateless decoders to this driver. Part of the driver will be shared between stateful and stateless codecs, but a few ops need to be specialized for both. Extract the stateful part of the driver and move it into its own file, accessible through ops that the common driver parts can call. This patch only moves code around and introduces a set of abstractions ; the behavior of the driver should not be changed in any way. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> [acourbot: refactor, cleanup and split] Co-developed-by:
Alexandre Courbot <acourbot@chromium.org> Signed-off-by:
Alexandre Courbot <acourbot@chromium.org>
-