Short summary of fixes pull (less than what git shortlog provides):

* drm/atomic: Release state on error
  * drm/syncobj: Fix use-after-free
  * drm/ttm: Don't use GFP_TRANSHUGE_LIGTH
  * drm/vc4: Unify driver naming for PCM
  * drm/vram-helper: Fix memory leak in vmap
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmAIHQwACgkQaA3BHVML
 eiO8fgf/UPOq1nZXv6WtmNXhQbXS8dcOchzIytliNvVQn0VZ7fB4FZ+w+s3Yu/Vs
 HchWP4jhqlAhK+9NzYLTJ25EigcsJ8IDlpgPo1HenmnMxMl6fN3xP0hwwFA+Usv3
 3yYboXpBEvUTesL6AEiAw+7L/FKnTSMhqwynRNMKjDmLbn40VQM7RxWMIbUKY9cu
 dzzYI6fOcmjWryd/rJQ1cA4k+JOPIC9rbvcY0OzaZOFCUOEeK6icvbG/ARk4BXvQ
 mh7ykD8u126c0ATvAPuwSzy9eSuetQ3HwKDGWS7mIlZa2CdhkSeOypa9spozuDxa
 Nd8dZWG6CcCBQ/Vwb8Ey7fM4JZ9Pig==
 =gLTY
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2021-01-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

Short summary of fixes pull (less than what git shortlog provides):

 * drm/atomic: Release state on error
 * drm/syncobj: Fix use-after-free
 * drm/ttm: Don't use GFP_TRANSHUGE_LIGTH
 * drm/vc4: Unify driver naming for PCM
 * drm/vram-helper: Fix memory leak in vmap

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YAgdYGNoH7pC29rz@linux-uq9g
This commit is contained in:
Dave Airlie 2021-01-22 09:19:20 +10:00
commit f722f5bea1
5 changed files with 24 additions and 12 deletions

View File

@ -3021,7 +3021,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set,
ret = handle_conflicting_encoders(state, true);
if (ret)
return ret;
goto fail;
ret = drm_atomic_commit(state);

View File

@ -387,9 +387,16 @@ static int drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo,
if (gbo->vmap_use_count > 0)
goto out;
ret = ttm_bo_vmap(&gbo->bo, &gbo->map);
if (ret)
return ret;
/*
* VRAM helpers unmap the BO only on demand. So the previous
* page mapping might still be around. Only vmap if the there's
* no mapping present.
*/
if (dma_buf_map_is_null(&gbo->map)) {
ret = ttm_bo_vmap(&gbo->bo, &gbo->map);
if (ret)
return ret;
}
out:
++gbo->vmap_use_count;
@ -577,6 +584,7 @@ static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo,
return;
ttm_bo_vunmap(bo, &gbo->map);
dma_buf_map_clear(&gbo->map); /* explicitly clear mapping for next vmap call */
}
static int drm_gem_vram_bo_driver_move(struct drm_gem_vram_object *gbo,

View File

@ -388,19 +388,18 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
return -ENOENT;
*fence = drm_syncobj_fence_get(syncobj);
drm_syncobj_put(syncobj);
if (*fence) {
ret = dma_fence_chain_find_seqno(fence, point);
if (!ret)
return 0;
goto out;
dma_fence_put(*fence);
} else {
ret = -EINVAL;
}
if (!(flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT))
return ret;
goto out;
memset(&wait, 0, sizeof(wait));
wait.task = current;
@ -432,6 +431,9 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
if (wait.node.next)
drm_syncobj_remove_wait(syncobj, &wait);
out:
drm_syncobj_put(syncobj);
return ret;
}
EXPORT_SYMBOL(drm_syncobj_find_fence);

View File

@ -79,12 +79,13 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags,
struct page *p;
void *vaddr;
if (order) {
gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY |
/* Don't set the __GFP_COMP flag for higher order allocations.
* Mapping pages directly into an userspace process and calling
* put_page() on a TTM allocated page is illegal.
*/
if (order)
gfp_flags |= __GFP_NOMEMALLOC | __GFP_NORETRY |
__GFP_KSWAPD_RECLAIM;
gfp_flags &= ~__GFP_MOVABLE;
gfp_flags &= ~__GFP_COMP;
}
if (!pool->use_dma_alloc) {
p = alloc_pages(gfp_flags, order);

View File

@ -1267,6 +1267,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
card->dai_link = dai_link;
card->num_links = 1;
card->name = vc4_hdmi->variant->card_name;
card->driver_name = "vc4-hdmi";
card->dev = dev;
card->owner = THIS_MODULE;