Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp912789lqs; Fri, 14 Jun 2024 09:05:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWid9mXdgW/Xsl+aIIVQ/daE4nbmXRsTesDMWA7XSukXcJ7khwBNBv73sh3wGSftSwqxLxMyQQn2ixe9A7MxeysjXaBmXNH8Jtgt99L3A== X-Google-Smtp-Source: AGHT+IE1yKjUsT4Oy1jeDrzDc0Nxch5lt5yASZ9d/YCerVyRc6DBjOSGfBxx2giXgbbojtYjfhgz X-Received: by 2002:a17:902:db11:b0:1f7:eb9:947e with SMTP id d9443c01a7336-1f862b26218mr36737115ad.63.1718381143376; Fri, 14 Jun 2024 09:05:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718381143; cv=pass; d=google.com; s=arc-20160816; b=K2zxNKgXrLqjlr3U2E9fVm9cVkVExK5Lq5G0Q7Cqpgt96qc/2L3ddWPk1Adi7e4C68 HMCuGNpzq/NBMceIZV25hE2fuuAlkqdfjLLr++Mha1+Rv84/AbMcjUcuSrGnfPuxZjEd 43Cybh+113kwmK9jsGYHbMGoBB9RZDaFPViim9z3lISa59Y421TjltGuXmxHzZGicvrS /+lX4SKQNQpsqYvjFndnABwkko0JTLJBvMSkUYUn2JWbYSR3wCNRJCyKcApt60x94j7N 4bGdTFAgQkYC1Oot8fyzrq0NIMiyUFIpymniMdjH9wybWF2hTldV4JTb/+hV/Y4t3nAc stFg== 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=kmzOSqTKJaH0dvCeP0l9yACALP9ZDMY12Vpbbl/oZpo=; fh=63W4dWKO34EGHE3T1vWmuYqFyINTaFbMpUFQla9Mwa0=; b=hBgTp03hp4OZt1Mwr6IILcCUdG2iCHFAj53xtxL9xEYZ51/+nI7y8JmbGAtcGHJfZH Ylg/LUPUa08I9t8ECR/wDjtYoJqzfgORZdvJFQUx6Ss1IVE2IvPfA3gLXqsFeb+M0Udm YqhE9j+O9npm7MddZ2vCOiDL6l2PZmEvKyUDI08QL+pLTbw7nugX4KLUClOkeDCTvyjM YTghVHkAmnJx6dsmn3PCByN/Goc1e8Ly5qaS1JOLdvaANuX+MLZS9sdk4Kyv+8NOwJ5G snLjAt3you++t1P0uee2OIrJHapQr+hCEwZOKYB4kAxdGAjRbZlXmgZGoyHo9xPn/V82 kVag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=aFh82x5B; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-215157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215157-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f855ee4b21si38276765ad.410.2024.06.14.09.05.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=aFh82x5B; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-215157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215157-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 620C1B298F0 for ; Fri, 14 Jun 2024 15:36:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1222716B720; Fri, 14 Jun 2024 15:36:12 +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="aFh82x5B" 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 E104816D4F8 for ; Fri, 14 Jun 2024 15:36:04 +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=1718379371; cv=none; b=T3i69mnGdKKnEC1+xIklRh3Ba1JzhgD+3qcSp+CPiQKkYhjl0ULvLvMho62HC2SUFtP/pcQiZUwPX5Vnoigb17pqYznRAR0tEBuH4SXvysMBjVueMd/55bHWSY+U9WngnMlrn5nQyRMicmhZkNkgMFG2tSBH+2FOOtzr1Q5Q/Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718379371; c=relaxed/simple; bh=0QddMAj+chbAGVELp6IRppqB/ssjTUpG6FHfntl6lLI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hGTE/bpiC/lztB+n3+aFywb9RDHsKjJDGTweJ/3qC+tiIT2IpvD4ILHKzsYAH2yMwv0KSrIALZOq5MUYug7cVHrfdOs5obKHi2ZbR3BGb/3m6KAnV5c7eHO4nIz+Gog53KwRMJm0n1WD0RK2jYbyJCnZAJKBW1/Kt6RAop/irnY= 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=aFh82x5B; 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=kmzOSqTKJaH0dvCeP0l9yACALP9ZDMY12Vpbbl/oZpo=; b=aFh82x5B16HfjMQDExiRAYOAAm f+p+YESYJxmGdkjJJFXxIDhcYx424j/smaqMdz5/3/77aQOwxYLMkU3TAiDIHnWA3uZbeVh+KJ3sG fZLfCLiAazI7zvQfh3PgDOBn3lC7zkMFUX+1P8dETPjZUtjjT5je5ozkwzmWO9uQJAV+1B3FVqHfj fJrMwntYMkrFJS+a0THptww0VlUiKdUlXTqyKCVNZGDmYVMBgCC4mvFPLMDCih6mtCipLYaOqMxhV C/BP6hP0UqoVg8a0V6OfZJyi5xnvMZNwv7vZ6GOHhLn6EpJuxPcmnoF3Hd+lUHHJNBUD5cfKaV8Po phSrk10g==; Received: from [179.118.191.115] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1sI8yA-003B8v-5N; Fri, 14 Jun 2024 17:36:02 +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, linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: kernel-dev@igalia.com, Melissa Wen , 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?= , Sam Ravnborg , Boris Brezillon , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Jani Nikula , Rodrigo Vivi , Karol Herbst , Lyude Paul , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v6 2/8] drm: Support per-plane async flip configuration Date: Fri, 14 Jun 2024 12:35:29 -0300 Message-ID: <20240614153535.351689-3-andrealmeid@igalia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614153535.351689-1-andrealmeid@igalia.com> References: <20240614153535.351689-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 Drivers have different capabilities on what plane types they can or cannot perform async flips. Create a plane::async_flip field so each driver can choose which planes they allow doing async flips. Signed-off-by: André Almeida --- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++-- include/drm/drm_plane.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 2e1d9391febe..ed1af3455477 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1079,9 +1079,9 @@ int drm_atomic_set_property(struct drm_atomic_state *state, break; } - if (async_flip && plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY) { + if (async_flip && !plane->async_flip) { drm_dbg_atomic(prop->dev, - "[OBJECT:%d] Only primary planes can be changed during async flip\n", + "[PLANE:%d] does not support async flips\n", obj->id); ret = -EINVAL; break; diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 9507542121fa..0bebc72af5c3 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -786,6 +786,11 @@ struct drm_plane { * @kmsg_panic: Used to register a panic notifier for this plane */ struct kmsg_dumper kmsg_panic; + + /** + * @async_flip: indicates if a plane can do async flips + */ + bool async_flip; }; #define obj_to_plane(x) container_of(x, struct drm_plane, base) -- 2.45.2