From patchwork Mon Dec 19 11:08:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 9480093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D851A606DB for ; Mon, 19 Dec 2016 11:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2A172841B for ; Mon, 19 Dec 2016 11:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C722928468; Mon, 19 Dec 2016 11:08:23 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9A7AE2841B for ; Mon, 19 Dec 2016 11:08:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B113B6E5C0; Mon, 19 Dec 2016 11:08:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 252006E5C0; Mon, 19 Dec 2016 11:08:20 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP; 19 Dec 2016 03:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,373,1477983600"; d="scan'208";a="44125896" Received: from sstoeck1-mobl1.ger.corp.intel.com (HELO patser.lan) ([10.252.10.89]) by orsmga005.jf.intel.com with ESMTP; 19 Dec 2016 03:08:17 -0800 To: Daniel Vetter References: <1481204729-9058-1-git-send-email-maarten.lankhorst@linux.intel.com> <1481204729-9058-3-git-send-email-maarten.lankhorst@linux.intel.com> <20161208154104.vmgr5d2pywg7fmhj@phenom.ffwll.local> <1995226.mylCh0k4y5@avalon> <20161209082549.jdzl2kinu3j7zacv@phenom.ffwll.local> <20161213171044.cg7ussvzmq7pvtaz@phenom.ffwll.local> From: Maarten Lankhorst Message-ID: <6d82f9b6-9d16-91d1-d176-4a37b09afc44@linux.intel.com> Date: Mon, 19 Dec 2016 12:08:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161213171044.cg7ussvzmq7pvtaz@phenom.ffwll.local> Cc: intel-gfx@lists.freedesktop.org, Laurent Pinchart , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v2 2/6] drm/atomic: Unconditionally call prepare_fb. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Op 13-12-16 om 18:10 schreef Daniel Vetter: > On Tue, Dec 13, 2016 at 03:13:54PM +0100, Maarten Lankhorst wrote: >> Op 09-12-16 om 09:25 schreef Daniel Vetter: >>> On Fri, Dec 09, 2016 at 12:42:19AM +0200, Laurent Pinchart wrote: >>>> Hi Daniel, >>>> >>>> On Thursday 08 Dec 2016 16:41:04 Daniel Vetter wrote: >>>>> On Thu, Dec 08, 2016 at 02:45:25PM +0100, Maarten Lankhorst wrote: >>>>>> Atomic drivers may set properties like rotation on the same fb, which >>>>>> may require a call to prepare_fb even when framebuffer stays identical. >>>>>> >>>>>> Instead of handling all the special cases in the core, let the driver >>>>>> decide when prepare_fb and cleanup_fb are noops. >>>>>> >>>>>> Signed-off-by: Maarten Lankhorst >>>>> I think this makes sense, but would be really good to get a pile of acks >>>>> from driver maintainers on this one. Rob, Eric, Laurent, others? >>>> This is all very nice, but it will introduce at least a performance >>>> regression, and possibly worse, until drivers get updated. There are 7 drivers >>>> implementing the .prepare_fb() callback (plus a bunch of drivers that probably >>>> should use drm_fb_cma_prepare_fb() but don't at the moment). I can't ack this >>>> patch before they get fixed. >>> Maarten's commit message is insufficient, since this is defacto a revert >>> of >>> >>> commit fcc60b413d14dd06ddbd79ec50e83c4fb2a097ba >>> Author: Keith Packard >>> Date: Sat Jun 4 01:16:22 2016 -0700 >>> >>> drm: Don't prepare or cleanup unchanging frame buffers [v3] >>> >>> because that breaks stuff. We're simply going back to where we've been a >>> few months ago. Since this is a regression fix, back to original >>> behaviour, can you ack (assuming Maarten updates the commit message to >>> reflect the nature of the commit here)? >> Waiting on a reply, but what about this commit message for this patch? >> --- >> Atomic drivers may set properties like rotation on the same fb, which >> may require a call to prepare_fb even when framebuffer stays identical. >> >> Instead of handling all the special cases in the core, let the driver >> decide when prepare_fb and cleanup_fb are noops. >> >> This is a revert of: >> >> commit fcc60b413d14dd06ddbd79ec50e83c4fb2a097ba >> Author: Keith Packard >> Date: Sat Jun 4 01:16:22 2016 -0700 >> >> drm: Don't prepare or cleanup unchanging frame buffers [v3] >> >> The original commit mentions that this prevents waiting in i915 on all >> previous rendering during cursor updates, but there are better ways to >> fix this. >> >> Signed-off-by: Maarten Lankhorst > Yeah sounds good to me. Since we don't want to backport all the i915 > cursor patches no cc: stable on this. Also, this is only an issue for > drivers which both have a cursor plane, and implement that cursor using > universal planes (i.e. settting drm_crtc->cursor). Afaik the only two are > vc4 and i915, and after this series both will have appropriate hacks (for > now) to keep existing userspace happy. > -Daniel Same patch, reworded! ---8<--- Atomic drivers may set properties like rotation on the same fb, which may require a call to prepare_fb even when framebuffer stays identical. Instead of handling all the special cases in the core, let the driver decide when prepare_fb and cleanup_fb are noops. This is a revert of: commit fcc60b413d14dd06ddbd79ec50e83c4fb2a097ba Author: Keith Packard Date: Sat Jun 4 01:16:22 2016 -0700 drm: Don't prepare or cleanup unchanging frame buffers [v3] The original commit mentions that this prevents waiting in i915 on all previous rendering during cursor updates, but there are better ways to fix this. Signed-off-by: Maarten Lankhorst Acked-by: Laurent Pinchart --- drivers/gpu/drm/drm_atomic_helper.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 23767df72615..d19563651e07 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1664,9 +1664,6 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, funcs = plane->helper_private; - if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc)) - continue; - if (funcs->prepare_fb) { ret = funcs->prepare_fb(plane, plane_state); if (ret) @@ -1683,9 +1680,6 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, if (j >= i) continue; - if (!drm_atomic_helper_framebuffer_changed(dev, state, plane_state->crtc)) - continue; - funcs = plane->helper_private; if (funcs->cleanup_fb) @@ -1952,9 +1946,6 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev, for_each_plane_in_state(old_state, plane, plane_state, i) { const struct drm_plane_helper_funcs *funcs; - if (!drm_atomic_helper_framebuffer_changed(dev, old_state, plane_state->crtc)) - continue; - funcs = plane->helper_private; if (funcs->cleanup_fb)