Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp681406lqp; Wed, 12 Jun 2024 12:56:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeZLaFbkJFI6JEQLfBQ7esT7G0UwqWk5L/c6YNNOyWuT5hDvCMO8VE/FZT/cZ6OmUsdkc+DkdEGQZE+fWKdWSQXeMeKAEvdnEOvcCTVQ== X-Google-Smtp-Source: AGHT+IFzOaWmj2oKbNSXrWNvGx1EJ+wp0ZuS5DHrao9rnDszTUo3+8mvmtf+lmdjQqysQvRMMDZW X-Received: by 2002:a17:90a:8d0a:b0:2c2:f6f0:f690 with SMTP id 98e67ed59e1d1-2c4a762d588mr2824245a91.13.1718222180291; Wed, 12 Jun 2024 12:56:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718222180; cv=pass; d=google.com; s=arc-20160816; b=GrO//i38r99Xiqkl8fOBHS8QC7KfBo3IhFcetNOX9BiPTQn8/OkI2TpwYXZtdw6kkn 56Mx8wogzhhuPjjnoV8QQuhmv/wXRY0y1rYdolFET03IVK6uOuA0SASPSsB59FbxWTha qumn4YWAFYy1c41rzuF9jO1LeTIHQGVPoHN37B3iu2utPZlthN4WOO47h5sYjpAi93FJ C+iOT4IUwzRU3vVukxe9DNk1wCUfkt2XwU8Ks5ekYtjO8277NHBZWvQ3eAlagbjhhvBG aqoEe8L8sa6UR4/VWOqJp77QUDOK3Ksyn8MRsZrX5qaNZlzRBl2FXGuGoRGr4MZpvnGD HCFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ld6CWp6MvzsfLCexkDmw2gq97DL2MMR6pnNJDMxtfIA=; fh=njd2ecPfO+MOSUbjxezZy5Zaoa3J5aSXR1p04i4lAW0=; b=zV8cDGkR11As2uImMOHvqbqgzxYmeSdxGvtvDBHqdWxUPSff7eoF2pz8XtKuJIRp6l PR0N0CTirzzpv2KBo3JAYhQAjwpslw/BV0EyYPLQCcyI93zSCIyCebp12jJ9DtTTSlvO K0Zccmocqi+lMNjfDJehZDRhylHYYexr0sh+kn80iXNKExwxGlZHEMTn6yn0dELK5W8b KOS9p9dfNruroeYd4dYov30wBFVancPRVzdp0C1dsTeZU/M0AjgBX3VBGKDJib2eUsNW n2xfhcmjfCTFHuGxXoP2PmK9YP/3/hX5zVqA8EH327kQHe/BGm0P9ymAHd5qWCLpfZTn eyxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=Vtz+E3fb; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-212179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212179-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a75e605asi2131204a91.2.2024.06.12.12.56.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:56:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=Vtz+E3fb; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-212179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212179-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E6896284875 for ; Wed, 12 Jun 2024 19:56:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EAF284D29; Wed, 12 Jun 2024 19:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="Vtz+E3fb" Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (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 D78857E110 for ; Wed, 12 Jun 2024 19:55:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718222158; cv=none; b=e7juZPX/fNju8sM571SsMQf+LASwa2un7HdGo5/R+Vbrysg5jpMccTPAYHa0dNbCujqbLjI0wMcj+4zqTN2sWRbXyLQdw2Xy3l8DFQrn0Fd7BcIzYYt7OjxTnAJR2DSz7iJ8ZjwPeLWe7DKiEpQqS5oz4zwUGkQxIo8KMUPnxoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718222158; c=relaxed/simple; bh=Dh2KtUvAtiglq0b5/QtxJb7/lWsVoYr0FusrI650O/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uk9xPwkQcD8MnCG+8+9iMb+QQumE2qz35ohFhnkuGOFDTunGqwH59fV/AaIemsU2mdXkfRFjUmIh+cjPNWYfFApKWWNdUKH6gh4j1TFsAa8oxfmSibNrmWMz7XSjGtVz0/ehDmDQNdJXGvjzQ1wMBUnkOi4IeyDJMVYQaN+JPZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=Vtz+E3fb; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Ld6CWp6MvzsfLCexkDmw2gq97DL2MMR6pnNJDMxtfIA=; b=Vtz+E3fbD9VMAjoM7eXXw/SekN /PGXprwiiarZARHaEYw01wCUTLmPpMy3P2njBf20E2WoMhObsnQPJ/ht8zj8hmcbsthTvjr7CpFow B1fLTQ+hYpXR87n+bzFaP5+eGIkDr/NhT9QuGdD32fUZDRnP/aYuZBm1HuW103UfEIBaU7UBs9yv1 dzaues67Dmyc8wccMFs0E1EssR4SLmIDKjRWRRz3f3V+Tmcelbfe++1CIAqYUW/xKBqYZVIY/9fL9 E8g+/0zAE+dAQdKtaFF6QlAPRhEbpPds8lj9UPBh6ZX3/7HO2/xtFWUQqc2U3QQTFkCX/SBH/h8Ot L93b3x3A==; Received: from [191.204.194.169] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1sHTmg-002RtF-JM; Wed, 12 Jun 2024 21:37:27 +0200 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, Simon Ser , Pekka Paalanen , daniel@ffwll.ch, Daniel Stone , =?UTF-8?q?=27Marek=20Ol=C5=A1=C3=A1k=27?= , Dave Airlie , ville.syrjala@linux.intel.com, Xaver Hugl , Joshua Ashton , =?UTF-8?q?Michel=20D=C3=A4nzer?= , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v5 1/3] drm/atomic: Allow userspace to use explicit sync with atomic async flips Date: Wed, 12 Jun 2024 16:37:11 -0300 Message-ID: <20240612193713.167448-2-andrealmeid@igalia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612193713.167448-1-andrealmeid@igalia.com> References: <20240612193713.167448-1-andrealmeid@igalia.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: 8bit Allow userspace to use explicit synchronization with atomic async flips. That means that the flip will wait for some hardware fence, and then will flip as soon as possible (async) in regard of the vblank. Signed-off-by: André Almeida --- drivers/gpu/drm/drm_atomic_uapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 22bbb2d83e30..2e1d9391febe 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1070,7 +1070,9 @@ int drm_atomic_set_property(struct drm_atomic_state *state, break; } - if (async_flip && prop != config->prop_fb_id) { + if (async_flip && + prop != config->prop_fb_id && + prop != config->prop_in_fence_fd) { ret = drm_atomic_plane_get_property(plane, plane_state, prop, &old_val); ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop); -- 2.45.2