Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp189235ybv; Thu, 6 Feb 2020 20:55:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwKpMQnfhMkbKJx4Gsze86StsecLhBTtQRQ9lroxOwBngiHl2JIW5CQDy9+YaWb1VdXdAiL X-Received: by 2002:aca:2b04:: with SMTP id i4mr909535oik.21.1581051340893; Thu, 06 Feb 2020 20:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581051340; cv=none; d=google.com; s=arc-20160816; b=NvU9GZwNyOFtmVfyN31rOFkcdppo/Q/GnN8+b20owT/EIyfcGwt3kpMD2PDBimGJsp wjj2ayiHNYPEGBYK+ViLt3iVwWbPhPd2CvTKaY1/FNQOWu7es6pJMDSzmkfdu4m6n6ra CA+HzE9Hd6xrZDy08CzKIrpRnkztFlr+95LnkO/Tts2EuYRwLEh351SGTf4B9XXSIboC 2clM4bcCaJQ63VkoyR38KHzLrXql7YDjfWp/gnO6y9rnlEqpf1C8ZNNGwMjXGQKa//4w tkxrPCkMXneIYX/ItZGilPqfcF8TosHR/Gh9eVlnx5WVkNjGQPHv+vvmrwBMMXT+549h Rlrw== 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=W8urWy+QgrC/YMF1CIIkby5XffaDuEx4UNskBOy8RUs=; b=vfnkUeGq9i5qYynE3SZHd8I66SBCxo56O8ngYWnKwYSGLsM3i8K4AUnd7OWrSWcf7+ /96N7V+9edj4UQZkd4RkNg7m/dzhzNJTEXG4RGPFKSBDq/qa3vAvTJiJRwwtkfL0WUlb /hACarh50Ar082tQ7hprGQN8bctaYaFLZSbh5obXN8mfyVdxatKl39QiLpCivLyDDf33 nRpp4bt5xg9Q5Q1p8sUpDpJEtyAhmXcxRKEmSG49ug3WdRdEvVrLnQERpk43V0LVmC25 VMZS2MosGPgafMcBn+7wMJRclT8UGad3qEoslm8Bp4MwxtvznhEpiOFWgHPnQXNB3Fy8 9FRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fL8dDpBS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f187si3344207oia.218.2020.02.06.20.55.26; Thu, 06 Feb 2020 20:55:40 -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=@chromium.org header.s=google header.b=fL8dDpBS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727305AbgBGEwf (ORCPT + 99 others); Thu, 6 Feb 2020 23:52:35 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39433 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgBGEwe (ORCPT ); Thu, 6 Feb 2020 23:52:34 -0500 Received: by mail-oi1-f194.google.com with SMTP id z2so836230oih.6 for ; Thu, 06 Feb 2020 20:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W8urWy+QgrC/YMF1CIIkby5XffaDuEx4UNskBOy8RUs=; b=fL8dDpBSRVSlM8FGOuZfEp6zopgEtvglqThCVlfAdJyXUd1xw/bl5PyyXPjVJMmE6O xhruU/YngLkt6YE9gdDXeL0++a8tYHMimWtQCT1caaDsqrcfcL2TXNgDO46Tg6IwfPBc N68ToIQHl33MkLSupJmZeDaLwA89c5qw5fqL8= 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=W8urWy+QgrC/YMF1CIIkby5XffaDuEx4UNskBOy8RUs=; b=buW50sCiWmOq6HR3CDFne9wkLkPpewINierjBAmY+9SjxJuUrae5vZGAIg87Pz8X0n bz2a5ml2tZtFLzuutHd6ykJ9eBY0szmY+rrOWMPRXQNlQKB5mRhBCzN0eXHLgM+PTY0V B+gspUNhvmLLn+szfZfgbCks+ZFYZA5tccJairiNzHuigSa0PacYHFOpltOa2dp2ZCxL QJeFF3tvwgaA9Yjn4SKJAxH1JlLwQ7SGUFkbN7VKJVrmveqJnwTx9Uh5nmYvdE8bQ3JT ALd81h4mASJzr1A7fdNwMDRs/H1Q/atGEK96r6QEliT2KgXZk3VfqEJ5aJcafYpSaMeq MN7Q== X-Gm-Message-State: APjAAAXNbdAFFDZ36YvBjdjog9W/WLH9GZ/h1FUnKHlTJWAgdD0bBaAP lBrmW8rlZ3LtVlZIbwZnvYZB01jB88HpUT1tC5KaK3d/j4bKOg== X-Received: by 2002:aca:ebc3:: with SMTP id j186mr871922oih.15.1581051154041; Thu, 06 Feb 2020 20:52:34 -0800 (PST) MIME-Version: 1.0 References: <20200206140140.GA18465@art_vandelay> <20200207152348.1.Ie0633018fc787dda6e869cae23df76ae30f2a686@changeid> In-Reply-To: <20200207152348.1.Ie0633018fc787dda6e869cae23df76ae30f2a686@changeid> From: Evan Benn Date: Fri, 7 Feb 2020 15:52:23 +1100 Message-ID: Subject: Re: [PATCH] drm/mediatek: Find the cursor plane instead of hard coding it To: dri-devel@lists.freedesktop.org Cc: CK Hu , Philipp Zabel , linux-kernel@vger.kernel.org, Matthias Brugger , linux-mediatek@lists.infradead.org, David Airlie , linux-arm-kernel@lists.infradead.org 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 Apologies for the confusing thread. Please apply the above patch: 'drm/mediatek: Find the cursor plane instead of hard coding it' before Sean Paul's original patch: 'drm/mediatek: Ensure the cursor plane is on top of other overlays' This way authorship is correctly preserved, but we do not introduce the bug. Thanks On Fri, Feb 7, 2020 at 3:23 PM Evan Benn wrote: > > The cursor and primary planes were hard coded. > Now search for them for passing to drm_crtc_init_with_planes > > 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; > > -- > 2.25.0.341.g760bfbb309-goog >