Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp483436pxu; Fri, 11 Dec 2020 07:02:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6FVtx1lDjshRKJqj/d6LyNN333T7niBxaIMAmIgP1W6fxnNKEUkQzHPN+pMwvv9shqWgi X-Received: by 2002:aa7:d919:: with SMTP id a25mr11879365edr.81.1607698941427; Fri, 11 Dec 2020 07:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607698941; cv=none; d=google.com; s=arc-20160816; b=PRedegaYZyMpgf1idRQ1M5u6OiCoUU2RPX7TqdT9t+rw9jFmRQx/MXZctsB+DbNw3l f3YGpGDBoVpqGBy2RrFGGEro1ytiAMJzM0w1ExRU2jWc2AKwI9WtqVSBccbqbR7+LWgO uoaQwnHh2UmtTXGXWO7AkGNlEFhjyK1hQdBk7zTcldvygiAPxODElmpRBnKj6KQ7JOZW aegHkCk2xbT5aPM7Yq57Z341Bj3ctC2mbT3R4Q5Ak3MPM1RjbsEix047AHboJ4DtU8nh 8pG/awBkowbznyWCIpJ7xnYxIciwgETU3pl5b8LmMR9KPPjUKGXtb1xvwf8q61eriz++ gHnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=KbJuPo0i6r1UumF35CJpw3kn3KosRSauBUlJR1ciMhc=; b=rVbe1++PVjpVOJK7RhXEWglQioCasxvnFGBCNX8XB2gKJArsdpVlIsRdBixBHqeyjm 65f/HnstCVfGoiJ/E7Vym+Kq1HkWt76nFuBJGp/8HlxC5AOUzch4WBLHOZjBg7On881a DetyEpJ1XIl6AdKOA8GQIeQosuHXhFwP2wzbtp2Dbicagi3OwzMsMSnIVUjuqP78keob OUOG8RbBYLqvvTqSgrjNeSshViNCScvoEvNCXdJmkRCrZkgo5NCJk4VxHvUckRE/PTnn RVv6lztb/CGY72sWrvH+sK6aizHvzx3wDQ7blYOC7gvUzh1psmc/G5CENWLdN09zy63T bqwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si4645272eja.691.2020.12.11.07.01.50; Fri, 11 Dec 2020 07:02:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733001AbgLJQMR (ORCPT + 99 others); Thu, 10 Dec 2020 11:12:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:38770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388530AbgLJQLl (ORCPT ); Thu, 10 Dec 2020 11:11:41 -0500 From: Chun-Kuang Hu Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Philipp Zabel , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH v2 01/12] drm/mediatek: Get CMDQ client register for all ddp component Date: Fri, 11 Dec 2020 00:10:39 +0800 Message-Id: <20201210161050.8460-2-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201210161050.8460-1-chunkuang.hu@kernel.org> References: <20201210161050.8460-1-chunkuang.hu@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only OVL, RDMA,and WDMA get CMDQ client register information, but all ddp component should work with CMDQ, so get this information for all ddp component. Signed-off-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index 3064eac1a750..cab53431ceec 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c @@ -506,6 +506,21 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, if (IS_ERR(comp->clk)) return PTR_ERR(comp->clk); +#if IS_REACHABLE(CONFIG_MTK_CMDQ) + if (of_address_to_resource(node, 0, &res) != 0) { + dev_err(dev, "Missing reg in %s node\n", node->full_name); + put_device(&larb_pdev->dev); + return -EINVAL; + } + comp->regs_pa = res.start; + + ret = cmdq_dev_get_client_reg(dev, &cmdq_reg, 0); + if (ret) + dev_dbg(dev, "get mediatek,gce-client-reg fail!\n"); + else + comp->subsys = cmdq_reg.subsys; +#endif + /* Only DMA capable components need the LARB property */ comp->larb_dev = NULL; if (type != MTK_DISP_OVL && @@ -531,20 +546,6 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, comp->larb_dev = &larb_pdev->dev; -#if IS_REACHABLE(CONFIG_MTK_CMDQ) - if (of_address_to_resource(node, 0, &res) != 0) { - dev_err(dev, "Missing reg in %s node\n", node->full_name); - put_device(&larb_pdev->dev); - return -EINVAL; - } - comp->regs_pa = res.start; - - ret = cmdq_dev_get_client_reg(dev, &cmdq_reg, 0); - if (ret) - dev_dbg(dev, "get mediatek,gce-client-reg fail!\n"); - else - comp->subsys = cmdq_reg.subsys; -#endif return 0; } -- 2.17.1