Lines Matching full:gpu
49 int (*get_param)(struct msm_gpu *gpu, struct msm_context *ctx,
51 int (*set_param)(struct msm_gpu *gpu, struct msm_context *ctx,
53 int (*hw_init)(struct msm_gpu *gpu);
58 int (*ucode_load)(struct msm_gpu *gpu);
60 int (*pm_suspend)(struct msm_gpu *gpu);
61 int (*pm_resume)(struct msm_gpu *gpu);
62 void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit);
63 void (*flush)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
65 struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
66 void (*recover)(struct msm_gpu *gpu);
67 void (*destroy)(struct msm_gpu *gpu);
69 /* show GPU status in debugfs: */
70 void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
73 void (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor);
76 u64 (*gpu_busy)(struct msm_gpu *gpu, unsigned long *out_sample_rate);
77 struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu);
79 unsigned long (*gpu_get_freq)(struct msm_gpu *gpu);
81 void (*gpu_set_freq)(struct msm_gpu *gpu, struct dev_pm_opp *opp,
83 struct drm_gpuvm *(*create_vm)(struct msm_gpu *gpu, struct platform_device *pdev);
84 struct drm_gpuvm *(*create_private_vm)(struct msm_gpu *gpu, bool kernel_managed);
85 uint32_t (*get_rptr)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
88 * progress: Has the GPU made progress?
90 * Return true if GPU position in cmdstream has advanced (or changed)
94 bool (*progress)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
95 void (*sysprof_setup)(struct msm_gpu *gpu);
125 * Shadow frequency used while the GPU is idle. From the PoV of
127 * adjust frequency while the GPU is idle, but we use this shadow
128 * value as the GPU is actually clamped to minimum frequency while
196 * General lock for serializing all the gpu things.
216 /* does gpu need hw_init? */
220 * global_faults: number of GPU hangs not attributed to a particular
245 /* work for handling GPU recovery: */
291 adreno_smmu_has_prr(struct msm_gpu *gpu) in adreno_smmu_has_prr() argument
293 struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(&gpu->pdev->dev); in adreno_smmu_has_prr()
309 static inline bool msm_gpu_active(struct msm_gpu *gpu) in msm_gpu_active() argument
313 for (i = 0; i < gpu->nr_rings; i++) { in msm_gpu_active()
314 struct msm_ringbuffer *ring = gpu->rb[i]; in msm_gpu_active()
337 * The number of priority levels provided by drm gpu scheduler. The
371 * The per-process GPU address-space. Do not access directly, use
414 * The total (cumulative) elapsed time GPU was busy with rendering
420 * The total (cumulative) GPU cycles elapsed attributed to this
466 * @gpu: the gpu instance
469 * @sched_prio: [out] the gpu scheduler priority level which the userspace
490 static inline int msm_gpu_convert_priority(struct msm_gpu *gpu, int prio, in msm_gpu_convert_priority() argument
502 if (rn >= gpu->nr_rings) in msm_gpu_convert_priority()
522 * @faults: the number of GPU hangs associated with this submitqueue
595 static inline void gpu_write(struct msm_gpu *gpu, u32 reg, u32 data) in gpu_write() argument
598 writel(data, gpu->mmio + (reg << 2)); in gpu_write()
601 static inline u32 gpu_read(struct msm_gpu *gpu, u32 reg) in gpu_read() argument
604 return readl(gpu->mmio + (reg << 2)); in gpu_read()
607 static inline void gpu_rmw(struct msm_gpu *gpu, u32 reg, u32 mask, u32 or) in gpu_rmw() argument
610 msm_rmw(gpu->mmio + (reg << 2), mask, or); in gpu_rmw()
613 static inline u64 gpu_read64(struct msm_gpu *gpu, u32 reg) in gpu_read64() argument
619 * not quad word aligned and 2) the GPU hardware designers have a bit in gpu_read64()
621 * spins. The longer a GPU family goes the higher the chance that in gpu_read64()
632 val = (u64) readl(gpu->mmio + (reg << 2)); in gpu_read64()
634 val |= ((u64) readl(gpu->mmio + ((reg + 1) << 2)) << 32); in gpu_read64()
639 static inline void gpu_write64(struct msm_gpu *gpu, u32 reg, u64 val) in gpu_write64() argument
643 writel(lower_32_bits(val), gpu->mmio + (reg << 2)); in gpu_write64()
645 writel(upper_32_bits(val), gpu->mmio + ((reg + 1) << 2)); in gpu_write64()
648 int msm_gpu_pm_suspend(struct msm_gpu *gpu);
649 int msm_gpu_pm_resume(struct msm_gpu *gpu);
651 void msm_gpu_show_fdinfo(struct msm_gpu *gpu, struct msm_context *ctx,
667 int msm_context_set_sysprof(struct msm_context *ctx, struct msm_gpu *gpu, int sysprof);
682 void msm_devfreq_init(struct msm_gpu *gpu);
683 void msm_devfreq_cleanup(struct msm_gpu *gpu);
684 void msm_devfreq_resume(struct msm_gpu *gpu);
685 void msm_devfreq_suspend(struct msm_gpu *gpu);
686 void msm_devfreq_boost(struct msm_gpu *gpu, unsigned factor);
687 void msm_devfreq_active(struct msm_gpu *gpu);
688 void msm_devfreq_idle(struct msm_gpu *gpu);
690 int msm_gpu_hw_init(struct msm_gpu *gpu);
692 void msm_gpu_perfcntr_start(struct msm_gpu *gpu);
693 void msm_gpu_perfcntr_stop(struct msm_gpu *gpu);
694 int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime,
697 void msm_gpu_retire(struct msm_gpu *gpu);
698 void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit);
701 struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs,
705 msm_gpu_create_private_vm(struct msm_gpu *gpu, struct task_struct *task,
708 void msm_gpu_cleanup(struct msm_gpu *gpu);
721 static inline struct msm_gpu_state *msm_gpu_crashstate_get(struct msm_gpu *gpu) in msm_gpu_crashstate_get() argument
725 mutex_lock(&gpu->lock); in msm_gpu_crashstate_get()
727 if (gpu->crashstate) { in msm_gpu_crashstate_get()
728 kref_get(&gpu->crashstate->ref); in msm_gpu_crashstate_get()
729 state = gpu->crashstate; in msm_gpu_crashstate_get()
732 mutex_unlock(&gpu->lock); in msm_gpu_crashstate_get()
737 static inline void msm_gpu_crashstate_put(struct msm_gpu *gpu) in msm_gpu_crashstate_put() argument
739 mutex_lock(&gpu->lock); in msm_gpu_crashstate_put()
741 if (gpu->crashstate) { in msm_gpu_crashstate_put()
742 if (gpu->funcs->gpu_state_put(gpu->crashstate)) in msm_gpu_crashstate_put()
743 gpu->crashstate = NULL; in msm_gpu_crashstate_put()
746 mutex_unlock(&gpu->lock); in msm_gpu_crashstate_put()
749 void msm_gpu_fault_crashstate_capture(struct msm_gpu *gpu, struct msm_gpu_fault_info *fault_info);
755 #define check_apriv(gpu, flags) \ argument
756 (((gpu)->hw_apriv ? MSM_BO_MAP_PRIV : 0) | (flags))