Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp605624lqc; Fri, 8 Mar 2024 06:56:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsc0EfMjhsJVFoIQwyAPe8C2uhqOkudJirGd/qmBA25Ao3O84bxRRbvYLcw309LqOxorgzT8aIEo4Tteucqs6snc7GB+VIwUAvNdOnKw== X-Google-Smtp-Source: AGHT+IE1Ztn4gj+DcHY6cj+R7CI0ib4Qa8wR0GRVuo39qWA8raFehyTPByNVJiN3EOke7Le6gVHx X-Received: by 2002:a92:c248:0:b0:365:8513:b6b with SMTP id k8-20020a92c248000000b0036585130b6bmr21229672ilo.29.1709909801483; Fri, 08 Mar 2024 06:56:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709909801; cv=pass; d=google.com; s=arc-20160816; b=PV2X3deDjNsEIRJkRaadyjASDbgAAI/AiWIi38XGe1pa3CSGcf5XUy1Np2N4ySaor6 jiBkemb6+TUvZac5JG1QJeN42Vl+213O2rLGENqr4SEbUl6Qa6rL1SPDgL4Rja3ZPq3k 6eeyN3OzeY5R5rvtzRG/3++i8s82O8WwNCe9pit4NoG3pt1D0HJag5RudW2mvqnJLH7a b96FfAxn9ttl2+ZiFFfIavU2CdqDrhiSvzNtCgafcatxmA2X5S+d58U+fc/oG354peEM bJxua1/lQR8MEV2VlwoJ4010k/G1qcogmLp8xyGgeJhWqlAkXs3ShTiL3TADjCPK5EjK BuXg== 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=krDIRYgU1uLFsIvNtqFMjTjuXBLodI3PgcqmjvYIA64=; fh=njd2ecPfO+MOSUbjxezZy5Zaoa3J5aSXR1p04i4lAW0=; b=DAvL30auQNdVyoYw456UcksD/8oN4O/yL23m6r9XQUDwNqkBi3+ekmkmh9aaVWUy1S Z2zPJp6gXzPwRRlZGCmfo+0nA0ApucM39Aa2OvUpFIIG1gycPjYa1u73vG8Dhv5cyVpN wJ81Zrxi0G74sMDC4M9X1D/e05udgd0iLIzBBL8WiJTTD35SeO33667kBUzobS2hzyZV 1pRt+nxKhsLgg7SimKmTawZ2woBUCKKnWSEso+fT8RhsxV8L4qldUkFPP81IverUw1CP RTNkaD9kQkNYJ1CY2D6Vn1m1vDVh1D1PUu8iJmjOcwRjUFKgh5khYGEeB7ju0HLkdO/e yQ8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=ma7RYtqG; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-97196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97196-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z13-20020a63330d000000b005ce025116bbsi15917718pgz.858.2024.03.08.06.56.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 06:56:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=ma7RYtqG; arc=pass (i=1 spf=pass spfdomain=igalia.com dkim=pass dkdomain=igalia.com); spf=pass (google.com: domain of linux-kernel+bounces-97196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97196-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 27A4C28343E for ; Fri, 8 Mar 2024 14:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E6A463B8; Fri, 8 Mar 2024 14:56:20 +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="ma7RYtqG" Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 4E8FC4C7B for ; Fri, 8 Mar 2024 14:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909779; cv=none; b=IWxGK6tQoi6b1TLJx3nu2wLjY6WzeiI7eK59q/X5CEKp5/zK4mJiKEt4iBEJE4q6DA3TuJeBpH8bPe2GkTRCWly932PHPIb+Str9HbN84ey8U1ZWTb3RMQ1aszjdhXoE1CYPry1hmXKNbdgOL6wDwMPQUqcpB+Dcng9GX3/xqjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909779; c=relaxed/simple; bh=5ThtQbWLBgHmpYKWBlCX/ig9OsKqfKuNyKhycD5kgVI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=INBWxAHfrOIQHZ/cvtss7gOdJLvpD9qf+3zDFQG+ufrmHnzatAFRsOx4m0QaUOHUw6VRttzaDc2NCxtIs8+8h6rIQGNGHUfpTmwhpyY8+z7LOkZRqvP0OxWVM01JTa7G56HTqeFF6DbrIneVmDEb4mJoEeJWRISkElvCsVIWOAc= 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=ma7RYtqG; arc=none smtp.client-ip=213.97.179.56 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=krDIRYgU1uLFsIvNtqFMjTjuXBLodI3PgcqmjvYIA64=; b=ma7RYtqGTddCWW/HzBOmsnL5Ut cpRud3IdvZ/c3pm3joUw6CwSSPeRodpDnGoKBQbAExK6ObI17EF5vq2qqqgbecfUF8g9mnspAHfsv AEnNry+B+spRFExeOeJ7Feu0pW6Ka7CMDBjuQumO1dHn0bodi43ZgI49zkYZ1iyf9YD+XfuuittVq LI1/4BSoF54VL0KUVUMZ+baz4xTH+8/CxfTLaj7MmV1oigMDTT+UEqAR8QjYkeMkWDl9HI+iv0cfY ZpdyKtnv/weyNo+o6G0ZLuPMbcsWObrzPZK1DrEIt7/LuVWax2a3GySvway+4buP7PHI849iQ3b0H od/OUN9g==; Received: from [152.249.135.210] (helo=steammachine.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1ribdu-007p93-5S; Fri, 08 Mar 2024 15:56:14 +0100 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: [RESEND PATCH v4 2/3] drm: Allow drivers to choose plane types to async flip Date: Fri, 8 Mar 2024 11:55:52 -0300 Message-ID: <20240308145553.194165-3-andrealmeid@igalia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240308145553.194165-1-andrealmeid@igalia.com> References: <20240308145553.194165-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 Different planes may have different capabilities of doing async flips, so create a field to let drivers allow async flip per plane type. Signed-off-by: André Almeida --- v4: new patch drivers/gpu/drm/drm_atomic_uapi.c | 4 ++-- drivers/gpu/drm/drm_plane.c | 3 +++ include/drm/drm_plane.h | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 1eecfb9e240d..5c66289188be 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1075,9 +1075,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_state->plane->async_flip) { drm_dbg_atomic(prop->dev, - "[OBJECT:%d] Only primary planes can be changed during async flip\n", + "[OBJECT:%d] This type of plane cannot be changed during async flip\n", obj->id); ret = -EINVAL; break; diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 672c655c7a8e..71ada690222a 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -366,6 +366,9 @@ static int __drm_universal_plane_init(struct drm_device *dev, drm_modeset_lock_init(&plane->mutex); + if (type == DRM_PLANE_TYPE_PRIMARY) + plane->async_flip = true; + plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 641fe298052d..5e9efb7321ac 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -779,6 +779,11 @@ struct drm_plane { * @hotspot_y_property: property to set mouse hotspot y offset. */ struct drm_property *hotspot_y_property; + + /** + * @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.43.0