#include <linux/clk.h>
#include <linux/component.h>
#include <linux/delay.h>
#include <linux/dma-fence.h>
#include <linux/dma-mapping.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/thermal.h>
#include "etnaviv_cmdbuf.h"
#include "etnaviv_dump.h"
#include "etnaviv_gpu.h"
#include "etnaviv_gem.h"
#include "etnaviv_mmu.h"
#include "etnaviv_perfmon.h"
#include "etnaviv_sched.h"
#include "common.xml.h"
#include "state.xml.h"
#include "state_hi.xml.h"
#include "cmdstream.xml.h"
static const struct platform_device_id gpu_ids[] = …;
int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value)
{ … }
static inline bool etnaviv_is_model_rev(struct etnaviv_gpu *gpu, u32 model, u32 revision)
{ … }
#define etnaviv_field(val, field) …
static void etnaviv_hw_specs(struct etnaviv_gpu *gpu)
{ … }
static void etnaviv_hw_identify(struct etnaviv_gpu *gpu)
{ … }
static void etnaviv_gpu_load_clock(struct etnaviv_gpu *gpu, u32 clock)
{ … }
static void etnaviv_gpu_update_clock(struct etnaviv_gpu *gpu)
{ … }
static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
{ … }
static void etnaviv_gpu_enable_mlcg(struct etnaviv_gpu *gpu)
{ … }
void etnaviv_gpu_start_fe(struct etnaviv_gpu *gpu, u32 address, u16 prefetch)
{ … }
static void etnaviv_gpu_start_fe_idleloop(struct etnaviv_gpu *gpu,
struct etnaviv_iommu_context *context)
{ … }
static void etnaviv_gpu_setup_pulse_eater(struct etnaviv_gpu *gpu)
{ … }
static void etnaviv_gpu_hw_init(struct etnaviv_gpu *gpu)
{ … }
int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
{ … }
#ifdef CONFIG_DEBUG_FS
struct dma_debug { … };
static void verify_dma(struct etnaviv_gpu *gpu, struct dma_debug *debug)
{ … }
int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m)
{ … }
#endif
struct etnaviv_fence { … };
static inline struct etnaviv_fence *to_etnaviv_fence(struct dma_fence *fence)
{ … }
static const char *etnaviv_fence_get_driver_name(struct dma_fence *fence)
{ … }
static const char *etnaviv_fence_get_timeline_name(struct dma_fence *fence)
{ … }
static bool etnaviv_fence_signaled(struct dma_fence *fence)
{ … }
static void etnaviv_fence_release(struct dma_fence *fence)
{ … }
static const struct dma_fence_ops etnaviv_fence_ops = …;
static struct dma_fence *etnaviv_gpu_fence_alloc(struct etnaviv_gpu *gpu)
{ … }
static inline bool fence_after(u32 a, u32 b)
{ … }
static int event_alloc(struct etnaviv_gpu *gpu, unsigned nr_events,
unsigned int *events)
{ … }
static void event_free(struct etnaviv_gpu *gpu, unsigned int event)
{ … }
int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu,
u32 id, struct drm_etnaviv_timespec *timeout)
{ … }
int etnaviv_gpu_wait_obj_inactive(struct etnaviv_gpu *gpu,
struct etnaviv_gem_object *etnaviv_obj,
struct drm_etnaviv_timespec *timeout)
{ … }
static void sync_point_perfmon_sample(struct etnaviv_gpu *gpu,
struct etnaviv_event *event, unsigned int flags)
{ … }
static void sync_point_perfmon_sample_pre(struct etnaviv_gpu *gpu,
struct etnaviv_event *event)
{ … }
static void sync_point_perfmon_sample_post(struct etnaviv_gpu *gpu,
struct etnaviv_event *event)
{ … }
struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit)
{ … }
static void sync_point_worker(struct work_struct *work)
{ … }
void etnaviv_gpu_recover_hang(struct etnaviv_gem_submit *submit)
{ … }
static void dump_mmu_fault(struct etnaviv_gpu *gpu)
{ … }
static irqreturn_t irq_handler(int irq, void *data)
{ … }
static int etnaviv_gpu_clk_enable(struct etnaviv_gpu *gpu)
{ … }
static int etnaviv_gpu_clk_disable(struct etnaviv_gpu *gpu)
{ … }
int etnaviv_gpu_wait_idle(struct etnaviv_gpu *gpu, unsigned int timeout_ms)
{ … }
static void etnaviv_gpu_hw_suspend(struct etnaviv_gpu *gpu)
{ … }
static int etnaviv_gpu_hw_resume(struct etnaviv_gpu *gpu)
{ … }
static int
etnaviv_gpu_cooling_get_max_state(struct thermal_cooling_device *cdev,
unsigned long *state)
{ … }
static int
etnaviv_gpu_cooling_get_cur_state(struct thermal_cooling_device *cdev,
unsigned long *state)
{ … }
static int
etnaviv_gpu_cooling_set_cur_state(struct thermal_cooling_device *cdev,
unsigned long state)
{ … }
static const struct thermal_cooling_device_ops cooling_ops = …;
static int etnaviv_gpu_bind(struct device *dev, struct device *master,
void *data)
{ … }
static void etnaviv_gpu_unbind(struct device *dev, struct device *master,
void *data)
{ … }
static const struct component_ops gpu_ops = …;
static const struct of_device_id etnaviv_gpu_match[] = …;
MODULE_DEVICE_TABLE(of, etnaviv_gpu_match);
static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
{ … }
static void etnaviv_gpu_platform_remove(struct platform_device *pdev)
{ … }
static int etnaviv_gpu_rpm_suspend(struct device *dev)
{ … }
static int etnaviv_gpu_rpm_resume(struct device *dev)
{ … }
static const struct dev_pm_ops etnaviv_gpu_pm_ops = …;
struct platform_driver etnaviv_gpu_driver = …;