From patchwork Tue Sep 19 21:56:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 142135 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3774079vqi; Tue, 19 Sep 2023 17:25:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6uKOucKqzpPj1LMdbl+u1zd39W1Hu5T3qUXBDfbJVpe8uu6ISMNXuXjjoQaN9FPcY0Xef X-Received: by 2002:a17:90a:ca93:b0:273:dfb1:2439 with SMTP id y19-20020a17090aca9300b00273dfb12439mr4930791pjt.21.1695169557815; Tue, 19 Sep 2023 17:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695169557; cv=none; d=google.com; s=arc-20160816; b=t7DsDHzrPD0NgzVYOjLeC5PllARkVqqVLZZpsDCON3VW3GvLXk/Zqh83l569N1pnAS NdWDzKVAC5sN25xg1U00eTjI3TKf/jUrITLnCI7amZRigy29U1h44cYFt4+EH+DTyDTX 8njIMqpy1TxZ++UslBlKhbgrrotlxMQywiTv7K6OcGbW6BwDOYw646K7qFvWR0dhrkdS VGdnEa+tq5rYUJ8bmYicHgWXr8fqdsBh8yr5gLiC3VVdpoZOyaSHUdy4yrzCJ0cRrvwq eezxbUs97likQZk0PoAsEK8UTEp45MVttryt3IEfzBoHIFAEQ2pp85VSekmaqzQ4Y8LN Ow1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zFieiXbaBTjfuTiZca2mPcFhbLUov1B8cBzL+moIOfI=; fh=LphdH2KZBF5dGhNB8OUz/iCnTrVRiTKOHYGPc7QmRQ8=; b=jtt6XvKKzWRB6Poh691WHpX2X67/FuFy0QRtigv9cG2CN8VEk4INjH9eeh8BSgq7Da IKOrHMo5xamHsb4Gw9696085quEvrr4JGzlVYQ1uIBuaE73L7+ntgdfnAKvgYtFYK4VB 5nAfkpLmPws3eZyfsMXz4AnIDobIodr45UpTjgE9Ro6xksmpkcnkTHCIRVvwAE58zlh9 je4pTu3h0vhan9G+7SH+tQx+KanFoLjL4CwUwLkj1Lk/d2oe5C3RL835o89WCIlidKct p/AOfnTcQQGoCeApBNBJ1QXqacMt0K1eskmqTN0ftbYe/utFazvXt98W0b4q+QIodnqq qyeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="iFcI0/6T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q24-20020a17090aa01800b00276b1993b47si320380pjp.135.2023.09.19.17.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="iFcI0/6T"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 30535833CE04; Tue, 19 Sep 2023 15:09:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233445AbjISWJ3 (ORCPT + 26 others); Tue, 19 Sep 2023 18:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233629AbjISWJV (ORCPT ); Tue, 19 Sep 2023 18:09:21 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9A111B8 for ; Tue, 19 Sep 2023 15:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695161260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zFieiXbaBTjfuTiZca2mPcFhbLUov1B8cBzL+moIOfI=; b=iFcI0/6Tua2P36uJK6EORI6/m+qQCQvmYfBIxhn41AbAyCeLW1d3UATjJzfOJhA1lAH72O sVbSMIJaMyxqZ029+200a5+jJPBt0xrM8//cso040nL1cHk+w1RYVA6KO99hJaKDuWRsVs 42BZzWgck2+gPIi6hz83amA2h/8E25Q= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-u6ZPMQjhPmGjAgPc6Tpi0Q-1; Tue, 19 Sep 2023 18:07:36 -0400 X-MC-Unique: u6ZPMQjhPmGjAgPc6Tpi0Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69C32800883; Tue, 19 Sep 2023 22:07:36 +0000 (UTC) Received: from emerald.lyude.net (unknown [10.22.18.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0920A40C2064; Tue, 19 Sep 2023 22:07:36 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Cc: Ben Skeggs , Danilo Krummrich , Karol Herbst , David Airlie , Daniel Vetter , Wayne Lin , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 40/44] drm/nouveau/kms/nv50-: create heads after outps/conns Date: Tue, 19 Sep 2023 17:56:35 -0400 Message-ID: <20230919220442.202488-41-lyude@redhat.com> In-Reply-To: <20230919220442.202488-1-lyude@redhat.com> References: <20230919220442.202488-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 19 Sep 2023 15:09:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777514114153752137 X-GMAIL-MSGID: 1777514114153752137 From: Ben Skeggs - output info will be used later to determine MST support Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 64 ++++++++++++------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 2134502ec04e2..26d59346703e3 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2774,38 +2774,6 @@ nv50_display_create(struct drm_device *dev) dev->mode_config.cursor_height = 64; } - /* create crtc objects to represent the hw heads */ - for_each_set_bit(i, &disp->disp->head_mask, sizeof(disp->disp->head_mask) * 8) { - struct nv50_head *head; - - head = nv50_head_create(dev, i); - if (IS_ERR(head)) { - ret = PTR_ERR(head); - goto out; - } - - if (has_mst) { - head->msto = nv50_msto_new(dev, head, i); - if (IS_ERR(head->msto)) { - ret = PTR_ERR(head->msto); - head->msto = NULL; - goto out; - } - - /* - * FIXME: This is a hack to workaround the following - * issues: - * - * https://gitlab.gnome.org/GNOME/mutter/issues/759 - * https://gitlab.freedesktop.org/xorg/xserver/merge_requests/277 - * - * Once these issues are closed, this should be - * removed - */ - head->msto->encoder.possible_crtcs = disp->disp->head_mask; - } - } - /* create encoder/connector objects based on VBIOS DCB table */ for (i = 0, dcbe = &dcb->entry[0]; i < dcb->entries; i++, dcbe++) { struct nouveau_encoder *outp; @@ -2868,6 +2836,38 @@ nv50_display_create(struct drm_device *dev) connector->funcs->destroy(connector); } + /* create crtc objects to represent the hw heads */ + for_each_set_bit(i, &disp->disp->head_mask, sizeof(disp->disp->head_mask) * 8) { + struct nv50_head *head; + + head = nv50_head_create(dev, i); + if (IS_ERR(head)) { + ret = PTR_ERR(head); + goto out; + } + + if (has_mst) { + head->msto = nv50_msto_new(dev, head, i); + if (IS_ERR(head->msto)) { + ret = PTR_ERR(head->msto); + head->msto = NULL; + goto out; + } + + /* + * FIXME: This is a hack to workaround the following + * issues: + * + * https://gitlab.gnome.org/GNOME/mutter/issues/759 + * https://gitlab.freedesktop.org/xorg/xserver/merge_requests/277 + * + * Once these issues are closed, this should be + * removed + */ + head->msto->encoder.possible_crtcs = disp->disp->head_mask; + } + } + /* Disable vblank irqs aggressively for power-saving, safe on nv50+ */ dev->vblank_disable_immediate = true;