Lines Matching refs:vps

427 void vmw_du_plane_unpin_surf(struct vmw_plane_state *vps,  in vmw_du_plane_unpin_surf()  argument
430 if (vps->surf) { in vmw_du_plane_unpin_surf()
431 if (vps->pinned) { in vmw_du_plane_unpin_surf()
432 vmw_resource_unpin(&vps->surf->res); in vmw_du_plane_unpin_surf()
433 vps->pinned--; in vmw_du_plane_unpin_surf()
437 if (vps->pinned) in vmw_du_plane_unpin_surf()
439 vmw_surface_unreference(&vps->surf); in vmw_du_plane_unpin_surf()
459 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); in vmw_du_plane_cleanup_fb() local
461 vmw_du_plane_unpin_surf(vps, false); in vmw_du_plane_cleanup_fb()
479 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); in vmw_du_cursor_plane_cleanup_fb() local
482 if (vps->bo != NULL && ttm_kmap_obj_virtual(&vps->bo->map, &dummy) != NULL) { in vmw_du_cursor_plane_cleanup_fb()
483 const int ret = ttm_bo_reserve(&vps->bo->base, true, false, NULL); in vmw_du_cursor_plane_cleanup_fb()
486 if (atomic_read(&vps->bo->base_mapped_count) == 0) in vmw_du_cursor_plane_cleanup_fb()
487 ttm_bo_kunmap(&vps->bo->map); in vmw_du_cursor_plane_cleanup_fb()
488 ttm_bo_unreserve(&vps->bo->base); in vmw_du_cursor_plane_cleanup_fb()
492 if (vps->cm_bo != NULL && ttm_kmap_obj_virtual(&vps->cm_map, &dummy) != NULL) { in vmw_du_cursor_plane_cleanup_fb()
493 const int ret = ttm_bo_reserve(vps->cm_bo, true, false, NULL); in vmw_du_cursor_plane_cleanup_fb()
496 ttm_bo_kunmap(&vps->cm_map); in vmw_du_cursor_plane_cleanup_fb()
497 ttm_bo_unreserve(vps->cm_bo); in vmw_du_cursor_plane_cleanup_fb()
501 vmw_du_plane_unpin_surf(vps, false); in vmw_du_cursor_plane_cleanup_fb()
503 if (vps->surf) { in vmw_du_cursor_plane_cleanup_fb()
504 vmw_surface_unreference(&vps->surf); in vmw_du_cursor_plane_cleanup_fb()
505 vps->surf = NULL; in vmw_du_cursor_plane_cleanup_fb()
508 if (vps->bo) { in vmw_du_cursor_plane_cleanup_fb()
509 vmw_bo_unreference(&vps->bo); in vmw_du_cursor_plane_cleanup_fb()
510 vps->bo = NULL; in vmw_du_cursor_plane_cleanup_fb()
528 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_du_cursor_plane_prepare_fb() local
533 if (vps->surf) { in vmw_du_cursor_plane_prepare_fb()
534 vmw_surface_unreference(&vps->surf); in vmw_du_cursor_plane_prepare_fb()
535 vps->surf = NULL; in vmw_du_cursor_plane_prepare_fb()
538 if (vps->bo) { in vmw_du_cursor_plane_prepare_fb()
539 vmw_bo_unreference(&vps->bo); in vmw_du_cursor_plane_prepare_fb()
540 vps->bo = NULL; in vmw_du_cursor_plane_prepare_fb()
545 vps->bo = vmw_framebuffer_to_vfbd(fb)->buffer; in vmw_du_cursor_plane_prepare_fb()
546 vmw_bo_reference(vps->bo); in vmw_du_cursor_plane_prepare_fb()
548 vps->surf = vmw_framebuffer_to_vfbs(fb)->surface; in vmw_du_cursor_plane_prepare_fb()
549 vmw_surface_reference(vps->surf); in vmw_du_cursor_plane_prepare_fb()
553 vps->cm_bo = NULL; in vmw_du_cursor_plane_prepare_fb()
555 if (vps->surf == NULL && vps->bo != NULL) { in vmw_du_cursor_plane_prepare_fb()
560 ret = ttm_bo_reserve(&vps->bo->base, true, false, NULL); in vmw_du_cursor_plane_prepare_fb()
565 ret = ttm_bo_kmap(&vps->bo->base, 0, PFN_UP(size), &vps->bo->map); in vmw_du_cursor_plane_prepare_fb()
568 atomic_inc(&vps->bo->base_mapped_count); in vmw_du_cursor_plane_prepare_fb()
570 ttm_bo_unreserve(&vps->bo->base); in vmw_du_cursor_plane_prepare_fb()
576 if (vps->surf || vps->bo) { in vmw_du_cursor_plane_prepare_fb()
577 unsigned cursor_mob_idx = vps->cursor_mob_idx; in vmw_du_cursor_plane_prepare_fb()
582 vps->cursor_mob_idx = cursor_mob_idx = -1U; in vmw_du_cursor_plane_prepare_fb()
602 ret = ttm_bo_kmap(cm_bo, 0, PFN_UP(size), &vps->cm_map); in vmw_du_cursor_plane_prepare_fb()
619 vps->cursor_mob_idx = cursor_mob_idx ^ 1; in vmw_du_cursor_plane_prepare_fb()
620 vps->cm_bo = cm_bo; in vmw_du_cursor_plane_prepare_fb()
627 if (vps->bo != NULL && ttm_kmap_obj_virtual(&vps->bo->map, &dummy) != NULL) { in vmw_du_cursor_plane_prepare_fb()
628 const int ret = ttm_bo_reserve(&vps->bo->base, true, false, NULL); in vmw_du_cursor_plane_prepare_fb()
630 atomic_dec(&vps->bo->base_mapped_count); in vmw_du_cursor_plane_prepare_fb()
631 ttm_bo_kunmap(&vps->bo->map); in vmw_du_cursor_plane_prepare_fb()
632 ttm_bo_unreserve(&vps->bo->base); in vmw_du_cursor_plane_prepare_fb()
651 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_du_cursor_plane_atomic_update() local
662 du->cursor_surface = vps->surf; in vmw_du_cursor_plane_atomic_update()
663 du->cursor_bo = vps->bo; in vmw_du_cursor_plane_atomic_update()
665 if (vps->surf) { in vmw_du_cursor_plane_atomic_update()
668 vmw_cursor_update_image(dev_priv, vps->cm_bo, &vps->cm_map, in vmw_du_cursor_plane_atomic_update()
669 vps->surf->snooper.image, in vmw_du_cursor_plane_atomic_update()
673 } else if (vps->bo) { in vmw_du_cursor_plane_atomic_update()
674 vmw_cursor_update_bo(dev_priv, vps->cm_bo, &vps->cm_map, in vmw_du_cursor_plane_atomic_update()
675 vps->bo, in vmw_du_cursor_plane_atomic_update()
936 struct vmw_plane_state *vps; in vmw_du_plane_duplicate_state() local
938 vps = kmemdup(plane->state, sizeof(*vps), GFP_KERNEL); in vmw_du_plane_duplicate_state()
940 if (!vps) in vmw_du_plane_duplicate_state()
943 vps->pinned = 0; in vmw_du_plane_duplicate_state()
944 vps->cpp = 0; in vmw_du_plane_duplicate_state()
947 if (vps->surf) in vmw_du_plane_duplicate_state()
948 (void) vmw_surface_reference(vps->surf); in vmw_du_plane_duplicate_state()
950 if (vps->bo) in vmw_du_plane_duplicate_state()
951 (void) vmw_bo_reference(vps->bo); in vmw_du_plane_duplicate_state()
953 state = &vps->base; in vmw_du_plane_duplicate_state()
970 struct vmw_plane_state *vps; in vmw_du_plane_reset() local
975 vps = kzalloc(sizeof(*vps), GFP_KERNEL); in vmw_du_plane_reset()
977 if (!vps) { in vmw_du_plane_reset()
982 __drm_atomic_helper_plane_reset(plane, &vps->base); in vmw_du_plane_reset()
998 struct vmw_plane_state *vps = vmw_plane_state_to_vps(state); in vmw_du_plane_destroy_state() local
1002 if (vps->surf) in vmw_du_plane_destroy_state()
1003 vmw_surface_unreference(&vps->surf); in vmw_du_plane_destroy_state()
1005 if (vps->bo) in vmw_du_plane_destroy_state()
1006 vmw_bo_unreference(&vps->bo); in vmw_du_plane_destroy_state()