From mboxrd@z Thu Jan 1 00:00:00 1970 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 C5ABAC04FFE for ; Tue, 23 Apr 2024 14:08:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10B5B10F614; Tue, 23 Apr 2024 14:08:13 +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="rks4+qR/"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8246310F614 for ; Tue, 23 Apr 2024 14:08:11 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BBC75614BF; Tue, 23 Apr 2024 14:08:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 561EDC116B1; Tue, 23 Apr 2024 14:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713881290; bh=3tRGSuZF1BB2XlYYR2G/huzS33URelcI6rC3xF6UYs4=; h=Subject:To:Cc:From:Date:From; b=rks4+qR/3Ro3Xh2bdioIHHmsrJkELghAMjGON8MDACden2tC1PASPDpt9/DQqzYRQ 6jR0l7xHtWcsEq9h4T4I7tsmn9WaM3v+gTs7I1+WPaBB9wiBlc95fzNWV5KQXXKdJ8 MV0gPDngZT9twPj71sf4mjPsM2TGjVWmA5Vlyozc= Subject: Patch "drm/vmwgfx: Fix crtc's atomic check conditional" has been added to the 6.6-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:07:36 -0700 Message-ID: <2024042336-spool-cacti-e355@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.6-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.6 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 @@ -926,6 +926,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); @@ -933,9 +934,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.6/drm-vmwgfx-fix-prime-import-export.patch queue-6.6/drm-vmwgfx-sort-primary-plane-formats-by-order-of-preference.patch queue-6.6/drm-vmwgfx-fix-crtc-s-atomic-check-conditional.patch