Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1897684imm; Sun, 27 May 2018 19:51:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAE62YkW3Z0+fcTKlM/2YJvraxb5Md14CimHDHhmbgAFe75pODVud4VMt169OknNepdSww X-Received: by 2002:a17:902:6046:: with SMTP id a6-v6mr11777508plt.59.1527475863979; Sun, 27 May 2018 19:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527475863; cv=none; d=google.com; s=arc-20160816; b=ym9/5e4f8Nf7i+V/vht7JlJIuO4dUfeBwY7NPn7SfK0uxab0ynxCKIGmzAOmahKy5q klMIqYmjZKmKyCJVepBXgxjda1BcZRW3FmiY82haJ1y4dtcpZl32YshsxZR2D+QE8iOO dz1vio73U9lPoTzDkN4huVTJ8KNVTG/OpUKCSRLrf9rs4PpUebt4PAIBaXvuKrUkQADo Ks9jbeB4EU/7LqKE9fyxYyi2J80z3ZrtCu5QTK9KJpWnukjDG+FndDDqyqnsFsqpzkcV vYmKq8gBnEoXH6isEsySdU9W4b0ceG964Mvld0YDXk6+1APTh3E4I8SloMLQvBdRy0vr Jm0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=9Xw7O70+fgyNr1I61Dc/2fNp5wd8BAZFOeZFFw1r4no=; b=LRXmLH8Zl2EFG/EtXg6NV54vbHE0tJDESMEYMmo7sQmkyAKyVtvCc4y7cBoTYNj1g2 UGg2MysziAE3enNKnlhUNFrlQ8jmiGKSM68GoGggwCp7kwQ2PLA32QDvFc1a1oRD/itG z0gxX4Cf9yCiyUGmYsPQVz+cmfIPSls4i2sJU4OoPhxAt+K6OCGC9hbddPKHLI6hiKmb yX/srBXvCXKxlJp+2RwWQgzgfNkrhz5e2wq/rQUVBxxOwVBoi/1FKABliS50l9fa8ilB 7c7k2PMnS73MITuofYsxrhBrAT+XOa1iHRs1HooJkVjDgZtWxSVPayMVpEYt4Vdl29xO NEbg== 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 u22-v6si6336072pfg.62.2018.05.27.19.50.38; Sun, 27 May 2018 19:51:03 -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 S1753049AbeE1CuW (ORCPT + 99 others); Sun, 27 May 2018 22:50:22 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:50655 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752970AbeE1CuV (ORCPT ); Sun, 27 May 2018 22:50:21 -0400 X-UUID: 02f64a154f3f46ba9e8ea63bc03597e4-20180528 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2122331844; Mon, 28 May 2018 10:50:17 +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; Mon, 28 May 2018 10:50:15 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 28 May 2018 10:50:15 +0800 Message-ID: <1527475815.31089.0.camel@mtksdaap41> Subject: Re: [PATCH v3 8/8] drm/mediatek: add third ddp path From: CK Hu To: Stu Hsieh CC: Philipp Zabel , David Airlie , Rob Herring , Mark Rutland , Matthias Brugger , , , , , , Date: Mon, 28 May 2018 10:50:15 +0800 In-Reply-To: <1527474417.11190.21.camel@mtksdccf07> References: <1527215665-11937-1-git-send-email-stu.hsieh@mediatek.com> <1527215665-11937-9-git-send-email-stu.hsieh@mediatek.com> <1527224425.27165.27.camel@mtksdaap41> <1527474417.11190.21.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Stu: On Mon, 2018-05-28 at 10:26 +0800, Stu Hsieh wrote: > Hi, CK: > I've some idea as below. > > On Fri, 2018-05-25 at 13:00 +0800, CK Hu wrote: > > Hi, Stu: > > > > On Fri, 2018-05-25 at 10:34 +0800, stu.hsieh@mediatek.com wrote: > > > From: Stu Hsieh > > > > > > This patch create third crtc by third ddp path > > > > > > > Apply this patch before the patch 'Add support for mediatek SOC MT2712' > > because this patch is necessary for mt2712. > > > > > Signed-off-by: Stu Hsieh > > > --- > > > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > > > index b32c4cc8d051..3a866e1d6af4 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > > > @@ -267,6 +267,11 @@ static int mtk_drm_kms_init(struct drm_device *drm) > > > if (ret < 0) > > > goto err_component_unbind; > > > > > > + ret = mtk_drm_crtc_create(drm, private->data->third_path, > > > + private->data->third_len); > > > > I think you should prevent doing this for mt8173 and mt2701 because that > > two SoC has only two ddp path. > > Now, 8173 and 2701 have only two ddp path, there is a problem on run > time. > There are three crtc for drm resource, and there is nothing in third > crtc. > Because 8173 and 2701 have no third ddp, and the third ddp_len is zero. > So, I want to add the condition like following in mtk_crtc_create() > if (path_len == 0) > return 0; > > Then, the valur ret is zero and it would not create the null third crtc. This sounds good to me. Regards, CK > > > Regards, > Stu > > > > > Regards, > > CK > > > > > + if (ret < 0) > > > + goto err_component_unbind; > > > + > > > /* Use OVL device for all DMA memory allocations */ > > > np = private->comp_node[private->data->main_path[0]] ?: > > > private->comp_node[private->data->ext_path[0]]; > > > > > >