Lines Matching defs:vps
56 static int vmw_du_cursor_plane_unmap_cm(struct vmw_plane_state *vps);
58 struct vmw_plane_state *vps,
111 * @vps: the plane state of the cursor plane
119 struct vmw_plane_state *vps,
123 if (vps->cursor.bo)
124 vmw_cursor_update_mob(dev_priv, vps, image,
125 vps->base.crtc_w, vps->base.crtc_h,
141 * @vps: the plane state of the cursor plane
149 struct vmw_plane_state *vps,
157 header = vmw_bo_map_and_cache(vps->cursor.bo);
172 vps->cursor.bo->tbo.resource->start);
183 * @vps: cursor plane state
185 static u32 *vmw_du_cursor_plane_acquire_image(struct vmw_plane_state *vps)
187 if (vps->surf) {
188 if (vps->surf_mapped)
189 return vmw_bo_map_and_cache(vps->surf->res.guest_memory_bo);
190 return vps->surf->snooper.image;
191 } else if (vps->bo)
192 return vmw_bo_map_and_cache(vps->bo);
234 struct vmw_plane_state *vps)
238 if (!vps->cursor.bo)
241 vmw_du_cursor_plane_unmap_cm(vps);
246 vcp->cursor_mobs[i] = vps->cursor.bo;
247 vps->cursor.bo = NULL;
255 vps->cursor.bo->tbo.base.size) {
257 vcp->cursor_mobs[i] = vps->cursor.bo;
258 vps->cursor.bo = NULL;
264 vmw_du_destroy_cursor_mob(&vps->cursor.bo);
268 struct vmw_plane_state *vps)
271 u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h);
284 if (size > mob_max_size || vps->base.crtc_w > cursor_max_dim ||
285 vps->base.crtc_h > cursor_max_dim)
288 if (vps->cursor.bo) {
289 if (vps->cursor.bo->tbo.base.size >= size)
291 vmw_du_put_cursor_mob(vcp, vps);
298 vps->cursor.bo = vcp->cursor_mobs[i];
306 &vps->cursor.bo);
312 ret = ttm_bo_reserve(&vps->cursor.bo->tbo, false, false, NULL);
318 ttm_bo_unreserve(&vps->cursor.bo->tbo);
325 ttm_bo_unreserve(&vps->cursor.bo->tbo);
329 vmw_du_destroy_cursor_mob(&vps->cursor.bo);
529 * @vps: plane state associated with the display surface
532 void vmw_du_plane_unpin_surf(struct vmw_plane_state *vps,
535 if (vps->surf) {
536 if (vps->pinned) {
537 vmw_resource_unpin(&vps->surf->res);
538 vps->pinned--;
542 if (vps->pinned)
544 vmw_surface_unreference(&vps->surf);
564 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state);
566 vmw_du_plane_unpin_surf(vps, false);
573 * @vps: plane_state
579 vmw_du_cursor_plane_map_cm(struct vmw_plane_state *vps)
582 u32 size = vmw_du_cursor_mob_size(vps->base.crtc_w, vps->base.crtc_h);
585 if (!vps->cursor.bo)
588 bo = &vps->cursor.bo->tbo;
593 if (vps->cursor.bo->map.virtual)
600 vmw_bo_map_and_cache(vps->cursor.bo);
614 * @vps: state of the cursor plane
620 vmw_du_cursor_plane_unmap_cm(struct vmw_plane_state *vps)
623 struct vmw_bo *vbo = vps->cursor.bo;
653 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state);
655 if (vps->surf_mapped) {
656 vmw_bo_unmap(vps->surf->res.guest_memory_bo);
657 vps->surf_mapped = false;
660 vmw_du_cursor_plane_unmap_cm(vps);
661 vmw_du_put_cursor_mob(vcp, vps);
663 vmw_du_plane_unpin_surf(vps, false);
665 if (vps->surf) {
666 vmw_surface_unreference(&vps->surf);
667 vps->surf = NULL;
670 if (vps->bo) {
671 vmw_bo_unreference(&vps->bo);
672 vps->bo = NULL;
691 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state);
694 if (vps->surf) {
695 if (vps->surf_mapped) {
696 vmw_bo_unmap(vps->surf->res.guest_memory_bo);
697 vps->surf_mapped = false;
699 vmw_surface_unreference(&vps->surf);
700 vps->surf = NULL;
703 if (vps->bo) {
704 vmw_bo_unreference(&vps->bo);
705 vps->bo = NULL;
710 vps->bo = vmw_framebuffer_to_vfbd(fb)->buffer;
711 vmw_bo_reference(vps->bo);
713 vps->surf = vmw_framebuffer_to_vfbs(fb)->surface;
714 vmw_surface_reference(vps->surf);
718 if (!vps->surf && vps->bo) {
726 ret = ttm_bo_reserve(&vps->bo->tbo, true, false, NULL);
731 ret = ttm_bo_kmap(&vps->bo->tbo, 0, PFN_UP(size), &vps->bo->map);
733 ttm_bo_unreserve(&vps->bo->tbo);
737 } else if (vps->surf && !vps->bo && vps->surf->res.guest_memory_bo) {
739 WARN_ON(vps->surf->snooper.image);
740 ret = ttm_bo_reserve(&vps->surf->res.guest_memory_bo->tbo, true, false,
744 vmw_bo_map_and_cache(vps->surf->res.guest_memory_bo);
745 ttm_bo_unreserve(&vps->surf->res.guest_memory_bo->tbo);
746 vps->surf_mapped = true;
749 if (vps->surf || vps->bo) {
750 vmw_du_get_cursor_mob(vcp, vps);
751 vmw_du_cursor_plane_map_cm(vps);
769 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state);
781 du->cursor_surface = vps->surf;
782 du->cursor_bo = vps->bo;
784 if (!vps->surf && !vps->bo) {
789 vps->cursor.hotspot_x = hotspot_x;
790 vps->cursor.hotspot_y = hotspot_y;
792 if (vps->surf) {
796 if (!vmw_du_cursor_plane_has_changed(old_vps, vps)) {
802 old_vps->cursor = vps->cursor;
803 vps->cursor = tmp;
805 void *image = vmw_du_cursor_plane_acquire_image(vps);
807 vmw_cursor_update_image(dev_priv, vps, image,
1060 struct vmw_plane_state *vps;
1062 vps = kmemdup(plane->state, sizeof(*vps), GFP_KERNEL);
1064 if (!vps)
1067 vps->pinned = 0;
1068 vps->cpp = 0;
1070 memset(&vps->cursor, 0, sizeof(vps->cursor));
1073 if (vps->surf)
1074 (void) vmw_surface_reference(vps->surf);
1076 if (vps->bo)
1077 (void) vmw_bo_reference(vps->bo);
1079 state = &vps->base;
1096 struct vmw_plane_state *vps;
1101 vps = kzalloc(sizeof(*vps), GFP_KERNEL);
1103 if (!vps) {
1108 __drm_atomic_helper_plane_reset(plane, &vps->base);
1124 struct vmw_plane_state *vps = vmw_plane_state_to_vps(state);
1127 if (vps->surf)
1128 vmw_surface_unreference(&vps->surf);
1130 if (vps->bo)
1131 vmw_bo_unreference(&vps->bo);