From mboxrd@z Thu Jan 1 00:00:00 1970 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 314701CFA8 for ; Tue, 18 Jun 2024 16:18:40 +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=1718727524; cv=none; b=o7AtecOR5aR5cDu6A/qXAWRwM3RIsCCfjv7Xrcmknn2f53HI9J7Od2Bt8jJ9K/a75X1oA1XeP44xMcOB4Fe/XyCQSbMou/PzXgf7fiybJfpHiJtwFkggrH9KCl3q/YsWowiqXTjAHe2yvdniRauJaC3gSjATo+oALnvAnt6ILR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718727524; c=relaxed/simple; bh=yuXsMbZqPaXeKh8NOGAOCpmkk1JBjjn03dGQ3d1VVYA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nmlcEtB014RYBnhXTKSa111Bfau9iRzN3i1yKIdsBFSRhrzgwY8OT3DzTYamIolBE17suy4RpdAjiTwj0yZpIXhj7tJohLEfBE4AK8EUTWeBo6wVOxymAcSMpEcvtX4tVHSaNWyiuOE4HceCv+b7sEB+qJnAeJDnvPREpPuZFq0= 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=Kjh5TorH; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="Kjh5TorH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID: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=YJvIf2DDEFs4F7cl6mRoHHDrlRyogLF3aAA6llHTpMM=; b=Kjh5TorHWywtTOKU3DR8seE9DT J1P6eLTtgK4qTlj1CMVS13+GAY70esJ3ef2HogKsoiqh3fri7T5xblTJ/6SecVCjcr0bF/SjgDtju mxpYCRqVNrSUd8SSb6v3+tn/mh1qzT/vKLbemhu3EWRPIz37DRBDDYNopMWKboku066wF+ZC7lBNH /AHAcfHPHXVhRQfCBcsGUxBlUTKyi06lubS4wwy70jCElT81E0XG/+099c4XI1INCXVveu/9F0r0K iGa6noh+fZQ0JkimLwpUbtwmoYweHKBhmvzpkKar/2LYRsAfAk+5LzuHq/IW5d5vvZew3yNanZZKG b4isgE7A==; Received: from [177.172.122.99] (helo=[192.168.15.100]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1sJbXI-004na1-TW; Tue, 18 Jun 2024 18:18:21 +0200 Message-ID: Date: Tue, 18 Jun 2024 13:18:10 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration To: Dmitry Baryshkov , Jani Nikula Cc: 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, 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?B?TWFyZWsgT2zFocOhaw==?= , Dave Airlie , ville.syrjala@linux.intel.com, Xaver Hugl , Joshua Ashton , =?UTF-8?Q?Michel_D=C3=A4nzer?= , Sam Ravnborg , Boris Brezillon , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Rodrigo Vivi , Karol Herbst , Lyude Paul References: <20240618030024.500532-1-andrealmeid@igalia.com> <20240618030024.500532-3-andrealmeid@igalia.com> <878qz2h9pp.fsf@intel.com> Content-Language: en-US From: =?UTF-8?Q?Andr=C3=A9_Almeida?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Em 18/06/2024 07:07, Dmitry Baryshkov escreveu: > On Tue, 18 Jun 2024 at 12:38, Jani Nikula wrote: >> >> On Tue, 18 Jun 2024, André Almeida wrote: >>> 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 >>> --- >>> include/drm/drm_plane.h | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> 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 >>> + */ >> >> When is it okay to set or change the value of this member? >> >> If you don't document it, people will find creative uses for this. > > Maybe it's better to have a callback instead of a static field? This > way it becomes clear that it's only relevant at the time of the > atomic_check(). > So we would have something like bool (*async_flip) for struct drm_plane_funcs I suppose. Then each driver will implement this function and check on runtime if it should flip or not, right? I agree that it makes more clear, but as far as I can see this is not something that is subject to being changed at runtime at all, so it seems a bit overkill to me to encapsulate a static information like that. I prefer to improve the documentation on the struct member to see if this solves the problem. What do you think of the following comment: /** * @async_flip: indicates if a plane can perform async flips. The * driver should set this true only for planes that the hardware * supports flipping asynchronously. It may not be changed during * runtime. This field is checked inside drm_mode_atomic_ioctl() to * allow only the correct planes to go with DRM_MODE_PAGE_FLIP_ASYNC. */