From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFBF2C43603 for ; Thu, 12 Dec 2019 04:50:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1BB121655 for ; Thu, 12 Dec 2019 04:50:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="f5bMNPM5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1BB121655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33E2E6EC53; Thu, 12 Dec 2019 04:50:09 +0000 (UTC) Received: from mailgw01.mediatek.com (unknown [1.203.163.78]) by gabe.freedesktop.org (Postfix) with ESMTP id CC40B6EC53 for ; Thu, 12 Dec 2019 04:50:07 +0000 (UTC) X-UUID: 0350d3d39d8d4823bb50c2421b97151f-20191212 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=61QzL2uAhif1inmfHk4F3GpOWbSMt53a76nKAzVwLMU=; b=f5bMNPM5X3vpibe0RnOnQWIHHLjNcUhruZoyv2kTE7kQMw2sq6n8oCiqECQvYoXylolEXoxlHHdzYCtPjixo5Mk4wplOpBb8wMOEzckUSh89XQ0ukV3N+v41y+IA9vePsWjQrTSMqTJAM1tHOscJaSAx8PQJYXxGxJA+hQ4XHSw=; X-UUID: 0350d3d39d8d4823bb50c2421b97151f-20191212 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1765757622; Thu, 12 Dec 2019 12:49:59 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 12 Dec 2019 12:49:45 +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.1395.4 via Frontend Transport; Thu, 12 Dec 2019 12:49:53 +0800 Message-ID: <1576126197.29693.3.camel@mtksdaap41> Subject: Re: [PATCH] drm/mediatek: Fix can't get component for external display plane. From: CK Hu To: Pi-Hsun Shih Date: Thu, 12 Dec 2019 12:49:57 +0800 In-Reply-To: <1575264270.16063.0.camel@mtksdaap41> References: <20191127100419.130300-1-pihsun@chromium.org> <1575264270.16063.0.camel@mtksdaap41> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: A33FA4A393275F96C1D67CACE7875D97147C4BC54960F0F3AB9A8D502DF8916C2000:8 X-MTK: N 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: Sean Paul , Yongqiang Niu , David Airlie , open list , "open list:DRM DRIVERS FOR MEDIATEK" , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , "moderated list:ARM/Mediatek SoC support" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, Pi-Hsun: On Mon, 2019-12-02 at 13:24 +0800, CK Hu wrote: > Hi, Pi-Hsun: > > > On Wed, 2019-11-27 at 18:04 +0800, Pi-Hsun Shih wrote: > > From: Yongqiang Niu > > > > The original logic is ok for primary display, but will not find out > > component for external display. > > > > For example, plane->index is 6 for external display, but there are only > > 2 layer nr in external display, and this condition will never happen: > > if (plane->index < (count + mtk_ddp_comp_layer_nr(comp))) > > > > Fix this by using the offset of the plane to mtk_crtc->planes as index, > > instead of plane->index. > > Reviewed-by: CK Hu > Applied to mediatek-drm-fixes-5.5 [1], thanks. [1] https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.5 Regards, CK > Regards, > CK > > > > > Fixes: d6b53f68356f ("drm/mediatek: Add helper to get component for a plane") > > Signed-off-by: Yongqiang Niu > > Signed-off-by: Pi-Hsun Shih > > --- > > drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > index f80a8ba75977..b34e7d70702a 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > @@ -215,11 +215,12 @@ struct mtk_ddp_comp *mtk_drm_ddp_comp_for_plane(struct drm_crtc *crtc, > > struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); > > struct mtk_ddp_comp *comp; > > int i, count = 0; > > + unsigned int local_index = plane - mtk_crtc->planes; > > > > for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) { > > comp = mtk_crtc->ddp_comp[i]; > > - if (plane->index < (count + mtk_ddp_comp_layer_nr(comp))) { > > - *local_layer = plane->index - count; > > + if (local_index < (count + mtk_ddp_comp_layer_nr(comp))) { > > + *local_layer = local_index - count; > > return comp; > > } > > count += mtk_ddp_comp_layer_nr(comp); > > > > base-commit: 1875ff320f14afe21731a6e4c7b46dd33e45dfaa > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel