• Home
  • Raw
  • Download

Lines Matching refs:res

36 	struct vmw_resource res;  member
44 static void vmw_user_context_free(struct vmw_resource *res);
48 static int vmw_gb_context_create(struct vmw_resource *res);
49 static int vmw_gb_context_bind(struct vmw_resource *res,
51 static int vmw_gb_context_unbind(struct vmw_resource *res,
54 static int vmw_gb_context_destroy(struct vmw_resource *res);
55 static int vmw_dx_context_create(struct vmw_resource *res);
56 static int vmw_dx_context_bind(struct vmw_resource *res,
58 static int vmw_dx_context_unbind(struct vmw_resource *res,
61 static int vmw_dx_context_destroy(struct vmw_resource *res);
122 struct vmw_resource *res; in vmw_context_cotables_unref() local
129 res = uctx->cotables[i]; in vmw_context_cotables_unref()
133 if (res) in vmw_context_cotables_unref()
134 vmw_resource_unreference(&res); in vmw_context_cotables_unref()
138 static void vmw_hw_context_destroy(struct vmw_resource *res) in vmw_hw_context_destroy() argument
141 container_of(res, struct vmw_user_context, res); in vmw_hw_context_destroy()
142 struct vmw_private *dev_priv = res->dev_priv; in vmw_hw_context_destroy()
149 if (res->func->destroy == vmw_gb_context_destroy || in vmw_hw_context_destroy()
150 res->func->destroy == vmw_dx_context_destroy) { in vmw_hw_context_destroy()
155 (void) res->func->destroy(res); in vmw_hw_context_destroy()
172 cmd->body.cid = res->id; in vmw_hw_context_destroy()
180 struct vmw_resource *res, in vmw_gb_context_init() argument
181 void (*res_free)(struct vmw_resource *res)) in vmw_gb_context_init() argument
185 container_of(res, struct vmw_user_context, res); in vmw_gb_context_init()
187 res->backup_size = (dx ? sizeof(SVGADXContextMobFormat) : in vmw_gb_context_init()
189 ret = vmw_resource_init(dev_priv, res, true, in vmw_gb_context_init()
218 &uctx->res, i); in vmw_gb_context_init()
226 res->hw_destroy = vmw_hw_context_destroy; in vmw_gb_context_init()
233 res_free(res); in vmw_gb_context_init()
235 kfree(res); in vmw_gb_context_init()
240 struct vmw_resource *res, in vmw_context_init() argument
241 void (*res_free)(struct vmw_resource *res), in vmw_context_init() argument
252 return vmw_gb_context_init(dev_priv, dx, res, res_free); in vmw_context_init()
254 ret = vmw_resource_init(dev_priv, res, false, in vmw_context_init()
262 if (unlikely(res->id >= SVGA3D_MAX_CONTEXT_IDS)) { in vmw_context_init()
264 vmw_resource_unreference(&res); in vmw_context_init()
270 vmw_resource_unreference(&res); in vmw_context_init()
276 cmd->body.cid = res->id; in vmw_context_init()
280 res->hw_destroy = vmw_hw_context_destroy; in vmw_context_init()
285 kfree(res); in vmw_context_init()
287 res_free(res); in vmw_context_init()
296 static int vmw_gb_context_create(struct vmw_resource *res) in vmw_gb_context_create() argument
298 struct vmw_private *dev_priv = res->dev_priv; in vmw_gb_context_create()
305 if (likely(res->id != -1)) in vmw_gb_context_create()
308 ret = vmw_resource_alloc_id(res); in vmw_gb_context_create()
314 if (unlikely(res->id >= VMWGFX_NUM_GB_CONTEXT)) { in vmw_gb_context_create()
327 cmd->body.cid = res->id; in vmw_gb_context_create()
334 vmw_resource_release_id(res); in vmw_gb_context_create()
339 static int vmw_gb_context_bind(struct vmw_resource *res, in vmw_gb_context_bind() argument
342 struct vmw_private *dev_priv = res->dev_priv; in vmw_gb_context_bind()
357 cmd->body.cid = res->id; in vmw_gb_context_bind()
359 cmd->body.validContents = res->backup_dirty; in vmw_gb_context_bind()
360 res->backup_dirty = false; in vmw_gb_context_bind()
366 static int vmw_gb_context_unbind(struct vmw_resource *res, in vmw_gb_context_unbind() argument
370 struct vmw_private *dev_priv = res->dev_priv; in vmw_gb_context_unbind()
374 container_of(res, struct vmw_user_context, res); in vmw_gb_context_unbind()
406 cmd1->body.cid = res->id; in vmw_gb_context_unbind()
411 cmd2->body.cid = res->id; in vmw_gb_context_unbind()
432 static int vmw_gb_context_destroy(struct vmw_resource *res) in vmw_gb_context_destroy() argument
434 struct vmw_private *dev_priv = res->dev_priv; in vmw_gb_context_destroy()
440 if (likely(res->id == -1)) in vmw_gb_context_destroy()
449 cmd->body.cid = res->id; in vmw_gb_context_destroy()
451 if (dev_priv->query_cid == res->id) in vmw_gb_context_destroy()
453 vmw_resource_release_id(res); in vmw_gb_context_destroy()
463 static int vmw_dx_context_create(struct vmw_resource *res) in vmw_dx_context_create() argument
465 struct vmw_private *dev_priv = res->dev_priv; in vmw_dx_context_create()
472 if (likely(res->id != -1)) in vmw_dx_context_create()
475 ret = vmw_resource_alloc_id(res); in vmw_dx_context_create()
481 if (unlikely(res->id >= VMWGFX_NUM_DXCONTEXT)) { in vmw_dx_context_create()
494 cmd->body.cid = res->id; in vmw_dx_context_create()
501 vmw_resource_release_id(res); in vmw_dx_context_create()
506 static int vmw_dx_context_bind(struct vmw_resource *res, in vmw_dx_context_bind() argument
509 struct vmw_private *dev_priv = res->dev_priv; in vmw_dx_context_bind()
524 cmd->body.cid = res->id; in vmw_dx_context_bind()
526 cmd->body.validContents = res->backup_dirty; in vmw_dx_context_bind()
527 res->backup_dirty = false; in vmw_dx_context_bind()
552 container_of(ctx, struct vmw_user_context, res); in vmw_dx_context_scrub_cotables()
559 struct vmw_resource *res; in vmw_dx_context_scrub_cotables() local
563 res = uctx->cotables[vmw_cotable_scrub_order[i]]; in vmw_dx_context_scrub_cotables()
564 if (res) in vmw_dx_context_scrub_cotables()
565 res = vmw_resource_reference_unless_doomed(res); in vmw_dx_context_scrub_cotables()
567 if (!res) in vmw_dx_context_scrub_cotables()
570 WARN_ON(vmw_cotable_scrub(res, readback)); in vmw_dx_context_scrub_cotables()
571 vmw_resource_unreference(&res); in vmw_dx_context_scrub_cotables()
575 static int vmw_dx_context_unbind(struct vmw_resource *res, in vmw_dx_context_unbind() argument
579 struct vmw_private *dev_priv = res->dev_priv; in vmw_dx_context_unbind()
583 container_of(res, struct vmw_user_context, res); in vmw_dx_context_unbind()
600 vmw_dx_context_scrub_cotables(res, readback); in vmw_dx_context_unbind()
604 WARN_ON(uctx->dx_query_mob->dx_query_ctx != res); in vmw_dx_context_unbind()
622 cmd1->body.cid = res->id; in vmw_dx_context_unbind()
627 cmd2->body.cid = res->id; in vmw_dx_context_unbind()
648 static int vmw_dx_context_destroy(struct vmw_resource *res) in vmw_dx_context_destroy() argument
650 struct vmw_private *dev_priv = res->dev_priv; in vmw_dx_context_destroy()
656 if (likely(res->id == -1)) in vmw_dx_context_destroy()
665 cmd->body.cid = res->id; in vmw_dx_context_destroy()
667 if (dev_priv->query_cid == res->id) in vmw_dx_context_destroy()
669 vmw_resource_release_id(res); in vmw_dx_context_destroy()
682 return &(container_of(base, struct vmw_user_context, base)->res); in vmw_user_context_base_to_res()
685 static void vmw_user_context_free(struct vmw_resource *res) in vmw_user_context_free() argument
688 container_of(res, struct vmw_user_context, res); in vmw_user_context_free()
689 struct vmw_private *dev_priv = res->dev_priv; in vmw_user_context_free()
694 (void) vmw_context_bind_dx_query(res, NULL); in vmw_user_context_free()
711 struct vmw_resource *res = &ctx->res; in vmw_user_context_base_release() local
714 vmw_resource_unreference(&res); in vmw_user_context_base_release()
731 struct vmw_resource *res; in vmw_context_define() local
773 res = &ctx->res; in vmw_context_define()
781 ret = vmw_context_init(dev_priv, res, vmw_user_context_free, dx); in vmw_context_define()
785 tmp = vmw_resource_reference(&ctx->res); in vmw_context_define()
796 vmw_resource_unreference(&res); in vmw_context_define()
836 container_of(ctx, struct vmw_user_context, res); in vmw_context_binding_list()
843 return container_of(ctx, struct vmw_user_context, res)->man; in vmw_context_res_man()
855 return container_of(ctx, struct vmw_user_context, res)-> in vmw_context_cotable()
871 return container_of(ctx, struct vmw_user_context, res)->cbs; in vmw_context_binding_state()
890 container_of(ctx_res, struct vmw_user_context, res); in vmw_context_bind_dx_query()
923 container_of(ctx_res, struct vmw_user_context, res); in vmw_context_get_dx_query_mob()