Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11555789imu; Tue, 1 Jan 2019 01:49:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN4sey7k7TUJYiRlFs+vkivtnNKA00dq3iQPDjl7s9hFREghmDpRPqdKNfwgpxgP+Jb2GJaV X-Received: by 2002:a65:43c5:: with SMTP id n5mr10366099pgp.250.1546336184064; Tue, 01 Jan 2019 01:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546336184; cv=none; d=google.com; s=arc-20160816; b=JlFcYfhxX9wmKbGTxHXvxcMQv4zZN6B0KmW37U7oOQoJa3T4ho5kp0xe3x/j8oBnFU GBZXeZ2/QEukrVFHJz8si+PK3+wgLevwJoD/2WTmTTsU23qt5lzBfVC8UEnVzzyULs4N FsOzzhpkuFy1hphBO8yjVPJllgMKXXUXCDg+WWcvRanIBpiGUfCZSRLK9mWUXMKlVm4l gJJ6/SDraueY7nc+jV5u1gCZmCx0hkoCNRw2+Rnyz/gWFyFzTbiycykBmrmSVNyfqn/C H5g71MU5XKRZDN9n+/PZQ9tRldjjAjMfNWkbTzE0KYk17NsEZg4ZUgKn/Gkr0ldeErtJ rAWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=+wyFl1UcBT3w5JO0OyiMMKn7HddNg5E3sV8hn2dHygg=; b=XEVHxUULAqMn2sfdbpiPHwyNBJqyUVztG6cowciUFFGLLRKbijhkHuBcCA7G7TmW0o x7OqOjdhw3NBs7fMXWaGBU1RTbi4Qy/LMjcMtW4PQBAl0URn0bK9cgnekA6XfR0yQtDn NcWx8B2XK7z/q9IDltDAw014ZOdRqys8AKR8LjrxlMWzdKqoSMgEAPWBQ/Kuq4MkHNn6 LSiwQzg3ihQnkHm5H1E1VkXXEKu1S+UHFFGvotjyBddftbqisPKdBNS5OBe7u8lStLox Tq65+Ohwg6JKYjmmFd7YkYQzSY714xK/0dWhrKTtxbymW8hA092vyAAkCjzgVAfOBACr UXhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si46769071pgm.112.2019.01.01.01.49.07; Tue, 01 Jan 2019 01:49:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728541AbfAAEwy (ORCPT + 99 others); Mon, 31 Dec 2018 23:52:54 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:16672 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728272AbfAAEwy (ORCPT ); Mon, 31 Dec 2018 23:52:54 -0500 X-UUID: 057c9f877e22482c9b2c837242ed57cc-20190101 X-UUID: 057c9f877e22482c9b2c837242ed57cc-20190101 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 274667257; Tue, 01 Jan 2019 12:52:50 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:52:49 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 1 Jan 2019 12:52:48 +0800 From: Yong Wu To: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring CC: Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , CK Hu , Philipp Zabel Subject: [PATCH 09/13] drm/mediatek: Get rid of mtk_smi_larb_get/put Date: Tue, 1 Jan 2019 12:51:12 +0800 Message-ID: <1546318276-18993-10-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> References: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the drm device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: CK Hu CC: Philipp Zabel Signed-off-by: Yong Wu --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 11 ----------- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 26 -------------------------- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 1 - 3 files changed, 38 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 92ecb9b..fbf859e 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "mtk_drm_drv.h" #include "mtk_drm_crtc.h" @@ -371,20 +370,12 @@ static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; int ret; DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id); - ret = mtk_smi_larb_get(comp->larb_dev); - if (ret) { - DRM_ERROR("Failed to get larb: %d\n", ret); - return; - } - ret = mtk_crtc_ddp_hw_init(mtk_crtc); if (ret) { - mtk_smi_larb_put(comp->larb_dev); return; } @@ -396,7 +387,6 @@ static void mtk_drm_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; int i; DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id); @@ -419,7 +409,6 @@ static void mtk_drm_crtc_atomic_disable(struct drm_crtc *crtc, drm_crtc_vblank_off(crtc); mtk_crtc_ddp_hw_fini(mtk_crtc); - mtk_smi_larb_put(comp->larb_dev); mtk_crtc->enabled = false; } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index 54ca794..ede15c9 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c @@ -265,8 +265,6 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, const struct mtk_ddp_comp_funcs *funcs) { enum mtk_ddp_comp_type type; - struct device_node *larb_node; - struct platform_device *larb_pdev; if (comp_id < 0 || comp_id >= DDP_COMPONENT_ID_MAX) return -EINVAL; @@ -296,30 +294,6 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, if (IS_ERR(comp->clk)) return PTR_ERR(comp->clk); - /* Only DMA capable components need the LARB property */ - comp->larb_dev = NULL; - if (type != MTK_DISP_OVL && - type != MTK_DISP_RDMA && - type != MTK_DISP_WDMA) - return 0; - - larb_node = of_parse_phandle(node, "mediatek,larb", 0); - if (!larb_node) { - dev_err(dev, - "Missing mediadek,larb phandle in %pOF node\n", node); - return -EINVAL; - } - - larb_pdev = of_find_device_by_node(larb_node); - if (!larb_pdev) { - dev_warn(dev, "Waiting for larb device %pOF\n", larb_node); - of_node_put(larb_node); - return -EPROBE_DEFER; - } - of_node_put(larb_node); - - comp->larb_dev = &larb_pdev->dev; - return 0; } diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h index 8399229..b8dc17e 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h @@ -91,7 +91,6 @@ struct mtk_ddp_comp { struct clk *clk; void __iomem *regs; int irq; - struct device *larb_dev; enum mtk_ddp_comp_id id; const struct mtk_ddp_comp_funcs *funcs; }; -- 1.9.1