Lines Matching refs:vps

66 static int vmw_du_cursor_plane_unmap_cm(struct vmw_plane_state *vps);
68 struct vmw_plane_state *vps,
129 struct vmw_plane_state *vps, in vmw_cursor_update_image() argument
133 if (vps->cursor.bo) in vmw_cursor_update_image()
134 vmw_cursor_update_mob(dev_priv, vps, image, in vmw_cursor_update_image()
135 vps->base.crtc_w, vps->base.crtc_h, in vmw_cursor_update_image()
159 struct vmw_plane_state *vps, in vmw_cursor_update_mob() argument
167 header = vmw_bo_map_and_cache(vps->cursor.bo); in vmw_cursor_update_mob()
182 vps->cursor.bo->tbo.resource->start); in vmw_cursor_update_mob()
195 static u32 *vmw_du_cursor_plane_acquire_image(struct vmw_plane_state *vps) in vmw_du_cursor_plane_acquire_image() argument
199 if (vmw_user_object_is_null(&vps->uo)) in vmw_du_cursor_plane_acquire_image()
202 surf = vmw_user_object_surface(&vps->uo); in vmw_du_cursor_plane_acquire_image()
203 if (surf && !vmw_user_object_is_mapped(&vps->uo)) in vmw_du_cursor_plane_acquire_image()
206 return vmw_user_object_map(&vps->uo); in vmw_du_cursor_plane_acquire_image()
247 struct vmw_plane_state *vps) in vmw_du_put_cursor_mob() argument
251 if (!vps->cursor.bo) in vmw_du_put_cursor_mob()
254 vmw_du_cursor_plane_unmap_cm(vps); in vmw_du_put_cursor_mob()
259 vcp->cursor_mobs[i] = vps->cursor.bo; in vmw_du_put_cursor_mob()
260 vps->cursor.bo = NULL; in vmw_du_put_cursor_mob()
268 vps->cursor.bo->tbo.base.size) { in vmw_du_put_cursor_mob()
270 vcp->cursor_mobs[i] = vps->cursor.bo; in vmw_du_put_cursor_mob()
271 vps->cursor.bo = NULL; in vmw_du_put_cursor_mob()
277 vmw_du_destroy_cursor_mob(&vps->cursor.bo); in vmw_du_put_cursor_mob()
281 struct vmw_plane_state *vps) in vmw_du_get_cursor_mob() argument
284 u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h); in vmw_du_get_cursor_mob()
297 if (size > mob_max_size || vps->base.crtc_w > cursor_max_dim || in vmw_du_get_cursor_mob()
298 vps->base.crtc_h > cursor_max_dim) in vmw_du_get_cursor_mob()
301 if (vps->cursor.bo) { in vmw_du_get_cursor_mob()
302 if (vps->cursor.bo->tbo.base.size >= size) in vmw_du_get_cursor_mob()
304 vmw_du_put_cursor_mob(vcp, vps); in vmw_du_get_cursor_mob()
311 vps->cursor.bo = vcp->cursor_mobs[i]; in vmw_du_get_cursor_mob()
319 &vps->cursor.bo); in vmw_du_get_cursor_mob()
325 ret = ttm_bo_reserve(&vps->cursor.bo->tbo, false, false, NULL); in vmw_du_get_cursor_mob()
331 ttm_bo_unreserve(&vps->cursor.bo->tbo); in vmw_du_get_cursor_mob()
338 ttm_bo_unreserve(&vps->cursor.bo->tbo); in vmw_du_get_cursor_mob()
342 vmw_du_destroy_cursor_mob(&vps->cursor.bo); in vmw_du_get_cursor_mob()
544 void vmw_du_plane_unpin_surf(struct vmw_plane_state *vps) in vmw_du_plane_unpin_surf() argument
546 struct vmw_surface *surf = vmw_user_object_surface(&vps->uo); in vmw_du_plane_unpin_surf()
549 if (vps->pinned) { in vmw_du_plane_unpin_surf()
551 vps->pinned--; in vmw_du_plane_unpin_surf()
571 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); in vmw_du_plane_cleanup_fb() local
573 vmw_du_plane_unpin_surf(vps); in vmw_du_plane_cleanup_fb()
586 vmw_du_cursor_plane_map_cm(struct vmw_plane_state *vps) in vmw_du_cursor_plane_map_cm() argument
589 u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h); in vmw_du_cursor_plane_map_cm()
592 if (!vps->cursor.bo) in vmw_du_cursor_plane_map_cm()
595 bo = &vps->cursor.bo->tbo; in vmw_du_cursor_plane_map_cm()
600 if (vps->cursor.bo->map.virtual) in vmw_du_cursor_plane_map_cm()
607 vmw_bo_map_and_cache(vps->cursor.bo); in vmw_du_cursor_plane_map_cm()
627 vmw_du_cursor_plane_unmap_cm(struct vmw_plane_state *vps) in vmw_du_cursor_plane_unmap_cm() argument
630 struct vmw_bo *vbo = vps->cursor.bo; in vmw_du_cursor_plane_unmap_cm()
660 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); in vmw_du_cursor_plane_cleanup_fb() local
662 if (!vmw_user_object_is_null(&vps->uo)) in vmw_du_cursor_plane_cleanup_fb()
663 vmw_user_object_unmap(&vps->uo); in vmw_du_cursor_plane_cleanup_fb()
665 vmw_du_cursor_plane_unmap_cm(vps); in vmw_du_cursor_plane_cleanup_fb()
666 vmw_du_put_cursor_mob(vcp, vps); in vmw_du_cursor_plane_cleanup_fb()
668 vmw_du_plane_unpin_surf(vps); in vmw_du_cursor_plane_cleanup_fb()
669 vmw_user_object_unref(&vps->uo); in vmw_du_cursor_plane_cleanup_fb()
687 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_du_cursor_plane_prepare_fb() local
691 if (!vmw_user_object_is_null(&vps->uo)) { in vmw_du_cursor_plane_prepare_fb()
692 vmw_user_object_unmap(&vps->uo); in vmw_du_cursor_plane_prepare_fb()
693 vmw_user_object_unref(&vps->uo); in vmw_du_cursor_plane_prepare_fb()
698 vps->uo.buffer = vmw_framebuffer_to_vfbd(fb)->buffer; in vmw_du_cursor_plane_prepare_fb()
699 vps->uo.surface = NULL; in vmw_du_cursor_plane_prepare_fb()
701 memcpy(&vps->uo, &vmw_framebuffer_to_vfbs(fb)->uo, sizeof(vps->uo)); in vmw_du_cursor_plane_prepare_fb()
703 vmw_user_object_ref(&vps->uo); in vmw_du_cursor_plane_prepare_fb()
706 bo = vmw_user_object_buffer(&vps->uo); in vmw_du_cursor_plane_prepare_fb()
729 if (!vmw_user_object_is_null(&vps->uo)) { in vmw_du_cursor_plane_prepare_fb()
730 vmw_du_get_cursor_mob(vcp, vps); in vmw_du_cursor_plane_prepare_fb()
731 vmw_du_cursor_plane_map_cm(vps); in vmw_du_cursor_plane_prepare_fb()
749 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_du_cursor_plane_atomic_update() local
759 du->cursor_surface = vmw_user_object_surface(&vps->uo); in vmw_du_cursor_plane_atomic_update()
761 if (vmw_user_object_is_null(&vps->uo)) { in vmw_du_cursor_plane_atomic_update()
766 vps->cursor.hotspot_x = hotspot_x; in vmw_du_cursor_plane_atomic_update()
767 vps->cursor.hotspot_y = hotspot_y; in vmw_du_cursor_plane_atomic_update()
779 if (!vmw_user_object_is_null(&vps->uo)) { in vmw_du_cursor_plane_atomic_update()
780 new_bo = vmw_user_object_buffer(&vps->uo); in vmw_du_cursor_plane_atomic_update()
789 if (!vmw_du_cursor_plane_has_changed(old_vps, vps)) { in vmw_du_cursor_plane_atomic_update()
795 old_vps->cursor = vps->cursor; in vmw_du_cursor_plane_atomic_update()
796 vps->cursor = tmp; in vmw_du_cursor_plane_atomic_update()
798 void *image = vmw_du_cursor_plane_acquire_image(vps); in vmw_du_cursor_plane_atomic_update()
800 vmw_cursor_update_image(dev_priv, vps, image, in vmw_du_cursor_plane_atomic_update()
1059 struct vmw_plane_state *vps; in vmw_du_plane_duplicate_state() local
1061 vps = kmemdup(plane->state, sizeof(*vps), GFP_KERNEL); in vmw_du_plane_duplicate_state()
1063 if (!vps) in vmw_du_plane_duplicate_state()
1066 vps->pinned = 0; in vmw_du_plane_duplicate_state()
1067 vps->cpp = 0; in vmw_du_plane_duplicate_state()
1069 memset(&vps->cursor, 0, sizeof(vps->cursor)); in vmw_du_plane_duplicate_state()
1072 vmw_user_object_ref(&vps->uo); in vmw_du_plane_duplicate_state()
1073 state = &vps->base; in vmw_du_plane_duplicate_state()
1090 struct vmw_plane_state *vps; in vmw_du_plane_reset() local
1095 vps = kzalloc(sizeof(*vps), GFP_KERNEL); in vmw_du_plane_reset()
1097 if (!vps) { in vmw_du_plane_reset()
1102 __drm_atomic_helper_plane_reset(plane, &vps->base); in vmw_du_plane_reset()
1118 struct vmw_plane_state *vps = vmw_plane_state_to_vps(state); in vmw_du_plane_destroy_state() local
1121 vmw_user_object_unref(&vps->uo); in vmw_du_plane_destroy_state()