From nobody Mon Sep 28 17:48:33 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 3FCF6481FB7 for ; Wed, 19 Aug 2026 16:00:09 +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=1787155210; cv=none; b=Z/VfgDNNdB9j7NnsTSTzbDa8wg1r7WWxEDQREaIW47Td+DDjJufiowS2AcWFB1qlSc8sIn0Y4JXrPrko+BIJpwzLO2mDlbNuK1lN97b2EaQKp6A8agP2u+ZhESZcPBThVoIJRzYdGTKeZj3W2Br+3qfWjbgStKCJ00V5NErFfac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155210; c=relaxed/simple; bh=BJ/kVaE/61dNOwCMKw6yVJWUCXGmmJw0OAbiOOPSdz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XBUIYkJVP4gtxSdeMWjnleHvDJpIFGLMWeN8fj54WYz5C/FJc1tRMDYK8q93+3Ml1IinBiUxdaveJR+ryNsw0DPjEMwj72WkI0/2Nz3hzYW5scTIt9j9Um5g87/tUFS8PBntmfRvX1QL0YUT+smFF3cX/5mrZVZDvFXiJS56mq8= 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=gk+YJ5gl; 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="gk+YJ5gl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155208; 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=gk+YJ5glT29NFjvb9UxG++4dyGLaOGqHKtLbA+f57ZzJ9kcxv55iEVTUCFEsbhcudvP/OD 5R/tXvb+ZA8gcK2U1hJZilmtweErkLgtZvqFv5U8sWFEU+KXSKffTtLWtI5WWhRSvouITL 9/jdGIBdq4TdgKrjYnmTVqKAfhbdZxw= 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-501-GM-ns7WWP726exDZ-ptw4A-1; Wed, 19 Aug 2026 12:00:01 -0400 X-MC-Unique: GM-ns7WWP726exDZ-ptw4A-1 X-Mimecast-MFC-AGG-ID: GM-ns7WWP726exDZ-ptw4A_1787155193 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 78AAD1955DD2; Wed, 19 Aug 2026 15:59:49 +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 C237518005BC; Wed, 19 Aug 2026 15:59:44 +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" , "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 1/6] drm/nouveau/kms/nv50-: Move DPCD backlight disable into its own function Date: Wed, 19 Aug 2026 11:43:48 -0400 Message-ID: <20260819155934.154125-2-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 17:48:33 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 AD7903BBFA2 for ; Wed, 19 Aug 2026 16:00:23 +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=1787155225; cv=none; b=Cz3TxKFsyi2Jhu5crclqOfPbCcfHDPoeOwwcsfcuewdqdC3+k1vw0LWTt4+iRGA9sNno/cHs4aCL2Ty4Of2hpsw6+8mBYyaUpPD/pnCPseTgMxY6zatKHH09FKvoPrGLmq7QuQ6teCEuaCoc4g1Wyy6aW0lbizOzLq3PCMs46HA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155225; c=relaxed/simple; bh=Go9qyjClI5XuqFOTeUdtCcOltUcHrxHIVnsoj1l3gZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UcgN/Y98ZIJCyG4KjSG6B5fPuUTrOre1mQGlcrrwEuGZN3pBAzaWHHUsqxwW6oeiHhiOQMs0W2bUYZAUwyikoC6PPXiRwiVHz9ryJKnwGg4JDrwK9FUG+GI6alqPkfNX9Hb//PdJLPSjHsJ2INQC6hqmJS6MX1grbK2KI4+hOjw= 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=c6Y4SgQt; 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="c6Y4SgQt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155222; 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=c6Y4SgQtL85BTGGUBuNy+nsYKipJo+OepB/FX1ks2rSrZhzFx4ylnUIibhblzmam0qbpn/ Ro6zFlrSACYCych5PIHXJSGrL9vf/D5blJSi8z0rF4P0ae9H3TXf+PbCk52CCpzr0KHokG X1zpXjcNnlQzKjVcovxsz8RsW9vd77k= Received: from mx-prod-mc-05.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-383-eCl0fOJ4MQCvU2ebNBM7_Q-1; Wed, 19 Aug 2026 12:00:09 -0400 X-MC-Unique: eCl0fOJ4MQCvU2ebNBM7_Q-1 X-Mimecast-MFC-AGG-ID: eCl0fOJ4MQCvU2ebNBM7_Q_1787155199 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C5271954AFB; Wed, 19 Aug 2026 15:59:57 +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 63C4A18005BB; Wed, 19 Aug 2026 15:59: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, "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 2/6] drm/nouveau/kms/nv50-: Add nv50_outp_get_old_crtc() Date: Wed, 19 Aug 2026 11:43:49 -0400 Message-ID: <20260819155934.154125-3-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 17:48:33 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 6E0043CAA2F for ; Wed, 19 Aug 2026 16:00:24 +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=1787155225; cv=none; b=ItBxbr/Jzqmqrq4OXUvxYzuf0mg3B74sgA0sYPKsvcOGEIORYUat2XmhWtusnTWmOiltD400rXNLQRFd3pQQIa1D1EGX/FGZikU4crkN0pouty3XnJUM/oLYTuZfkJot2W6s6c+7ZjH+TU7d4EVE3HdrUrBEvV888JoP4V+mhUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155225; c=relaxed/simple; bh=cVYN0k7yL7k+ocQStlIjdIgldryc/hkG+TyXn4QYmok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1Mw10/G/OOYMWzUlArprtYTC8NMyuIkiFy9lk0Plm2xdC5lxRlLzGYdD/FY+oRQuDCMEEO6OPvdftxMjv7C4zsyOGC6VKwePmR2Sba2c1ii75U/GnPrA3RZO2tJfvQPjTizzl+LPmZg1kX5Njg2ixovxK61k38mccQHyF8NVHg= 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=QAvRvFNU; 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="QAvRvFNU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155223; 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=fMF+0ARQ9Eixkloaq8eI+L+kTqWe7Y7ZEuYINPQUR1c=; b=QAvRvFNUBcfZcJgq2GP22TDJTS5G3KuyiL4qazY5LMvta7mSUvZc4RYbkqKGNSASSSeT3z DltuQwLlmoelXiCkmY5kVIj10BpV3UvDmRXW9w+HiySq1vfcueKl3gUvGnYPpwRpWpE8lP FC286qVZwQRlb7xrVTtxMi+kq6ATPQM= 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-620-5Dfng3uhMEqdLYBca1IOjQ-1; Wed, 19 Aug 2026 12:00:19 -0400 X-MC-Unique: 5Dfng3uhMEqdLYBca1IOjQ-1 X-Mimecast-MFC-AGG-ID: 5Dfng3uhMEqdLYBca1IOjQ_1787155206 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 950711956047; Wed, 19 Aug 2026 16:00:06 +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 EDE4A18005BB; Wed, 19 Aug 2026 16:00:00 +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 v2 3/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_sor_atomic_disable() Date: Wed, 19 Aug 2026 11:43:50 -0400 Message-ID: <20260819155934.154125-4-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 17:48:33 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 90825212FAD for ; Wed, 19 Aug 2026 16:00:32 +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=1787155234; cv=none; b=K1/5tID9V91PWfh0/KJA9+dIEpLRz7xrhrrSUIMee21KRoaXA293GmCci3vi/gGBYpAYQcvpdyDMH0L8hxT1EtyOJkhX1D9MF4Inrmk6GzXLBTqdJRsw3cHAH8sp2rKCVpGb2+xgMId+ai5V5zifS63Ii+cwlO6Wi+13JK96XjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155234; c=relaxed/simple; bh=0UyVVQWZh27567FrgxGhJJ/fRDBKgHJExverwoUCMqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YmfhnA101vItrIcJR0pRkDRoS9rjsD6VZR26MnYaNiq+x6RwbYj874FODYNGLmLCFNxZz3B4jmmAeTJdQG88lKc3+hMGTBVIdzPBg9OCXa/+JAO26Ni2Os47DoKtrLqumLKIgZsmAD7IKkXAjkUdhho7uXzE9R22zGO+6h91Tvo= 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=Yj9YkzIl; 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="Yj9YkzIl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155231; 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=JT0fofyDnN3jIOFGkcp2QtaEzfnX9HVu+laIRR16rT8=; b=Yj9YkzIlsIdiha2R1kqRmf5ocHlVf7lR8IuYxvXkGTesxjBUoRfctAAzR7EdolrKCmTsc2 eUmGLNFrPPu3AEwXAP/LV+Hfy32K01L7KI4EhcXgROcIahS+7bDrodihD5ahMLKEMx6AIl dttVao6kG/NawAZiNmSRz6cliNmwmdE= Received: from mx-prod-mc-05.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-3-_fe2aKthM6-dWDRcoiYhNQ-1; Wed, 19 Aug 2026 12:00:26 -0400 X-MC-Unique: _fe2aKthM6-dWDRcoiYhNQ-1 X-Mimecast-MFC-AGG-ID: _fe2aKthM6-dWDRcoiYhNQ_1787155214 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 56A7019560B9; Wed, 19 Aug 2026 16:00:14 +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 517EF180034F; Wed, 19 Aug 2026 16:00:10 +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" , "Marco Crivellari" , "Luca Ceresoli" , "Kees Cook" , "Simona Vetter" , "Ben Skeggs" , "David Airlie" , "Thomas Zimmermann" , "Maxime Ripard" , "Danilo Krummrich" , "Jani Nikula" , "James Jones" , "Lyude Paul" Subject: [PATCH v2 4/6] drm/nouveau/kms/nv50-: Stop using nv_encoder->crtc in nv50_disp_atomic_commit_core() Date: Wed, 19 Aug 2026 11:43:51 -0400 Message-ID: <20260819155934.154125-5-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 --- V2: * Only grab the new CRTC for an outp if we're enabling it, which guarantees that we have the CRTC's atomic state present in the current atomic commit (also removing the need for a NULL check). drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index f19820dc055ae..d038743d1382a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2173,7 +2173,8 @@ nv50_disp_atomic_commit_core(struct drm_atomic_commit= *state, u32 *interlock) struct nouveau_encoder *nv_encoder =3D nouveau_encoder(outp->encoder); =20 if (outp->enabled) { - nv50_audio_enable(outp->encoder, nouveau_crtc(nv_encoder->crtc), + nv50_audio_enable(outp->encoder, + nv50_outp_get_new_crtc(state, nv_encoder), nv_encoder->conn, NULL, NULL); outp->enabled =3D outp->disabled =3D false; } else { --=20 2.55.0 From nobody Mon Sep 28 17:48:33 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 28664212FAD for ; Wed, 19 Aug 2026 16:00:44 +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=1787155245; cv=none; b=UMj7yKfwu24oJMX7AZqzxVFxTgqw75b0xG8NEcf9IFZkCT0f3WumO+r6qzF/Z+j1INh/yPDof40pystSC2aRH0BAC74UscoCBkW3CGC/Cj4ws5eBrE3X033Urc8xbglVnVO2sFK5wCit5vxreW2GLhm9dZIwBXO9Lh63NdtE3v0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787155245; c=relaxed/simple; bh=ekWMGQ2OUAqL+ANlgdrPnKXospBoMhHC4R0tnAi9CKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qUlr0wUd48rFPRXsXzMVWts3FrSsuKeCgXY+Bym2SA1bh0KhdPzDtIs1vLxjM3FK2yuRaz2PZQBLS0HCH3iaMFT9MHzNYWgMWoX7ojfRjC77XFYpSdPjnEnpf9EinqWZ3V0wEFucAEZcFmeKZAKuvJoxbohK1tdJYCVWWyLRtV8= 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=fQstKInh; 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="fQstKInh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787155243; 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=AmVZrC88SHmujLw0GwInwyK0aXHXazrDaX+bMc3Sarg=; b=fQstKInhxL31fuhjA6YLJgJeAZnz6kIp0kX+r4x7E3FVroYtML388Seoz2IComi02vAgWO DMSMWFppFZv6G8QigVnOAZd1OHSCY3fP48iy1h6rLY511Yg7smcms6VsH2z+p4SVzCkvLZ F3j2rT+ZOPcSaQUHFOK5h/RF5d9mfTs= Received: from mx-prod-mc-01.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-10-cLSv2quxNVWFMru23CE9vQ-1; Wed, 19 Aug 2026 12:00:37 -0400 X-MC-Unique: cLSv2quxNVWFMru23CE9vQ-1 X-Mimecast-MFC-AGG-ID: cLSv2quxNVWFMru23CE9vQ_1787155222 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A45ED19540E7; Wed, 19 Aug 2026 16:00:21 +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 192BD18005BC; Wed, 19 Aug 2026 16:00:17 +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 5/6] drm/nouveau/kms/nv50-: Add nouveau_encoder->audio.crtc Date: Wed, 19 Aug 2026 11:43:52 -0400 Message-ID: <20260819155934.154125-6-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 d038743d1382a..fbb874b11d7a8 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 17:48:33 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 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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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 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, 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 @@ -2794,7 +2787,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