Lines Matching refs:vps
75 struct vmw_plane_state *vps) in vmw_cursor_plane_update_legacy() argument
77 struct vmw_surface *surface = vmw_user_object_surface(&vps->uo); in vmw_cursor_plane_update_legacy()
78 s32 hotspot_x = vps->cursor.legacy.hotspot_x + vps->base.hotspot_x; in vmw_cursor_plane_update_legacy()
79 s32 hotspot_y = vps->cursor.legacy.hotspot_y + vps->base.hotspot_y; in vmw_cursor_plane_update_legacy()
84 if (vps->cursor.legacy.id != surface->snooper.id) { in vmw_cursor_plane_update_legacy()
86 vps->base.crtc_w, vps->base.crtc_h, in vmw_cursor_plane_update_legacy()
88 vps->cursor.legacy.id = surface->snooper.id; in vmw_cursor_plane_update_legacy()
93 vmw_cursor_update_type(struct vmw_private *vmw, struct vmw_plane_state *vps) in vmw_cursor_update_type() argument
95 struct vmw_surface *surface = vmw_user_object_surface(&vps->uo); in vmw_cursor_update_type()
109 struct vmw_plane_state *vps) in vmw_cursor_update_mob() argument
113 struct vmw_bo *bo = vmw_user_object_buffer(&vps->uo); in vmw_cursor_update_mob()
115 const u32 image_size = vps->base.crtc_w * vps->base.crtc_h * sizeof(*image); in vmw_cursor_update_mob()
117 header = vmw_bo_map_and_cache(vps->cursor.mob); in vmw_cursor_update_mob()
125 alpha_header->hotspotX = vps->cursor.legacy.hotspot_x + vps->base.hotspot_x; in vmw_cursor_update_mob()
126 alpha_header->hotspotY = vps->cursor.legacy.hotspot_y + vps->base.hotspot_y; in vmw_cursor_update_mob()
127 alpha_header->width = vps->base.crtc_w; in vmw_cursor_update_mob()
128 alpha_header->height = vps->base.crtc_h; in vmw_cursor_update_mob()
131 vmw_write(vmw, SVGA_REG_CURSOR_MOBID, vmw_bo_mobid(vps->cursor.mob)); in vmw_cursor_update_mob()
134 vmw_bo_unmap(vps->cursor.mob); in vmw_cursor_update_mob()
168 vmw_cursor_mob_unmap(struct vmw_plane_state *vps) in vmw_cursor_mob_unmap() argument
171 struct vmw_bo *vbo = vps->cursor.mob; in vmw_cursor_mob_unmap()
186 struct vmw_plane_state *vps) in vmw_cursor_mob_put() argument
190 if (!vps->cursor.mob) in vmw_cursor_mob_put()
193 vmw_cursor_mob_unmap(vps); in vmw_cursor_mob_put()
198 vcp->cursor_mobs[i] = vps->cursor.mob; in vmw_cursor_mob_put()
199 vps->cursor.mob = NULL; in vmw_cursor_mob_put()
207 vps->cursor.mob->tbo.base.size) { in vmw_cursor_mob_put()
209 vcp->cursor_mobs[i] = vps->cursor.mob; in vmw_cursor_mob_put()
210 vps->cursor.mob = NULL; in vmw_cursor_mob_put()
216 vmw_cursor_mob_destroy(&vps->cursor.mob); in vmw_cursor_mob_put()
220 struct vmw_plane_state *vps) in vmw_cursor_mob_get() argument
223 u32 size = vmw_cursor_mob_size(vps->cursor.update_type, in vmw_cursor_mob_get()
224 vps->base.crtc_w, vps->base.crtc_h); in vmw_cursor_mob_get()
237 if (size > mob_max_size || vps->base.crtc_w > cursor_max_dim || in vmw_cursor_mob_get()
238 vps->base.crtc_h > cursor_max_dim) in vmw_cursor_mob_get()
241 if (vps->cursor.mob) { in vmw_cursor_mob_get()
242 if (vps->cursor.mob->tbo.base.size >= size) in vmw_cursor_mob_get()
244 vmw_cursor_mob_put(vcp, vps); in vmw_cursor_mob_get()
251 vps->cursor.mob = vcp->cursor_mobs[i]; in vmw_cursor_mob_get()
258 &vps->cursor.mob); in vmw_cursor_mob_get()
264 ret = ttm_bo_reserve(&vps->cursor.mob->tbo, false, false, NULL); in vmw_cursor_mob_get()
270 ttm_bo_unreserve(&vps->cursor.mob->tbo); in vmw_cursor_mob_get()
277 ttm_bo_unreserve(&vps->cursor.mob->tbo); in vmw_cursor_mob_get()
282 vmw_cursor_mob_destroy(&vps->cursor.mob); in vmw_cursor_mob_get()
426 vmw_cursor_mob_map(struct vmw_plane_state *vps) in vmw_cursor_mob_map() argument
429 u32 size = vmw_cursor_mob_size(vps->cursor.update_type, in vmw_cursor_mob_map()
430 vps->base.crtc_w, vps->base.crtc_h); in vmw_cursor_mob_map()
431 struct vmw_bo *vbo = vps->cursor.mob; in vmw_cursor_mob_map()
468 struct vmw_plane_state *vps = vmw_plane_state_to_vps(old_state); in vmw_cursor_plane_cleanup_fb() local
470 if (!vmw_user_object_is_null(&vps->uo)) in vmw_cursor_plane_cleanup_fb()
471 vmw_user_object_unmap(&vps->uo); in vmw_cursor_plane_cleanup_fb()
473 vmw_cursor_mob_unmap(vps); in vmw_cursor_plane_cleanup_fb()
474 vmw_cursor_mob_put(vcp, vps); in vmw_cursor_plane_cleanup_fb()
476 vmw_du_plane_unpin_surf(vps); in vmw_cursor_plane_cleanup_fb()
477 vmw_user_object_unref(&vps->uo); in vmw_cursor_plane_cleanup_fb()
597 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_cursor_plane_prepare_fb() local
604 if (!vmw_user_object_is_null(&vps->uo)) { in vmw_cursor_plane_prepare_fb()
605 vmw_user_object_unmap(&vps->uo); in vmw_cursor_plane_prepare_fb()
606 vmw_user_object_unref(&vps->uo); in vmw_cursor_plane_prepare_fb()
611 vps->uo.buffer = vmw_framebuffer_to_vfbd(fb)->buffer; in vmw_cursor_plane_prepare_fb()
612 vps->uo.surface = NULL; in vmw_cursor_plane_prepare_fb()
614 memcpy(&vps->uo, &vmw_framebuffer_to_vfbs(fb)->uo, sizeof(vps->uo)); in vmw_cursor_plane_prepare_fb()
616 vmw_user_object_ref(&vps->uo); in vmw_cursor_plane_prepare_fb()
619 vps->cursor.update_type = vmw_cursor_update_type(vmw, vps); in vmw_cursor_plane_prepare_fb()
620 switch (vps->cursor.update_type) { in vmw_cursor_plane_prepare_fb()
622 surface = vmw_user_object_surface(&vps->uo); in vmw_cursor_plane_prepare_fb()
623 if (!surface || vps->cursor.legacy.id == surface->snooper.id) in vmw_cursor_plane_prepare_fb()
624 vps->cursor.update_type = VMW_CURSOR_UPDATE_NONE; in vmw_cursor_plane_prepare_fb()
627 bo = vmw_user_object_buffer(&vps->uo); in vmw_cursor_plane_prepare_fb()
657 if (!vmw_user_object_is_null(&vps->uo)) { in vmw_cursor_plane_prepare_fb()
658 if (!vmw_cursor_plane_changed(vps, old_vps) && in vmw_cursor_plane_prepare_fb()
659 !vmw_cursor_buffer_changed(vps, old_vps)) { in vmw_cursor_plane_prepare_fb()
660 vps->cursor.update_type = in vmw_cursor_plane_prepare_fb()
663 vmw_cursor_mob_get(vcp, vps); in vmw_cursor_plane_prepare_fb()
664 vmw_cursor_mob_map(vps); in vmw_cursor_plane_prepare_fb()
697 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_cursor_plane_atomic_check() local
716 update_type = vmw_cursor_update_type(vmw, vps); in vmw_cursor_plane_atomic_check()
725 surface = vmw_user_object_surface(&vps->uo); in vmw_cursor_plane_atomic_check()
747 struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state); in vmw_cursor_plane_atomic_update() local
753 if (vmw_user_object_is_null(&vps->uo)) { in vmw_cursor_plane_atomic_update()
758 switch (vps->cursor.update_type) { in vmw_cursor_plane_atomic_update()
760 vmw_cursor_plane_update_legacy(dev_priv, vps); in vmw_cursor_plane_atomic_update()
763 vmw_cursor_update_mob(dev_priv, vps); in vmw_cursor_plane_atomic_update()
776 hotspot_x = vps->cursor.legacy.hotspot_x + new_state->hotspot_x; in vmw_cursor_plane_atomic_update()
777 hotspot_y = vps->cursor.legacy.hotspot_y + new_state->hotspot_y; in vmw_cursor_plane_atomic_update()
788 struct vmw_plane_state *vps; in vmw_kms_cursor_bypass_ioctl() local
796 vps = vmw_plane_state_to_vps(du->cursor.base.state); in vmw_kms_cursor_bypass_ioctl()
797 vps->cursor.legacy.hotspot_x = arg->xhot; in vmw_kms_cursor_bypass_ioctl()
798 vps->cursor.legacy.hotspot_y = arg->yhot; in vmw_kms_cursor_bypass_ioctl()
812 vps = vmw_plane_state_to_vps(du->cursor.base.state); in vmw_kms_cursor_bypass_ioctl()
813 vps->cursor.legacy.hotspot_x = arg->xhot; in vmw_kms_cursor_bypass_ioctl()
814 vps->cursor.legacy.hotspot_y = arg->yhot; in vmw_kms_cursor_bypass_ioctl()