Message ID | 20181115102303.24744-2-boris.brezillon@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/2] drm/vc4: Fix NULL pointer dereference in the async update path | expand |
On Thu, 15 Nov 2018 11:23:03 +0100 Boris Brezillon <boris.brezillon@bootlin.com> wrote: > drm_atomic_helper_setup_commit() auto-completes commit->flip_done when > state->legacy_cursor_update is true, but we now for sure that we want ^know > a sync update when we call drm_atomic_helper_setup_commit() from > vc4_atomic_commit(). > > Explicitly set state->legacy_cursor_update to false to prevent this > auto-completion. > Forgot Fixes: 184d3cf4f738 ("drm/vc4: Use wait_for_flip_done() instead of wait_for_vblanks()") Cc: <stable@vger.kernel> I'll send a v3. > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> > Reviewed-by: Eric Anholt <eric@anholt.net> > --- > Changes in v2: > - Add Eric's R-b > --- > drivers/gpu/drm/vc4/vc4_kms.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c > index 127468785f74..1f94b9affe4b 100644 > --- a/drivers/gpu/drm/vc4/vc4_kms.c > +++ b/drivers/gpu/drm/vc4/vc4_kms.c > @@ -214,6 +214,12 @@ static int vc4_atomic_commit(struct drm_device *dev, > return 0; > } > > + /* We know for sure we don't want an async update here. Set > + * state->legacy_cursor_update to false to prevent > + * drm_atomic_helper_setup_commit() from auto-completing > + * commit->flip_done. > + */ > + state->legacy_cursor_update = false; > ret = drm_atomic_helper_setup_commit(state, nonblock); > if (ret) > return ret;
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 127468785f74..1f94b9affe4b 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -214,6 +214,12 @@ static int vc4_atomic_commit(struct drm_device *dev, return 0; } + /* We know for sure we don't want an async update here. Set + * state->legacy_cursor_update to false to prevent + * drm_atomic_helper_setup_commit() from auto-completing + * commit->flip_done. + */ + state->legacy_cursor_update = false; ret = drm_atomic_helper_setup_commit(state, nonblock); if (ret) return ret;