From patchwork Fri Apr 12 12:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helen Mae Koike Fornazier X-Patchwork-Id: 10898245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65BDE17E1 for ; Fri, 12 Apr 2019 12:59:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42E4828DB9 for ; Fri, 12 Apr 2019 12:59:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35F9528DBC; Fri, 12 Apr 2019 12:59:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D052528DC0 for ; Fri, 12 Apr 2019 12:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rvx98Xtt7NVZOgwCJApchEPLRQcFnW3jeM5XySTiVH0=; b=KPOpfUE+BQ5jTK uojVdHBlk8/LfbgofEoDDEsdRYKVyyrGVxRJccj+fXMZH804OZlpax1JNpUWoWDWtxsFrjjvL3cgd ++WFu8ki5YT1BlybabqMuI7UtSVSCOMhVomDEPlNyZvlmu1KYvBfxyRgt6tVhzFfGqINjQP+1kgzD T+pfNpawUn0lPLaSUKKhUSIpXN+14FkMzp8cjV6MhMltJ7YBdoQhkmP49jcPsdLowLkILW6N7bktn BcJdtBqCLBzNMLsP9kQ/yxEgObjLUU1cCLNexMUmDwK5NRdYfO2tS9PIkOSpkrPnpE5bO+tqhKQrl cSK2Rd8eHFt5KfuJHIMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEvlk-0006j7-00; Fri, 12 Apr 2019 12:59:00 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEvlg-0006hr-6Y; Fri, 12 Apr 2019 12:58:58 +0000 Received: from localhost.localdomain (unknown [IPv6:2804:431:9718:a5e8:c168:522a:50d5:d06d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id C0DC9281156; Fri, 12 Apr 2019 13:58:42 +0100 (BST) From: Helen Koike To: dri-devel@lists.freedesktop.org, David Airlie Subject: [PATCH v3 0/4] async vs amend - UAPI Date: Fri, 12 Apr 2019 09:58:23 -0300 Message-Id: <20190412125827.5877-1-helen.koike@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_055856_500952_55779C2F X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Heiko_St=C3=BCbner?= , Sean Paul , alexandros.frantzis@collabora.com, Maxime Ripard , daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, Eric Anholt , Mamta Shukla , tina.zhang@intel.com, kernel@collabora.com, Anthony Koo , =?utf-8?b?VmlsbGUg?= =?utf-8?b?U3lyasOkbMOk?= , "David \(ChunMing\) Zhou" , Jonathan Corbet , Sean Paul , David Francis , linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, Gustavo Padovan , linux-rockchip@lists.infradead.org, Harry Wentland , daniels@collabora.com, Leo Li , linux-arm-msm@vger.kernel.org, Maarten Lankhorst , Helen Koike , Daniel Vetter , Mikita Lipski , Bhawanpreet Lakha , linux-arm-kernel@lists.infradead.org, dnicoara@chromium.org, =?utf-8?q?St?= =?utf-8?q?=C3=A9phane_Marchesin?= , freedreno@lists.freedesktop.org, Sandy Huang , tomasz Figa , Rob Clark , boris.brezillon@collabora.com, Thomas Zimmermann , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Russell King , nicholas.kazlauskas@amd.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This patch series is an attempt to clarify some concepts and how things are hooked inside drm. There are two main concepts that are similar but different and are causing some confusion: - Asynchronous update: is the ability change the hw state at any time, not only during vblank. - Amend update: is the ability to perform 1000 commits to be applied as soon as possible without waiting for 1000 vblanks. async updates can be seen as amend, but the opposite is not true. Please see documentation on the commit "drm/atomic: rename async_{update,check} to amend_{update,check}" for a more detailed explanation. To perform an async update, we already have the DRM_MODE_PAGE_FLIP_ASYNC flag in the atomic API and it is already being used by amdgpu in the atomic path. The first two commits clarifies these differences. The last two are RFCs that exposes new async and amend features to userspace. We introduce in this series the flag DRM_MODE_ATOMIC_AMEND to expose the amend feature to userspace. The main reasons to expose this through atomic api is to avoid mixing legacy with modern/atomic API (since their interactions are not well defined) and to be able to explicitly manage the cursor plane. And the last commit hooks the current async implementations with the DRM_MODE_PAGE_FLIP_ASYNC flag. Please, see the message in each commit and the documentation that was added for more details and let me know what you think. Thanks Helen Changes in v3: - rebase tree - rebase on top of renaming async_update to amend_update - improve documentation - don't fall back to a normal commit if amend is not possible when requested through the atomic api Changes in v2: - rebase tree - do not fall back to a non-async update if if there isn't any pending commit to amend Changes in v1: - https://patchwork.freedesktop.org/patch/243088/ - Only enable it if userspace requests it. - Only allow async update for cursor type planes. - Rename ASYNC_UPDATE for ATOMIC_AMEND. Helen Koike (4): drm/uapi: add documentation for atomic flags drm/atomic: rename async_{update,check} to amend_{update,check} drm/atomic: add ATOMIC_AMEND flag to the Atomic IOCTL. drm/atomic: hook atomic_async_{check,update} with PAGE_FLIP_ASYNC flag Documentation/gpu/drm-kms-helpers.rst | 8 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +- drivers/gpu/drm/drm_atomic_helper.c | 157 ++++++++++++++---- drivers/gpu/drm/drm_atomic_uapi.c | 9 + drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 6 + drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 12 +- drivers/gpu/drm/vc4/vc4_kms.c | 4 +- drivers/gpu/drm/vc4/vc4_plane.c | 6 + include/drm/drm_atomic.h | 4 +- include/drm/drm_atomic_helper.h | 9 +- include/drm/drm_modeset_helper_vtables.h | 69 ++++++-- include/uapi/drm/drm_mode.h | 27 ++- 12 files changed, 264 insertions(+), 62 deletions(-)