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 41586E98E10 for ; Mon, 23 Feb 2026 09:17:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95C3310E2B2; Mon, 23 Feb 2026 09:17:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="no4nlTgz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 410AE10E2A9; Mon, 23 Feb 2026 09:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771838267; x=1803374267; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=wuNncTDf7aNB+KmQiCWYP6QZ7+MIWRY1LdqW7ruGoVM=; b=no4nlTgz4ETjFkCq+UkZT1Xb2JekFJg+DAtBrXeMCTLex8gmUQ82v0ab Yp9y4850H24YnZqf/zMLHWH3/x1pvzhS946bYZeAGkMVnpW/1+g/ADSTl EXx95QSLIAcNlSJDrl7G3Q7CVI6YjbkwbyV0tMSffYlsrXgG/6v82sRUe L+xkANkuF1B993MZEI+vMHHEZGhZPRcRZEB99mRY88m6eWzCT3cEsBGcL +Ir8CSuOfNBkAbxRO8iQpRuO37Ivp0HIQ4sB/9XFCLW5UBKwq4uKN8pbk KIu27xKcAeiIf3IoCAlYf12Ggnm4QiUjsjojR/kw5uXM2fN9W3Gt+HQ5X g==; X-CSE-ConnectionGUID: 4LiN7DAXQDO0/u0770MGlw== X-CSE-MsgGUID: +jazJjkCRVuFrbEufb56ig== X-IronPort-AV: E=McAfee;i="6800,10657,11709"; a="76690770" X-IronPort-AV: E=Sophos;i="6.21,306,1763452800"; d="scan'208";a="76690770" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2026 01:17:47 -0800 X-CSE-ConnectionGUID: A506h/w5S5eLCKSQKdk4jg== X-CSE-MsgGUID: VfQGMvvWS5abkhQbGw1c4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,306,1763452800"; d="scan'208";a="220048808" Received: from srr4-3-linux-106-armuthy.iind.intel.com ([10.190.238.56]) by fmviesa005.fm.intel.com with ESMTP; 23 Feb 2026 01:17:42 -0800 From: Arun R Murthy Date: Mon, 23 Feb 2026 14:46:01 +0530 Subject: [PATCH v10 3/7] drm/atomic: Call complete_signaling only if prepare_signaling is done MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260223-atomic-v10-3-f59c8def2e70@intel.com> References: <20260223-atomic-v10-0-f59c8def2e70@intel.com> In-Reply-To: <20260223-atomic-v10-0-f59c8def2e70@intel.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , xaver.hugl@kde.org, harry.wentland@amd.com, uma.shankar@intel.com, louis.chauvet@bootlin.com, naveen1.kumar@intel.com, ramya.krishna.yella@intel.com Cc: "Imported from f20260210-atomic-v9-5-525c88fd2402"@intel.com, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Arun R Murthy , Suraj Kandpal X-Mailer: b4 0.15-dev 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" Upon returning valid error code on atomic_ioctl failure, changes have been done to goto error/out in cases of error instead of returining to accommodate returning the failure codes. As part of this change complete_signaling() will be called as part of cleanup. Check if the fences are initialized/prepared before completing. Signed-off-by: Arun R Murthy Reviewed-by: Suraj Kandpal --- drivers/gpu/drm/drm_atomic_uapi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 87de41fb445931ff8383b45839fca63123026f8e..ac84b9a9c25844985816b9c0843c44e6e763d048 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1569,7 +1569,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, struct drm_modeset_acquire_ctx ctx; struct drm_out_fence_state *fence_state; int ret = 0; - unsigned int i, j, num_fences; + unsigned int i, j, num_fences = 0; bool async_flip = false; /* disallow for drivers not supporting atomic: */ @@ -1719,7 +1719,8 @@ int drm_mode_atomic_ioctl(struct drm_device *dev, } out: - complete_signaling(dev, state, fence_state, num_fences, !ret); + if (num_fences) + complete_signaling(dev, state, fence_state, num_fences, !ret); if (ret == -EDEADLK) { drm_atomic_state_clear(state); -- 2.25.1