From nobody Mon Sep 28 18:33:59 2026 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 DF9483806C2 for ; Tue, 18 Aug 2026 23:56:55 +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=1787097417; cv=none; b=QFd8xgNhdJgm6uZ75JYcXKucX3JVyUL0FFeRIHDc4PVaKpWLxxtaAZcDsVxGq59kmrgP5YybLhUwpEcC8phYFDI+HgHf4NTRbMk0K4nwJJEjrO8sq/8bHwwv011jWUjEMaIFJ6FZ/mtrE7OIbidIUjpsUaqZD82zQJkfb/PG56c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097417; c=relaxed/simple; bh=BJ/kVaE/61dNOwCMKw6yVJWUCXGmmJw0OAbiOOPSdz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BmVMAo7j7fc9P/4o6yMi2AX4mWzlY9bM9Vsp4Tm5KGPfJlKK6LlKttD3PO+i9KTAgeZHLtZ0xhA9gHbZhziAwHhvx/zdyEzUUBTPfuXWx13E9PmzF5ocbEgA0bMxFNeCnBYAO0jysIy6PZro4jJ4JbG00NqcQhk6BUOZZvPqN4o= 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=MC5whajg; 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="MC5whajg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yQ3/ySkk4MATWRJyNja7KbHykfH+1xBTq7SfrpfOH5s=; b=MC5whajg6dnDRA0aei7W5k98+cisuNyk5mYG3+NrIbx+SwzooPKO1Yi2pN8893xbsO6qOX sRXdaMmwamFPWrpMGTMCTq2jGYWbAY0ikRZukCbkppsyH7d7qL9cyqrzGBPhtoXdK6dpEa Y4GFAcHR2yWDWveyqZ24Wv6Wq9qGItI= 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-135-kpkGkP4lMGm6evd75ZFzzw-1; Tue, 18 Aug 2026 19:56:52 -0400 X-MC-Unique: kpkGkP4lMGm6evd75ZFzzw-1 X-Mimecast-MFC-AGG-ID: kpkGkP4lMGm6evd75ZFzzw_1787097410 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 D8D8A19560B4; Tue, 18 Aug 2026 23:56:49 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DCF76180049F; Tue, 18 Aug 2026 23:56:46 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marek Czernohous Cc: stable@vger.kernel.org, "Faith Ekstrand" , "Dave Airlie" , "Marek Czernohous" , "Maarten Lankhorst" , "Luca Ceresoli" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH 1/6] drm/nouveau/kms/nv50-: Move DPCD backlight disable into its own function Date: Tue, 18 Aug 2026 19:48:43 -0400 Message-ID: <20260818235637.1738055-2-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Besides using state->dev to access the nouveau_drm device again, there should be no functional changes here. Fixes: f575f2bdb6c3 ("drm/nouveau/kms/nv50-: Remove (nv_encoder->crtc) chec= ks in ->disable callbacks") Cc: # v5.12+ Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 39 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index 2c66e480b5116..a885394f7cb92 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1561,24 +1561,39 @@ nv50_sor_update(struct nouveau_encoder *nv_encoder,= u8 head, * the panel backlight has been shut off? Intel doesn't seem to do this, a= nd uses a * fixed time delay from the vbios=E2=80=A6 */ +#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT +static inline void +nv50_sor_atomic_disable_backlight(struct nouveau_drm *drm, + struct nouveau_encoder *nv_encoder, + struct drm_atomic_commit *state) +{ + struct nouveau_connector *nv_connector; + struct nouveau_backlight *backlight; + int ret; + + nv_connector =3D nv50_outp_get_old_connector(state, nv_encoder); + if (drm_WARN_ON(drm->dev, !nv_connector)) + return; + backlight =3D nv_connector->backlight; + + if (!backlight || !backlight->uses_dpcd) + return; + + ret =3D drm_edp_backlight_disable(&nv_connector->aux, &backlight->edp_inf= o); + if (ret < 0) + NV_ERROR(drm, "Failed to disable backlight on [CONNECTOR:%d:%s]: %d\n", + nv_connector->base.base.id, nv_connector->base.name, ret); +} +#endif + static void nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_com= mit *state) { struct nouveau_encoder *nv_encoder =3D nouveau_encoder(encoder); struct nv50_head *head =3D nv50_head(nv_encoder->crtc); -#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT - struct nouveau_connector *nv_connector =3D nv50_outp_get_old_connector(st= ate, nv_encoder); - struct nouveau_drm *drm =3D nouveau_drm(nv_encoder->base.base.dev); - struct nouveau_backlight *backlight =3D nv_connector->backlight; - struct drm_dp_aux *aux =3D &nv_connector->aux; - int ret; =20 - if (backlight && backlight->uses_dpcd) { - ret =3D drm_edp_backlight_disable(aux, &backlight->edp_info); - if (ret < 0) - NV_ERROR(drm, "Failed to disable backlight on [CONNECTOR:%d:%s]: %d\n", - nv_connector->base.base.id, nv_connector->base.name, ret); - } +#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT + nv50_sor_atomic_disable_backlight(nouveau_drm(state->dev), nv_encoder, st= ate); #endif =20 if (nv_encoder->dcb->type =3D=3D DCB_OUTPUT_TMDS && nv_encoder->hdmi.enab= led) { --=20 2.55.0 From nobody Mon Sep 28 18:33:59 2026 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 B3D083806C2 for ; Tue, 18 Aug 2026 23:57:14 +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=1787097436; cv=none; b=ZWpr9ixdbfDGcLvIQhDsGKTUm1bzME7l8pTvALiC+gFD3bi7SG8bAVTDfwxX6QnYLG+3D3R9ATPdjk7l89cVwe/GY+JZLuEoG6rrKpbWLpYIebVG8RAB7igNUGxoiU2VNGDv/KIEvpmgBrnKkrpDfILwFGHb8pgP5Of4EOMuYrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097436; c=relaxed/simple; bh=Go9qyjClI5XuqFOTeUdtCcOltUcHrxHIVnsoj1l3gZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eDPitzOCe5w2S89QuQiAnreSMLfpVOSQ/zMQKfQRa8oHUOYz0+0a11vCJhSQq2JOXGo7T6fddAf6KyRlvonW85Jm0BaT96pR02AWs8YNeRJAkJneikR6jdyiLJWmZeatZA6ctHSOmKiUogPibwvdsk+eLiNDdjL/L0TBheNTjyE= 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=dKj5Gd3V; 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="dKj5Gd3V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097433; 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=Cdwphjmf7twiQKozt/YmavKP3Voyo4Fdnf0ShOQkMVE=; b=dKj5Gd3VlqowZdPONMKI3WiKeLA49JB5E8Qxw+EPYkI/QCe3tLTB74bKjAEX9K6I+YbhTv RF4mW+fCSUdmy/++mMjOjbokaCsAE7iUhjZA7yHMwyL4nqKLsZM5SMZT2Rg4ZkvWl0Xe71 xtXplVvxy/BIgTqGIbsvGzcMtjE4QPo= 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-355-dpPbQUV8Ok279EuZMzRjBQ-1; Tue, 18 Aug 2026 19:56:59 -0400 X-MC-Unique: dpPbQUV8Ok279EuZMzRjBQ-1 X-Mimecast-MFC-AGG-ID: dpPbQUV8Ok279EuZMzRjBQ_1787097417 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 B0DD419560AA; Tue, 18 Aug 2026 23:56:56 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A06ED180049F; Tue, 18 Aug 2026 23:56:53 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marek Czernohous Cc: stable@vger.kernel.org, "Faith Ekstrand" , "Dave Airlie" , "Marek Czernohous" , "Maarten Lankhorst" , "Luca Ceresoli" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH 2/6] drm/nouveau/kms/nv50-: Add nv50_outp_get_old_crtc() Date: Tue, 18 Aug 2026 19:48:44 -0400 Message-ID: <20260818235637.1738055-3-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Does what it says on the label, unused for now. Signed-off-by: Lyude Paul Fixes: f575f2bdb6c3 ("drm/nouveau/kms/nv50-: Remove (nv_encoder->crtc) chec= ks in ->disable callbacks") Cc: # v5.12+ --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index a885394f7cb92..152361f7feb42 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -459,6 +459,22 @@ nv50_outp_get_old_connector(struct drm_atomic_commit *= state, struct nouveau_enco return NULL; } =20 +static struct nouveau_crtc * __maybe_unused +nv50_outp_get_old_crtc(const struct drm_atomic_commit *state, const struct= nouveau_encoder *outp) +{ + struct drm_crtc *crtc; + struct drm_crtc_state *crtc_state; + const u32 mask =3D drm_encoder_mask(&outp->base.base); + int i; + + for_each_old_crtc_in_state(state, crtc, crtc_state, i) { + if (crtc_state->encoder_mask & mask) + return nouveau_crtc(crtc); + } + + return NULL; +} + static struct nouveau_crtc * nv50_outp_get_new_crtc(const struct drm_atomic_commit *state, const struct= nouveau_encoder *outp) { --=20 2.55.0 From nobody Mon Sep 28 18:33:59 2026 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 C02B9381EB0 for ; Tue, 18 Aug 2026 23:57:13 +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=1787097435; cv=none; b=MI/Nvl6o898NNzdOWGG78KY2Iorbdgf7pisYe0ufIpJRQS6jqQGeRiJDxfSZ3KaedhXnwr8W3+VAoGd7lceLVoj8OnCpoLeOKnf93esZTfqkC+z2TuoMHMn0UxIziWtv3SU/5p9IhgUtbLSGH0Pj85m+s51/080RycEGnhgv94o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097435; c=relaxed/simple; bh=CCLYtguIp7aFmld18f3Sh0cOqkHOeVpid7iacpuj2RE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N9SRXBaipTPcogWRvjlAnikjIwRHVgOwjvjw+phj7ClnuctKN1dbEJ+wm/6/n1ZYuE7M+ilnaN0LYoqoAjxYsae6rcSGBnN4Nno5GJgCfZNdYHdB7TQTM2pPfElyvxcRkws62/z/AGBPGa5UQGEgwPVthVOkTUJfxzu0StBZw4U= 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=PcbR1N3c; 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="PcbR1N3c" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097432; 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=Pz0aXgFMqOpBVjMIOtdMICeTUjk8ldXgSQBenL20dmc=; b=PcbR1N3chSZMoqPJ39liELPBQRSrhGDdtZ+PV/XwX6JJpa7fScher951izZbPiEWc17HA0 N8vtQCMv7tTHE1rhT1g+QAdaE9gKvgYDTQ3NSZAenOpPo6V7BqkOIBCIRQCZPR2mNZgXmM 2XC+ZX4PRoT9i0h1xKBynUalyCdNzkc= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-H0UBxphkPlK_ZrnM_2TM5w-1; Tue, 18 Aug 2026 19:57:06 -0400 X-MC-Unique: H0UBxphkPlK_ZrnM_2TM5w-1 X-Mimecast-MFC-AGG-ID: H0UBxphkPlK_ZrnM_2TM5w_1787097424 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D881180049D; Tue, 18 Aug 2026 23:57:03 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7B68D1800347; Tue, 18 Aug 2026 23:57:00 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marek Czernohous Cc: Marek Czernohous , stable@vger.kernel.org, "Faith Ekstrand" , "Dave Airlie" , "Maarten Lankhorst" , "Luca Ceresoli" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "James Jones" , "Lyude Paul" Subject: [PATCH 3/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_sor_atomic_disable() Date: Tue, 18 Aug 2026 19:48:45 -0400 Message-ID: <20260818235637.1738055-4-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" This is a leftover CRTC bookkeeping variable from the pre-atomic days. While it works in most situations, it's prone to breaking - as pointed out by Marek Czernohous. Signed-off-by: Lyude Paul Reported-by: Marek Czernohous Fixes: f575f2bdb6c3 ("drm/nouveau/kms/nv50-: Remove (nv_encoder->crtc) chec= ks in ->disable callbacks") Cc: # v5.12+ --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index 152361f7feb42..f19820dc055ae 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -459,7 +459,7 @@ nv50_outp_get_old_connector(struct drm_atomic_commit *s= tate, struct nouveau_enco return NULL; } =20 -static struct nouveau_crtc * __maybe_unused +static struct nouveau_crtc * nv50_outp_get_old_crtc(const struct drm_atomic_commit *state, const struct= nouveau_encoder *outp) { struct drm_crtc *crtc; @@ -1606,12 +1606,18 @@ static void nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_com= mit *state) { struct nouveau_encoder *nv_encoder =3D nouveau_encoder(encoder); - struct nv50_head *head =3D nv50_head(nv_encoder->crtc); + struct nouveau_crtc *nv_crtc; + struct nv50_head *head; =20 #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT nv50_sor_atomic_disable_backlight(nouveau_drm(state->dev), nv_encoder, st= ate); #endif =20 + nv_crtc =3D nv50_outp_get_old_crtc(state, nv_encoder); + if (drm_WARN_ON(state->dev, !nv_crtc)) + return; + head =3D nv50_head(&nv_crtc->base); + if (nv_encoder->dcb->type =3D=3D DCB_OUTPUT_TMDS && nv_encoder->hdmi.enab= led) { nvif_outp_hdmi(&nv_encoder->outp, head->base.index, false, 0, 0, 0, false, false, false); --=20 2.55.0 From nobody Mon Sep 28 18:33:59 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 019B2383C8F for ; Tue, 18 Aug 2026 23:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097446; cv=none; b=YSahicsY/Rtf8pQ2yyhdEfWsDFOPj5hGkgjkOC+35N+1FeG9TihfcI/c/qIOU/dEHGQpfLv294MxYKSEb3agiN3Y4cz0R9bLw9zQirR9tSKrreRrKvlCqCwN0U2RWygpy4Cip7VxDhyEAmA6gDDo++YroqqxMYvc0ajNSdTKCe8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097446; c=relaxed/simple; bh=FEfZVw3I7pLTnOoRqF7JdRxdkEeZS9JVn6Q3+uhuFak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KbiBEyuThB4RqYjJwcxMWyeKCzmizCcA+9cBMmyti3GYgcZZQDd9NOxqUuCbrl+bwn1zAuxYp8BdWmYPWqD3PsmJzUhYfDLitqjDgPtbF9qcOeflFc+iBj8CgAZ6xk80nzWxXtvRFTcdWFEiSsLluM+0J0TBm3ss+nWR2Hr0QEk= 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=g0EG2l6b; arc=none smtp.client-ip=170.10.133.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="g0EG2l6b" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097442; 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=+AiUvg3f0tmCvkZK9tohm8bvMedZbKf/cdnpoumO1Tw=; b=g0EG2l6bARcijadv8DMrLn808EL5vB2lmGhkIuzo4kMOkMVL1zyeozOgufEMMilsXTOi28 qeqPXAYFgou7N4Hw3lN+ezzuFTofe5FMMoZGQlHFRbWmuON9gFonpMxiNA41C/U95zQe+a GXtiSlfWybL2TNQi52BKRrGkWMJzA2g= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-aqiblKe4MkGyJoEF2yAsqQ-1; Tue, 18 Aug 2026 19:57:12 -0400 X-MC-Unique: aqiblKe4MkGyJoEF2yAsqQ-1 X-Mimecast-MFC-AGG-ID: aqiblKe4MkGyJoEF2yAsqQ_1787097430 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1B8C41800637; Tue, 18 Aug 2026 23:57:10 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C9D41800347; Tue, 18 Aug 2026 23:57:07 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Marek Czernohous Cc: Marek Czernohous , "Faith Ekstrand" , "Dave Airlie" , "Maarten Lankhorst" , "Luca Ceresoli" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core() Date: Tue, 18 Aug 2026 19:48:46 -0400 Message-ID: <20260818235637.1738055-5-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Another leftover spot where we still use nv_encoder->crtc. Get rid of it and do the right thing: get the currently assigned CRTC from the new atomic state. Signed-off-by: Lyude Paul Reported-by: Marek Czernohous --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index f19820dc055ae..63d554e97fb62 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2171,10 +2171,14 @@ nv50_disp_atomic_commit_core(struct drm_atomic_comm= it *state, u32 *interlock) list_for_each_entry(outp, &atom->outp, head) { if (outp->encoder->encoder_type !=3D DRM_MODE_ENCODER_DPMST) { struct nouveau_encoder *nv_encoder =3D nouveau_encoder(outp->encoder); + struct nouveau_crtc *nv_crtc =3D nv50_outp_get_new_crtc(state, nv_encod= er); + + if (drm_WARN_ON(drm->dev, !nv_crtc)) + continue; =20 if (outp->enabled) { - nv50_audio_enable(outp->encoder, nouveau_crtc(nv_encoder->crtc), - nv_encoder->conn, NULL, NULL); + nv50_audio_enable(outp->encoder, nv_crtc, nv_encoder->conn, NULL, + NULL); outp->enabled =3D outp->disabled =3D false; } else { if (outp->disabled) { --=20 2.55.0 From nobody Mon Sep 28 18:33:59 2026 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 0439A385529 for ; Tue, 18 Aug 2026 23:57:33 +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=1787097455; cv=none; b=oX2iigCBJbnO5LpsiswolaM+1raHYIn/aAPw795vglDHY8rRS07lQ49ShFkttEvpUHCzg3ubTLWOTPo/MN1iSZ8sE6HGiGNkZm962H9vVDvan1qpXNPfCa07XQnLWgBWPCKUxcYybCzabLoPQLj9lvspTnbfm79TuiqlTKGUORA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097455; c=relaxed/simple; bh=Tfzt0Z68bihyXdu0vR/jV6efgJzKtIS85Vqf+E2pWXM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pBqHPkjkY8QnDVj0sy211UP9gukXclzkyFVxKLYUL/8R7zNw6MRRHzsXYWjFE6o5jnTJnpKdp17r+9oF3UglsMyM7jj9J/l2Xx9Ds5Ktr8fzo0HrmetJYXzO+YB+1s/l/vRz+EbtMBTf5HsO7fCJTQKUfGBgHfXI4SyMM6IfijE= 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=QJATYYA6; 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="QJATYYA6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097453; 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=6joxchIjpSKAZuVd8UNWe0u9ndTjKFHdE9rh6/DiW54=; b=QJATYYA62RWOEJ8rGJ5mc/YD3Ww+CHwfuGmt0TjwhNgDq3ZRHK3oc35xDRTHK6fW9J+mz9 jeoRZkE7WVwiofOgM8NmY9awkyDunFi0h6mrSxFfJi+clE+CaHK22LHfJG9so+XKVy8qnz i2Wpl/TOcfqQmjr8CYcbPvvOS3GFIvY= 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-711-rwbj6aTuNea1z1EyPRRfDQ-1; Tue, 18 Aug 2026 19:57:18 -0400 X-MC-Unique: rwbj6aTuNea1z1EyPRRfDQ-1 X-Mimecast-MFC-AGG-ID: rwbj6aTuNea1z1EyPRRfDQ_1787097436 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 4890B1956041; Tue, 18 Aug 2026 23:57:16 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C0329180049F; Tue, 18 Aug 2026 23:57:13 +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" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH 5/6] drm/nouveau/kms/nv50-: Add nouveau_encoder->audio.crtc Date: Tue, 18 Aug 2026 19:48:47 -0400 Message-ID: <20260818235637.1738055-6-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" This is the only spot in nouveau where we do actually need to keep track of the currently assigned CRTC for an encoder, and it ideally should be happening outside of the modesetting locks. So in preparation for obliterating nouveau_encoder->crtc, let's just add a variable into nouveau_encoder->audio for tracking this and use it instead of nouveau_encoder->crtc. This makes it a lot more obvious that this is only intended for state-tracking for audio. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index 63d554e97fb62..3bfc04f7ef602 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -636,7 +636,7 @@ nv50_audio_component_get_eld(struct device *kdev, int p= ort, int dev_id, =20 nv_encoder =3D nouveau_encoder(encoder); nv_connector =3D nv_encoder->conn; - nv_crtc =3D nouveau_crtc(nv_encoder->crtc); + nv_crtc =3D nv_encoder->audio.crtc; =20 if (!nv_crtc || nv_encoder->outp.or.id !=3D port || nv_crtc->index !=3D = dev_id) continue; @@ -757,6 +757,7 @@ nv50_audio_disable(struct drm_encoder *encoder, struct = nouveau_crtc *nv_crtc) mutex_lock(&drm->audio.lock); if (nv_encoder->audio.enabled) { nv_encoder->audio.enabled =3D false; + nv_encoder->audio.crtc =3D NULL; nvif_outp_hda_eld(&nv_encoder->outp, nv_crtc->index, NULL, 0); } mutex_unlock(&drm->audio.lock); @@ -781,6 +782,7 @@ nv50_audio_enable(struct drm_encoder *encoder, struct n= ouveau_crtc *nv_crtc, nvif_outp_hda_eld(&nv_encoder->outp, nv_crtc->index, nv_connector->base.e= ld, drm_eld_size(nv_connector->base.eld)); nv_encoder->audio.enabled =3D true; + nv_encoder->audio.crtc =3D nv_crtc; =20 mutex_unlock(&drm->audio.lock); =20 diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/no= uveau/nouveau_encoder.h index 4422c6185d498..647322ac1c8df 100644 --- a/drivers/gpu/drm/nouveau/nouveau_encoder.h +++ b/drivers/gpu/drm/nouveau/nouveau_encoder.h @@ -62,6 +62,7 @@ struct nouveau_encoder { /* Protected by nouveau_drm.audio.lock */ struct { bool enabled; + struct nouveau_crtc *crtc; } audio; =20 struct drm_display_mode mode; --=20 2.55.0 From nobody Mon Sep 28 18:33:59 2026 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 025B6381EB1 for ; Tue, 18 Aug 2026 23:57:29 +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=1787097451; cv=none; b=ttecFU0BrAEXViw75JqAj63gtMHB/7o6CjcthyvbPCzHh8VadMWw5rhjQoEM92lHnrt+YM/4EGKFACwYmbhcypoGV31B840xapRvwJxnNWjTDE4w9Zz1TI3qKBfZCet/lDz39R2fvDhMG/S0+YsvnSsjd9Uc6sU9FjgHHxjtYJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787097451; c=relaxed/simple; bh=CLIflbTK3K8NuDlGXHs9MGesopu/mahtSFnSSloyOXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XhgNvBtsXGSDDrI6p5//Pl3Koh3c1UvaEzktm5kuXoKIskDv4c8Hk8AZiiBq1hcqUnq8g/h3+58rcTZqGWyEuM2LQ0QvJ5LKqzVYfV30DXPPhqQNuNiCaMaWjZ91PMZGOMzDGEKrIFmbpq5PgZrseBMuGgohXan++R6R2jkw/0I= 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=FP3lvmJ9; 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="FP3lvmJ9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787097449; 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=BCyf9rtyGAx6bysEfHD8j87uaMQiZpddyxAMrWCqR7E=; b=FP3lvmJ9qmyinjIrJ1TVc5p2CCXlckOHmelmUH+WXcX9AdlMe+GEMptablXePuZ6IV/6rw t7klZpLBheKFiwfS4XJNvKzRxkemUPStehw3DNmLsYKtkywHlIDNRA/RC3svZ9cgQznzVY rZHPz7btfjb8L8kW/ivKolHwlb51vVw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-301-CWvHRAMxOtaZlqVxCZ09-A-1; Tue, 18 Aug 2026 19:57:25 -0400 X-MC-Unique: CWvHRAMxOtaZlqVxCZ09-A-1 X-Mimecast-MFC-AGG-ID: CWvHRAMxOtaZlqVxCZ09-A_1787097443 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1574C180074B; Tue, 18 Aug 2026 23:57:23 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.80.100]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0E0111800347; Tue, 18 Aug 2026 23:57:19 +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" , "Kees Cook" , "Marco Crivellari" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH 6/6] drm/nouveau/kms/nv50-: Obliterate nouveau_encoder->crtc Date: Tue, 18 Aug 2026 19:48:48 -0400 Message-ID: <20260818235637.1738055-7-lyude@redhat.com> In-Reply-To: <20260818235637.1738055-1-lyude@redhat.com> References: <20260818235637.1738055-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" 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/nouv= eau/dispnv50/disp.c index 3bfc04f7ef602..9ab342ebed180 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, st= ruct drm_atomic_commit *s const u32 ctrl =3D NVDEF(NV507D, DAC_SET_CONTROL, OWNER, NONE); =20 core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); - nv_encoder->crtc =3D NULL; } =20 static void @@ -532,8 +531,6 @@ nv50_dac_atomic_enable(struct drm_encoder *encoder, str= uct drm_atomic_commit *st =20 core->func->dac->ctrl(core, nv_encoder->outp.or.id, ctrl, asyh); asyh->or.depth =3D 0; - - nv_encoder->crtc =3D &nv_crtc->base; } =20 static enum drm_connector_status @@ -1634,7 +1631,6 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, = struct drm_atomic_commit *s =20 nv_encoder->update(nv_encoder, head->base.index, NULL, 0, 0); nv50_audio_disable(encoder, &head->base); - nv_encoder->crtc =3D NULL; } =20 // common/inc/displayport/displayport.h @@ -1802,7 +1798,6 @@ nv50_sor_atomic_enable(struct drm_encoder *encoder, s= truct drm_atomic_commit *st u8 depth =3D NV837D_SOR_SET_CONTROL_PIXEL_DEPTH_DEFAULT; =20 nv_connector =3D nv50_outp_get_new_connector(state, nv_encoder); - nv_encoder->crtc =3D &nv_crtc->base; =20 if ((disp->disp->object.oclass =3D=3D GT214_DISP || disp->disp->object.oclass >=3D GF110_DISP) && @@ -2013,7 +2008,6 @@ nv50_pior_atomic_disable(struct drm_encoder *encoder,= struct drm_atomic_commit * const u32 ctrl =3D NVDEF(NV507D, PIOR_SET_CONTROL, OWNER, NONE); =20 core->func->pior->ctrl(core, nv_encoder->outp.or.id, ctrl, NULL); - nv_encoder->crtc =3D NULL; } =20 static void @@ -2058,7 +2052,6 @@ nv50_pior_atomic_enable(struct drm_encoder *encoder, = struct drm_atomic_commit *s } =20 core->func->pior->ctrl(core, nv_encoder->outp.or.id, ctrl, asyh); - nv_encoder->crtc =3D &nv_crtc->base; } =20 static const struct drm_encoder_helper_funcs @@ -2797,7 +2790,6 @@ nv50_display_read_hw_or_state(struct drm_device *dev,= struct nv50_disp *disp, armh->state.enable =3D true; pm_runtime_get_noresume(dev->dev); =20 - outp->crtc =3D crtc; outp->ctrl =3D NVVAL(NV507D, SOR_SET_CONTROL, PROTOCOL, proto) | BIT(crtc= ->index); =20 drm_connector_get(conn); diff --git a/drivers/gpu/drm/nouveau/nouveau_encoder.h b/drivers/gpu/drm/no= uveau/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 { =20 struct i2c_adapter *i2c; =20 - /* different to drm_encoder.crtc, this reflects what's - * actually programmed on the hw, not the proposed crtc */ - struct drm_crtc *crtc; u32 ctrl; =20 /* Protected by nouveau_drm.audio.lock */ --=20 2.55.0