Lines Matching defs:hdev
14 struct hl_device *hdev = ctx->hdev;
26 for (i = 0 ; i < hdev->asic_prop.max_pending_cs ; i++)
32 dev_dbg(hdev->dev, "closing user context %d\n", ctx->asid);
40 if ((hdev->in_debug) && (hdev->compute_ctx == ctx))
41 hl_device_set_debug_mode(hdev, false);
45 hl_asid_free(hdev, ctx->asid);
47 if ((!hdev->pldm) && (hdev->pdev) &&
48 (!hdev->asic_funcs->is_device_idle(hdev,
50 dev_notice(hdev->dev,
54 dev_dbg(hdev->dev, "closing kernel context\n");
73 int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv)
90 dev_err(hdev->dev, "Failed to allocate IDR for a new CTX\n");
96 rc = hl_ctx_init(hdev, ctx, false);
107 hdev->compute_ctx = ctx;
121 void hl_ctx_free(struct hl_device *hdev, struct hl_ctx *ctx)
126 dev_warn(hdev->dev,
130 int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx)
134 ctx->hdev = hdev;
142 ctx->cs_pending = kcalloc(hdev->asic_prop.max_pending_cs,
152 dev_err(hdev->dev, "Failed to init mmu ctx module\n");
156 ctx->asid = hl_asid_alloc(hdev);
158 dev_err(hdev->dev, "No free ASID, failed to create context\n");
165 dev_err(hdev->dev, "Failed to init mem ctx module\n");
172 dev_err(hdev->dev,
177 rc = hdev->asic_funcs->ctx_init(ctx);
179 dev_err(hdev->dev, "ctx_init failed\n");
183 dev_dbg(hdev->dev, "create user context %d\n", ctx->asid);
193 hl_asid_free(hdev, ctx->asid);
200 void hl_ctx_get(struct hl_device *hdev, struct hl_ctx *ctx)
212 struct asic_fixed_properties *asic_prop = &ctx->hdev->asic_prop;
252 * @hdev: pointer to device structure
258 void hl_ctx_mgr_fini(struct hl_device *hdev, struct hl_ctx_mgr *mgr)
267 hl_ctx_free(hdev, ctx);