From patchwork Tue Sep 8 11:52:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 7140271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3966BBEEC1 for ; Tue, 8 Sep 2015 11:50:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55403206E3 for ; Tue, 8 Sep 2015 11:50:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 63BAB206E2 for ; Tue, 8 Sep 2015 11:50:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 597706E454; Tue, 8 Sep 2015 04:50:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CDA06E454 for ; Tue, 8 Sep 2015 04:50:10 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so112262906wic.1 for ; Tue, 08 Sep 2015 04:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=FmojqrIndl2KPouDEz+Ag3LhMMFTX+sXreURfydl2Rw=; b=TrG1N3uO3ekTDTzqrc0z02aPrjnp6McP9kRB5CbkqhtDRRg9QXG5P7KpVIfT/I/3Va B26cUO5z9zdBguRGduDJBNaDasWN7vD5Y7cCE1QhM/uV+LOelilndM7FOwPLdCH/ROXz A2Ta7nCGmXdOsvL7by+l57OjoDw1bJd/uKZq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FmojqrIndl2KPouDEz+Ag3LhMMFTX+sXreURfydl2Rw=; b=gIMo875b+MUc0bCo2PKOJeGF+Y+IN792uHhpK4HY0Rm50FILVIq5xyugvpP3QX/rvn q/5VwM63mZ4HXuvN+1kLinSxqLmSvTCnNqn6dqrWOTW8Hh+D2Bd5GJd9x4ZBP6BMEqT5 0alrQdhEZHuL/in2SaoJU9tzQ/r7HVlN7ajvkHcixc8bCOk2anYtKCdx9Kr8DsvfCGpW Clz1ATIVdf0JgL6XWJ+E0b1m87qmePUjbaBCIpUtTiv6LIERyDXhHukJgbk4PaPkyohu XZAji68z4zlrvjojc8BPTfT3tqO2iiIxQ4a2EeRFTyN1DoasdSOr/DgwGr2a7AqkAUKN B2ug== X-Gm-Message-State: ALoCoQnM15OqOYvyHZENwZN0YTCrgnkneq3o3rjmi3kJs9j8TDnOIxEE+p/7izl3kyxlW1/1X6w6 X-Received: by 10.194.85.163 with SMTP id i3mr45871909wjz.75.1441713009333; Tue, 08 Sep 2015 04:50:09 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id wo2sm4460416wjb.2.2015.09.08.04.50.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Sep 2015 04:50:08 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/atomic-helper: Pimp docs with recommendations for rpm drivers Date: Tue, 8 Sep 2015 13:52:45 +0200 Message-Id: <1441713165-24465-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.1 Cc: Daniel Vetter , Laurent Pinchart , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Requested by Laurent. Note that this uses the new markdown support which will only land in kernel 4.4 (for the code snippet). v2: A few spelling fixes I spotted myself. Cc: Laurent Pinchart Reviewed-by: Thierry Reding (v1 on irc) Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 12c25c54309f..bd23b4dc7f43 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -993,6 +993,22 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks); * object. This can still fail when e.g. the framebuffer reservation fails. For * now this doesn't implement asynchronous commits. * + * Note that right now this function does not support async commits, and hence + * driver writers must implement their own version for now. Also note that the + * default ordering of how the various stages are called is to match the legacy + * modeset helper library closest. One peculiarity of that is that it doesn't + * mesh well with runtime pm at all. + * + * For drivers supporting runtime PM the recommended sequence is + * + * drm_atomic_helper_commit_modeset_disables(dev, state); + * + * drm_atomic_helper_commit_modeset_enables(dev, state); + * + * drm_atomic_helper_commit_planes(dev, state, true); + * + * See the kerneldoc entries for these three functions for more details. + * * RETURNS * Zero for success or -errno. */ @@ -1168,6 +1184,12 @@ bool plane_crtc_active(struct drm_plane_state *state) * Note that this function does all plane updates across all CRTCs in one step. * If the hardware can't support this approach look at * drm_atomic_helper_commit_planes_on_crtc() instead. + * + * Note that for drivers supporting runtime PM, or which are otherwise unhappy if + * their plane update hooks get called on CRTCs which are off, it is highly + * recommended to set @active_only to true. Setting @active_only to false as the + * default implementation in drm_atomic_helper_commit() does is just done to + * most closely match the behaviour of the legacy helpers. */ void drm_atomic_helper_commit_planes(struct drm_device *dev, struct drm_atomic_state *old_state,