Lines Matching defs:context
26 #define SUBMIT_ERR(context, fmt, ...) \
27 dev_err_ratelimited(context->client->base.dev, \
146 tegra_drm_mapping_get(struct tegra_drm_context *context, u32 id)
150 xa_lock(&context->mappings);
152 mapping = xa_load(&context->mappings, id);
156 xa_unlock(&context->mappings);
180 struct tegra_drm_context *context,
187 SUBMIT_ERR(context, "gather_data_words cannot be zero");
192 SUBMIT_ERR(context, "gather_data_words is too large");
198 SUBMIT_ERR(context, "failed to allocate memory for bo info");
209 SUBMIT_ERR(context, "failed to allocate memory for gather data");
215 SUBMIT_ERR(context, "failed to copy gather data from userspace");
228 static int submit_write_reloc(struct tegra_drm_context *context, struct gather_bo *bo,
243 SUBMIT_ERR(context,
257 static int submit_process_bufs(struct tegra_drm_context *context, struct gather_bo *bo,
269 SUBMIT_ERR(context, "failed to copy bufs array from userspace");
275 SUBMIT_ERR(context, "failed to allocate memory for mapping info");
285 SUBMIT_ERR(context, "invalid flag specified for buffer");
290 mapping = tegra_drm_mapping_get(context, buf->mapping);
292 SUBMIT_ERR(context, "invalid mapping ID '%u' for buffer", buf->mapping);
297 err = submit_write_reloc(context, bo, buf, mapping);
327 static int submit_get_syncpt(struct tegra_drm_context *context, struct host1x_job *job,
333 SUBMIT_ERR(context, "invalid flag specified for syncpt");
340 SUBMIT_ERR(context, "syncpoint specified in syncpt was not allocated");
350 static int submit_job_add_gather(struct host1x_job *job, struct tegra_drm_context *context,
359 SUBMIT_ERR(context, "non-zero reserved field in GATHER_UPTR command");
365 SUBMIT_ERR(context, "too many words in GATHER_UPTR command");
370 SUBMIT_ERR(context, "too many total words in job");
375 SUBMIT_ERR(context, "GATHER_UPTR command overflows gather data");
379 if (tegra_drm_fw_validate(context->client, bo->gather_data, *offset,
381 SUBMIT_ERR(context, "job was rejected by firewall");
393 submit_create_job(struct tegra_drm_context *context, struct gather_bo *bo,
403 class = context->client->base.class;
408 SUBMIT_ERR(context, "failed to copy cmds array from userspace");
412 job = host1x_job_alloc(context->channel, args->num_cmds, 0, true);
414 SUBMIT_ERR(context, "failed to allocate memory for job");
419 err = submit_get_syncpt(context, job, syncpoints, args);
423 job->client = &context->client->base;
424 job->class = context->client->base.class;
431 SUBMIT_ERR(context, "unknown flags given for cmd");
437 err = submit_job_add_gather(job, context, &cmd->gather_uptr, bo,
443 SUBMIT_ERR(context, "non-zero reserved value");
452 SUBMIT_ERR(context, "non-zero reserved value");
458 SUBMIT_ERR(context, "syncpoint ID in CMD_WAIT_SYNCPT_RELATIVE is not used by the job");
466 SUBMIT_ERR(context, "unknown cmd type");
473 SUBMIT_ERR(context, "job must have at least one gather");
516 struct tegra_drm_context *context;
524 context = xa_load(&fpriv->contexts, args->context);
525 if (!context) {
527 pr_err_ratelimited("%s: %s: invalid channel context '%#x'", __func__,
528 current->comm, args->context);
537 SUBMIT_ERR(context, "invalid syncobj_in '%#x'", args->syncobj_in);
544 SUBMIT_ERR(context, "wait for syncobj_in timed out");
552 SUBMIT_ERR(context, "invalid syncobj_out '%#x'", args->syncobj_out);
559 err = submit_copy_gather_data(&bo, drm->dev, context, args);
565 SUBMIT_ERR(context, "failed to allocate memory for job data");
571 err = submit_process_bufs(context, bo, args, job_data);
576 job = submit_create_job(context, bo, args, job_data, &fpriv->syncpoints);
583 err = host1x_job_pin(job, context->client->base.dev);
585 SUBMIT_ERR(context, "failed to pin job: %d", err);
589 if (context->client->ops->get_streamid_offset) {
590 err = context->client->ops->get_streamid_offset(
591 context->client, &job->engine_streamid_offset);
593 SUBMIT_ERR(context, "failed to get streamid offset: %d", err);
598 if (context->memory_context && context->client->ops->can_use_memory_ctx) {
601 err = context->client->ops->can_use_memory_ctx(context->client, &supported);
603 SUBMIT_ERR(context, "failed to detect if engine can use memory context: %d", err);
608 job->memory_context = context->memory_context;
611 } else if (context->client->ops->get_streamid_offset) {
616 if (!tegra_dev_iommu_get_stream_id(context->client->base.dev,
622 err = pm_runtime_resume_and_get(context->client->base.dev);
624 SUBMIT_ERR(context, "could not power up engine: %d", err);
641 SUBMIT_ERR(context, "host1x job submission failed: %d", err);
652 SUBMIT_ERR(context, "failed to create postfence: %d", err);