Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp963343rdb; Tue, 19 Sep 2023 16:11:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIc0HfdTvRsXjIi1zEIUa5UtgEe+/FwH2uW3PRZ/1a4Xl1VxktS7/39b3UMNzjRxcDD+vA X-Received: by 2002:a05:6a20:7493:b0:158:1387:6a95 with SMTP id p19-20020a056a20749300b0015813876a95mr1126351pzd.19.1695165098368; Tue, 19 Sep 2023 16:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695165098; cv=none; d=google.com; s=arc-20160816; b=X9N7lXnyyujHCzfgnUI3g3rHapcrNqAP3oAY/ps8HxUJq6ubLtPAmic77fyorQjraI YG5njDd/vtzEwUaQkkKEAOD5HGZM5u314mpdp30ICA2voeiVI1Uzkw5IdZKfxUdIgd5x h4Vm/f+6BE8Xt56mrTuhQnyRiB75xw2TWQ/oLjeAcQTVyflsbnFNgC8A2xUbvYbc9thx EZW2uC6C0ez18aScxjo4t08iNZ7bMa2k+bbpbsns27LbDk08IQg8o6x441zpD2Mnn2Hh 3xAIC5red4Rwju110IpN5pmSLR/+QGwAKZhZX68cYi483DXLXawmRiyqkN5fjZfe4XHw wg7Q== 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=ZDlxZXlw0JV4U7Nw4IyuZ8EJ56qCOFrt9bf6Gmbwdp4=; fh=LphdH2KZBF5dGhNB8OUz/iCnTrVRiTKOHYGPc7QmRQ8=; b=dyR+9AvBPaRZGicqyGi+b0vGf5mCfr0TJYgZHGmIsPxlNx1W/InpbtRse2oZB5MVQF jevSLQrhJVjDD69/KTHVA6Q02FGPvL4iKWmlDZy05hqF25KWg7rZ8lAB3BN5TdIyHyEk tsG2K29O8x07qpZWhGMV880EzVO2ihbA4fKx3ZmEQxVNNS77ib6p3pIhDEv05rz+JC05 pX7+qE5H6ThsKYPGlvxaJG27EqkZSL9QWNeYArZDpS+fmDk+K8DpkplmKYm41NNjjN+a G682NweUAxEi7goDk8AovYJVIUd4epQUg5JMAmL7jV+wqxW366yLefSzqjnOYMLP61OR C0CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I1xVxVQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id dw23-20020a056a00369700b0068fb1a85ec8si390812pfb.370.2023.09.19.16.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 16:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I1xVxVQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 1BABF8303A1F; Tue, 19 Sep 2023 15:10:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233537AbjISWK4 (ORCPT + 99 others); Tue, 19 Sep 2023 18:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbjISWKz (ORCPT ); Tue, 19 Sep 2023 18:10:55 -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 D0397B3 for ; Tue, 19 Sep 2023 15:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695161259; 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=ZDlxZXlw0JV4U7Nw4IyuZ8EJ56qCOFrt9bf6Gmbwdp4=; b=I1xVxVQO5tBM92Qq8x5AuI6Ljx/RWly518TRp7xoANmZ33U6Bs2YsB/F5zcZqzRMEXnOzy FJIWYGl63SsgpgoFqf68xPOIZ7XIVKSkucGEm96o9CqDaQPe1jOCpAzi3Zx8XLuHkQSGq/ DymjDauLKTGfUFfD6If26dPsG42qQzQ= 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-534-mDCDAfWCMuSuLJotFf7nBA-1; Tue, 19 Sep 2023 18:07:35 -0400 X-MC-Unique: mDCDAfWCMuSuLJotFf7nBA-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 27D738039C8; Tue, 19 Sep 2023 22:07:35 +0000 (UTC) Received: from emerald.lyude.net (unknown [10.22.18.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB68E40C2064; Tue, 19 Sep 2023 22:07:34 +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 39/44] drm/nouveau/kms/nv50-: create heads based on nvkm head mask Date: Tue, 19 Sep 2023 17:56:34 -0400 Message-ID: <20230919220442.202488-40-lyude@redhat.com> In-Reply-To: <20230919220442.202488-1-lyude@redhat.com> References: <20230919220442.202488-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 15:10:58 -0700 (PDT) From: Ben Skeggs No need to go poking HW directly, and probably shouldn't on GSP-RM. 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 | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index d6de5ee89d543..2134502ec04e2 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2692,13 +2692,12 @@ nv50_display_destroy(struct drm_device *dev) int nv50_display_create(struct drm_device *dev) { - struct nvif_device *device = &nouveau_drm(dev)->client.device; struct nouveau_drm *drm = nouveau_drm(dev); struct dcb_table *dcb = &drm->vbios.dcb; struct drm_connector *connector, *tmp; struct nv50_disp *disp; struct dcb_output *dcbe; - int crtcs, ret, i; + int ret, i; bool has_mst = nv50_has_mst(drm); disp = kzalloc(sizeof(*disp), GFP_KERNEL); @@ -2776,20 +2775,9 @@ nv50_display_create(struct drm_device *dev) } /* create crtc objects to represent the hw heads */ - if (disp->disp->object.oclass >= GV100_DISP) - crtcs = nvif_rd32(&device->object, 0x610060) & 0xff; - else - if (disp->disp->object.oclass >= GF110_DISP) - crtcs = nvif_rd32(&device->object, 0x612004) & 0xf; - else - crtcs = 0x3; - - for (i = 0; i < fls(crtcs); i++) { + for_each_set_bit(i, &disp->disp->head_mask, sizeof(disp->disp->head_mask) * 8) { struct nv50_head *head; - if (!(crtcs & (1 << i))) - continue; - head = nv50_head_create(dev, i); if (IS_ERR(head)) { ret = PTR_ERR(head); @@ -2814,7 +2802,7 @@ nv50_display_create(struct drm_device *dev) * Once these issues are closed, this should be * removed */ - head->msto->encoder.possible_crtcs = crtcs; + head->msto->encoder.possible_crtcs = disp->disp->head_mask; } } -- 2.41.0