Lines Matching full:mapping
17 struct tegra_drm_mapping *mapping = in tegra_drm_mapping_release() local
20 host1x_bo_unpin(mapping->map); in tegra_drm_mapping_release()
21 host1x_bo_put(mapping->bo); in tegra_drm_mapping_release()
23 kfree(mapping); in tegra_drm_mapping_release()
26 void tegra_drm_mapping_put(struct tegra_drm_mapping *mapping) in tegra_drm_mapping_put() argument
28 kref_put(&mapping->ref, tegra_drm_mapping_release); in tegra_drm_mapping_put()
33 struct tegra_drm_mapping *mapping; in tegra_drm_channel_context_close() local
39 xa_for_each(&context->mappings, id, mapping) in tegra_drm_channel_context_close()
40 tegra_drm_mapping_put(mapping); in tegra_drm_channel_context_close()
189 struct tegra_drm_mapping *mapping; in tegra_drm_ioctl_channel_map() local
206 mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); in tegra_drm_ioctl_channel_map()
207 if (!mapping) { in tegra_drm_ioctl_channel_map()
212 kref_init(&mapping->ref); in tegra_drm_ioctl_channel_map()
219 mapping->bo = tegra_gem_lookup(file, args->handle); in tegra_drm_ioctl_channel_map()
220 if (!mapping->bo) { in tegra_drm_ioctl_channel_map()
243 mapping->map = host1x_bo_pin(mapping_dev, mapping->bo, direction, NULL); in tegra_drm_ioctl_channel_map()
244 if (IS_ERR(mapping->map)) { in tegra_drm_ioctl_channel_map()
245 err = PTR_ERR(mapping->map); in tegra_drm_ioctl_channel_map()
249 mapping->iova = mapping->map->phys; in tegra_drm_ioctl_channel_map()
250 mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size; in tegra_drm_ioctl_channel_map()
252 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX), in tegra_drm_ioctl_channel_map()
262 host1x_bo_unpin(mapping->map); in tegra_drm_ioctl_channel_map()
264 host1x_bo_put(mapping->bo); in tegra_drm_ioctl_channel_map()
266 kfree(mapping); in tegra_drm_ioctl_channel_map()
276 struct tegra_drm_mapping *mapping; in tegra_drm_ioctl_channel_unmap() local
287 mapping = xa_erase(&context->mappings, args->mapping); in tegra_drm_ioctl_channel_unmap()
291 if (!mapping) in tegra_drm_ioctl_channel_unmap()
294 tegra_drm_mapping_put(mapping); in tegra_drm_ioctl_channel_unmap()