Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm: add a kernel param to select between MDP5 and DPU drivers

For some of the platforms (e.g. SDM660, SDM630, MSM8996, etc.) it is
possible to support this platform via the DPU driver (e.g. to provide
support for DP, multirect, etc). Add a modparam to be able to switch
between these two drivers.

All platforms supported by both drivers are by default handled by the
MDP5 driver. To let them be handled by the DPU driver pass the
`msm.prefer_mdp5=false` kernel param.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/577504/
Link: https://lore.kernel.org/r/20240208-fd-migrate-mdp5-v4-3-945d08ef3fa8@linaro.org

+38
+3
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
··· 1279 1279 int irq; 1280 1280 int ret = 0; 1281 1281 1282 + if (!msm_disp_drv_should_bind(&pdev->dev, true)) 1283 + return -ENODEV; 1284 + 1282 1285 dpu_kms = devm_kzalloc(dev, sizeof(*dpu_kms), GFP_KERNEL); 1283 1286 if (!dpu_kms) 1284 1287 return -ENOMEM;
+3
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
··· 852 852 853 853 DBG(""); 854 854 855 + if (!msm_disp_drv_should_bind(&pdev->dev, false)) 856 + return -ENODEV; 857 + 855 858 mdp5_kms = devm_kzalloc(&pdev->dev, sizeof(*mdp5_kms), GFP_KERNEL); 856 859 if (!mdp5_kms) 857 860 return -ENOMEM;
+31
drivers/gpu/drm/msm/msm_drv.c
··· 969 969 return 0; 970 970 } 971 971 972 + #if !IS_REACHABLE(CONFIG_DRM_MSM_MDP5) || !IS_REACHABLE(CONFIG_DRM_MSM_DPU) 973 + bool msm_disp_drv_should_bind(struct device *dev, bool dpu_driver) 974 + { 975 + /* If just a single driver is enabled, use it no matter what */ 976 + return true; 977 + } 978 + #else 979 + 980 + static bool prefer_mdp5 = true; 981 + MODULE_PARM_DESC(prefer_mdp5, "Select whether MDP5 or DPU driver should be preferred"); 982 + module_param(prefer_mdp5, bool, 0444); 983 + 984 + /* list all platforms supported by both mdp5 and dpu drivers */ 985 + static const char *const msm_mdp5_dpu_migration[] = { 986 + NULL, 987 + }; 988 + 989 + bool msm_disp_drv_should_bind(struct device *dev, bool dpu_driver) 990 + { 991 + /* If it is not an MDP5 device, do not try MDP5 driver */ 992 + if (!of_device_is_compatible(dev->of_node, "qcom,mdp5")) 993 + return dpu_driver; 994 + 995 + /* If it is not in the migration list, use MDP5 */ 996 + if (!of_device_compatible_match(dev->of_node, msm_mdp5_dpu_migration)) 997 + return !dpu_driver; 998 + 999 + return prefer_mdp5 ? !dpu_driver : dpu_driver; 1000 + } 1001 + #endif 1002 + 972 1003 /* 973 1004 * We don't know what's the best binding to link the gpu with the drm device. 974 1005 * Fow now, we just hunt for all the possible gpus that we support, and add them
+1
drivers/gpu/drm/msm/msm_drv.h
··· 563 563 struct msm_kms *kms); 564 564 void msm_kms_shutdown(struct platform_device *pdev); 565 565 566 + bool msm_disp_drv_should_bind(struct device *dev, bool dpu_driver); 566 567 567 568 #endif /* __MSM_DRV_H__ */