Commit 1d74f133 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2018-11-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

- vc4: Fix NULL deref in async path (Boris)
- vc4: Avoid taking async path for cursor updates when impossible (Boris)
- udmabuf: Fix mmap with PROT_WRITE (Gerd)
- fb-helper: Don't use writeback connectors for fbdev (Paul)

Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20181121155248.GA241511@art_vandelay
parents 7989b9ee 8fd3b903
...@@ -184,6 +184,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, ...@@ -184,6 +184,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head,
exp_info.ops = &udmabuf_ops; exp_info.ops = &udmabuf_ops;
exp_info.size = ubuf->pagecount << PAGE_SHIFT; exp_info.size = ubuf->pagecount << PAGE_SHIFT;
exp_info.priv = ubuf; exp_info.priv = ubuf;
exp_info.flags = O_RDWR;
buf = dma_buf_export(&exp_info); buf = dma_buf_export(&exp_info);
if (IS_ERR(buf)) { if (IS_ERR(buf)) {
......
...@@ -219,6 +219,9 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper) ...@@ -219,6 +219,9 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
mutex_lock(&fb_helper->lock); mutex_lock(&fb_helper->lock);
drm_connector_list_iter_begin(dev, &conn_iter); drm_connector_list_iter_begin(dev, &conn_iter);
drm_for_each_connector_iter(connector, &conn_iter) { drm_for_each_connector_iter(connector, &conn_iter) {
if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
continue;
ret = __drm_fb_helper_add_one_connector(fb_helper, connector); ret = __drm_fb_helper_add_one_connector(fb_helper, connector);
if (ret) if (ret)
goto fail; goto fail;
......
...@@ -214,6 +214,12 @@ static int vc4_atomic_commit(struct drm_device *dev, ...@@ -214,6 +214,12 @@ static int vc4_atomic_commit(struct drm_device *dev,
return 0; 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); ret = drm_atomic_helper_setup_commit(state, nonblock);
if (ret) if (ret)
return ret; return ret;
......
...@@ -807,7 +807,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) ...@@ -807,7 +807,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
static void vc4_plane_atomic_async_update(struct drm_plane *plane, static void vc4_plane_atomic_async_update(struct drm_plane *plane,
struct drm_plane_state *state) struct drm_plane_state *state)
{ {
struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state); struct vc4_plane_state *vc4_state, *new_vc4_state;
if (plane->state->fb != state->fb) { if (plane->state->fb != state->fb) {
vc4_plane_async_set_fb(plane, state->fb); vc4_plane_async_set_fb(plane, state->fb);
...@@ -828,7 +828,18 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, ...@@ -828,7 +828,18 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane,
plane->state->src_y = state->src_y; plane->state->src_y = state->src_y;
/* Update the display list based on the new crtc_x/y. */ /* Update the display list based on the new crtc_x/y. */
vc4_plane_atomic_check(plane, plane->state); vc4_plane_atomic_check(plane, state);
new_vc4_state = to_vc4_plane_state(state);
vc4_state = to_vc4_plane_state(plane->state);
/* Update the current vc4_state pos0, pos2 and ptr0 dlist entries. */
vc4_state->dlist[vc4_state->pos0_offset] =
new_vc4_state->dlist[vc4_state->pos0_offset];
vc4_state->dlist[vc4_state->pos2_offset] =
new_vc4_state->dlist[vc4_state->pos2_offset];
vc4_state->dlist[vc4_state->ptr0_offset] =
new_vc4_state->dlist[vc4_state->ptr0_offset];
/* Note that we can't just call vc4_plane_write_dlist() /* Note that we can't just call vc4_plane_write_dlist()
* because that would smash the context data that the HVS is * because that would smash the context data that the HVS is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment