Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754153AbdGCLCE (ORCPT ); Mon, 3 Jul 2017 07:02:04 -0400 Received: from mga06.intel.com ([134.134.136.31]:23839 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbdGCLCC (ORCPT ); Mon, 3 Jul 2017 07:02:02 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,302,1496127600"; d="scan'208";a="874278407" Subject: Re: [Intel-gfx] [PATCH 1/2] drm/atomic: Change drm_atomic_helper_swap_state to return an error. To: dri-devel@lists.freedesktop.org, David Airlie , nouveau@lists.freedesktop.org, Thierry Reding , Daniel Vetter , Boris Brezillon , Jonathan Hunter , Tomi Valkeinen , Ben Skeggs , CK Hu , linux-tegra@vger.kernel.org, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Jyri Sarha , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Philipp Zabel , freedreno@lists.freedesktop.org References: <20170628132812.14927-1-maarten.lankhorst@linux.intel.com> <20170630135621.c2xlunjaepne2vqt@phenom.ffwll.local> From: Maarten Lankhorst Message-ID: <76319124-3497-f941-73c7-ce6abf084551@linux.intel.com> Date: Mon, 3 Jul 2017 13:01:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170630135621.c2xlunjaepne2vqt@phenom.ffwll.local> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3645 Lines: 74 Op 30-06-17 om 15:56 schreef Daniel Vetter: > On Wed, Jun 28, 2017 at 03:28:11PM +0200, Maarten Lankhorst wrote: >> We want to change swap_state to wait indefinitely, but to do this >> swap_state should wait interruptibly. This requires propagating >> the error to each driver. All drivers have changes to deal with the >> clean up. In order to allow easy reverting, the commit that changes >> behavior is separate so someone only has to revert that for testing. >> >> Nouveau has a small bugfix, if drm_atomic_helper_wait_for_fences >> failed cleanup_planes was not called. >> >> Cc: Boris Brezillon >> Cc: David Airlie >> Cc: Daniel Vetter >> Cc: Jani Nikula >> Cc: Sean Paul >> Cc: CK Hu >> Cc: Philipp Zabel >> Cc: Matthias Brugger >> Cc: Rob Clark >> Cc: Ben Skeggs >> Cc: Thierry Reding >> Cc: Jonathan Hunter >> Cc: Jyri Sarha >> Cc: Tomi Valkeinen >> Cc: Eric Anholt >> Cc: dri-devel@lists.freedesktop.org >> Cc: linux-kernel@vger.kernel.org >> Cc: intel-gfx@lists.freedesktop.org >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-mediatek@lists.infradead.org >> Cc: linux-arm-msm@vger.kernel.org >> Cc: freedreno@lists.freedesktop.org >> Cc: nouveau@lists.freedesktop.org >> Cc: linux-tegra@vger.kernel.org >> Signed-off-by: Maarten Lankhorst > We kinda need to backport this to older kernels, but I don't really see > how :( Maybe we should split this up: > patch 1: Change to int return type > patches 2-(n-1): Driver conversions > patch n: __must_check addition > > That would at least somewhat make this backportable ... > >> --- >> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 14 ++++++++++++-- >> drivers/gpu/drm/drm_atomic_helper.c | 18 ++++++++++++------ >> drivers/gpu/drm/i915/intel_display.c | 10 +++++++++- >> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++++++- >> drivers/gpu/drm/msm/msm_atomic.c | 14 +++++++++----- >> drivers/gpu/drm/nouveau/nv50_display.c | 10 ++++++++-- >> drivers/gpu/drm/tegra/drm.c | 7 ++++++- >> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++++- >> drivers/gpu/drm/vc4/vc4_kms.c | 21 +++++++++++++-------- >> include/drm/drm_atomic_helper.h | 4 ++-- >> 10 files changed, 82 insertions(+), 29 deletions(-) >> >> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c >> index 516d9547d331..d4f787bf1d4a 100644 >> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c >> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c >> @@ -544,9 +544,11 @@ static int atmel_hlcdc_dc_atomic_commit(struct drm_device *dev, >> goto error; >> } >> >> - /* Swap the state, this is the point of no return. */ >> - drm_atomic_helper_swap_state(state, true); > Push the swap_state up over the commit setup (but after the allocation) > and there's no more a problem with unrolling. This can't be done higher up because of the interruptible wait. Unless we change the patch series to move the waiting for hw_done to a separate step and get rid of the stall argument to swap_state once everything is converted. This could be useful for all drivers that have some kind of setup, because we could move the wait up slightly to suit the drivers needs. ~Maarten