From patchwork Wed Mar 17 02:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 403026 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp194914ejz; Tue, 16 Mar 2021 19:55:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4WjGSkJ1n/RBrdSIpYVCzYBB/f+Vsh2ratr+ftchUGWyhJZZv9yaPjFAbv5ZxGNe7H5sU X-Received: by 2002:a65:5a0a:: with SMTP id y10mr736789pgs.122.1615949739884; Tue, 16 Mar 2021 19:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615949739; cv=none; d=google.com; s=arc-20160816; b=Rum4I4f03z4UnFeAN5GS7ADPLGn42ajsSSYX6IrLNAXNHUxzKa6R4NS2bDoQAS8kuN IaDgIvOyCNE1geiNqN7XH3FfkkUlSBfk0CrytKPtpbzeSFSUS8s+Yhmx1k0k1Nxps4Fd mxd3sfJsFOysfN4zD2NcoCf00LjBgP1k4No7WSfX7+sRjcu7/tRzG96qTyj7IVpbKisL OxrDHgff6bnicm+v0Wgzla+V1uFp9hPwdFFEX3hiF6SA2WC4AbBy2P16jawT1mH1+NS+ pRD6JDYSszfQHdL5Da4VJMwhiJVcvx7RSCiaDbyXzQPB3D9YZ5CsBdcx937Ua/p0Fo+C zgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=53fcb9NExtOdUwVtSV49/QQnef20VeQhnUrzgMNRelI=; b=pGeOa0d5IYXLX7csEOfpDxzlSoN/Cl8lAYYxn2BGSjvOPgj2A38M0tGjkL/1NOSIqt SAZyWA6GEJlQ9xrzzojNa0i04ZQm3r6m5nyIvo6XMfE2jjEDZvHER23bnyYbJrqbPxxw 9JCoqdU7DvsDniS9UhDU2fQPvWfPwPjEdYZZrAXLW2OGMKFzDUUCcu+Qdfsaz3yhnBbU 52n/Rc/dtR0oNu34HbI0NFhkPFiltTznKBKh2G8pbO0NWVWpDY8gt5jNwCNYF66sA95Z K9u231rRPvEf9KySV7q/suujNoTihtZDaFvPFyARuoVQLLBMtlVP7F54rrij1gsHa62a hn5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jvSPqvR7; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id e1si466584pgr.169.2021.03.16.19.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 19:55:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jvSPqvR7; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0FFB6E0AB; Wed, 17 Mar 2021 02:55:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 985506E0AB for ; Wed, 17 Mar 2021 02:55:37 +0000 (UTC) Received: by mail-oi1-x232.google.com with SMTP id w195so33727507oif.11 for ; Tue, 16 Mar 2021 19:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BCzU6F4uZhx7sJJrGnHwNOzG8RXcM1PdQDQ68KOnb4g=; b=jvSPqvR7vVYrXbfTCmHC4c+lnilvsDwSUEmRijXAEuU0IrZwpiVgus15lDOP56XG0M OeBdYDxDW1oBk0WdZJRlK1+xg9h4JPznsTR6yb+uMSyRfcmQ5VPp5rFYjSHBEbjZp9i5 vlJzl3at/HDjPAXW37FOnqrAve6FRQKIELgTk2Vf/ArXUgY8c+2/XrBmxu7FMnukBElS fipyQFx6Z/U08vkzOHj01+PmrteDauTNjjreibEf2IUYbahbhBQVEmkD8AQTjatoeFBr 7NNZn5B2qCane9+9SzW6B0Pyivu+ubPQYGXk3q0t3YMKYbottqQ+6bzChFDNHxyQx599 ZLSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BCzU6F4uZhx7sJJrGnHwNOzG8RXcM1PdQDQ68KOnb4g=; b=HqC3zQc6HE6A9tskc6IOQE5kEF2Jcy92vCSvd0khMV+/D7MR6SKUZkmu2fAW+7Ec0d FImE+eLi7PXHPbi4eGrlpW4kHaBKyHbWiODLnYy8X7RwEtyWE/jQkA2fJj0OH5dJn2QM 540fUCfAE48b6dAZ3+OCefH036kqYoAQsLFbosQnO9zvG1PaMAbZG5YZ80HgjfaUmpMH YfofhHZa6BwxrPc2Yxz0M4J08CjmQn39eHtXZFfdX9XCt4T2Uvobp8dXmlYFK+w+Qqgc WnCc5WZCxU157rcFNSpHSaRiXipSj+2/37UmzZotmfELb1EesMn24PapSN+bXqu8MAKb UJPA== X-Gm-Message-State: AOAM5333xxAt2WhGpYvVuWU+6Ya2lbwx64pTPEY0BvYRkqpu+ToGJ8U0 GLiJwS9p/rPUjiQiEzmsBSIw/Q== X-Received: by 2002:aca:ab44:: with SMTP id u65mr1244373oie.122.1615949736872; Tue, 16 Mar 2021 19:55:36 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id a6sm8559963otq.79.2021.03.16.19.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 19:55:36 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter Subject: [PATCH] drm/msm: Remove need for reiterating the compatibles Date: Tue, 16 Mar 2021 19:56:34 -0700 Message-Id: <20210317025634.3987908-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 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: , Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After spending a non-negligible time trying to figure out why dpu_kms_init() would dereference a NULL dpu_kms->pdev, it turns out that in addition to adding the new compatible to the msm_drv of_match_table one also need to teach add_display_components() to register the child nodes - which includes the DPU platform_device. Replace the open coded test for compatibles with a check against the match data of the mdss device to save others this trouble in the future. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/msm_drv.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 94525ac76d4e..0f6e186a609d 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1173,10 +1173,11 @@ static int compare_name_mdp(struct device *dev, void *data) return (strstr(dev_name(dev), "mdp") != NULL); } -static int add_display_components(struct device *dev, +static int add_display_components(struct platform_device *pdev, struct component_match **matchptr) { struct device *mdp_dev; + struct device *dev = &pdev->dev; int ret; /* @@ -1185,9 +1186,9 @@ static int add_display_components(struct device *dev, * Populate the children devices, find the MDP5/DPU node, and then add * the interfaces to our components list. */ - if (of_device_is_compatible(dev->of_node, "qcom,mdss") || - of_device_is_compatible(dev->of_node, "qcom,sdm845-mdss") || - of_device_is_compatible(dev->of_node, "qcom,sc7180-mdss")) { + switch (get_mdp_ver(pdev)) { + case KMS_MDP5: + case KMS_DPU: ret = of_platform_populate(dev->of_node, NULL, NULL, dev); if (ret) { DRM_DEV_ERROR(dev, "failed to populate children devices\n"); @@ -1206,9 +1207,11 @@ static int add_display_components(struct device *dev, /* add the MDP component itself */ drm_of_component_match_add(dev, matchptr, compare_of, mdp_dev->of_node); - } else { + break; + case KMS_MDP4: /* MDP4 */ mdp_dev = dev; + break; } ret = add_components_mdp(mdp_dev, matchptr); @@ -1273,7 +1276,7 @@ static int msm_pdev_probe(struct platform_device *pdev) int ret; if (get_mdp_ver(pdev)) { - ret = add_display_components(&pdev->dev, &match); + ret = add_display_components(pdev, &match); if (ret) return ret; }