for (i = 0; i < cdl->len; i++) {
ctx = &cdl->devs[i];
ctx->host = host1x;
device_initialize(&ctx->dev);
/* * Due to an issue with T194 NVENC, only 38 bits can be used. * Anyway, 256GiB of IOVA ought to be enough for anyone.
*/
ctx->dma_mask = DMA_BIT_MASK(38);
ctx->dev.dma_mask = &ctx->dma_mask;
ctx->dev.coherent_dma_mask = ctx->dma_mask;
dev_set_name(&ctx->dev, "host1x-ctx.%d", i);
ctx->dev.bus = &host1x_context_device_bus_type;
ctx->dev.parent = host1x->dev;
ctx->dev.release = host1x_memory_context_release;
err = device_add(&ctx->dev); if (err) {
dev_err(host1x->dev, "could not add context device %d: %d\n", i, err);
put_device(&ctx->dev); goto unreg_devices;
}
err = of_dma_configure_id(&ctx->dev, node, true, &i); if (err) {
dev_err(host1x->dev, "IOMMU configuration failed for context device %d: %d\n",
i, err);
device_unregister(&ctx->dev); goto unreg_devices;
}
if (!tegra_dev_iommu_get_stream_id(&ctx->dev, &ctx->stream_id) ||
!device_iommu_mapped(&ctx->dev)) {
dev_err(host1x->dev, "Context device %d has no IOMMU!\n", i);
device_unregister(&ctx->dev);
/* * This means that if IOMMU is disabled but context devices * are defined in the device tree, Host1x will fail to probe. * That's probably OK in this time and age.
*/
err = -EINVAL;
goto unreg_devices;
}
}
return 0;
unreg_devices: while (i--)
device_unregister(&cdl->devs[i].dev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.