From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com ([62.4.15.54]:46315 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729339AbeGYUcT (ORCPT ); Wed, 25 Jul 2018 16:32:19 -0400 Date: Wed, 25 Jul 2018 21:18:48 +0200 From: Boris Brezillon To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Cc: Gustavo Padovan , Sean Paul , Eric Anholt , stable@vger.kernel.org Subject: Re: [PATCH v2] drm/atomic: Check old_plane_state->crtc in drm_atomic_helper_async_check() Message-ID: <20180725211848.7106f6df@bbrezillon> In-Reply-To: <20180724133215.31917-1-boris.brezillon@bootlin.com> References: <20180724133215.31917-1-boris.brezillon@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Tue, 24 Jul 2018 15:32:15 +0200 Boris Brezillon wrote: > Async plane update is supposed to work only when updating the FB or FB > position of an already enabled plane. That does not apply to requests > where the plane was previously disabled or assigned to a different > CTRC. > > Check old_plane_state->crtc value to make sure async plane update is > allowed. > > Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update") > Cc: > Signed-off-by: Boris Brezillon > Reviewed-by: Eric Anholt Applied to drm-misc-fixes. > --- > Changes in v2: > - Cc stable > - Add Eric's R-b > --- > drivers/gpu/drm/drm_atomic_helper.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index 866a2cc72ef6..f7ccfebd3ca8 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -1555,7 +1555,8 @@ int drm_atomic_helper_async_check(struct drm_device *dev, > if (n_planes != 1) > return -EINVAL; > > - if (!new_plane_state->crtc) > + if (!new_plane_state->crtc || > + old_plane_state->crtc != new_plane_state->crtc) > return -EINVAL; > > funcs = plane->helper_private;