Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2558742rdg; Mon, 16 Oct 2023 08:01:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0L60AKYDGKbFmzzmpUYKgW9O9Q+0ou+u+ptqDx2LplpJOpWSPogiSpC6EAp6RuL2O3Bdz X-Received: by 2002:a17:902:dac9:b0:1ca:8e79:53af with SMTP id q9-20020a170902dac900b001ca8e7953afmr940768plx.3.1697468509534; Mon, 16 Oct 2023 08:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697468509; cv=none; d=google.com; s=arc-20160816; b=bhuVTtQV6++W3XO3WCM20wCUqVsygXWayO5HQLp0MBtRg+5AemFVFx9OQyS4k0wypu 3h5+6jny1cAsBHNqLp7/MEbrjM2VJ+GvXACAcjdlF7mu5FwhAazUDkVsmcBa3Ud8C3t7 a6bpf2jm8AyXlMLLfQKB7Z2NSot6VgH9xsYFD4jJDzSbOisyrKRNajvSuthldlB4cpzg 2QyKhdJH/nmZm1bwBFvh4WHdvI8FFdYhJC4P1uFDBv2i7mK0Kc6HOc0OAD390Uszl1si RlXPRKbffEk+s5/Dtco154HuUY4wbUiXSg2t7sDeIJSn9b9aSEYbceqWuQgpEDvMLDlM BMhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jsUfO3TQJ7vOnQMKxuQpxgCnMK23mkHnPBih2nqMT4k=; fh=o9iFxiRelvnNmlDKYm19Rrv3kH6MHmgPdUu+6f2ad+8=; b=biJrynZxN8myK9Sw9vv6B7C2VR44DgG+E9dAE8HuypXBzOjNYcJHyW1hdZOvfyuGXh cKsDH6X9X949PsV8Fa6CO41KwTxTmr0ydVOskbPU9TGY3pqXOvCyR1aO6C7k1O7HvI9z ezEItfEXKz40kJ08FPaBszcTsnK/yuz0yf3H/Dqj/rZ/FYjZiHERD3ba1lZfSri6AkOZ /leubEK3ZMG3QXWsTntKBcPm1LZQVGj/1NLPvmFeLG6NpM+cXyQHpjG7gRZo4uVDp896 eSV0q0hnua0BTh0nD71frE9kEf05amSgrz00YIXY8mQJJEir1rMemrJA8aaSafJDef0B fouQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=iAqlT+T2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id be6-20020a170902aa0600b001c76a1aa6basi10293937plb.27.2023.10.16.08.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=iAqlT+T2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DFE69805E43D; Mon, 16 Oct 2023 08:01:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233772AbjJPPBg (ORCPT + 99 others); Mon, 16 Oct 2023 11:01:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbjJPPBb (ORCPT ); Mon, 16 Oct 2023 11:01:31 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9BCC112 for ; Mon, 16 Oct 2023 08:01:26 -0700 (PDT) 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=jsUfO3TQJ7vOnQMKxuQpxgCnMK23mkHnPBih2nqMT4k=; b=iAqlT+T2w4q+O+zGPJDhy6nPGr aTk3BKCw7bRpG/xlYBcwYfPDNCQIspKo60177O+RJGQafaq8h5oFGzShc5EyFjYkWFT3B+7gQ0MZh AxLq+3L6Tz4LsnMPeWIypxC3DQGGDhtTxQWTGD1gPk0XZHAgCPkvcfQvSJ/De+TOd2jz8FkBZQNOm ow5lk0VeLxWULhgE5G3/TK7r+YZBX76ayyHDXJJkSnfBJusS1koculQaBufWyUUHyi5l7swiHND13 R81DDoy9HbrkR9x4aDPDQVHErh0x5CVYahgubIVzLpWOC0HYld2yVSkMYzfEIMvVcdid2OnlsCw7v ER+qm/tw==; Received: from [192.168.12.174] by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1qsP5e-0016BK-Cv; Mon, 16 Oct 2023 17:01:06 +0200 Message-ID: Date: Mon, 16 Oct 2023 17:01:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 6/6] drm/doc: Define KMS atomic state set Content-Language: en-US To: Pekka Paalanen Cc: =?UTF-8?Q?Michel_D=C3=A4nzer?= , xaver.hugl@gmail.com, pierre-eric.pelloux-prayer@amd.com, Daniel Vetter , =?UTF-8?B?J01hcmVrIE9sxaHDoWsn?= , Randy Dunlap , Daniel Stone , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hwentlan@amd.com, Rob Clark , ville.syrjala@linux.intel.com, kernel-dev@igalia.com, alexander.deucher@amd.com, Dave Airlie , christian.koenig@amd.com, joshua@froggi.es, wayland-devel@lists.freedesktop.org References: <20230815185710.159779-1-andrealmeid@igalia.com> <20230815185710.159779-7-andrealmeid@igalia.com> <1b23576d-1649-ff5c-6273-b54729ea46d8@mailbox.org> <20231016151856.74af9305@eldfell> <20231016175222.7a89e6ab@eldfell> From: =?UTF-8?Q?Andr=C3=A9_Almeida?= In-Reply-To: <20231016175222.7a89e6ab@eldfell> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:01:47 -0700 (PDT) On 10/16/23 16:52, Pekka Paalanen wrote: > On Mon, 16 Oct 2023 15:42:16 +0200 > André Almeida wrote: > >> Hi Pekka, >> >> On 10/16/23 14:18, Pekka Paalanen wrote: >>> On Mon, 16 Oct 2023 12:52:32 +0200 >>> André Almeida wrote: >>> >>>> Hi Michel, >>>> >>>> On 8/17/23 12:37, Michel Dänzer wrote: >>>>> On 8/15/23 20:57, André Almeida wrote: >>>>>> From: Pekka Paalanen >>>>>> >>>>>> Specify how the atomic state is maintained between userspace and >>>>>> kernel, plus the special case for async flips. >>>>>> >>>>>> Signed-off-by: Pekka Paalanen >>>>>> Signed-off-by: André Almeida >>>>> [...] >>>>> >>>>>> +An atomic commit with the flag DRM_MODE_PAGE_FLIP_ASYNC is allowed to >>>>>> +effectively change only the FB_ID property on any planes. No-operation changes >>>>>> +are ignored as always. [...] >>>>> During the hackfest in Brno, it was mentioned that a commit which re-sets the same FB_ID could actually have an effect with VRR: It could trigger scanout of the next frame before vertical blank has reached its maximum duration. Some kind of mechanism is required for this in order to allow user space to perform low frame rate compensation. >>>>> >>>> Xaver tested this hypothesis in a flipping the same fb in a VRR monitor >>>> and it worked as expected, so this shouldn't be a concern. >>> Right, so it must have some effect. It cannot be simply ignored like in >>> the proposed doc wording. Do we special-case re-setting the same FB_ID >>> as "not a no-op" or "not ignored" or some other way? >> There's an effect in the refresh rate, the image won't change but it >> will report that a flip had happened asynchronously so the reported >> framerate will be increased. Maybe an additional wording could be like: >> >> Flipping to the same FB_ID will result in a immediate flip as if it was >> changing to a different one, with no effect on the image but effecting >> the reported frame rate. > Re-setting FB_ID to its current value is a special case regardless of > PAGE_FLIP_ASYNC, is it not? > > So it should be called out somewhere that applies regardless of > PAGE_FLIP_ASYNC. Maybe to the end of the earlier paragraph: > >> +The changes recorded in an atomic commit apply on top the current KMS state in >> +the kernel. Hence, the complete new KMS state is the complete old KMS state with >> +the committed property settings done on top. The kernel will try to avoid >> +no-operation changes, so it is safe for userspace to send redundant property >> +settings. However, not every situation allows for no-op changes, due to the >> +need to acquire locks for some attributes. Userspace needs to be aware that some >> +redundant information might result in oversynchronization issues. No-operation >> +changes do not count towards actually needed changes, e.g. setting MODE_ID to a >> +different blob with identical contents as the current KMS state shall not be a >> +modeset on its own. > +As a special exception for VRR needs, explicitly setting FB_ID to its > +current value is not a no-op. > > Would that work? I liked this suggestion, thanks! I'll wrap up a v7 > I'd like to try to avoid being more specific about what it does > exactly, because that's not the topic here. Such things can be > documented with the property itself. This is a summary of what is or is > not a no-op or a modeset. > > > Thanks, > pq