Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1505773imm; Wed, 8 Aug 2018 19:17:38 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxOPb0saOE1qMZNP8GwNtxp6QC2PAmjCu8jf/e/Eru9qPOK/OevC06xJNloUsgQdVx9evvA X-Received: by 2002:a65:5b08:: with SMTP id y8-v6mr193411pgq.297.1533781058668; Wed, 08 Aug 2018 19:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533781058; cv=none; d=google.com; s=arc-20160816; b=qSuOcRPm0me+BorZHkxXD/nyRd722HF6vwM9QN1LBB3oAFtoYu3SqQXi9oXRP/lsnW TbG7HP6DYO0Bxl84wCSN3HK0IYlhWtd4ihG1yOpwKf3tsJEe4N6/8KTH/4e0ycM7Vk8N tiZp2guS9HNerL3igcS4zkHVhn9gpS2KPvRXvaDjnnGefRDQUnaLcA+9XIikoRdth/5n 9fHOwm96jaDFQ8wMLQi4o7bcyoWUyQUYdKbLPet5QUd/Htui/RPokjgS7ynrO2COUYYg 6MdSk+NjzGkLJoKrACaLT1ToV87JZoPFAU1VkSg3oB8yNLFM9+VxLbjEr8UMs111gDSz JFrw== 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:arc-authentication-results; bh=VhgyYeQmSpSY4NjLkcx+IAjrGxBtH7KeCXj+o3Fwfek=; b=Qmgz9cCU8K9QuFG9sqRyO4hrIy5uQLt5z8Bqho0r5/K6K8lxouk63fyXIvPJWIgW1I oLuLyVz255Q7Wyqi5ezpaBOB9hNk6/LeOb9LlAeh+Lk0E5g/mf19zMk/mXu81SdiBA5s /UbNKn7yuHkTRliSeFE3iL4lGpIYC3v6ouujV/EnYmUmvFi53929FdWNym4cKM5bxhQ+ yvvVl7JpghUIPRL4JCTrDe75UBp0qpemgwB8+0eNVWkpGbLtFlBCEBPBC5nyiWFQPjod qInuBQjLpkG5UGNq4TQpGTK0D3XpVhs+pKdBE+nNPfJKG56h6eO7TEAkyMctn22xcqmd RMkQ== 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 l5-v6si5272012pff.304.2018.08.08.19.17.24; Wed, 08 Aug 2018 19:17:38 -0700 (PDT) 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 S1728323AbeHIEie (ORCPT + 99 others); Thu, 9 Aug 2018 00:38:34 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:61614 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728156AbeHIEid (ORCPT ); Thu, 9 Aug 2018 00:38:33 -0400 X-UUID: 0f8b8cdce29c4cb3b05e06d46a5d1d21-20180809 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1216285570; Thu, 09 Aug 2018 10:15:53 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 9 Aug 2018 10:15:52 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 9 Aug 2018 10:15:52 +0800 From: Stu Hsieh To: CK Hu , Philipp Zabel CC: David Airlie , Matthias Brugger , , , , , , Stu Hsieh Subject: [PATCH v4 09/14] drm/mediatek: add function to get layer number for component Date: Thu, 9 Aug 2018 10:15:44 +0800 Message-ID: <1533780949-30141-10-git-send-email-stu.hsieh@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533780949-30141-1-git-send-email-stu.hsieh@mediatek.com> References: <1533780949-30141-1-git-send-email-stu.hsieh@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 This patch add function to get layer number for component Signed-off-by: Stu Hsieh Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h index 7413ffeb3c9d..8399229e6ad2 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h @@ -78,6 +78,7 @@ struct mtk_ddp_comp_funcs { void (*stop)(struct mtk_ddp_comp *comp); void (*enable_vblank)(struct mtk_ddp_comp *comp, struct drm_crtc *crtc); void (*disable_vblank)(struct mtk_ddp_comp *comp); + unsigned int (*layer_nr)(struct mtk_ddp_comp *comp); void (*layer_on)(struct mtk_ddp_comp *comp, unsigned int idx); void (*layer_off)(struct mtk_ddp_comp *comp, unsigned int idx); void (*layer_config)(struct mtk_ddp_comp *comp, unsigned int idx, @@ -128,6 +129,14 @@ static inline void mtk_ddp_comp_disable_vblank(struct mtk_ddp_comp *comp) comp->funcs->disable_vblank(comp); } +static inline unsigned int mtk_ddp_comp_layer_nr(struct mtk_ddp_comp *comp) +{ + if (comp->funcs && comp->funcs->layer_nr) + return comp->funcs->layer_nr(comp); + + return 0; +} + static inline void mtk_ddp_comp_layer_on(struct mtk_ddp_comp *comp, unsigned int idx) { -- 2.12.5.2.gbdf23ab