Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD089C4345F for ; Tue, 23 Apr 2024 14:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DBAE410FC83; Tue, 23 Apr 2024 14:09:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gzTjScCG"; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28F4510FC83 for ; Tue, 23 Apr 2024 14:09:20 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D43D2CE10DC; Tue, 23 Apr 2024 14:09:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDB30C32786; Tue, 23 Apr 2024 14:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713881357; bh=ylzQHRh1xhLplxfxYDXaInS8tuETCl+ngK07m4tWdrQ=; h=Subject:To:Cc:From:Date:From; b=gzTjScCGC8HloTj4LyGXU7l1RlM8aTlXDGgYIyFXHtiWyClWT0v9shdvwg1833puV 6vbkzTOy/ZFZ76QcefDpB9A6b8WZZD8CWUsb3ZFrmbnlwmdh9GonYHMu0cVp75VoxK FceUPKuXOjJk1my+CtQAd3JVul919p9DMIcv3zTo= Subject: Patch "drm/vmwgfx: Fix crtc's atomic check conditional" has been added to the 6.8-stable tree To: bcm-kernel-feedback-list@broadcom.com, dri-devel@lists.freedesktop.org, gregkh@linuxfoundation.org, ian.forbes@broadcom.com, martin.krastev@broadcom.com, zack.rusin@broadcom.com Cc: From: Date: Tue, 23 Apr 2024 07:08:22 -0700 Message-ID: <2024042322-dominion-corset-f92a@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a note to let you know that I've just added the patch titled drm/vmwgfx: Fix crtc's atomic check conditional to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-vmwgfx-fix-crtc-s-atomic-check-conditional.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From a60ccade88f926e871a57176e86a34bbf0db0098 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 11 Apr 2024 22:55:10 -0400 Subject: drm/vmwgfx: Fix crtc's atomic check conditional 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 && Patches currently in stable-queue which might be from zack.rusin@broadcom.com are queue-6.8/drm-vmwgfx-fix-prime-import-export.patch queue-6.8/drm-vmwgfx-sort-primary-plane-formats-by-order-of-preference.patch queue-6.8/drm-vmwgfx-fix-crtc-s-atomic-check-conditional.patch