Lines Matching +full:tegra194 +full:- +full:dc
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2012-2016 NVIDIA CORPORATION. All rights reserved.
27 #include <asm/dma-iommu.h>
30 #include "dc.h"
79 struct drm_device *drm = old_state->dev; in tegra_atomic_commit_tail()
80 struct tegra_drm *tegra = drm->dev_private; in tegra_atomic_commit_tail()
82 if (tegra->hub) { in tegra_atomic_commit_tail()
111 return -ENOMEM; in tegra_drm_open()
113 idr_init_base(&fpriv->legacy_contexts, 1); in tegra_drm_open()
114 xa_init_flags(&fpriv->contexts, XA_FLAGS_ALLOC1); in tegra_drm_open()
115 xa_init(&fpriv->syncpoints); in tegra_drm_open()
116 mutex_init(&fpriv->lock); in tegra_drm_open()
117 filp->driver_priv = fpriv; in tegra_drm_open()
124 context->client->ops->close_channel(context); in tegra_drm_context_free()
125 pm_runtime_put(context->client->base.dev); in tegra_drm_context_free()
137 err = get_user(cmdbuf, &src->cmdbuf.handle); in host1x_reloc_copy_from_user()
141 err = get_user(dest->cmdbuf.offset, &src->cmdbuf.offset); in host1x_reloc_copy_from_user()
145 err = get_user(target, &src->target.handle); in host1x_reloc_copy_from_user()
149 err = get_user(dest->target.offset, &src->target.offset); in host1x_reloc_copy_from_user()
153 err = get_user(dest->shift, &src->shift); in host1x_reloc_copy_from_user()
157 dest->flags = HOST1X_RELOC_READ | HOST1X_RELOC_WRITE; in host1x_reloc_copy_from_user()
159 dest->cmdbuf.bo = tegra_gem_lookup(file, cmdbuf); in host1x_reloc_copy_from_user()
160 if (!dest->cmdbuf.bo) in host1x_reloc_copy_from_user()
161 return -ENOENT; in host1x_reloc_copy_from_user()
163 dest->target.bo = tegra_gem_lookup(file, target); in host1x_reloc_copy_from_user()
164 if (!dest->target.bo) in host1x_reloc_copy_from_user()
165 return -ENOENT; in host1x_reloc_copy_from_user()
174 struct host1x_client *client = &context->client->base; in tegra_drm_submit()
175 unsigned int num_cmdbufs = args->num_cmdbufs; in tegra_drm_submit()
176 unsigned int num_relocs = args->num_relocs; in tegra_drm_submit()
181 struct host1x *host1x = dev_get_drvdata(drm->dev->parent); in tegra_drm_submit()
188 user_cmdbufs = u64_to_user_ptr(args->cmdbufs); in tegra_drm_submit()
189 user_relocs = u64_to_user_ptr(args->relocs); in tegra_drm_submit()
190 user_syncpt = u64_to_user_ptr(args->syncpts); in tegra_drm_submit()
193 if (args->num_syncpts != 1) in tegra_drm_submit()
194 return -EINVAL; in tegra_drm_submit()
197 if (args->num_waitchks != 0) in tegra_drm_submit()
198 return -EINVAL; in tegra_drm_submit()
200 job = host1x_job_alloc(context->channel, args->num_cmdbufs, in tegra_drm_submit()
201 args->num_relocs, false); in tegra_drm_submit()
203 return -ENOMEM; in tegra_drm_submit()
205 job->num_relocs = args->num_relocs; in tegra_drm_submit()
206 job->client = client; in tegra_drm_submit()
207 job->class = client->class; in tegra_drm_submit()
208 job->serialize = true; in tegra_drm_submit()
209 job->syncpt_recovery = true; in tegra_drm_submit()
219 err = -ENOMEM; in tegra_drm_submit()
233 err = -EFAULT; in tegra_drm_submit()
242 err = -EINVAL; in tegra_drm_submit()
248 err = -ENOENT; in tegra_drm_submit()
254 refs[num_refs++] = &obj->gem; in tegra_drm_submit()
257 * Gather buffer base address must be 4-bytes aligned, in tegra_drm_submit()
261 if (offset & 3 || offset > obj->gem.size) { in tegra_drm_submit()
262 err = -EINVAL; in tegra_drm_submit()
267 num_cmdbufs--; in tegra_drm_submit()
272 while (num_relocs--) { in tegra_drm_submit()
276 err = host1x_reloc_copy_from_user(&job->relocs[num_relocs], in tegra_drm_submit()
282 reloc = &job->relocs[num_relocs]; in tegra_drm_submit()
283 obj = host1x_to_tegra_bo(reloc->cmdbuf.bo); in tegra_drm_submit()
284 refs[num_refs++] = &obj->gem; in tegra_drm_submit()
291 if (reloc->cmdbuf.offset & 3 || in tegra_drm_submit()
292 reloc->cmdbuf.offset >= obj->gem.size) { in tegra_drm_submit()
293 err = -EINVAL; in tegra_drm_submit()
297 obj = host1x_to_tegra_bo(reloc->target.bo); in tegra_drm_submit()
298 refs[num_refs++] = &obj->gem; in tegra_drm_submit()
300 if (reloc->target.offset >= obj->gem.size) { in tegra_drm_submit()
301 err = -EINVAL; in tegra_drm_submit()
307 err = -EFAULT; in tegra_drm_submit()
314 err = -ENOENT; in tegra_drm_submit()
318 job->is_addr_reg = context->client->ops->is_addr_reg; in tegra_drm_submit()
319 job->is_valid_class = context->client->ops->is_valid_class; in tegra_drm_submit()
320 job->syncpt_incrs = syncpt.incrs; in tegra_drm_submit()
321 job->syncpt = sp; in tegra_drm_submit()
322 job->timeout = 10000; in tegra_drm_submit()
324 if (args->timeout && args->timeout < 10000) in tegra_drm_submit()
325 job->timeout = args->timeout; in tegra_drm_submit()
327 err = host1x_job_pin(job, context->client->base.dev); in tegra_drm_submit()
337 args->fence = job->syncpt_end; in tegra_drm_submit()
340 while (num_refs--) in tegra_drm_submit()
358 bo = tegra_bo_create_with_handle(file, drm, args->size, args->flags, in tegra_gem_create()
359 &args->handle); in tegra_gem_create()
373 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_mmap()
375 return -EINVAL; in tegra_gem_mmap()
379 args->offset = drm_vma_node_offset_addr(&bo->gem.vma_node); in tegra_gem_mmap()
389 struct host1x *host = dev_get_drvdata(drm->dev->parent); in tegra_syncpt_read()
393 sp = host1x_syncpt_get_by_id_noref(host, args->id); in tegra_syncpt_read()
395 return -EINVAL; in tegra_syncpt_read()
397 args->value = host1x_syncpt_read_min(sp); in tegra_syncpt_read()
404 struct host1x *host1x = dev_get_drvdata(drm->dev->parent); in tegra_syncpt_incr()
408 sp = host1x_syncpt_get_by_id_noref(host1x, args->id); in tegra_syncpt_incr()
410 return -EINVAL; in tegra_syncpt_incr()
418 struct host1x *host1x = dev_get_drvdata(drm->dev->parent); in tegra_syncpt_wait()
422 sp = host1x_syncpt_get_by_id_noref(host1x, args->id); in tegra_syncpt_wait()
424 return -EINVAL; in tegra_syncpt_wait()
426 return host1x_syncpt_wait(sp, args->thresh, in tegra_syncpt_wait()
427 msecs_to_jiffies(args->timeout), in tegra_syncpt_wait()
428 &args->value); in tegra_syncpt_wait()
437 err = pm_runtime_resume_and_get(client->base.dev); in tegra_client_open()
441 err = client->ops->open_channel(client, context); in tegra_client_open()
443 pm_runtime_put(client->base.dev); in tegra_client_open()
447 err = idr_alloc(&fpriv->legacy_contexts, context, 1, 0, GFP_KERNEL); in tegra_client_open()
449 client->ops->close_channel(context); in tegra_client_open()
450 pm_runtime_put(client->base.dev); in tegra_client_open()
454 context->client = client; in tegra_client_open()
455 context->id = err; in tegra_client_open()
463 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_open_channel()
464 struct tegra_drm *tegra = drm->dev_private; in tegra_open_channel()
468 int err = -ENODEV; in tegra_open_channel()
472 return -ENOMEM; in tegra_open_channel()
474 mutex_lock(&fpriv->lock); in tegra_open_channel()
476 list_for_each_entry(client, &tegra->clients, list) in tegra_open_channel()
477 if (client->base.class == args->client) { in tegra_open_channel()
482 args->context = context->id; in tegra_open_channel()
489 mutex_unlock(&fpriv->lock); in tegra_open_channel()
496 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_close_channel()
501 mutex_lock(&fpriv->lock); in tegra_close_channel()
503 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_close_channel()
505 err = -EINVAL; in tegra_close_channel()
509 idr_remove(&fpriv->legacy_contexts, context->id); in tegra_close_channel()
513 mutex_unlock(&fpriv->lock); in tegra_close_channel()
520 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_get_syncpt()
526 mutex_lock(&fpriv->lock); in tegra_get_syncpt()
528 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_get_syncpt()
530 err = -ENODEV; in tegra_get_syncpt()
534 if (args->index >= context->client->base.num_syncpts) { in tegra_get_syncpt()
535 err = -EINVAL; in tegra_get_syncpt()
539 syncpt = context->client->base.syncpts[args->index]; in tegra_get_syncpt()
540 args->id = host1x_syncpt_id(syncpt); in tegra_get_syncpt()
543 mutex_unlock(&fpriv->lock); in tegra_get_syncpt()
550 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_submit()
555 mutex_lock(&fpriv->lock); in tegra_submit()
557 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_submit()
559 err = -ENODEV; in tegra_submit()
563 err = context->client->ops->submit(context, args, drm, file); in tegra_submit()
566 mutex_unlock(&fpriv->lock); in tegra_submit()
573 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_get_syncpt_base()
580 mutex_lock(&fpriv->lock); in tegra_get_syncpt_base()
582 context = idr_find(&fpriv->legacy_contexts, args->context); in tegra_get_syncpt_base()
584 err = -ENODEV; in tegra_get_syncpt_base()
588 if (args->syncpt >= context->client->base.num_syncpts) { in tegra_get_syncpt_base()
589 err = -EINVAL; in tegra_get_syncpt_base()
593 syncpt = context->client->base.syncpts[args->syncpt]; in tegra_get_syncpt_base()
597 err = -ENXIO; in tegra_get_syncpt_base()
601 args->id = host1x_syncpt_base_id(base); in tegra_get_syncpt_base()
604 mutex_unlock(&fpriv->lock); in tegra_get_syncpt_base()
617 switch (args->mode) { in tegra_gem_set_tiling()
621 if (args->value != 0) in tegra_gem_set_tiling()
622 return -EINVAL; in tegra_gem_set_tiling()
629 if (args->value != 0) in tegra_gem_set_tiling()
630 return -EINVAL; in tegra_gem_set_tiling()
637 if (args->value > 5) in tegra_gem_set_tiling()
638 return -EINVAL; in tegra_gem_set_tiling()
640 value = args->value; in tegra_gem_set_tiling()
644 return -EINVAL; in tegra_gem_set_tiling()
647 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_set_tiling()
649 return -ENOENT; in tegra_gem_set_tiling()
653 bo->tiling.mode = mode; in tegra_gem_set_tiling()
654 bo->tiling.value = value; in tegra_gem_set_tiling()
669 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_get_tiling()
671 return -ENOENT; in tegra_gem_get_tiling()
675 switch (bo->tiling.mode) { in tegra_gem_get_tiling()
677 args->mode = DRM_TEGRA_GEM_TILING_MODE_PITCH; in tegra_gem_get_tiling()
678 args->value = 0; in tegra_gem_get_tiling()
682 args->mode = DRM_TEGRA_GEM_TILING_MODE_TILED; in tegra_gem_get_tiling()
683 args->value = 0; in tegra_gem_get_tiling()
687 args->mode = DRM_TEGRA_GEM_TILING_MODE_BLOCK; in tegra_gem_get_tiling()
688 args->value = bo->tiling.value; in tegra_gem_get_tiling()
692 err = -EINVAL; in tegra_gem_get_tiling()
708 if (args->flags & ~DRM_TEGRA_GEM_FLAGS) in tegra_gem_set_flags()
709 return -EINVAL; in tegra_gem_set_flags()
711 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_set_flags()
713 return -ENOENT; in tegra_gem_set_flags()
716 bo->flags = 0; in tegra_gem_set_flags()
718 if (args->flags & DRM_TEGRA_GEM_BOTTOM_UP) in tegra_gem_set_flags()
719 bo->flags |= TEGRA_BO_BOTTOM_UP; in tegra_gem_set_flags()
733 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_get_flags()
735 return -ENOENT; in tegra_gem_get_flags()
738 args->flags = 0; in tegra_gem_get_flags()
740 if (bo->flags & TEGRA_BO_BOTTOM_UP) in tegra_gem_get_flags()
741 args->flags |= DRM_TEGRA_GEM_BOTTOM_UP; in tegra_gem_get_flags()
820 struct tegra_drm_file *fpriv = file->driver_priv; in tegra_drm_postclose()
822 mutex_lock(&fpriv->lock); in tegra_drm_postclose()
823 idr_for_each(&fpriv->legacy_contexts, tegra_drm_context_cleanup, NULL); in tegra_drm_postclose()
825 mutex_unlock(&fpriv->lock); in tegra_drm_postclose()
827 idr_destroy(&fpriv->legacy_contexts); in tegra_drm_postclose()
828 mutex_destroy(&fpriv->lock); in tegra_drm_postclose()
835 struct drm_info_node *node = (struct drm_info_node *)s->private; in tegra_debugfs_framebuffers()
836 struct drm_device *drm = node->minor->dev; in tegra_debugfs_framebuffers()
839 mutex_lock(&drm->mode_config.fb_lock); in tegra_debugfs_framebuffers()
841 list_for_each_entry(fb, &drm->mode_config.fb_list, head) { in tegra_debugfs_framebuffers()
843 fb->base.id, fb->width, fb->height, in tegra_debugfs_framebuffers()
844 fb->format->depth, in tegra_debugfs_framebuffers()
845 fb->format->cpp[0] * 8, in tegra_debugfs_framebuffers()
849 mutex_unlock(&drm->mode_config.fb_lock); in tegra_debugfs_framebuffers()
856 struct drm_info_node *node = (struct drm_info_node *)s->private; in tegra_debugfs_iova()
857 struct drm_device *drm = node->minor->dev; in tegra_debugfs_iova()
858 struct tegra_drm *tegra = drm->dev_private; in tegra_debugfs_iova()
861 if (tegra->domain) { in tegra_debugfs_iova()
862 mutex_lock(&tegra->mm_lock); in tegra_debugfs_iova()
863 drm_mm_print(&tegra->mm, &p); in tegra_debugfs_iova()
864 mutex_unlock(&tegra->mm_lock); in tegra_debugfs_iova()
879 minor->debugfs_root, minor); in tegra_debugfs_init()
919 client->shared_channel = host1x_channel_request(&client->base); in tegra_drm_register_client()
920 if (!client->shared_channel) in tegra_drm_register_client()
921 return -EBUSY; in tegra_drm_register_client()
923 mutex_lock(&tegra->clients_lock); in tegra_drm_register_client()
924 list_add_tail(&client->list, &tegra->clients); in tegra_drm_register_client()
925 client->drm = tegra; in tegra_drm_register_client()
926 mutex_unlock(&tegra->clients_lock); in tegra_drm_register_client()
934 mutex_lock(&tegra->clients_lock); in tegra_drm_unregister_client()
935 list_del_init(&client->list); in tegra_drm_unregister_client()
936 client->drm = NULL; in tegra_drm_unregister_client()
937 mutex_unlock(&tegra->clients_lock); in tegra_drm_unregister_client()
939 if (client->shared_channel) in tegra_drm_unregister_client()
940 host1x_channel_put(client->shared_channel); in tegra_drm_unregister_client()
947 struct iommu_domain *domain = iommu_get_domain_for_dev(client->dev); in host1x_client_iommu_attach()
948 struct drm_device *drm = dev_get_drvdata(client->host); in host1x_client_iommu_attach()
949 struct tegra_drm *tegra = drm->dev_private; in host1x_client_iommu_attach()
954 if (client->dev->archdata.mapping) { in host1x_client_iommu_attach()
956 to_dma_iommu_mapping(client->dev); in host1x_client_iommu_attach()
957 arm_iommu_detach_device(client->dev); in host1x_client_iommu_attach()
960 domain = iommu_get_domain_for_dev(client->dev); in host1x_client_iommu_attach()
967 * domain. This allows using the IOMMU-backed DMA API. in host1x_client_iommu_attach()
969 if (domain && domain != tegra->domain) in host1x_client_iommu_attach()
972 if (tegra->domain) { in host1x_client_iommu_attach()
973 group = iommu_group_get(client->dev); in host1x_client_iommu_attach()
975 return -ENODEV; in host1x_client_iommu_attach()
977 if (domain != tegra->domain) { in host1x_client_iommu_attach()
978 err = iommu_attach_group(tegra->domain, group); in host1x_client_iommu_attach()
985 tegra->use_explicit_iommu = true; in host1x_client_iommu_attach()
988 client->group = group; in host1x_client_iommu_attach()
995 struct drm_device *drm = dev_get_drvdata(client->host); in host1x_client_iommu_detach()
996 struct tegra_drm *tegra = drm->dev_private; in host1x_client_iommu_detach()
999 if (client->group) { in host1x_client_iommu_detach()
1005 domain = iommu_get_domain_for_dev(client->dev); in host1x_client_iommu_detach()
1007 iommu_detach_group(tegra->domain, client->group); in host1x_client_iommu_detach()
1009 iommu_group_put(client->group); in host1x_client_iommu_detach()
1010 client->group = NULL; in host1x_client_iommu_detach()
1021 if (tegra->domain) in tegra_drm_alloc()
1022 size = iova_align(&tegra->carveout.domain, size); in tegra_drm_alloc()
1027 if (!tegra->domain) { in tegra_drm_alloc()
1029 * Many units only support 32-bit addresses, even on 64-bit in tegra_drm_alloc()
1030 * SoCs. If there is no IOMMU to translate into a 32-bit IO in tegra_drm_alloc()
1032 * lower 32-bit range. in tegra_drm_alloc()
1039 return ERR_PTR(-ENOMEM); in tegra_drm_alloc()
1041 if (!tegra->domain) { in tegra_drm_alloc()
1050 alloc = alloc_iova(&tegra->carveout.domain, in tegra_drm_alloc()
1051 size >> tegra->carveout.shift, in tegra_drm_alloc()
1052 tegra->carveout.limit, true); in tegra_drm_alloc()
1054 err = -EBUSY; in tegra_drm_alloc()
1058 *dma = iova_dma_addr(&tegra->carveout.domain, alloc); in tegra_drm_alloc()
1059 err = iommu_map(tegra->domain, *dma, virt_to_phys(virt), in tegra_drm_alloc()
1067 __free_iova(&tegra->carveout.domain, alloc); in tegra_drm_alloc()
1077 if (tegra->domain) in tegra_drm_free()
1078 size = iova_align(&tegra->carveout.domain, size); in tegra_drm_free()
1082 if (tegra->domain) { in tegra_drm_free()
1083 iommu_unmap(tegra->domain, dma, size); in tegra_drm_free()
1084 free_iova(&tegra->carveout.domain, in tegra_drm_free()
1085 iova_pfn(&tegra->carveout.domain, dma)); in tegra_drm_free()
1093 struct host1x *host1x = dev_get_drvdata(dev->dev.parent); in host1x_drm_wants_iommu()
1102 * likely to be allocated beyond the 32-bit boundary if sufficient in host1x_drm_wants_iommu()
1107 * 32-bit boundary. in host1x_drm_wants_iommu()
1127 domain = iommu_get_domain_for_dev(dev->dev.parent); in host1x_drm_wants_iommu()
1131 * 32-bit boundary, so the regular GATHER opcodes will always be in host1x_drm_wants_iommu()
1147 drm = drm_dev_alloc(&tegra_drm_driver, &dev->dev); in host1x_drm_probe()
1153 err = -ENOMEM; in host1x_drm_probe()
1158 tegra->domain = iommu_domain_alloc(&platform_bus_type); in host1x_drm_probe()
1159 if (!tegra->domain) { in host1x_drm_probe()
1160 err = -ENOMEM; in host1x_drm_probe()
1169 mutex_init(&tegra->clients_lock); in host1x_drm_probe()
1170 INIT_LIST_HEAD(&tegra->clients); in host1x_drm_probe()
1172 dev_set_drvdata(&dev->dev, drm); in host1x_drm_probe()
1173 drm->dev_private = tegra; in host1x_drm_probe()
1174 tegra->drm = drm; in host1x_drm_probe()
1178 drm->mode_config.min_width = 0; in host1x_drm_probe()
1179 drm->mode_config.min_height = 0; in host1x_drm_probe()
1180 drm->mode_config.max_width = 0; in host1x_drm_probe()
1181 drm->mode_config.max_height = 0; in host1x_drm_probe()
1183 drm->mode_config.normalize_zpos = true; in host1x_drm_probe()
1185 drm->mode_config.funcs = &tegra_drm_mode_config_funcs; in host1x_drm_probe()
1186 drm->mode_config.helper_private = &tegra_drm_mode_config_helpers; in host1x_drm_probe()
1203 tegra->hmask = drm->mode_config.max_width - 1; in host1x_drm_probe()
1204 tegra->vmask = drm->mode_config.max_height - 1; in host1x_drm_probe()
1206 if (tegra->use_explicit_iommu) { in host1x_drm_probe()
1208 u64 dma_mask = dma_get_mask(&dev->dev); in host1x_drm_probe()
1212 start = tegra->domain->geometry.aperture_start & dma_mask; in host1x_drm_probe()
1213 end = tegra->domain->geometry.aperture_end & dma_mask; in host1x_drm_probe()
1216 gem_end = end - CARVEOUT_SZ; in host1x_drm_probe()
1220 order = __ffs(tegra->domain->pgsize_bitmap); in host1x_drm_probe()
1221 init_iova_domain(&tegra->carveout.domain, 1UL << order, in host1x_drm_probe()
1224 tegra->carveout.shift = iova_shift(&tegra->carveout.domain); in host1x_drm_probe()
1225 tegra->carveout.limit = carveout_end >> tegra->carveout.shift; in host1x_drm_probe()
1227 drm_mm_init(&tegra->mm, gem_start, gem_end - gem_start + 1); in host1x_drm_probe()
1228 mutex_init(&tegra->mm_lock); in host1x_drm_probe()
1231 DRM_DEBUG_DRIVER(" GEM: %#llx-%#llx\n", gem_start, gem_end); in host1x_drm_probe()
1232 DRM_DEBUG_DRIVER(" Carveout: %#llx-%#llx\n", carveout_start, in host1x_drm_probe()
1234 } else if (tegra->domain) { in host1x_drm_probe()
1235 iommu_domain_free(tegra->domain); in host1x_drm_probe()
1236 tegra->domain = NULL; in host1x_drm_probe()
1240 if (tegra->hub) { in host1x_drm_probe()
1241 err = tegra_display_hub_prepare(tegra->hub); in host1x_drm_probe()
1246 /* syncpoints are used for full 32-bit hardware VBLANK counters */ in host1x_drm_probe()
1247 drm->max_vblank_count = 0xffffffff; in host1x_drm_probe()
1249 err = drm_vblank_init(drm, drm->mode_config.num_crtc); in host1x_drm_probe()
1272 if (tegra->hub) in host1x_drm_probe()
1273 tegra_display_hub_cleanup(tegra->hub); in host1x_drm_probe()
1275 if (tegra->domain) { in host1x_drm_probe()
1276 mutex_destroy(&tegra->mm_lock); in host1x_drm_probe()
1277 drm_mm_takedown(&tegra->mm); in host1x_drm_probe()
1278 put_iova_domain(&tegra->carveout.domain); in host1x_drm_probe()
1289 if (tegra->domain) in host1x_drm_probe()
1290 iommu_domain_free(tegra->domain); in host1x_drm_probe()
1300 struct drm_device *drm = dev_get_drvdata(&dev->dev); in host1x_drm_remove()
1301 struct tegra_drm *tegra = drm->dev_private; in host1x_drm_remove()
1311 if (tegra->hub) in host1x_drm_remove()
1312 tegra_display_hub_cleanup(tegra->hub); in host1x_drm_remove()
1316 dev_err(&dev->dev, "host1x device cleanup failed: %d\n", err); in host1x_drm_remove()
1318 if (tegra->domain) { in host1x_drm_remove()
1319 mutex_destroy(&tegra->mm_lock); in host1x_drm_remove()
1320 drm_mm_takedown(&tegra->mm); in host1x_drm_remove()
1321 put_iova_domain(&tegra->carveout.domain); in host1x_drm_remove()
1323 iommu_domain_free(tegra->domain); in host1x_drm_remove()
1352 { .compatible = "nvidia,tegra20-dc", },
1353 { .compatible = "nvidia,tegra20-hdmi", },
1354 { .compatible = "nvidia,tegra20-gr2d", },
1355 { .compatible = "nvidia,tegra20-gr3d", },
1356 { .compatible = "nvidia,tegra30-dc", },
1357 { .compatible = "nvidia,tegra30-hdmi", },
1358 { .compatible = "nvidia,tegra30-gr2d", },
1359 { .compatible = "nvidia,tegra30-gr3d", },
1360 { .compatible = "nvidia,tegra114-dc", },
1361 { .compatible = "nvidia,tegra114-dsi", },
1362 { .compatible = "nvidia,tegra114-hdmi", },
1363 { .compatible = "nvidia,tegra114-gr2d", },
1364 { .compatible = "nvidia,tegra114-gr3d", },
1365 { .compatible = "nvidia,tegra124-dc", },
1366 { .compatible = "nvidia,tegra124-sor", },
1367 { .compatible = "nvidia,tegra124-hdmi", },
1368 { .compatible = "nvidia,tegra124-dsi", },
1369 { .compatible = "nvidia,tegra124-vic", },
1370 { .compatible = "nvidia,tegra132-dsi", },
1371 { .compatible = "nvidia,tegra210-dc", },
1372 { .compatible = "nvidia,tegra210-dsi", },
1373 { .compatible = "nvidia,tegra210-sor", },
1374 { .compatible = "nvidia,tegra210-sor1", },
1375 { .compatible = "nvidia,tegra210-vic", },
1376 { .compatible = "nvidia,tegra210-nvdec", },
1377 { .compatible = "nvidia,tegra186-display", },
1378 { .compatible = "nvidia,tegra186-dc", },
1379 { .compatible = "nvidia,tegra186-sor", },
1380 { .compatible = "nvidia,tegra186-sor1", },
1381 { .compatible = "nvidia,tegra186-vic", },
1382 { .compatible = "nvidia,tegra186-nvdec", },
1383 { .compatible = "nvidia,tegra194-display", },
1384 { .compatible = "nvidia,tegra194-dc", },
1385 { .compatible = "nvidia,tegra194-sor", },
1386 { .compatible = "nvidia,tegra194-vic", },
1387 { .compatible = "nvidia,tegra194-nvdec", },
1388 { .compatible = "nvidia,tegra234-vic", },
1420 return -ENODEV; in host1x_drm_init()
1445 MODULE_AUTHOR("Thierry Reding <thierry.reding@avionic-design.de>");