aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_drv.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-07-19 12:59:32 -0400
committerRob Clark <robdclark@gmail.com>2013-08-24 14:57:18 -0400
commit7198e6b03155f6dadecadba004eb83b81a6ffe4c (patch)
treeed4ae3e859fd9a722524242a145008d13606a95a /drivers/gpu/drm/msm/msm_drv.h
parent902e6eb851a78ad9e3db006c1e1df71841f633e2 (diff)
drm/msm: add a3xx gpu support
Add initial support for a3xx 3d core. So far, with hardware that I've seen to date, we can have: + zero, one, or two z180 2d cores + a3xx or a2xx 3d core, which share a common CP (the firmware for the CP seems to implement some different PM4 packet types but the basics of cmdstream submission are the same) Which means that the eventual complete "class" hierarchy, once support for all past and present hw is in place, becomes: + msm_gpu + adreno_gpu + a3xx_gpu + a2xx_gpu + z180_gpu This commit splits out the parts that will eventually be common between a2xx/a3xx into adreno_gpu, and the parts that are even common to z180 into msm_gpu. Note that there is no cmdstream validation required. All memory access from the GPU is via IOMMU/MMU. So as long as you don't map silly things to the GPU, there isn't much damage that the GPU can do. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.h')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 36f8ba2f5c84..34c36b2911d9 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -40,17 +40,34 @@
40#include <drm/drmP.h> 40#include <drm/drmP.h>
41#include <drm/drm_crtc_helper.h> 41#include <drm/drm_crtc_helper.h>
42#include <drm/drm_fb_helper.h> 42#include <drm/drm_fb_helper.h>
43#include <drm/msm_drm.h>
43 44
44struct msm_kms; 45struct msm_kms;
46struct msm_gpu;
45 47
46#define NUM_DOMAINS 1 /* one for KMS, then one per gpu core (?) */ 48#define NUM_DOMAINS 2 /* one for KMS, then one per gpu core (?) */
49
50struct msm_file_private {
51 /* currently we don't do anything useful with this.. but when
52 * per-context address spaces are supported we'd keep track of
53 * the context's page-tables here.
54 */
55 int dummy;
56};
47 57
48struct msm_drm_private { 58struct msm_drm_private {
49 59
50 struct msm_kms *kms; 60 struct msm_kms *kms;
51 61
62 /* when we have more than one 'msm_gpu' these need to be an array: */
63 struct msm_gpu *gpu;
64 struct msm_file_private *lastctx;
65
52 struct drm_fb_helper *fbdev; 66 struct drm_fb_helper *fbdev;
53 67
68 uint32_t next_fence, completed_fence;
69 wait_queue_head_t fence_event;
70
54 /* list of GEM objects: */ 71 /* list of GEM objects: */
55 struct list_head inactive_list; 72 struct list_head inactive_list;
56 73
@@ -108,6 +125,13 @@ int msm_register_iommu(struct drm_device *dev, struct iommu_domain *iommu);
108int msm_iommu_attach(struct drm_device *dev, struct iommu_domain *iommu, 125int msm_iommu_attach(struct drm_device *dev, struct iommu_domain *iommu,
109 const char **names, int cnt); 126 const char **names, int cnt);
110 127
128int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence,
129 struct timespec *timeout);
130void msm_update_fence(struct drm_device *dev, uint32_t fence);
131
132int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
133 struct drm_file *file);
134
111int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma); 135int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
112int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); 136int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
113uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj); 137uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj);
@@ -125,6 +149,12 @@ void *msm_gem_vaddr_locked(struct drm_gem_object *obj);
125void *msm_gem_vaddr(struct drm_gem_object *obj); 149void *msm_gem_vaddr(struct drm_gem_object *obj);
126int msm_gem_queue_inactive_work(struct drm_gem_object *obj, 150int msm_gem_queue_inactive_work(struct drm_gem_object *obj,
127 struct work_struct *work); 151 struct work_struct *work);
152void msm_gem_move_to_active(struct drm_gem_object *obj,
153 struct msm_gpu *gpu, uint32_t fence);
154void msm_gem_move_to_inactive(struct drm_gem_object *obj);
155int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op,
156 struct timespec *timeout);
157int msm_gem_cpu_fini(struct drm_gem_object *obj);
128void msm_gem_free_object(struct drm_gem_object *obj); 158void msm_gem_free_object(struct drm_gem_object *obj);
129int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, 159int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file,
130 uint32_t size, uint32_t flags, uint32_t *handle); 160 uint32_t size, uint32_t flags, uint32_t *handle);
@@ -168,20 +198,14 @@ static inline int align_pitch(int width, int bpp)
168 198
169/* for the generated headers: */ 199/* for the generated headers: */
170#define INVALID_IDX(idx) ({BUG(); 0;}) 200#define INVALID_IDX(idx) ({BUG(); 0;})
201#define fui(x) ({BUG(); 0;})
202#define util_float_to_half(x) ({BUG(); 0;})
203
171 204
172#define FIELD(val, name) (((val) & name ## __MASK) >> name ## __SHIFT) 205#define FIELD(val, name) (((val) & name ## __MASK) >> name ## __SHIFT)
173 206
174/* for conditionally setting boolean flag(s): */ 207/* for conditionally setting boolean flag(s): */
175#define COND(bool, val) ((bool) ? (val) : 0) 208#define COND(bool, val) ((bool) ? (val) : 0)
176 209
177/* just put these here until we start adding driver private ioctls: */
178// TODO might shuffle these around.. just need something for now..
179#define MSM_BO_CACHE_MASK 0x0000000f
180#define MSM_BO_SCANOUT 0x00010000 /* scanout capable */
181
182#define MSM_BO_CACHED 0x00000001 /* default */
183#define MSM_BO_WC 0x0000002
184#define MSM_BO_UNCACHED 0x00000004
185
186 210
187#endif /* __MSM_DRV_H__ */ 211#endif /* __MSM_DRV_H__ */