123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119 |
- #ifndef __KGSL_DEVICE_H
- #define __KGSL_DEVICE_H
- #include <linux/sched/mm.h>
- #include <linux/sched/task.h>
- #include <trace/events/gpu_mem.h>
- #include "kgsl.h"
- #include "kgsl_drawobj.h"
- #include "kgsl_mmu.h"
- #include "kgsl_regmap.h"
- #define KGSL_IOCTL_FUNC(_cmd, _func) \
- [_IOC_NR((_cmd))] = \
- { .cmd = (_cmd), .func = (_func) }
- #define KGSL_STATE_NONE 0x00000000
- #define KGSL_STATE_INIT 0x00000001
- #define KGSL_STATE_ACTIVE 0x00000002
- #define KGSL_STATE_NAP 0x00000004
- #define KGSL_STATE_SUSPEND 0x00000010
- #define KGSL_STATE_AWARE 0x00000020
- #define KGSL_STATE_SLUMBER 0x00000080
- #define KGSL_STATE_MINBW 0x00000100
- enum kgsl_event_results {
- KGSL_EVENT_RETIRED = 1,
- KGSL_EVENT_CANCELLED = 2,
- };
- #define KGSL_CONTEXT_FLAGS \
- { KGSL_CONTEXT_NO_GMEM_ALLOC, "NO_GMEM_ALLOC" }, \
- { KGSL_CONTEXT_PREAMBLE, "PREAMBLE" }, \
- { KGSL_CONTEXT_TRASH_STATE, "TRASH_STATE" }, \
- { KGSL_CONTEXT_CTX_SWITCH, "CTX_SWITCH" }, \
- { KGSL_CONTEXT_PER_CONTEXT_TS, "PER_CONTEXT_TS" }, \
- { KGSL_CONTEXT_USER_GENERATED_TS, "USER_TS" }, \
- { KGSL_CONTEXT_NO_FAULT_TOLERANCE, "NO_FT" }, \
- { KGSL_CONTEXT_INVALIDATE_ON_FAULT, "INVALIDATE_ON_FAULT" }, \
- { KGSL_CONTEXT_PWR_CONSTRAINT, "PWR" }, \
- { KGSL_CONTEXT_SAVE_GMEM, "SAVE_GMEM" }, \
- { KGSL_CONTEXT_IFH_NOP, "IFH_NOP" }, \
- { KGSL_CONTEXT_SECURE, "SECURE" }, \
- { KGSL_CONTEXT_LPAC, "LPAC" }, \
- { KGSL_CONTEXT_NO_SNAPSHOT, "NO_SNAPSHOT" }
- #define KGSL_CONTEXT_ID(_context) \
- ((_context != NULL) ? (_context)->id : KGSL_MEMSTORE_GLOBAL)
- struct kgsl_device;
- struct platform_device;
- struct kgsl_device_private;
- struct kgsl_context;
- struct kgsl_power_stats;
- struct kgsl_event;
- struct kgsl_snapshot;
- struct kgsl_sync_fence;
- struct kgsl_functable {
-
- int (*suspend_context)(struct kgsl_device *device);
- int (*first_open)(struct kgsl_device *device);
- int (*last_close)(struct kgsl_device *device);
- int (*start)(struct kgsl_device *device, int priority);
- int (*stop)(struct kgsl_device *device);
- int (*getproperty)(struct kgsl_device *device,
- struct kgsl_device_getproperty *param);
- int (*getproperty_compat)(struct kgsl_device *device,
- struct kgsl_device_getproperty *param);
- int (*waittimestamp)(struct kgsl_device *device,
- struct kgsl_context *context, unsigned int timestamp,
- unsigned int msecs);
- int (*readtimestamp)(struct kgsl_device *device, void *priv,
- enum kgsl_timestamp_type type, unsigned int *timestamp);
- int (*queue_cmds)(struct kgsl_device_private *dev_priv,
- struct kgsl_context *context, struct kgsl_drawobj *drawobj[],
- uint32_t count, uint32_t *timestamp);
- void (*power_stats)(struct kgsl_device *device,
- struct kgsl_power_stats *stats);
- void (*snapshot)(struct kgsl_device *device,
- struct kgsl_snapshot *snapshot, struct kgsl_context *context,
- struct kgsl_context *context_lpac);
-
- int (*drain_and_idle)(struct kgsl_device *device);
- struct kgsl_device_private * (*device_private_create)(void);
- void (*device_private_destroy)(struct kgsl_device_private *dev_priv);
-
- struct kgsl_context *(*drawctxt_create)
- (struct kgsl_device_private *dev_priv,
- uint32_t *flags);
- void (*drawctxt_detach)(struct kgsl_context *context);
- void (*drawctxt_destroy)(struct kgsl_context *context);
- void (*drawctxt_dump)(struct kgsl_device *device,
- struct kgsl_context *context);
- long (*ioctl)(struct kgsl_device_private *dev_priv,
- unsigned int cmd, unsigned long arg);
- long (*compat_ioctl)(struct kgsl_device_private *dev_priv,
- unsigned int cmd, unsigned long arg);
- int (*setproperty)(struct kgsl_device_private *dev_priv,
- unsigned int type, void __user *value,
- unsigned int sizebytes);
- int (*setproperty_compat)(struct kgsl_device_private *dev_priv,
- unsigned int type, void __user *value,
- unsigned int sizebytes);
- void (*drawctxt_sched)(struct kgsl_device *device,
- struct kgsl_context *context);
- void (*resume)(struct kgsl_device *device);
- int (*regulator_enable)(struct kgsl_device *device);
- bool (*is_hw_collapsible)(struct kgsl_device *device);
- void (*regulator_disable)(struct kgsl_device *device);
- void (*pwrlevel_change_settings)(struct kgsl_device *device,
- unsigned int prelevel, unsigned int postlevel, bool post);
-
- int (*query_property_list)(struct kgsl_device *device, u32 *list,
- u32 count);
- bool (*is_hwcg_on)(struct kgsl_device *device);
-
- int (*gpu_clock_set)(struct kgsl_device *device, u32 pwrlevel);
-
- int (*gpu_bus_set)(struct kgsl_device *device, int bus_level, u32 ab);
- void (*deassert_gbif_halt)(struct kgsl_device *device);
-
- int (*queue_recurring_cmd)(struct kgsl_device_private *dev_priv,
- struct kgsl_context *context, struct kgsl_drawobj *drawobj);
-
- int (*dequeue_recurring_cmd)(struct kgsl_device *device,
- struct kgsl_context *context);
-
- void (*set_isdb_breakpoint_registers)(struct kgsl_device *device);
-
- void (*create_hw_fence)(struct kgsl_device *device, struct kgsl_sync_fence *kfence);
- };
- struct kgsl_ioctl {
- unsigned int cmd;
- long (*func)(struct kgsl_device_private *dev_priv,
- unsigned int cmd, void *data);
- };
- long kgsl_ioctl_helper(struct file *filep, unsigned int cmd, unsigned long arg,
- const struct kgsl_ioctl *cmds, int len);
- #define MEMOBJ_SKIP BIT(1)
- struct kgsl_memobj_node {
- struct list_head node;
- unsigned int id;
- uint64_t offset;
- uint64_t gpuaddr;
- uint64_t size;
- unsigned long flags;
- unsigned long priv;
- };
- struct kgsl_device {
- struct device *dev;
- const char *name;
- u32 id;
-
- void __iomem *shader_mem_virt;
-
- void __iomem *qdss_gfx_virt;
- struct kgsl_memdesc *memstore;
- struct kgsl_memdesc *scratch;
- struct kgsl_mmu mmu;
- struct gmu_core_device gmu_core;
- struct completion hwaccess_gate;
- struct completion halt_gate;
- const struct kgsl_functable *ftbl;
- struct work_struct idle_check_ws;
- struct timer_list idle_timer;
- struct kgsl_pwrctrl pwrctrl;
- int open_count;
-
- uint32_t submit_now;
- spinlock_t submit_lock;
-
- bool skip_inline_submit;
- struct mutex mutex;
- uint32_t state;
- uint32_t requested_state;
- atomic_t active_cnt;
-
- atomic64_t total_mapped;
- wait_queue_head_t active_cnt_wq;
- struct platform_device *pdev;
- struct dentry *d_debugfs;
- struct idr context_idr;
- rwlock_t context_lock;
- struct {
- void *ptr;
- dma_addr_t dma_handle;
- u32 size;
- } snapshot_memory;
- struct kgsl_snapshot *snapshot;
-
- struct notifier_block panic_nb;
- struct {
- void *ptr;
- u32 size;
- } snapshot_memory_atomic;
- u32 snapshot_faultcount;
- bool force_panic;
- bool skip_ib_capture;
- bool prioritize_unrecoverable;
- bool set_isdb_breakpoint;
- bool snapshot_atomic;
-
- bool snapshot_crashdumper;
-
- bool snapshot_legacy;
-
- u64 snapshot_ctxt_record_size;
- struct kobject snapshot_kobj;
- struct kgsl_pwrscale pwrscale;
- int reset_counter;
- struct kthread_worker *events_worker;
-
- int active_context_count;
- struct kobject gpu_sysfs_kobj;
- unsigned int l3_freq[3];
- unsigned int num_l3_pwrlevels;
-
- unsigned int cur_l3_pwrlevel;
-
- struct list_head globals;
-
- unsigned long *global_map;
-
- struct kgsl_memdesc *qdss_desc;
-
- struct kgsl_memdesc *qtimer_desc;
-
- struct list_head event_groups;
-
- rwlock_t event_groups_lock;
-
- u32 speed_bin;
-
- u32 soc_code;
-
- bool gmu_fault;
-
- struct kgsl_regmap regmap;
-
- struct idr timelines;
-
- spinlock_t timelines_lock;
-
- struct trace_array *fence_trace_array;
-
- bool l3_vote;
-
- bool pdev_loaded;
-
- struct srcu_notifier_head nh;
-
- struct kobject bcl_data_kobj;
-
- struct timer_list work_period_timer;
-
- spinlock_t work_period_lock;
-
- struct work_struct work_period_ws;
-
- unsigned long flags;
- struct {
- u64 begin;
- u64 end;
- } gpu_period;
-
- unsigned long idle_jiffies;
-
- bool dump_all_ibs;
-
- struct reset_control *freq_limiter_irq_clear;
-
- int freq_limiter_intr_num;
-
- int cx_host_irq_num;
- };
- #define KGSL_MMU_DEVICE(_mmu) \
- container_of((_mmu), struct kgsl_device, mmu)
- enum kgsl_context_priv {
- KGSL_CONTEXT_PRIV_SUBMITTED = 0,
- KGSL_CONTEXT_PRIV_DETACHED,
- KGSL_CONTEXT_PRIV_INVALID,
- KGSL_CONTEXT_PRIV_PAGEFAULT,
- KGSL_CONTEXT_PRIV_DEVICE_SPECIFIC = 16,
- };
- struct kgsl_process_private;
- #define KGSL_MAX_FAULT_ENTRIES 40
- #define KGSL_MAX_FAULT_TIME_THRESHOLD 5000
- struct kgsl_fault_node {
- struct list_head node;
- u32 type;
- void *priv;
- ktime_t time;
- };
- struct kgsl_context {
- struct kref refcount;
- uint32_t id;
- uint32_t priority;
- pid_t tid;
- struct kgsl_device_private *dev_priv;
- struct kgsl_process_private *proc_priv;
- unsigned long priv;
- struct kgsl_device *device;
- unsigned int reset_status;
- struct kgsl_sync_timeline *ktimeline;
- struct kgsl_event_group events;
- unsigned int flags;
- struct kgsl_pwr_constraint pwr_constraint;
- struct kgsl_pwr_constraint l3_pwr_constraint;
- unsigned int fault_count;
- ktime_t fault_time;
- struct kgsl_mem_entry *user_ctxt_record;
- unsigned int total_fault_count;
- unsigned int last_faulted_cmd_ts;
- bool gmu_registered;
-
- u32 gmu_dispatch_queue;
-
- struct list_head faults;
-
- struct mutex fault_lock;
- };
- #define _context_comm(_c) \
- (((_c) && (_c)->proc_priv) ? (_c)->proc_priv->comm : "unknown")
- #define pr_context(_d, _c, fmt, args...) \
- dev_err((_d)->dev, "%s[%d]: " fmt, \
- _context_comm((_c)), \
- pid_nr((_c)->proc_priv->pid), ##args)
- struct kgsl_process_private {
- unsigned long priv;
- struct pid *pid;
- char comm[TASK_COMM_LEN];
- spinlock_t mem_lock;
- struct kref refcount;
- struct idr mem_idr;
- struct kgsl_pagetable *pagetable;
- struct list_head list;
- struct list_head reclaim_list;
- struct kobject kobj;
- struct dentry *debug_root;
- struct {
- atomic64_t cur;
- uint64_t max;
- } stats[KGSL_MEM_ENTRY_MAX];
- atomic64_t gpumem_mapped;
- struct idr syncsource_idr;
- spinlock_t syncsource_lock;
- int fd_count;
- atomic_t ctxt_count;
- spinlock_t ctxt_count_lock;
- atomic64_t frame_count;
-
- unsigned long state;
-
- atomic_t unpinned_page_count;
-
- struct work_struct fg_work;
-
- struct mutex reclaim_lock;
-
- struct gpu_work_period *period;
-
- atomic_t cmd_count;
-
- struct kobject kobj_memtype;
-
- struct mutex private_mutex;
-
- char *cmdline;
- };
- struct kgsl_device_private {
- struct kgsl_device *device;
- struct kgsl_process_private *process_priv;
- };
- struct kgsl_snapshot {
- uint64_t ib1base;
- uint64_t ib2base;
- unsigned int ib1size;
- unsigned int ib2size;
- bool ib1dumped;
- bool ib2dumped;
- u64 ib1base_lpac;
- u64 ib2base_lpac;
- u32 ib1size_lpac;
- u32 ib2size_lpac;
- bool ib1dumped_lpac;
- bool ib2dumped_lpac;
- u8 *start;
- size_t size;
- u8 *ptr;
- size_t remain;
- unsigned long timestamp;
- u8 *mempool;
- size_t mempool_size;
- struct list_head obj_list;
- struct list_head cp_list;
- struct work_struct work;
- struct completion dump_gate;
- struct kgsl_process_private *process;
- struct kgsl_process_private *process_lpac;
- unsigned int sysfs_read;
- bool first_read;
- bool recovered;
- struct kgsl_device *device;
- };
- struct kgsl_snapshot_object {
- uint64_t gpuaddr;
- uint64_t size;
- uint64_t offset;
- int type;
- struct kgsl_mem_entry *entry;
- struct list_head node;
- };
- struct kgsl_device *kgsl_get_device(int dev_idx);
- static inline void kgsl_regread(struct kgsl_device *device,
- unsigned int offsetwords,
- unsigned int *value)
- {
- *value = kgsl_regmap_read(&device->regmap, offsetwords);
- }
- static inline void kgsl_regread64(struct kgsl_device *device,
- u32 offsetwords_lo, u32 offsetwords_hi,
- u64 *value)
- {
- u32 val_lo = 0, val_hi = 0;
- val_lo = kgsl_regmap_read(&device->regmap, offsetwords_lo);
- val_hi = kgsl_regmap_read(&device->regmap, offsetwords_hi);
- *value = (((u64)val_hi << 32) | val_lo);
- }
- static inline void kgsl_regwrite(struct kgsl_device *device,
- unsigned int offsetwords,
- unsigned int value)
- {
- kgsl_regmap_write(&device->regmap, value, offsetwords);
- }
- static inline void kgsl_regrmw(struct kgsl_device *device,
- unsigned int offsetwords,
- unsigned int mask, unsigned int bits)
- {
- kgsl_regmap_rmw(&device->regmap, offsetwords, mask, bits);
- }
- static inline bool kgsl_state_is_awake(struct kgsl_device *device)
- {
- return (device->state == KGSL_STATE_ACTIVE ||
- device->state == KGSL_STATE_AWARE);
- }
- static inline void kgsl_start_idle_timer(struct kgsl_device *device)
- {
- device->idle_jiffies = jiffies + msecs_to_jiffies(device->pwrctrl.interval_timeout);
- mod_timer(&device->idle_timer, device->idle_jiffies);
- }
- int kgsl_readtimestamp(struct kgsl_device *device, void *priv,
- enum kgsl_timestamp_type type, unsigned int *timestamp);
- bool kgsl_check_timestamp(struct kgsl_device *device,
- struct kgsl_context *context, unsigned int timestamp);
- int kgsl_device_platform_probe(struct kgsl_device *device);
- void kgsl_device_platform_remove(struct kgsl_device *device);
- const char *kgsl_pwrstate_to_str(unsigned int state);
- void kgsl_device_snapshot_probe(struct kgsl_device *device, u32 size);
- void kgsl_device_snapshot(struct kgsl_device *device,
- struct kgsl_context *context, struct kgsl_context *context_lpac,
- bool gmu_fault);
- void kgsl_device_snapshot_close(struct kgsl_device *device);
- void kgsl_events_init(void);
- void kgsl_events_exit(void);
- void kgsl_device_events_probe(struct kgsl_device *device);
- void kgsl_device_events_remove(struct kgsl_device *device);
- void kgsl_context_detach(struct kgsl_context *context);
- void kgsl_del_event_group(struct kgsl_device *device,
- struct kgsl_event_group *group);
- void kgsl_add_event_group(struct kgsl_device *device,
- struct kgsl_event_group *group,
- struct kgsl_context *context, readtimestamp_func readtimestamp,
- void *priv, const char *fmt, ...);
- void kgsl_cancel_events_timestamp(struct kgsl_device *device,
- struct kgsl_event_group *group, unsigned int timestamp);
- void kgsl_cancel_events(struct kgsl_device *device,
- struct kgsl_event_group *group);
- void kgsl_cancel_event(struct kgsl_device *device,
- struct kgsl_event_group *group, unsigned int timestamp,
- kgsl_event_func func, void *priv);
- bool kgsl_event_pending(struct kgsl_device *device,
- struct kgsl_event_group *group, unsigned int timestamp,
- kgsl_event_func func, void *priv);
- int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
- unsigned int timestamp, kgsl_event_func func, void *priv);
- void kgsl_process_event_group(struct kgsl_device *device,
- struct kgsl_event_group *group);
- void kgsl_flush_event_group(struct kgsl_device *device,
- struct kgsl_event_group *group);
- void kgsl_process_event_groups(struct kgsl_device *device);
- void kgsl_context_destroy(struct kref *kref);
- int kgsl_context_init(struct kgsl_device_private *dev_priv,
- struct kgsl_context *context);
- void kgsl_context_dump(struct kgsl_context *context);
- int kgsl_memfree_find_entry(pid_t ptname, uint64_t *gpuaddr,
- uint64_t *size, uint64_t *flags, pid_t *pid);
- long kgsl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
- long kgsl_ioctl_copy_in(unsigned int kernel_cmd, unsigned int user_cmd,
- unsigned long arg, unsigned char *ptr);
- long kgsl_ioctl_copy_out(unsigned int kernel_cmd, unsigned int user_cmd,
- unsigned long arg, unsigned char *ptr);
- const char *kgsl_context_type(int type);
- static inline void
- kgsl_context_put(struct kgsl_context *context)
- {
- if (context)
- kref_put(&context->refcount, kgsl_context_destroy);
- }
- static inline bool kgsl_context_detached(struct kgsl_context *context)
- {
- return (context == NULL || test_bit(KGSL_CONTEXT_PRIV_DETACHED,
- &context->priv));
- }
- static inline bool kgsl_context_invalid(struct kgsl_context *context)
- {
- return (context == NULL || test_bit(KGSL_CONTEXT_PRIV_INVALID,
- &context->priv));
- }
- static inline bool kgsl_context_is_bad(struct kgsl_context *context)
- {
- return (kgsl_context_detached(context) ||
- kgsl_context_invalid(context));
- }
- static inline int kgsl_check_context_state(struct kgsl_context *context)
- {
- if (kgsl_context_invalid(context))
- return -EDEADLK;
- if (kgsl_context_detached(context))
- return -ENOENT;
- return 0;
- }
- static inline struct kgsl_context *kgsl_context_get(struct kgsl_device *device,
- uint32_t id)
- {
- int result = 0;
- struct kgsl_context *context = NULL;
- read_lock(&device->context_lock);
- context = idr_find(&device->context_idr, id);
-
- if (kgsl_context_detached(context))
- context = NULL;
- else
- result = kref_get_unless_zero(&context->refcount);
- read_unlock(&device->context_lock);
- if (!result)
- return NULL;
- return context;
- }
- static inline int _kgsl_context_get(struct kgsl_context *context)
- {
- int ret = 0;
- if (context)
- ret = kref_get_unless_zero(&context->refcount);
- return ret;
- }
- static inline struct kgsl_context *kgsl_context_get_owner(
- struct kgsl_device_private *dev_priv, uint32_t id)
- {
- struct kgsl_context *context;
- context = kgsl_context_get(dev_priv->device, id);
-
- if (context != NULL && context->dev_priv != dev_priv) {
- kgsl_context_put(context);
- return NULL;
- }
- return context;
- }
- static inline int kgsl_process_private_get(struct kgsl_process_private *process)
- {
- if (process != NULL)
- return kref_get_unless_zero(&process->refcount);
- return 0;
- }
- void kgsl_process_private_put(struct kgsl_process_private *private);
- struct kgsl_process_private *kgsl_process_private_find(pid_t pid);
- #define SNAPSHOT_ERR_NOMEM(_d, _s) \
- dev_err_ratelimited((_d)->dev, \
- "snapshot: not enough snapshot memory for section %s\n", (_s))
- struct kgsl_snapshot_registers {
- const unsigned int *regs;
- unsigned int count;
- };
- size_t kgsl_snapshot_dump_registers(struct kgsl_device *device, u8 *buf,
- size_t remain, void *priv);
- void kgsl_snapshot_indexed_registers(struct kgsl_device *device,
- struct kgsl_snapshot *snapshot, unsigned int index,
- unsigned int data, unsigned int start, unsigned int count);
- void kgsl_snapshot_indexed_registers_v2(struct kgsl_device *device,
- struct kgsl_snapshot *snapshot, u32 index, u32 data,
- u32 start, u32 count, u32 pipe_id, u32 slice_id);
- int kgsl_snapshot_get_object(struct kgsl_snapshot *snapshot,
- struct kgsl_process_private *process, uint64_t gpuaddr,
- uint64_t size, unsigned int type);
- int kgsl_snapshot_have_object(struct kgsl_snapshot *snapshot,
- struct kgsl_process_private *process,
- uint64_t gpuaddr, uint64_t size);
- struct adreno_ib_object_list;
- int kgsl_snapshot_add_ib_obj_list(struct kgsl_snapshot *snapshot,
- struct adreno_ib_object_list *ib_obj_list);
- void kgsl_snapshot_add_section(struct kgsl_device *device, u16 id,
- struct kgsl_snapshot *snapshot,
- size_t (*func)(struct kgsl_device *, u8 *, size_t, void *),
- void *priv);
- int kgsl_of_property_read_ddrtype(struct device_node *node, const char *base,
- u32 *ptr);
- int kgsl_query_property_list(struct kgsl_device *device, u32 *list, u32 count);
- static inline bool kgsl_mmu_has_feature(struct kgsl_device *device,
- enum kgsl_mmu_feature feature)
- {
- return test_bit(feature, &device->mmu.features);
- }
- static inline void kgsl_mmu_set_feature(struct kgsl_device *device,
- enum kgsl_mmu_feature feature)
- {
- set_bit(feature, &device->mmu.features);
- }
- int kgsl_add_fault(struct kgsl_context *context, u32 type, void *priv);
- void kgsl_free_faults(struct kgsl_context *context);
- #ifdef CONFIG_TRACE_GPU_MEM
- static inline void kgsl_trace_gpu_mem_total(struct kgsl_device *device,
- s64 delta)
- {
- u64 total_size;
- total_size = atomic64_add_return(delta, &device->total_mapped);
- trace_gpu_mem_total(0, 0, total_size);
- }
- #else
- static inline void kgsl_trace_gpu_mem_total(struct kgsl_device *device,
- s64 delta) {}
- #endif
- static inline bool kgsl_context_is_lpac(struct kgsl_context *context)
- {
- if (context == NULL)
- return false;
- return (context->flags & KGSL_CONTEXT_LPAC) ? true : false;
- }
- #endif
|