From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 964BCC433FE for ; Wed, 2 Feb 2022 16:00:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345625AbiBBQAN (ORCPT ); Wed, 2 Feb 2022 11:00:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232735AbiBBQAL (ORCPT ); Wed, 2 Feb 2022 11:00:11 -0500 Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18DA4C061714; Wed, 2 Feb 2022 08:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org ; s=ds202112; 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=HjIuj8tK/i3bU/jTctNAzn1hnRcxPQQLduo2krywtkU=; b=EH3rg7kdaPqsCQ5aP0CO20CfG5 Nr+UWWGO7Y6S66ksZxEMOoGILOR1bK+G9d42uuu6ambVde60Hc7LD81TgLh2TObm2TVCRfUkG7ihu YXdwsmMZ5CDcWrkl3HdRzDoHqm5JK0pmNBJz+NdYnExIGn3Jd4U3louPhjPJ6NhC4bZc6ZFgOnC1P U8F/sqnpOAZ0jum9Po/llG943XMqWBeUDicmOiKZn64jsReQh71GwLPdSJqHFTsK/Kbnhr2bI2MrL /lLlAFOowI7vH218ri6Bsr7CpotdaR6QA5afJF6O/fHegYBvp6wFJ/Dcu9rfrlOO9na7n3Ilb54oL cHC6hYSw==; Received: from [2a01:799:95e:a400:cca0:57ac:c55d:a485] (port=60100) by smtp.domeneshop.no with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFI3E-0000np-3N; Wed, 02 Feb 2022 17:00:08 +0100 Message-ID: <7eb83dae-7dd9-1ffc-93ce-b47429ec510b@tronnes.org> Date: Wed, 2 Feb 2022 17:00:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 1/4] drm: Add I2C connector type To: Pekka Paalanen Cc: Thomas Zimmermann , Sam Ravnborg , Javier Martinez Canillas , linux-fbdev@vger.kernel.org, David Airlie , Daniel Vetter , Emil Velikov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Geert Uytterhoeven , Maxime Ripard , Andy Shevchenko References: <20220131201225.2324984-1-javierm@redhat.com> <20220131201225.2324984-2-javierm@redhat.com> <4d9a56a7-da25-b411-61cc-372c6fa9011d@tronnes.org> <4966d03e-ee0c-5130-3819-05a90a8f6d06@suse.de> <20220202170455.3eece5a3@eldfell> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= In-Reply-To: <20220202170455.3eece5a3@eldfell> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den 02.02.2022 16.04, skrev Pekka Paalanen: > On Wed, 2 Feb 2022 10:45:42 +0100 > Noralf Trønnes wrote: > >> Den 02.02.2022 10.14, skrev Thomas Zimmermann: >>> Hi Noralf, >>> >>> since you're here, I'll just hijack the discussion to ask something only >>> semi-related. >>> >>> IIRC the gud driver doesn't update the display immediately during atomic >>> commits. Instead, it instructs a helper thread to do the update. What's >>> the rational behind this design? Is that something we should adopt for >>> other drivers that operate over slow buses (USB, I2C, etc)? Would this >>> be relevant for the ssd1307 driver? >>> >> >> Async flushing is only necessary on multi display setups where there's >> only one rendering loop for all the displays. I saw what tiny/gm12u320.c >> did and Hans gave me the rationale. The SPI drivers run flushing inline. >> Info on the gud wiki: >> https://github.com/notro/gud/wiki/Linux-Host-Driver#asynchronous-flushing > > Hi, > > please also consider that userspace may throttle to the KMS pageflip > events. If the pageflip event is immediate from submitting a flip, that > could mean userspace will be repainting in a busy-loop, like 1 kHz. > However, I remember something about virtual KMS drivers doing exactly > this, and there being something that tells userspace to throttle itself > instead of depending on pageflip completions. I just forget how that is > supposed to work, and I'm fairly sure that e.g. Weston does not behave > well there. > > Unfortunately, the pageflip event is also what synchronises FB usage. > Once flipping in a new FB completed, the old FB is free for re-use. > But, if the kernel is still copying out from the old FB, userspace may > partially overwrite the contents, temporarily leading to an incomplete > or too new image on screen. Do you have anything to prevent that? > Unfortunately not. One solution would be to make a buffer copy during the flip and do the USB transfer async but I haven't looked into that. My plan is to wait and see what problems users report back before trying to fix anything. Noralf. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C238C433EF for ; Wed, 2 Feb 2022 16:00:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6970710E2C0; Wed, 2 Feb 2022 16:00:11 +0000 (UTC) Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 900AC10E2C0 for ; Wed, 2 Feb 2022 16:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org ; s=ds202112; 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=HjIuj8tK/i3bU/jTctNAzn1hnRcxPQQLduo2krywtkU=; b=EH3rg7kdaPqsCQ5aP0CO20CfG5 Nr+UWWGO7Y6S66ksZxEMOoGILOR1bK+G9d42uuu6ambVde60Hc7LD81TgLh2TObm2TVCRfUkG7ihu YXdwsmMZ5CDcWrkl3HdRzDoHqm5JK0pmNBJz+NdYnExIGn3Jd4U3louPhjPJ6NhC4bZc6ZFgOnC1P U8F/sqnpOAZ0jum9Po/llG943XMqWBeUDicmOiKZn64jsReQh71GwLPdSJqHFTsK/Kbnhr2bI2MrL /lLlAFOowI7vH218ri6Bsr7CpotdaR6QA5afJF6O/fHegYBvp6wFJ/Dcu9rfrlOO9na7n3Ilb54oL cHC6hYSw==; Received: from [2a01:799:95e:a400:cca0:57ac:c55d:a485] (port=60100) by smtp.domeneshop.no with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFI3E-0000np-3N; Wed, 02 Feb 2022 17:00:08 +0100 Message-ID: <7eb83dae-7dd9-1ffc-93ce-b47429ec510b@tronnes.org> Date: Wed, 2 Feb 2022 17:00:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 1/4] drm: Add I2C connector type To: Pekka Paalanen References: <20220131201225.2324984-1-javierm@redhat.com> <20220131201225.2324984-2-javierm@redhat.com> <4d9a56a7-da25-b411-61cc-372c6fa9011d@tronnes.org> <4966d03e-ee0c-5130-3819-05a90a8f6d06@suse.de> <20220202170455.3eece5a3@eldfell> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= In-Reply-To: <20220202170455.3eece5a3@eldfell> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, David Airlie , Daniel Vetter , Emil Velikov , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Maxime Ripard , Thomas Zimmermann , Andy Shevchenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Den 02.02.2022 16.04, skrev Pekka Paalanen: > On Wed, 2 Feb 2022 10:45:42 +0100 > Noralf Trønnes wrote: > >> Den 02.02.2022 10.14, skrev Thomas Zimmermann: >>> Hi Noralf, >>> >>> since you're here, I'll just hijack the discussion to ask something only >>> semi-related. >>> >>> IIRC the gud driver doesn't update the display immediately during atomic >>> commits. Instead, it instructs a helper thread to do the update. What's >>> the rational behind this design? Is that something we should adopt for >>> other drivers that operate over slow buses (USB, I2C, etc)? Would this >>> be relevant for the ssd1307 driver? >>> >> >> Async flushing is only necessary on multi display setups where there's >> only one rendering loop for all the displays. I saw what tiny/gm12u320.c >> did and Hans gave me the rationale. The SPI drivers run flushing inline. >> Info on the gud wiki: >> https://github.com/notro/gud/wiki/Linux-Host-Driver#asynchronous-flushing > > Hi, > > please also consider that userspace may throttle to the KMS pageflip > events. If the pageflip event is immediate from submitting a flip, that > could mean userspace will be repainting in a busy-loop, like 1 kHz. > However, I remember something about virtual KMS drivers doing exactly > this, and there being something that tells userspace to throttle itself > instead of depending on pageflip completions. I just forget how that is > supposed to work, and I'm fairly sure that e.g. Weston does not behave > well there. > > Unfortunately, the pageflip event is also what synchronises FB usage. > Once flipping in a new FB completed, the old FB is free for re-use. > But, if the kernel is still copying out from the old FB, userspace may > partially overwrite the contents, temporarily leading to an incomplete > or too new image on screen. Do you have anything to prevent that? > Unfortunately not. One solution would be to make a buffer copy during the flip and do the USB transfer async but I haven't looked into that. My plan is to wait and see what problems users report back before trying to fix anything. Noralf.