drm/msm/hdmi: Enable HPD after HDMI IRQ is set up
[linux/fpc-iii.git] / drivers / gpu / drm / tegra / gem.h
blob6bd7dd7e55b46fb1443bd9cd72bd99ce7b244b43
1 /*
2 * Tegra host1x GEM implementation
4 * Copyright (c) 2012-2013, NVIDIA Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef __HOST1X_GEM_H
12 #define __HOST1X_GEM_H
14 #include <linux/host1x.h>
16 #include <drm/drm.h>
17 #include <drm/drmP.h>
18 #include <drm/drm_gem.h>
20 #define TEGRA_BO_BOTTOM_UP (1 << 0)
22 enum tegra_bo_tiling_mode {
23 TEGRA_BO_TILING_MODE_PITCH,
24 TEGRA_BO_TILING_MODE_TILED,
25 TEGRA_BO_TILING_MODE_BLOCK,
28 struct tegra_bo_tiling {
29 enum tegra_bo_tiling_mode mode;
30 unsigned long value;
33 struct tegra_bo {
34 struct drm_gem_object gem;
35 struct host1x_bo base;
36 unsigned long flags;
37 struct sg_table *sgt;
38 dma_addr_t paddr;
39 void *vaddr;
41 struct drm_mm_node *mm;
42 unsigned long num_pages;
43 struct page **pages;
44 /* size of IOMMU mapping */
45 size_t size;
47 struct tegra_bo_tiling tiling;
50 static inline struct tegra_bo *to_tegra_bo(struct drm_gem_object *gem)
52 return container_of(gem, struct tegra_bo, gem);
55 static inline struct tegra_bo *host1x_to_tegra_bo(struct host1x_bo *bo)
57 return container_of(bo, struct tegra_bo, base);
60 struct tegra_bo *tegra_bo_create(struct drm_device *drm, size_t size,
61 unsigned long flags);
62 struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file,
63 struct drm_device *drm,
64 size_t size,
65 unsigned long flags,
66 u32 *handle);
67 void tegra_bo_free_object(struct drm_gem_object *gem);
68 int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
69 struct drm_mode_create_dumb *args);
71 extern const struct vm_operations_struct tegra_bo_vm_ops;
73 int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma);
74 int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma);
76 struct dma_buf *tegra_gem_prime_export(struct drm_device *drm,
77 struct drm_gem_object *gem,
78 int flags);
79 struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm,
80 struct dma_buf *buf);
82 #endif