#include "drm/drm_drv.h"
#include "msm_gpu.h"
#include "msm_gem.h"
#include "msm_mmu.h"
#include "msm_fence.h"
#include "msm_gpu_trace.h"
#include <generated/utsrelease.h>
#include <linux/string_helpers.h>
#include <linux/devcoredump.h>
#include <linux/sched/task.h>
static int enable_pwrrail(struct msm_gpu *gpu)
{ … }
static int disable_pwrrail(struct msm_gpu *gpu)
{ … }
static int enable_clk(struct msm_gpu *gpu)
{ … }
static int disable_clk(struct msm_gpu *gpu)
{ … }
static int enable_axi(struct msm_gpu *gpu)
{ … }
static int disable_axi(struct msm_gpu *gpu)
{ … }
int msm_gpu_pm_resume(struct msm_gpu *gpu)
{ … }
int msm_gpu_pm_suspend(struct msm_gpu *gpu)
{ … }
void msm_gpu_show_fdinfo(struct msm_gpu *gpu, struct msm_file_private *ctx,
struct drm_printer *p)
{ … }
int msm_gpu_hw_init(struct msm_gpu *gpu)
{ … }
#ifdef CONFIG_DEV_COREDUMP
static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset,
size_t count, void *data, size_t datalen)
{ … }
static void msm_gpu_devcoredump_free(void *data)
{ … }
static void msm_gpu_crashstate_get_bo(struct msm_gpu_state *state,
struct drm_gem_object *obj, u64 iova, bool full)
{ … }
static void msm_gpu_crashstate_capture(struct msm_gpu *gpu,
struct msm_gem_submit *submit, char *comm, char *cmd)
{ … }
#else
static void msm_gpu_crashstate_capture(struct msm_gpu *gpu,
struct msm_gem_submit *submit, char *comm, char *cmd)
{
}
#endif
static struct msm_gem_submit *
find_submit(struct msm_ringbuffer *ring, uint32_t fence)
{ … }
static void retire_submits(struct msm_gpu *gpu);
static void get_comm_cmdline(struct msm_gem_submit *submit, char **comm, char **cmd)
{ … }
static void recover_worker(struct kthread_work *work)
{ … }
static void fault_worker(struct kthread_work *work)
{ … }
static void hangcheck_timer_reset(struct msm_gpu *gpu)
{ … }
static bool made_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
{ … }
static void hangcheck_handler(struct timer_list *t)
{ … }
static int update_hw_cntrs(struct msm_gpu *gpu, uint32_t ncntrs, uint32_t *cntrs)
{ … }
static void update_sw_cntrs(struct msm_gpu *gpu)
{ … }
void msm_gpu_perfcntr_start(struct msm_gpu *gpu)
{ … }
void msm_gpu_perfcntr_stop(struct msm_gpu *gpu)
{ … }
int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime,
uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs)
{ … }
static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
struct msm_gem_submit *submit)
{ … }
static void retire_submits(struct msm_gpu *gpu)
{ … }
static void retire_worker(struct kthread_work *work)
{ … }
void msm_gpu_retire(struct msm_gpu *gpu)
{ … }
void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
{ … }
static irqreturn_t irq_handler(int irq, void *data)
{ … }
static int get_clocks(struct platform_device *pdev, struct msm_gpu *gpu)
{ … }
struct msm_gem_address_space *
msm_gpu_create_private_address_space(struct msm_gpu *gpu, struct task_struct *task)
{ … }
int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs,
const char *name, struct msm_gpu_config *config)
{ … }
void msm_gpu_cleanup(struct msm_gpu *gpu)
{ … }