From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C020885274; Tue, 23 Apr 2024 21:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713908560; cv=none; b=AQb/OKDsHyQLbjLrK2N2a/JAgAxoNdkv4aokq7zIfHqQNCllNF0s9klTAxzd9m91juRT3j4Q9AOlJpeAcnjQxZHIYxeXjvoBwCBKS+ejsXr6ZXmPo9wCBf1+zaWr8LsgI4LNWJdv9elVfMxCLV9lfB/5q5pDoQ7uxnRErHmtcbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713908560; c=relaxed/simple; bh=HO3LLj9BrHRilh1v5egcQVu7Tan1DJpbQAlk2INj8w0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TX0yOjDuE7+/oOXkGQT9c+CGfupMrtzIxYO8RA36DAxI8ijEuPDy/EBifYnAoxuxggP7PtmerAgfUzfONRSJ/V096FXACMb7Qg/QwEFarEK4/wScoUIM7eI45MrfmbeVgzwiBGUiytp+LAVLG9EBVoZBeI5XBkMz534MvXzsvBk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QL9eAH1U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QL9eAH1U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4495BC4AF08; Tue, 23 Apr 2024 21:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713908560; bh=HO3LLj9BrHRilh1v5egcQVu7Tan1DJpbQAlk2INj8w0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QL9eAH1UAcgqNkbkk9gIlkjrkeFkRScSs7aB8th1UWTuGFHm+M2EpvnpE6fwe/i7L b8vjUgqAujLPoaS32rkLrHE2sZadqwcBAm2fs3ancwCGRrEBtqAfVVx4zW93TlctOJ D2bg45oPA3RkfCy3R+EAOCtWEBtrUGJjx4KytwXI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zack Rusin , Broadcom internal kernel review list , dri-devel@lists.freedesktop.org, Ian Forbes , Martin Krastev Subject: [PATCH 6.8 147/158] drm/vmwgfx: Fix crtcs atomic check conditional Date: Tue, 23 Apr 2024 14:39:29 -0700 Message-ID: <20240423213900.633679341@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423213855.824778126@linuxfoundation.org> References: <20240423213855.824778126@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zack Rusin commit a60ccade88f926e871a57176e86a34bbf0db0098 upstream. The conditional was supposed to prevent enabling of a crtc state without a set primary plane. Accidently it also prevented disabling crtc state with a set primary plane. Neither is correct. Fix the conditional and just driver-warn when a crtc state has been enabled without a primary plane which will help debug broken userspace. Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests. Signed-off-by: Zack Rusin Fixes: 06ec41909e31 ("drm/vmwgfx: Add and connect CRTC helper functions") Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v4.12+ Reviewed-by: Ian Forbes Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-5-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -932,6 +932,7 @@ int vmw_du_cursor_plane_atomic_check(str int vmw_du_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { + struct vmw_private *vmw = vmw_priv(crtc->dev); struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc); struct vmw_display_unit *du = vmw_crtc_to_du(new_state->crtc); @@ -939,9 +940,13 @@ int vmw_du_crtc_atomic_check(struct drm_ bool has_primary = new_state->plane_mask & drm_plane_mask(crtc->primary); - /* We always want to have an active plane with an active CRTC */ - if (has_primary != new_state->enable) - return -EINVAL; + /* + * This is fine in general, but broken userspace might expect + * some actual rendering so give a clue as why it's blank. + */ + if (new_state->enable && !has_primary) + drm_dbg_driver(&vmw->drm, + "CRTC without a primary plane will be blank.\n"); if (new_state->connector_mask != connector_mask &&