Lines Matching refs:mob
92 struct vmw_mob *mob);
93 static void vmw_mob_pt_setup(struct vmw_mob *mob,
129 struct vmw_mob *mob; in vmw_setup_otable_base() local
140 mob = vmw_mob_create(otable->size >> PAGE_SHIFT); in vmw_setup_otable_base()
141 if (unlikely(mob == NULL)) { in vmw_setup_otable_base()
147 mob->pt_level = VMW_MOBFMT_PTDEPTH_0; in vmw_setup_otable_base()
148 mob->pt_root_page = vmw_piter_dma_addr(&iter); in vmw_setup_otable_base()
150 mob->pt_level = SVGA3D_MOBFMT_RANGE; in vmw_setup_otable_base()
151 mob->pt_root_page = vmw_piter_dma_addr(&iter); in vmw_setup_otable_base()
153 ret = vmw_mob_pt_populate(dev_priv, mob); in vmw_setup_otable_base()
157 vmw_mob_pt_setup(mob, iter, otable->size >> PAGE_SHIFT); in vmw_setup_otable_base()
158 mob->pt_level += VMW_MOBFMT_PTDEPTH_1 - SVGA3D_MOBFMT_PT_1; in vmw_setup_otable_base()
171 cmd->body.baseAddress = mob->pt_root_page >> PAGE_SHIFT; in vmw_setup_otable_base()
174 cmd->body.ptDepth = mob->pt_level; in vmw_setup_otable_base()
181 BUG_ON(mob->pt_level == VMW_MOBFMT_PTDEPTH_2); in vmw_setup_otable_base()
184 otable->page_table = mob; in vmw_setup_otable_base()
190 vmw_mob_destroy(mob); in vmw_setup_otable_base()
400 struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL); in vmw_mob_create() local
402 if (unlikely(!mob)) in vmw_mob_create()
405 mob->num_pages = vmw_mob_calculate_pt_pages(data_pages); in vmw_mob_create()
407 return mob; in vmw_mob_create()
422 struct vmw_mob *mob) in vmw_mob_pt_populate() argument
424 BUG_ON(mob->pt_bo != NULL); in vmw_mob_pt_populate()
426 return vmw_bo_create_and_populate(dev_priv, mob->num_pages * PAGE_SIZE, &mob->pt_bo); in vmw_mob_pt_populate()
502 static void vmw_mob_pt_setup(struct vmw_mob *mob, in vmw_mob_pt_setup() argument
507 struct ttm_buffer_object *bo = mob->pt_bo; in vmw_mob_pt_setup()
521 mob->pt_level = 0; in vmw_mob_pt_setup()
523 ++mob->pt_level; in vmw_mob_pt_setup()
524 BUG_ON(mob->pt_level > 2); in vmw_mob_pt_setup()
532 mob->pt_root_page = vmw_piter_dma_addr(&save_pt_iter); in vmw_mob_pt_setup()
541 void vmw_mob_destroy(struct vmw_mob *mob) in vmw_mob_destroy() argument
543 if (mob->pt_bo) { in vmw_mob_destroy()
544 vmw_bo_unpin_unlocked(mob->pt_bo); in vmw_mob_destroy()
545 ttm_bo_put(mob->pt_bo); in vmw_mob_destroy()
546 mob->pt_bo = NULL; in vmw_mob_destroy()
548 kfree(mob); in vmw_mob_destroy()
558 struct vmw_mob *mob) in vmw_mob_unbind() argument
565 struct ttm_buffer_object *bo = mob->pt_bo; in vmw_mob_unbind()
579 cmd->body.mobid = mob->id; in vmw_mob_unbind()
606 struct vmw_mob *mob, in vmw_mob_bind() argument
619 mob->id = mob_id; in vmw_mob_bind()
625 mob->pt_level = VMW_MOBFMT_PTDEPTH_0; in vmw_mob_bind()
626 mob->pt_root_page = vmw_piter_dma_addr(&data_iter); in vmw_mob_bind()
628 mob->pt_level = SVGA3D_MOBFMT_RANGE; in vmw_mob_bind()
629 mob->pt_root_page = vmw_piter_dma_addr(&data_iter); in vmw_mob_bind()
630 } else if (unlikely(mob->pt_bo == NULL)) { in vmw_mob_bind()
631 ret = vmw_mob_pt_populate(dev_priv, mob); in vmw_mob_bind()
635 vmw_mob_pt_setup(mob, data_iter, num_data_pages); in vmw_mob_bind()
637 mob->pt_level += VMW_MOBFMT_PTDEPTH_1 - SVGA3D_MOBFMT_PT_1; in vmw_mob_bind()
649 cmd->body.ptDepth = mob->pt_level; in vmw_mob_bind()
650 cmd->body.base = mob->pt_root_page >> PAGE_SHIFT; in vmw_mob_bind()
660 vmw_bo_unpin_unlocked(mob->pt_bo); in vmw_mob_bind()
661 ttm_bo_put(mob->pt_bo); in vmw_mob_bind()
662 mob->pt_bo = NULL; in vmw_mob_bind()