From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A935C433F5 for ; Tue, 5 Oct 2021 09:50:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C34B56137D for ; Tue, 5 Oct 2021 09:50:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C34B56137D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 508946E3C4; Tue, 5 Oct 2021 09:50:55 +0000 (UTC) X-Greylist: delayed 365 seconds by postgrey-1.36 at gabe; Tue, 05 Oct 2021 09:50:54 UTC Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 712496E3B7; Tue, 5 Oct 2021 09:50:54 +0000 (UTC) Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 05 Oct 2021 02:44:48 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 05 Oct 2021 02:44:47 -0700 X-QCInternal: smtphost Received: from mkrishn-linux.qualcomm.com ([10.204.66.35]) by ironmsg01-blr.qualcomm.com with ESMTP; 05 Oct 2021 15:14:34 +0530 Received: by mkrishn-linux.qualcomm.com (Postfix, from userid 438394) id 2953A221DF; Tue, 5 Oct 2021 15:14:33 +0530 (IST) From: Krishna Manikandan To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krishna Manikandan , kalyan_t@codeaurora.org, robdclark@gmail.com, swboyd@chromium.org, bjorn.andersson@linaro.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH v1] drm/msm: use compatible string to find mdp node Date: Tue, 5 Oct 2021 15:14:31 +0530 Message-Id: <1633427071-19523-1-git-send-email-mkrishn@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In the current implementation, substring comparison using device node name is used to find mdp node during driver probe. Use compatible string instead of node name to get mdp node from the parent mdss node. Signed-off-by: Krishna Manikandan --- drivers/gpu/drm/msm/msm_drv.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 2e6fc18..50a23cf 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1241,9 +1241,16 @@ static int add_components_mdp(struct device *mdp_dev, return 0; } -static int compare_name_mdp(struct device *dev, void *data) +static int find_mdp_node(struct device *dev, void *data) { - return (strstr(dev_name(dev), "mdp") != NULL); + return of_device_is_compatible(dev->of_node, "qcom,mdp4") || + of_device_is_compatible(dev->of_node, "qcom,mdp5") || + of_device_is_compatible(dev->of_node, "qcom,mdss_mdp") || + of_device_is_compatible(dev->of_node, "qcom,sdm845-dpu") || + of_device_is_compatible(dev->of_node, "qcom,sm8150-dpu") || + of_device_is_compatible(dev->of_node, "qcom,sm8250-dpu") || + of_device_is_compatible(dev->of_node, "qcom,sc7180-dpu") || + of_device_is_compatible(dev->of_node, "qcom,sc7280-dpu"); } static int add_display_components(struct platform_device *pdev, @@ -1268,7 +1275,7 @@ static int add_display_components(struct platform_device *pdev, return ret; } - mdp_dev = device_find_child(dev, NULL, compare_name_mdp); + mdp_dev = device_find_child(dev, NULL, find_mdp_node); if (!mdp_dev) { DRM_DEV_ERROR(dev, "failed to find MDSS MDP node\n"); of_platform_depopulate(dev); -- 2.7.4