Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3776534ybv; Mon, 10 Feb 2020 06:15:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyOsLNKgCCKWnKWCxJm5He8ZKR6eNaOJCYF/RopDRVBuYJYMjge6UTIOXNbTBr+CSklrO7+ X-Received: by 2002:a05:6830:16d0:: with SMTP id l16mr1255522otr.83.1581344129975; Mon, 10 Feb 2020 06:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581344129; cv=none; d=google.com; s=arc-20160816; b=WJrbphoUpgxVXxolkdUa3olQi2szXV4hWQ2Vn3OUtWjj68TrTfGyI2ba3T5cwks8Q1 BU/K89O3v8B4T0xKMMIRIrvQJIt41rHwkAwhnD+1vPw2tOys0K7wtpYCwo9nWA98E3Tc Hw3iCQzV8VOgOBRwMs3LhQIiTEiFaz058RaaLbZwJtjmVaulNYqRkkNf82JYd/RIRPWa PCeMNIS3jMbkQ+jxjyGKeVCWDNGu74NdKRvnOQLmDxVTFP4BmdhkABpYhKwM5KNuJC6/ J7D+6Dfe+P0tFdHQOED92fLOPuS+cJTg3KJr2wqJMIyR9c2j9L9fnVSJTjq5asK6kVna Q1Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FX0VcA61hup+M1eG33dRqyta/5/xteIuWl8koiSPDi4=; b=Dtws0q05SNhGqlWCIvxGdDcu3XFrF3qyd541KsDaKUXRDAweJKY5cS8bbi9hc4aQSd 6aXwM07wHN0VbvlHHfZKoYQq3q8pYwGLt0RzFErKpCLZYF8TpPv7BSUnAV8ORYac5nbJ 0cE9g0JYOi0NN4Mc67wFMCQL4/oyuUxu6ws0yIuXbiuTPw2kvFkoLmLTQ9vAM4yWmPgb 1afKzC782bGSZaTjCkRfYg3EPmaFfo9QRiR1Bc88s7D0XzhGS7Ki500M2ahh8lORmr8Q 7czgP81xNBA9eV1VfRKsRdVX8JtsuhUuwMFts1O4IeAsfWFtaLZ6jxuj8QtiJp58qCed 8BfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=G4uXB900; 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 z7si222177oid.150.2020.02.10.06.15.17; Mon, 10 Feb 2020 06:15:29 -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; dkim=pass header.i=@poorly.run header.s=google header.b=G4uXB900; 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 S1728440AbgBJOLT (ORCPT + 99 others); Mon, 10 Feb 2020 09:11:19 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:35634 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727581AbgBJOLT (ORCPT ); Mon, 10 Feb 2020 09:11:19 -0500 Received: by mail-io1-f68.google.com with SMTP id h8so7703835iob.2 for ; Mon, 10 Feb 2020 06:11:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FX0VcA61hup+M1eG33dRqyta/5/xteIuWl8koiSPDi4=; b=G4uXB900exoea2ii7+OFpaGuRK0OPIwrn5b/qyL1D2Q9SXUY52mV/GbNkHjMPnchAM ph7SyUwqgpei3jx8lD4a2qYiY8mhLmqs3rciAPdjTSxjBZSlhSwL+K5ny5rILoVPrv3K J48MqqhzBHWtUo3Y0ytkyzGLqroOVBCzNr/sxerxfodFVtmee1wXpdhLvt3EBdk3LnPN 3WT9oeSCayoMbkTRIdriomu+/UmKLxQ5ZKy7yrZbimr7zSx9r6ju33sS2XOZyJiYvUUs oP2DGX5M3gjG49im59BCr2dlcbr00eT7960geinWms86EIHtLSGo6OUV128LQvBM4LRW S1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FX0VcA61hup+M1eG33dRqyta/5/xteIuWl8koiSPDi4=; b=GOjXLd2KBDbXshCNX2igQHt8qdex4GT84rewm0QeqygWGA+0aWKpJKuFT4hKEk0vhV 1mTkmDohp6rF+zOXEmyacys96FJ3Oqfj58SVA5id4JurToXA6DYq7wJsk+2GmJ6+LSUf JBF66XX+KfajmcncpcGlZwbK2dJudoOfydsZwjUSDA/gUGcM5CZwb/iAcqhNxcIIEK63 lUCiOQA5vaUWAtQJdAdNKo68nomCEXwr+ZzfIuK//Jp6FPlnNRXSX9jlHXbNQF4jJrup uvQ32Ty/5xvVu1D/fmS0qP+VPjcOcZpB2uMKwf2PgvGggYPxQkl5Z5m69xXKNY12zZ0b 8sDQ== X-Gm-Message-State: APjAAAXLExq6p3+WSSYsreB4+uVySm8fsMprASaygXXh1xnpfEEzxDkI JunVXEh7wtp2qsOowuOlXPSopYisZXXvDodzDzFYLg== X-Received: by 2002:a6b:f206:: with SMTP id q6mr9531130ioh.264.1581343878489; Mon, 10 Feb 2020 06:11:18 -0800 (PST) MIME-Version: 1.0 References: <20200206140140.GA18465@art_vandelay> <20200207152348.1.Ie0633018fc787dda6e869cae23df76ae30f2a686@changeid> <1581064499.590.0.camel@mtksdaap41> <1581303187.951.2.camel@mtksdaap41> In-Reply-To: <1581303187.951.2.camel@mtksdaap41> From: Sean Paul Date: Mon, 10 Feb 2020 09:10:42 -0500 Message-ID: Subject: Re: [PATCH] drm/mediatek: Find the cursor plane instead of hard coding it To: CK Hu Cc: Evan Benn , David Airlie , LKML , dri-devel , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 9, 2020 at 9:53 PM CK Hu wrote: > > Hi, Evan: > > On Fri, 2020-02-07 at 16:34 +0800, CK Hu wrote: > > Hi, Evan: > > > > On Fri, 2020-02-07 at 15:23 +1100, Evan Benn wrote: > > > The cursor and primary planes were hard coded. > > > Now search for them for passing to drm_crtc_init_with_planes > > > > > > > Reviewed-by: CK Hu > > Applied to mediatek-drm-fixes-5.6 [1], thanks. > Hi CK, Thanks for picking this up. Before you send the pull, could you please reverse the order of these 2 patches? Evan's should come before mine to prevent a regression. Sean > [1] > https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.6 > > Regards, > CK > > > > > > Signed-off-by: Evan Benn > > > --- > > > > > > drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 ++++++++++++------ > > > 1 file changed, 12 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > > index 7b392d6c71cc..935652990afa 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c > > > @@ -658,10 +658,18 @@ static const struct drm_crtc_helper_funcs mtk_crtc_helper_funcs = { > > > > > > static int mtk_drm_crtc_init(struct drm_device *drm, > > > struct mtk_drm_crtc *mtk_crtc, > > > - struct drm_plane *primary, > > > - struct drm_plane *cursor, unsigned int pipe) > > > + unsigned int pipe) > > > { > > > - int ret; > > > + struct drm_plane *primary = NULL; > > > + struct drm_plane *cursor = NULL; > > > + int i, ret; > > > + > > > + for (i = 0; i < mtk_crtc->layer_nr; i++) { > > > + if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_PRIMARY) > > > + primary = &mtk_crtc->planes[i]; > > > + else if (mtk_crtc->planes[i].type == DRM_PLANE_TYPE_CURSOR) > > > + cursor = &mtk_crtc->planes[i]; > > > + } > > > > > > ret = drm_crtc_init_with_planes(drm, &mtk_crtc->base, primary, cursor, > > > &mtk_crtc_funcs, NULL); > > > @@ -830,9 +838,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, > > > return ret; > > > } > > > > > > - ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0], > > > - mtk_crtc->layer_nr > 1 ? &mtk_crtc->planes[1] : > > > - NULL, pipe); > > > + ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, pipe); > > > if (ret < 0) > > > return ret; > > > > > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel