[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170630134118.qtfalfscgabcwo5o@phenom.ffwll.local>
Date: Fri, 30 Jun 2017 15:41:18 +0200
From: Daniel Vetter <daniel@...ll.ch>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
Cc: dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
Thierry Reding <thierry.reding@...il.com>,
Daniel Vetter <daniel.vetter@...el.com>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Ben Skeggs <bskeggs@...hat.com>, linux-tegra@...r.kernel.org,
linux-arm-msm@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org, Jyri Sarha <jsarha@...com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
freedreno@...ts.freedesktop.org
Subject: Re: [PATCH 2/2] drm/atomic: Wait indefinitely and interruptibly for
hw_done.
On Wed, Jun 28, 2017 at 03:28:12PM +0200, Maarten Lankhorst wrote:
> Without waiting for hw_done, previous atomic updates may dereference
> the wrong state and cause a lot of confusion. The real fix is fixing
> all obj->state to use the accessor macros, but for now wait
> indefinitely and interruptibly.
>
> Cc: Boris Brezillon <boris.brezillon@...e-electrons.com>
> Cc: David Airlie <airlied@...ux.ie>
> Cc: Daniel Vetter <daniel.vetter@...el.com>
> Cc: Jani Nikula <jani.nikula@...ux.intel.com>
> Cc: Sean Paul <seanpaul@...omium.org>
> Cc: CK Hu <ck.hu@...iatek.com>
> Cc: Philipp Zabel <p.zabel@...gutronix.de>
> Cc: Matthias Brugger <matthias.bgg@...il.com>
> Cc: Rob Clark <robdclark@...il.com>
> Cc: Ben Skeggs <bskeggs@...hat.com>
> Cc: Thierry Reding <thierry.reding@...il.com>
> Cc: Jonathan Hunter <jonathanh@...dia.com>
> Cc: Jyri Sarha <jsarha@...com>
> Cc: Tomi Valkeinen <tomi.valkeinen@...com>
> Cc: Eric Anholt <eric@...olt.net>
> Cc: dri-devel@...ts.freedesktop.org
> Cc: linux-kernel@...r.kernel.org
> Cc: intel-gfx@...ts.freedesktop.org
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-mediatek@...ts.infradead.org
> Cc: linux-arm-msm@...r.kernel.org
> Cc: freedreno@...ts.freedesktop.org
> Cc: nouveau@...ts.freedesktop.org
> Cc: linux-tegra@...r.kernel.org
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index f66b6c45cdd0..56e7729d993d 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2144,8 +2144,7 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
> int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> bool stall)
Needs improved kernel-doc:
* Returns:
*
* 0 on success. Can return -EINTR when @stall is true and the waiting for
* the previous commits has been interrupted.
With that Reviewed-by: Daniel Vetter <daniel.vetter@...ll.ch>
> {
> - int i;
> - long ret;
> + int i, ret;
> struct drm_connector *connector;
> struct drm_connector_state *old_conn_state, *new_conn_state;
> struct drm_crtc *crtc;
> @@ -2168,12 +2167,11 @@ int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> if (!commit)
> continue;
>
> - ret = wait_for_completion_timeout(&commit->hw_done,
> - 10*HZ);
> - if (ret == 0)
> - DRM_ERROR("[CRTC:%d:%s] hw_done timed out\n",
> - crtc->base.id, crtc->name);
> + ret = wait_for_completion_interruptible(&commit->hw_done);
> drm_crtc_commit_put(commit);
> +
> + if (ret)
> + return ret;
> }
> }
>
> --
> 2.11.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Powered by blists - more mailing lists