From 18f27ed26248338c4322be24fde6ec0eec70f37c Mon Sep 17 00:00:00 2001 From: Alexey Minnekhanov Date: Wed, 7 Aug 2024 07:58:16 +0300 Subject: [PATCH] HACK: framebuffer scaling for several devices Add fake panel node for simple-framebuffer to calculate DPI from. It only needs width & height specified. We can't just reference "real" panel node which is under mdss/mdp/dsi, because it will cause simplefb to probe second, after mdss and it will cause multiple issues. This fake node allows us to break device link from simplefb to mdss (implicitly via panel->mdp->mdss) to fix drm device probe ordering. Without this, simpledrm would probe second after msm-drm, and confuse userspace with 2 GPUs in /dev/dri. Alternative workaround is to boot with kernel parameter `fw_devlink=permissive`, which allows simpledrm to probe first, but it is worse, because it can hide other issues with device dependencies. --- .../dts/qcom/sdm660-xiaomi-lavender-common.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender-common.dtsi b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender-common.dtsi index 3fe5961f0b7ea3..607143a3b999ac 100644 --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender-common.dtsi @@ -38,6 +38,23 @@ height = <2340>; stride = <(1080 * 4)>; format = "a8r8g8b8"; + + /* HACK: + * Fake panel node for simple-framebuffer to calculate DPI from. Only + * needs width & height specified. This allows us to break device link + * from simplefb to mdss (implicitly via panel->mdp->mdss) to fix drm + * device probe ordering. Without this, simpledrm would probe second + * after msm-drm, and confuse userspace with 2 GPUs in /dev/dri. + * Alternative workaround is to boot with kernel parameter + * `fw_devlink=permissive`, which is worse, because it can hide other + * issues with device dependencies. + */ + panel = <&fb_panel>; + + fb_panel: fb-panel { + width-mm = <67>; + height-mm = <145>; + }; }; };