diff options
author | Dave Airlie <airlied@redhat.com> | 2018-03-22 16:18:48 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-03-22 16:18:48 -0400 |
commit | 2a2553cc45c889f15a1df0355891a809f17ca43d (patch) | |
tree | e5664857265d4c1d47c5191ea0b71d569ba69613 /drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |
parent | f3924ae723d84746546bd74bdefc99c17da2a467 (diff) | |
parent | 43bfefedd0281ef476f8154397cd283a710d8baf (diff) |
Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next
A relative large set of various improvements for vmwgfx. Some of them
have been around for a while, some are relatively new, but functionality
should have been tested in our standalone repo.
* 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux:
drm/vmwgfx: Bump version patchlevel and date
drm/vmwgfx: use monotonic event timestamps
drm/vmwgfx: Unpin the screen object backup buffer when not used
drm/vmwgfx: Stricter count of legacy surface device resources
drm/vmwgfx: Use kasprintf
drm/vmwgfx: Get rid of the device-private suspended member
drm/vmwgfx: Improve on hibernation
drm/vmwgfx: Avoid pinning fbdev framebuffers
drm/vmwgfx: Fix multiple command buffer context use
drm/vmwgfx: Use the cpu blit utility for framebuffer to screen target blits
drm/vmwgfx: Add a cpu blit utility that can be used for page-backed bos
drm/ttm: Export the ttm_k[un]map_atomic_prot API.
drm/ttm: Clean up kmap_atomic_prot selection code
drm/vmwgfx: Cursor update fixes
drm/vmwgfx: Send the correct nonblock option for atomic_commit
drm/vmwgfx: Move the stdu vblank event to atomic function
drm/vmwgfx: Move screen object page flip to atomic function
drm/vmwgfx: Remove drm_crtc_arm_vblank_event from atomic flush
drm/vmwgfx: Move surface copy cmd to atomic function
drm/vmwgfx: Avoid iterating over display unit if crtc is available
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_resource.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 9e101450cc4d..6b3a942b18df 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |||
@@ -354,6 +354,7 @@ void vmw_dmabuf_bo_free(struct ttm_buffer_object *bo) | |||
354 | { | 354 | { |
355 | struct vmw_dma_buffer *vmw_bo = vmw_dma_buffer(bo); | 355 | struct vmw_dma_buffer *vmw_bo = vmw_dma_buffer(bo); |
356 | 356 | ||
357 | vmw_dma_buffer_unmap(vmw_bo); | ||
357 | kfree(vmw_bo); | 358 | kfree(vmw_bo); |
358 | } | 359 | } |
359 | 360 | ||
@@ -361,6 +362,7 @@ static void vmw_user_dmabuf_destroy(struct ttm_buffer_object *bo) | |||
361 | { | 362 | { |
362 | struct vmw_user_dma_buffer *vmw_user_bo = vmw_user_dma_buffer(bo); | 363 | struct vmw_user_dma_buffer *vmw_user_bo = vmw_user_dma_buffer(bo); |
363 | 364 | ||
365 | vmw_dma_buffer_unmap(&vmw_user_bo->dma); | ||
364 | ttm_prime_object_kfree(vmw_user_bo, prime); | 366 | ttm_prime_object_kfree(vmw_user_bo, prime); |
365 | } | 367 | } |
366 | 368 | ||
@@ -1239,6 +1241,12 @@ void vmw_resource_move_notify(struct ttm_buffer_object *bo, | |||
1239 | 1241 | ||
1240 | dma_buf = container_of(bo, struct vmw_dma_buffer, base); | 1242 | dma_buf = container_of(bo, struct vmw_dma_buffer, base); |
1241 | 1243 | ||
1244 | /* | ||
1245 | * Kill any cached kernel maps before move. An optimization could | ||
1246 | * be to do this iff source or destination memory type is VRAM. | ||
1247 | */ | ||
1248 | vmw_dma_buffer_unmap(dma_buf); | ||
1249 | |||
1242 | if (mem->mem_type != VMW_PL_MOB) { | 1250 | if (mem->mem_type != VMW_PL_MOB) { |
1243 | struct vmw_resource *res, *n; | 1251 | struct vmw_resource *res, *n; |
1244 | struct ttm_validate_buffer val_buf; | 1252 | struct ttm_validate_buffer val_buf; |
@@ -1262,6 +1270,21 @@ void vmw_resource_move_notify(struct ttm_buffer_object *bo, | |||
1262 | } | 1270 | } |
1263 | 1271 | ||
1264 | 1272 | ||
1273 | /** | ||
1274 | * vmw_resource_swap_notify - swapout notify callback. | ||
1275 | * | ||
1276 | * @bo: The buffer object to be swapped out. | ||
1277 | */ | ||
1278 | void vmw_resource_swap_notify(struct ttm_buffer_object *bo) | ||
1279 | { | ||
1280 | if (bo->destroy != vmw_dmabuf_bo_free && | ||
1281 | bo->destroy != vmw_user_dmabuf_destroy) | ||
1282 | return; | ||
1283 | |||
1284 | /* Kill any cached kernel maps before swapout */ | ||
1285 | vmw_dma_buffer_unmap(vmw_dma_buffer(bo)); | ||
1286 | } | ||
1287 | |||
1265 | 1288 | ||
1266 | /** | 1289 | /** |
1267 | * vmw_query_readback_all - Read back cached query states | 1290 | * vmw_query_readback_all - Read back cached query states |