Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp6109288ybl; Tue, 27 Aug 2019 14:38:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSZhsJo/8vyENQ1/W8lOBj0IKohp1rVa+pNHN2+x5+Wjv/vWjSHIH9Ip0bVoUt10qPer7f X-Received: by 2002:a63:e14d:: with SMTP id h13mr467408pgk.431.1566941892857; Tue, 27 Aug 2019 14:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566941892; cv=none; d=google.com; s=arc-20160816; b=GZNNbBopFiLt9qC1ZCPMuJvwl4vdRhyo/YRb+y7RA3gVHYASL1jmvbkdAT8k67v7xR vUWhW+7bv7qtEG3nDctRw5/WRTwgByR7hazpG9EehTWiLLDBEphmaU352XaZsABMuEaE Ia2DG3VPERrYhFJvUXYVz39sD6F7xW4iGdTDolHJTL82tcdE3Uj1kHAB7CL8KbBsXoUA dWFRXFnF2hjxk2L06UdMI1m8XBkFhaCHWGo55WxVUU1iniSs1UmWOWJR6gP5OH8IDjEX ONnGAY1yJcqftGbrebCBDVuA7tr0FGFB3fQ4cFSRfAB/F+tJ8AZ4xbQr4vTeScRIiLJp YLzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=k+0AUBxbU6JVGwde8Yye0R2BikQpnByAsWECQmXnXdg=; b=qdeuzY19YVSet8fE8z50XADGP+cNpyOnwFlH1aeaKVNhOMqXmn2qYCL+7UfJSjUw0u vVsL6/zYF9Xc4cOuCwZGgWp5Z4vEPEpUZ7AA4+VzQZuBn1Qs4ofaHovKSnMhcuHvfnFm 8UIACAi01RmoEiikNGei6mA59KYU6mYB8aYLRbCtGBzoeXQL48xY/RlHDY+X9zQ08J1/ 6dH4D/Db1g00Dh5b6aQ1m7Mx3Q21ZPjGvxMb1NWhMPM2w395hu6/C1ihrb7oLcrB5g/T ds69AjZ9jC2gTjVQoK9ml+ztw4h04vDLLEeqICmfczIsqzQ+PtuUJ7fDNAB/W83PC3Tv pAdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ORQG6ecU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z186si483354pgd.162.2019.08.27.14.37.54; Tue, 27 Aug 2019 14:38:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ORQG6ecU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730643AbfH0Vgo (ORCPT + 99 others); Tue, 27 Aug 2019 17:36:44 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38004 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfH0Vgo (ORCPT ); Tue, 27 Aug 2019 17:36:44 -0400 Received: by mail-pl1-f195.google.com with SMTP id w11so177154plp.5; Tue, 27 Aug 2019 14:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k+0AUBxbU6JVGwde8Yye0R2BikQpnByAsWECQmXnXdg=; b=ORQG6ecUUO5DHHrbAG09EZHk4pcKZezQuBxRAF+KWI2FGlRh5SpcXahV1RvNmYAeFl dn1epk7Ea0CJf26fKzI/BP5wzDexaa4K9aOFA2nGh98/oHHeHJf25lame43eyEgYOtNN PIexZfo4kWgQrIKgGV1PspZOBb53LpAoG5aO/wAbEqfUlEbIIcfTyK8+a52s3lXPXjbO bqeoqBQbMSkDMQoua45nrrUo0S9OSEBLwN9uRyZ0Zn505CbC+8+vogDtWZSCTTM6tahU 7w9X76M1Jwnevb1HG3vcL5+/WlcOoFvyZAUVDkTldSvpT5s3xzipcHNQFsWS+KJTHJg8 7RxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k+0AUBxbU6JVGwde8Yye0R2BikQpnByAsWECQmXnXdg=; b=qXi+GXrAjDzkXj4Cs2mEXLhVbEu6aA+a0HOMfDujGMvZfJT/pJ0mbUix8ub0BYYD1E O8BdZ0hddJmOMZha3xxAbXcwavXgAbrfubp99BEo6+tKw3lTdU8PMZYvxw8vj/CSgJcu Lx6NkVMwO7vFgEc4/HmEruWuNuzpnxXHR865ycCYd3mNEnee0sCqLZGjgV4HviyS+CHq Y6JY3T3H6MODeUiVa9gXHnfumkOax7G/QtFNSACEjvA6RHmXd7i8pM+1UgQV0GdLk14Y 9R6G020UCA1nCgjf1rzcvng8Jz3R9CDYVxlUD19hAWYGl2t8I7cxJePhEVnKghS0kEXa o9HA== X-Gm-Message-State: APjAAAV1MZR701VbQHO1saODfUMPhCDk/PA1q4X3y3kSF7uec0yLGQIj KEGAbo2nLn4d/we+7QkUfn4= X-Received: by 2002:a17:902:f01:: with SMTP id 1mr981614ply.337.1566941803570; Tue, 27 Aug 2019 14:36:43 -0700 (PDT) Received: from localhost ([100.118.89.196]) by smtp.gmail.com with ESMTPSA id b126sm275451pfa.177.2019.08.27.14.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 14:36:42 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Abhinav Kumar , Alexios Zavras , Allison Randal , Boris Brezillon , Bruce Wang , Daniel Vetter , Enrico Weigelt , freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), Fritz Koenig , Georgi Djakov , Greg Kroah-Hartman , Jeykumar Sankaran , Jonathan Marek , Jordan Crouse , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list), Mamta Shukla , Sean Paul , Sravanthi Kollukuduru , Thomas Gleixner Subject: [PATCH 0/9] drm/msm: async commit support Date: Tue, 27 Aug 2019 14:33:30 -0700 Message-Id: <20190827213421.21917-1-robdclark@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark Currently the dpu backend attempts to handle async commits. But it is racey and could result in flushing multiple times in a frame, or modifying hw state (such as scanout address or cursor position) after the previous flush, but before vblank, causing underflows (which manifest as brief black flashes). This patchset removes the previous dpu async commit handling, and reworks the internal kms backend API to decouple flushing. And in the end introduces an hrtimer to flush async updates. The overall approach is: 1) Move flushing various hw state out of encoder/crtc atomic commit (which is anyways an improvement over the current state, where we either flush from crtc or encoder, depending on whether it is a full modeset) 2) Switch to crtc_mask for anything that completes after atomic _commit_tail(), so we do not need to keep the atomic state around. Ie. from drm core's perspective, an async commit completes immediately. This avoids fighting with drm core about the lifecycle of an atomic state object. 3) Track a bitmask of crtcs w/ pending async flush, and setup an hrtimer with expiration 1ms before vblank, to trigger the flush. For async commits, we push the state down to the double buffered hw registers immediately, and only defer writing the flush registers. Current patchset only includes the dpu backend support for async commits.. mdp4 and mdp5 should be relatively trivial (less layers of indirection involved). But I won't have access to any mdp4 hw for a few more weeks, so at least that part I might punt on for now. Rob Clark (9): drm/msm/dpu: unwind async commit handling drm/msm/dpu: add real wait_for_commit_done() drm/msm/dpu: handle_frame_done() from vblank irq drm/msm: add kms->wait_flush() drm/msm: convert kms->complete_commit() to crtc_mask drm/msm: add kms->flush_commit() drm/msm: split power control from prepare/complete_commit drm/msm: async commit support drm/msm/dpu: async commit support drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 48 +--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 7 +- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 46 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 8 +- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 39 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 99 +++++---- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 48 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 47 ++-- drivers/gpu/drm/msm/msm_atomic.c | 210 +++++++++++++++--- drivers/gpu/drm/msm/msm_drv.c | 1 + drivers/gpu/drm/msm/msm_drv.h | 4 + drivers/gpu/drm/msm/msm_kms.h | 108 ++++++++- 12 files changed, 466 insertions(+), 199 deletions(-) -- 2.21.0