From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CB3F3CAA2F for ; Wed, 19 Aug 2026 16:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155250; cv=none; b=QitLFEmWCttB3aet1xq2MFUcmaxVUINQBc2mJNbio7+YScaITyXhyl57S21xNomm7EVvm+d5vWUS6jDLX78Xbar6R6+c8WN2ep7+htr9C6tZxfTgo6wyo3s80Fg38NBWZpflxptdgkB9fofl3dXeq7mKX5pdGMHBxYDDqhfIFhM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155250; c=relaxed/simple; bh=G4UGP4NGN59eDuchUoI5jlqttQIVGja8D1u+D7YFD7s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XamE/rIxQzH9oLLnZpzZd7tTbbA5e9nh8BuXCOs8nBaMoojxbNkJaeth/mS271Sg5Ej3cdcYFbpOSVb9KK/XCEGbJwcUudEfRjjV/KvpIFDxWtRz5ypof8yzweOX3FoZ9Qvy5BOSQlgBjQ+a7Lrq6pRkJnVfNdWPtxhbmcmKd+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GldHlhwV; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GldHlhwV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155248; 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=o/spj4W5FENPyv/B4rNGsfmEZBcto8Uc5DMRDqeD4Hw=; b=GldHlhwVd3bGwuY9BSbrXOgru+7K4jSbfwfxATTfUzPNLDamJTDcrWdGZyLo7Jvsps/QMa TP9jLkWGykSvGEl83XXjQ/2PxsTLwflzK+6zkhwQbwlGjRllX3wPcfb5s3fOe8/uT/FUTk 7Dkqa1woXNmWjekCPT9XA8fhtbkxgOE= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-j6z_4fppNDCdYmnoOZ5soQ-1; Wed, 19 Aug 2026 12:00:46 -0400 X-MC-Unique: j6z_4fppNDCdYmnoOZ5soQ-1 X-Mimecast-MFC-AGG-ID: j6z_4fppNDCdYmnoOZ5soQ_1787155231 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 950E319541B1; Wed, 19 Aug 2026 16:00:28 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.89.72]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6904C18005BC; Wed, 19 Aug 2026 16:00:25 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marek Czernohous Cc: "Faith Ekstrand" , "Dave Airlie" , "Marek Czernohous" , "Maarten Lankhorst" , "Luca Ceresoli" , "Marco Crivellari" , "Kees Cook" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH v2 6/6] drm/nouveau/kms/nv50-: Obliterate nouveau_encoder->crtc Date: Wed, 19 Aug 2026 11:43:53 -0400 Message-ID: <20260819155934.154125-7-lyude@redhat.com> In-Reply-To: <20260819155934.154125-1-lyude@redhat.com> References: <20260819155934.154125-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 This is mostly a leftover artifact from the pre-atomic days, and while we've been using it for a while now - it isn't great. Mostly because having redundant state tracking for things atomic already keeps track of is pretty much always error prone, as anyone working on nouveau who isn't already very well versed in atomic modesetting isn't going to realize this isn't the right way to see what CRTC is assigned to an encoder. Now that we've removed the only legitimate user (DRM audio) and all the illegitimate ones, let's obliterate it. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 -------- drivers/gpu/drm/nouveau/nouveau_encoder.h | 3 --- 2 files changed, 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index fbb874b11d7a8..1882ab3176a49 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -502,7 +502,6 @@ nv50_dac_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_commit *s const u32 ctrl = NVDEF(NV507D, DAC_SET_CONTROL, OWNER, NONE); core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); - nv_encoder->crtc = NULL; } static void @@ -532,8 +531,6 @@ nv50_dac_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_commit *st core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, asyh); asyh->or.depth = 0; - - nv_encoder->crtc = &nv_crtc->base; } static enum drm_connector_status @@ -1634,7 +1631,6 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_commit *s nv_encoder->update(nv_encoder, head->base.index, NULL, 0, 0); nv50_audio_disable(encoder, &head->base); - nv_encoder->crtc = NULL; } // common/inc/displayport/displayport.h @@ -1802,7 +1798,6 @@ nv50_sor_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_commit *st u8 depth = NV837D_SOR_SET_CONTROL_PIXEL_DEPTH_DEFAULT; nv_connector = nv50_outp_get_new_connector(state, nv_encoder); - nv_encoder->crtc = &nv_crtc->base; if ((disp->disp->object.oclass == GT214_DISP || disp->disp->object.oclass >= GF110_DISP) && @@ -2013,7 +2008,6 @@ nv50_pior_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_commit * const u32 ctrl = NVDEF(NV507D, PIOR_SET_CONTROL, OWNER, NONE); core->func->pior->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); - nv_encoder->crtc = NULL; } static void @@ -2058,7 +2052,6 @@ nv50_pior_atomic_enable(struct drm_encoder *encoder, struct drm_atomic_commit *s } core->func->pior->ctrl(core, nv_encoder->outp.or.id, ctrl, asyh); - nv_encoder->crtc = &nv_crtc->base; } static const struct drm_encoder_helper_funcs @@ -2794,7 +2787,6 @@ nv50_display_read_hw_or_state(struct drm_device *dev, struct nv50_disp *disp, armh->state.enable = true; pm_runtime_get_noresume(dev->dev); - outp->crtc = crtc; outp->ctrl = NVVAL(NV507D, SOR_SET_CONTROL, PROTOCOL, proto) | BIT(crtc->index); drm_connector_get(conn); diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/nouveau/nouveau_encoder.h index 647322ac1c8df..6dcdfd048a35d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_encoder.h +++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h @@ -54,9 +54,6 @@ struct nouveau_encoder { struct i2c_adapter *i2c; - /* different to drm_encoder.crtc, this reflects what's - * actually programmed on the hw, not the proposed crtc */ - struct drm_crtc *crtc; u32 ctrl; /* Protected by nouveau_drm.audio.lock */ -- 2.55.0