Error Trace

[Home]

Bug # 137

Show/hide error trace
Error trace
Function bodies
Blocks
  • Others...
    Function bodies without model function calls
    Initialization function calls
    Initialization function bodies
    Entry point
    Entry point body
    Function calls
    Skipped function calls
    Formal parameter names
    Declarations
    Assumes
    Assume conditions
    Returns
    Return values
    DEG initialization
    DEG function calls
    Model function calls
    Model function bodies
    Model asserts
    Model state changes
    Model function function calls
    Model function function bodies
    Model returns
    Model others
    Identation
    Line numbers
    Expand signs
-__CPAchecker_initialize()
{
20 typedef unsigned char __u8;
23 typedef unsigned short __u16;
25 typedef int __s32;
26 typedef unsigned int __u32;
30 typedef unsigned long long __u64;
15 typedef signed char s8;
16 typedef unsigned char u8;
19 typedef unsigned short u16;
21 typedef int s32;
22 typedef unsigned int u32;
24 typedef long long s64;
25 typedef unsigned long long u64;
14 typedef long __kernel_long_t;
15 typedef unsigned long __kernel_ulong_t;
27 typedef int __kernel_pid_t;
40 typedef __kernel_long_t __kernel_suseconds_t;
48 typedef unsigned int __kernel_uid32_t;
49 typedef unsigned int __kernel_gid32_t;
71 typedef __kernel_ulong_t __kernel_size_t;
72 typedef __kernel_long_t __kernel_ssize_t;
87 typedef long long __kernel_loff_t;
88 typedef __kernel_long_t __kernel_time_t;
89 typedef __kernel_long_t __kernel_clock_t;
90 typedef int __kernel_timer_t;
91 typedef int __kernel_clockid_t;
259 struct kernel_symbol { unsigned long value; const char *name; } ;
33 struct module ;
12 typedef __u32 __kernel_dev_t;
15 typedef __kernel_dev_t dev_t;
18 typedef unsigned short umode_t;
21 typedef __kernel_pid_t pid_t;
26 typedef __kernel_clockid_t clockid_t;
29 typedef _Bool bool;
31 typedef __kernel_uid32_t uid_t;
32 typedef __kernel_gid32_t gid_t;
45 typedef __kernel_loff_t loff_t;
54 typedef __kernel_size_t size_t;
59 typedef __kernel_ssize_t ssize_t;
69 typedef __kernel_time_t time_t;
102 typedef __s32 int32_t;
106 typedef __u8 uint8_t;
107 typedef __u16 uint16_t;
108 typedef __u32 uint32_t;
111 typedef __u64 uint64_t;
133 typedef unsigned long sector_t;
134 typedef unsigned long blkcnt_t;
152 typedef u64 dma_addr_t;
157 typedef unsigned int gfp_t;
158 typedef unsigned int fmode_t;
161 typedef u64 phys_addr_t;
166 typedef phys_addr_t resource_size_t;
176 struct __anonstruct_atomic_t_6 { int counter; } ;
176 typedef struct __anonstruct_atomic_t_6 atomic_t;
181 struct __anonstruct_atomic64_t_7 { long counter; } ;
181 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
182 struct list_head { struct list_head *next; struct list_head *prev; } ;
187 struct hlist_node ;
187 struct hlist_head { struct hlist_node *first; } ;
191 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
202 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
131 typedef void (*ctor_fn_t)();
48 struct device ;
432 struct file_operations ;
444 struct completion ;
445 struct pt_regs ;
21 struct kernel_param ;
26 struct kernel_param_ops { unsigned int flags; int (*set)(const char *, const struct kernel_param *); int (*get)(char *, const struct kernel_param *); void (*free)(void *); } ;
62 struct kparam_string ;
62 struct kparam_array ;
62 union __anonunion____missing_field_name_8 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
62 struct kernel_param { const char *name; struct module *mod; const struct kernel_param_ops *ops; const u16 perm; s8 level; u8 flags; union __anonunion____missing_field_name_8 __annonCompField4; } ;
83 struct kparam_string { unsigned int maxlen; char *string; } ;
89 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
27 union __anonunion___u_10 { struct list_head *__val; char __c[1U]; } ;
189 union __anonunion___u_14 { struct list_head *__val; char __c[1U]; } ;
693 enum chipset_type { NOT_SUPPORTED = 0, SUPPORTED = 1 } ;
698 struct agp_version { u16 major; u16 minor; } ;
44 struct pci_dev ;
44 struct vm_operations_struct ;
44 struct agp_kern_info { struct agp_version version; struct pci_dev *device; enum chipset_type chipset; unsigned long mode; unsigned long aper_base; size_t aper_size; int max_memory; int current_memory; bool cant_use_aperture; unsigned long page_mask; const struct vm_operations_struct *vm_ops; } ;
58 struct agp_bridge_data ;
59 struct page ;
59 struct scatterlist ;
555 struct task_struct ;
20 struct qspinlock { atomic_t val; } ;
33 typedef struct qspinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t wait_lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
15 struct lockdep_map ;
26 union __anonunion___u_26 { int __val; char __c[1U]; } ;
23 typedef atomic64_t atomic_long_t;
186 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
28 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 struct lock_class { struct hlist_node hash_entry; struct list_head lock_entry; struct lockdep_subclass_key *key; unsigned int subclass; unsigned int dep_gen_id; unsigned long usage_mask; struct stack_trace usage_traces[13U]; struct list_head locks_after; struct list_head locks_before; unsigned int version; unsigned long ops; const char *name; int name_version; unsigned long contention_point[4U]; unsigned long contending_point[4U]; } ;
144 struct lockdep_map { struct lock_class_key *key; struct lock_class *class_cache[2U]; const char *name; int cpu; unsigned long ip; } ;
207 struct held_lock { u64 prev_chain_key; unsigned long acquire_ip; struct lockdep_map *instance; struct lockdep_map *nest_lock; u64 waittime_stamp; u64 holdtime_stamp; unsigned short class_idx; unsigned char irq_context; unsigned char trylock; unsigned char read; unsigned char check; unsigned char hardirqs_off; unsigned short references; unsigned int pin_count; } ;
572 struct raw_spinlock { arch_spinlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
32 typedef struct raw_spinlock raw_spinlock_t;
33 struct __anonstruct____missing_field_name_38 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion____missing_field_name_37 { struct raw_spinlock rlock; struct __anonstruct____missing_field_name_38 __annonCompField5; } ;
33 struct spinlock { union __anonunion____missing_field_name_37 __annonCompField6; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_39 { arch_rwlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
23 typedef struct __anonstruct_rwlock_t_39 rwlock_t;
23 struct mm_struct ;
72 struct pt_regs { unsigned long r15; unsigned long r14; unsigned long r13; unsigned long r12; unsigned long bp; unsigned long bx; unsigned long r11; unsigned long r10; unsigned long r9; unsigned long r8; unsigned long ax; unsigned long cx; unsigned long dx; unsigned long si; unsigned long di; unsigned long orig_ax; unsigned long ip; unsigned long cs; unsigned long flags; unsigned long sp; unsigned long ss; } ;
66 struct __anonstruct____missing_field_name_41 { unsigned int a; unsigned int b; } ;
66 struct __anonstruct____missing_field_name_42 { u16 limit0; u16 base0; unsigned char base1; unsigned char type; unsigned char s; unsigned char dpl; unsigned char p; unsigned char limit; unsigned char avl; unsigned char l; unsigned char d; unsigned char g; unsigned char base2; } ;
66 union __anonunion____missing_field_name_40 { struct __anonstruct____missing_field_name_41 __annonCompField7; struct __anonstruct____missing_field_name_42 __annonCompField8; } ;
66 struct desc_struct { union __anonunion____missing_field_name_40 __annonCompField9; } ;
12 typedef unsigned long pteval_t;
13 typedef unsigned long pmdval_t;
15 typedef unsigned long pgdval_t;
16 typedef unsigned long pgprotval_t;
18 struct __anonstruct_pte_t_43 { pteval_t pte; } ;
18 typedef struct __anonstruct_pte_t_43 pte_t;
20 struct pgprot { pgprotval_t pgprot; } ;
250 typedef struct pgprot pgprot_t;
252 struct __anonstruct_pgd_t_44 { pgdval_t pgd; } ;
252 typedef struct __anonstruct_pgd_t_44 pgd_t;
291 struct __anonstruct_pmd_t_46 { pmdval_t pmd; } ;
291 typedef struct __anonstruct_pmd_t_46 pmd_t;
417 typedef struct page *pgtable_t;
428 struct file ;
441 struct seq_file ;
479 struct thread_struct ;
481 struct cpumask ;
253 struct math_emu_info { long ___orig_eip; struct pt_regs *regs; } ;
338 struct cpumask { unsigned long bits[128U]; } ;
15 typedef struct cpumask cpumask_t;
654 typedef struct cpumask *cpumask_var_t;
82 struct static_key { atomic_t enabled; } ;
22 struct tracepoint_func { void *func; void *data; int prio; } ;
28 struct tracepoint { const char *name; struct static_key key; void (*regfunc)(); void (*unregfunc)(); struct tracepoint_func *funcs; } ;
298 struct fregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
26 struct __anonstruct____missing_field_name_59 { u64 rip; u64 rdp; } ;
26 struct __anonstruct____missing_field_name_60 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
26 union __anonunion____missing_field_name_58 { struct __anonstruct____missing_field_name_59 __annonCompField15; struct __anonstruct____missing_field_name_60 __annonCompField16; } ;
26 union __anonunion____missing_field_name_61 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
26 struct fxregs_state { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion____missing_field_name_58 __annonCompField17; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion____missing_field_name_61 __annonCompField18; } ;
66 struct swregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u8 ftop; u8 changed; u8 lookahead; u8 no_update; u8 rm; u8 alimit; struct math_emu_info *info; u32 entry_eip; } ;
226 struct xstate_header { u64 xfeatures; u64 xcomp_bv; u64 reserved[6U]; } ;
232 struct xregs_state { struct fxregs_state i387; struct xstate_header header; u8 extended_state_area[0U]; } ;
247 union fpregs_state { struct fregs_state fsave; struct fxregs_state fxsave; struct swregs_state soft; struct xregs_state xsave; u8 __padding[4096U]; } ;
264 struct fpu { unsigned int last_cpu; unsigned char fpstate_active; unsigned char fpregs_active; unsigned char counter; union fpregs_state state; } ;
169 struct seq_operations ;
371 struct perf_event ;
372 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; unsigned long fsbase; unsigned long gsbase; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; struct fpu fpu; } ;
13 struct optimistic_spin_queue { atomic_t tail; } ;
39 struct mutex { atomic_t count; spinlock_t wait_lock; struct list_head wait_list; struct task_struct *owner; void *magic; struct lockdep_map dep_map; } ;
67 struct mutex_waiter { struct list_head list; struct task_struct *task; void *magic; } ;
177 struct timespec ;
178 struct compat_timespec ;
179 struct __anonstruct_futex_75 { u32 *uaddr; u32 val; u32 flags; u32 bitset; u64 time; u32 *uaddr2; } ;
179 struct __anonstruct_nanosleep_76 { clockid_t clockid; struct timespec *rmtp; struct compat_timespec *compat_rmtp; u64 expires; } ;
179 struct pollfd ;
179 struct __anonstruct_poll_77 { struct pollfd *ufds; int nfds; int has_timeout; unsigned long tv_sec; unsigned long tv_nsec; } ;
179 union __anonunion____missing_field_name_74 { struct __anonstruct_futex_75 futex; struct __anonstruct_nanosleep_76 nanosleep; struct __anonstruct_poll_77 poll; } ;
179 struct restart_block { long int (*fn)(struct restart_block *); union __anonunion____missing_field_name_74 __annonCompField21; } ;
416 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
52 typedef struct seqcount seqcount_t;
404 struct __anonstruct_seqlock_t_90 { struct seqcount seqcount; spinlock_t lock; } ;
404 typedef struct __anonstruct_seqlock_t_90 seqlock_t;
38 struct __wait_queue_head { spinlock_t lock; struct list_head task_list; } ;
43 typedef struct __wait_queue_head wait_queue_head_t;
1221 struct completion { unsigned int done; wait_queue_head_t wait; } ;
108 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
13 struct timeval { __kernel_time_t tv_sec; __kernel_suseconds_t tv_usec; } ;
446 union ktime { s64 tv64; } ;
41 typedef union ktime ktime_t;
1128 union __anonunion____missing_field_name_91 { unsigned long bitmap[4U]; struct callback_head callback_head; } ;
1128 struct idr_layer { int prefix; int layer; struct idr_layer *ary[256U]; int count; union __anonunion____missing_field_name_91 __annonCompField22; } ;
41 struct idr { struct idr_layer *hint; struct idr_layer *top; int layers; int cur; spinlock_t lock; int id_free_cnt; struct idr_layer *id_free; } ;
124 struct ida_bitmap { long nr_busy; unsigned long bitmap[15U]; } ;
167 struct ida { struct idr idr; struct ida_bitmap *free_bitmap; } ;
199 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
41 struct rb_root { struct rb_node *rb_node; } ;
98 struct dentry ;
99 struct iattr ;
100 struct vm_area_struct ;
101 struct super_block ;
102 struct file_system_type ;
103 struct kernfs_open_node ;
104 struct kernfs_iattrs ;
127 struct kernfs_root ;
127 struct kernfs_elem_dir { unsigned long subdirs; struct rb_root children; struct kernfs_root *root; } ;
85 struct kernfs_node ;
85 struct kernfs_elem_symlink { struct kernfs_node *target_kn; } ;
89 struct kernfs_ops ;
89 struct kernfs_elem_attr { const struct kernfs_ops *ops; struct kernfs_open_node *open; loff_t size; struct kernfs_node *notify_next; } ;
96 union __anonunion____missing_field_name_98 { struct kernfs_elem_dir dir; struct kernfs_elem_symlink symlink; struct kernfs_elem_attr attr; } ;
96 struct kernfs_node { atomic_t count; atomic_t active; struct lockdep_map dep_map; struct kernfs_node *parent; const char *name; struct rb_node rb; const void *ns; unsigned int hash; union __anonunion____missing_field_name_98 __annonCompField23; void *priv; unsigned short flags; umode_t mode; unsigned int ino; struct kernfs_iattrs *iattr; } ;
138 struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root *, int *, char *); int (*show_options)(struct seq_file *, struct kernfs_root *); int (*mkdir)(struct kernfs_node *, const char *, umode_t ); int (*rmdir)(struct kernfs_node *); int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); int (*show_path)(struct seq_file *, struct kernfs_node *, struct kernfs_root *); } ;
157 struct kernfs_root { struct kernfs_node *kn; unsigned int flags; struct ida ino_ida; struct kernfs_syscall_ops *syscall_ops; struct list_head supers; wait_queue_head_t deactivate_waitq; } ;
173 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; void *priv; struct mutex mutex; struct mutex prealloc_mutex; int event; struct list_head list; char *prealloc_buf; size_t atomic_write_len; bool mmapped; const struct vm_operations_struct *vm_ops; } ;
191 struct kernfs_ops { int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); ssize_t (*read)(struct kernfs_open_file *, char *, size_t , loff_t ); size_t atomic_write_len; bool prealloc; ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *); struct lock_class_key lockdep_key; } ;
288 struct inode ;
499 struct sock ;
500 struct kobject ;
501 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
507 struct kobj_ns_type_operations { enum kobj_ns_type type; bool (*current_may_mount)(); void * (*grab_current_ns)(); const void * (*netlink_ns)(struct sock *); const void * (*initial_ns)(); void (*drop_ns)(void *); } ;
83 struct user_namespace ;
22 struct __anonstruct_kuid_t_101 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_101 kuid_t;
27 struct __anonstruct_kgid_t_102 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_102 kgid_t;
139 struct kstat { u64 ino; dev_t dev; umode_t mode; unsigned int nlink; kuid_t uid; kgid_t gid; dev_t rdev; loff_t size; struct timespec atime; struct timespec mtime; struct timespec ctime; unsigned long blksize; unsigned long long blocks; } ;
36 struct bin_attribute ;
37 struct attribute { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
37 struct attribute_group { const char *name; umode_t (*is_visible)(struct kobject *, struct attribute *, int); umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
92 struct bin_attribute { struct attribute attr; size_t size; void *private; ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); } ;
165 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
530 struct kref { atomic_t refcount; } ;
139 struct timer_list { struct hlist_node entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; u32 flags; int slack; int start_pid; void *start_site; char start_comm[16U]; struct lockdep_map lockdep_map; } ;
240 struct hrtimer ;
241 enum hrtimer_restart ;
838 struct nsproxy ;
261 struct workqueue_struct ;
262 struct work_struct ;
54 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
107 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
52 struct kset ;
52 struct kobj_type ;
52 struct kobject { const char *name; struct list_head entry; struct kobject *parent; struct kset *kset; struct kobj_type *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned char state_initialized; unsigned char state_in_sysfs; unsigned char state_add_uevent_sent; unsigned char state_remove_uevent_sent; unsigned char uevent_suppress; } ;
115 struct kobj_type { void (*release)(struct kobject *); const struct sysfs_ops *sysfs_ops; struct attribute **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); const void * (*namespace)(struct kobject *); } ;
123 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
131 struct kset_uevent_ops { const int (*filter)(struct kset *, struct kobject *); const const char * (*name)(struct kset *, struct kobject *); const int (*uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); } ;
148 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
81 struct cdev { struct kobject kobj; struct module *owner; const struct file_operations *ops; struct list_head list; dev_t dev; unsigned int count; } ;
32 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; unsigned long desc; struct resource *parent; struct resource *sibling; struct resource *child; } ;
282 struct klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
97 struct __anonstruct_nodemask_t_105 { unsigned long bits[16U]; } ;
97 typedef struct __anonstruct_nodemask_t_105 nodemask_t;
93 struct hlist_bl_node ;
93 struct hlist_bl_head { struct hlist_bl_node *first; } ;
36 struct hlist_bl_node { struct hlist_bl_node *next; struct hlist_bl_node **pprev; } ;
114 struct __anonstruct____missing_field_name_133 { spinlock_t lock; int count; } ;
114 union __anonunion____missing_field_name_132 { struct __anonstruct____missing_field_name_133 __annonCompField26; } ;
114 struct lockref { union __anonunion____missing_field_name_132 __annonCompField27; } ;
75 struct path ;
76 struct vfsmount ;
77 struct __anonstruct____missing_field_name_135 { u32 hash; u32 len; } ;
77 union __anonunion____missing_field_name_134 { struct __anonstruct____missing_field_name_135 __annonCompField28; u64 hash_len; } ;
77 struct qstr { union __anonunion____missing_field_name_134 __annonCompField29; const unsigned char *name; } ;
65 struct dentry_operations ;
65 union __anonunion____missing_field_name_136 { struct list_head d_lru; wait_queue_head_t *d_wait; } ;
65 union __anonunion_d_u_137 { struct hlist_node d_alias; struct hlist_bl_node d_in_lookup_hash; struct callback_head d_rcu; } ;
65 struct dentry { unsigned int d_flags; seqcount_t d_seq; struct hlist_bl_node d_hash; struct dentry *d_parent; struct qstr d_name; struct inode *d_inode; unsigned char d_iname[32U]; struct lockref d_lockref; const struct dentry_operations *d_op; struct super_block *d_sb; unsigned long d_time; void *d_fsdata; union __anonunion____missing_field_name_136 __annonCompField30; struct list_head d_child; struct list_head d_subdirs; union __anonunion_d_u_137 d_u; } ;
121 struct dentry_operations { int (*d_revalidate)(struct dentry *, unsigned int); int (*d_weak_revalidate)(struct dentry *, unsigned int); int (*d_hash)(const struct dentry *, struct qstr *); int (*d_compare)(const struct dentry *, const struct dentry *, unsigned int, const char *, const struct qstr *); int (*d_delete)(const struct dentry *); void (*d_release)(struct dentry *); void (*d_prune)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); char * (*d_dname)(struct dentry *, char *, int); struct vfsmount * (*d_automount)(struct path *); int (*d_manage)(struct dentry *, bool ); struct inode * (*d_select_inode)(struct dentry *, unsigned int); struct dentry * (*d_real)(struct dentry *, struct inode *); } ;
577 struct path { struct vfsmount *mnt; struct dentry *dentry; } ;
19 struct mem_cgroup ;
19 struct shrink_control { gfp_t gfp_mask; unsigned long nr_to_scan; int nid; struct mem_cgroup *memcg; } ;
27 struct shrinker { unsigned long int (*count_objects)(struct shrinker *, struct shrink_control *); unsigned long int (*scan_objects)(struct shrinker *, struct shrink_control *); int seeks; long batch; unsigned long flags; struct list_head list; atomic_long_t *nr_deferred; } ;
80 struct list_lru_one { struct list_head list; long nr_items; } ;
32 struct list_lru_memcg { struct list_lru_one *lru[0U]; } ;
37 struct list_lru_node { spinlock_t lock; struct list_lru_one lru; struct list_lru_memcg *memcg_lrus; } ;
47 struct list_lru { struct list_lru_node *node; struct list_head list; } ;
189 struct llist_node ;
64 struct llist_node { struct llist_node *next; } ;
63 struct __anonstruct____missing_field_name_139 { struct radix_tree_node *parent; void *private_data; } ;
63 union __anonunion____missing_field_name_138 { struct __anonstruct____missing_field_name_139 __annonCompField31; struct callback_head callback_head; } ;
63 struct radix_tree_node { unsigned char shift; unsigned char offset; unsigned int count; union __anonunion____missing_field_name_138 __annonCompField32; struct list_head private_list; void *slots[64U]; unsigned long tags[3U][1U]; } ;
106 struct radix_tree_root { gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
521 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
528 struct pid_namespace ;
528 struct upid { int nr; struct pid_namespace *ns; struct hlist_node pid_chain; } ;
56 struct pid { atomic_t count; unsigned int level; struct hlist_head tasks[3U]; struct callback_head rcu; struct upid numbers[1U]; } ;
68 struct pid_link { struct hlist_node node; struct pid *pid; } ;
174 struct rw_semaphore ;
175 struct rw_semaphore { long count; struct list_head wait_list; raw_spinlock_t wait_lock; struct optimistic_spin_queue osq; struct task_struct *owner; struct lockdep_map dep_map; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
45 struct fiemap_extent { __u64 fe_logical; __u64 fe_physical; __u64 fe_length; __u64 fe_reserved64[2U]; __u32 fe_flags; __u32 fe_reserved[3U]; } ;
38 enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ;
58 struct pm_message { int event; } ;
64 typedef struct pm_message pm_message_t;
65 struct dev_pm_ops { int (*prepare)(struct device *); void (*complete)(struct device *); int (*suspend)(struct device *); int (*resume)(struct device *); int (*freeze)(struct device *); int (*thaw)(struct device *); int (*poweroff)(struct device *); int (*restore)(struct device *); int (*suspend_late)(struct device *); int (*resume_early)(struct device *); int (*freeze_late)(struct device *); int (*thaw_early)(struct device *); int (*poweroff_late)(struct device *); int (*restore_early)(struct device *); int (*suspend_noirq)(struct device *); int (*resume_noirq)(struct device *); int (*freeze_noirq)(struct device *); int (*thaw_noirq)(struct device *); int (*poweroff_noirq)(struct device *); int (*restore_noirq)(struct device *); int (*runtime_suspend)(struct device *); int (*runtime_resume)(struct device *); int (*runtime_idle)(struct device *); } ;
320 enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ;
327 enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ;
335 struct wakeup_source ;
336 struct wake_irq ;
337 struct pm_domain_data ;
338 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; struct pm_domain_data *domain_data; } ;
556 struct dev_pm_qos ;
556 struct dev_pm_info { pm_message_t power_state; unsigned char can_wakeup; unsigned char async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source *wakeup; bool wakeup_path; bool syscore; bool no_pm_callbacks; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; struct wake_irq *wakeirq; atomic_t usage_count; atomic_t child_count; unsigned char disable_depth; unsigned char idle_notification; unsigned char request_pending; unsigned char deferred_resume; unsigned char run_wake; unsigned char runtime_auto; bool ignore_children; unsigned char no_callbacks; unsigned char irq_safe; unsigned char use_autosuspend; unsigned char timer_autosuspends; unsigned char memalloc_noio; enum rpm_request request; enum rpm_status runtime_status; int runtime_error; int autosuspend_delay; unsigned long last_busy; unsigned long active_jiffies; unsigned long suspended_jiffies; unsigned long accounting_timestamp; struct pm_subsys_data *subsys_data; void (*set_latency_tolerance)(struct device *, s32 ); struct dev_pm_qos *qos; } ;
616 struct dev_pm_domain { struct dev_pm_ops ops; void (*detach)(struct device *, bool ); int (*activate)(struct device *); void (*sync)(struct device *); void (*dismiss)(struct device *); } ;
144 struct pci_bus ;
26 struct ldt_struct ;
26 struct vdso_image ;
26 struct __anonstruct_mm_context_t_209 { struct ldt_struct *ldt; unsigned short ia32_compat; struct mutex lock; void *vdso; const struct vdso_image *vdso_image; atomic_t perf_rdpmc_allowed; } ;
26 typedef struct __anonstruct_mm_context_t_209 mm_context_t;
124 enum rcu_sync_type { RCU_SYNC = 0, RCU_SCHED_SYNC = 1, RCU_BH_SYNC = 2 } ;
130 struct rcu_sync { int gp_state; int gp_count; wait_queue_head_t gp_wait; int cb_state; struct callback_head cb_head; enum rcu_sync_type gp_type; } ;
65 struct percpu_rw_semaphore { struct rcu_sync rss; unsigned int *fast_read_ctr; struct rw_semaphore rw_sem; atomic_t slow_read_ctr; wait_queue_head_t write_waitq; } ;
57 struct block_device ;
58 struct io_context ;
59 struct cgroup_subsys_state ;
268 struct delayed_call { void (*fn)(void *); void *arg; } ;
261 struct backing_dev_info ;
262 struct bdi_writeback ;
263 struct export_operations ;
266 struct kiocb ;
267 struct pipe_inode_info ;
268 struct poll_table_struct ;
269 struct kstatfs ;
270 struct cred ;
271 struct swap_info_struct ;
272 struct iov_iter ;
273 struct fscrypt_info ;
274 struct fscrypt_operations ;
76 struct iattr { unsigned int ia_valid; umode_t ia_mode; kuid_t ia_uid; kgid_t ia_gid; loff_t ia_size; struct timespec ia_atime; struct timespec ia_mtime; struct timespec ia_ctime; struct file *ia_file; } ;
213 struct dquot ;
214 struct kqid ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_240 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_240 kprojid_t;
181 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
66 typedef long long qsize_t;
67 union __anonunion____missing_field_name_241 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
67 struct kqid { union __anonunion____missing_field_name_241 __annonCompField44; enum quota_type type; } ;
184 struct mem_dqblk { qsize_t dqb_bhardlimit; qsize_t dqb_bsoftlimit; qsize_t dqb_curspace; qsize_t dqb_rsvspace; qsize_t dqb_ihardlimit; qsize_t dqb_isoftlimit; qsize_t dqb_curinodes; time_t dqb_btime; time_t dqb_itime; } ;
206 struct quota_format_type ;
207 struct mem_dqinfo { struct quota_format_type *dqi_format; int dqi_fmt_id; struct list_head dqi_dirty_list; unsigned long dqi_flags; unsigned int dqi_bgrace; unsigned int dqi_igrace; qsize_t dqi_max_spc_limit; qsize_t dqi_max_ino_limit; void *dqi_priv; } ;
272 struct dquot { struct hlist_node dq_hash; struct list_head dq_inuse; struct list_head dq_free; struct list_head dq_dirty; struct mutex dq_lock; atomic_t dq_count; wait_queue_head_t dq_wait_unused; struct super_block *dq_sb; struct kqid dq_id; loff_t dq_off; unsigned long dq_flags; struct mem_dqblk dq_dqb; } ;
299 struct quota_format_ops { int (*check_quota_file)(struct super_block *, int); int (*read_file_info)(struct super_block *, int); int (*write_file_info)(struct super_block *, int); int (*free_file_info)(struct super_block *, int); int (*read_dqblk)(struct dquot *); int (*commit_dqblk)(struct dquot *); int (*release_dqblk)(struct dquot *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
311 struct dquot_operations { int (*write_dquot)(struct dquot *); struct dquot * (*alloc_dquot)(struct super_block *, int); void (*destroy_dquot)(struct dquot *); int (*acquire_dquot)(struct dquot *); int (*release_dquot)(struct dquot *); int (*mark_dirty)(struct dquot *); int (*write_info)(struct super_block *, int); qsize_t * (*get_reserved_space)(struct inode *); int (*get_projid)(struct inode *, kprojid_t *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
328 struct qc_dqblk { int d_fieldmask; u64 d_spc_hardlimit; u64 d_spc_softlimit; u64 d_ino_hardlimit; u64 d_ino_softlimit; u64 d_space; u64 d_ino_count; s64 d_ino_timer; s64 d_spc_timer; int d_ino_warns; int d_spc_warns; u64 d_rt_spc_hardlimit; u64 d_rt_spc_softlimit; u64 d_rt_space; s64 d_rt_spc_timer; int d_rt_spc_warns; } ;
351 struct qc_type_state { unsigned int flags; unsigned int spc_timelimit; unsigned int ino_timelimit; unsigned int rt_spc_timelimit; unsigned int spc_warnlimit; unsigned int ino_warnlimit; unsigned int rt_spc_warnlimit; unsigned long long ino; blkcnt_t blocks; blkcnt_t nextents; } ;
397 struct qc_state { unsigned int s_incoredqs; struct qc_type_state s_state[3U]; } ;
408 struct qc_info { int i_fieldmask; unsigned int i_flags; unsigned int i_spc_timelimit; unsigned int i_ino_timelimit; unsigned int i_rt_spc_timelimit; unsigned int i_spc_warnlimit; unsigned int i_ino_warnlimit; unsigned int i_rt_spc_warnlimit; } ;
421 struct quotactl_ops { int (*quota_on)(struct super_block *, int, int, struct path *); int (*quota_off)(struct super_block *, int); int (*quota_enable)(struct super_block *, unsigned int); int (*quota_disable)(struct super_block *, unsigned int); int (*quota_sync)(struct super_block *, int); int (*set_info)(struct super_block *, int, struct qc_info *); int (*get_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_nextdqblk)(struct super_block *, struct kqid *, struct qc_dqblk *); int (*set_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_state)(struct super_block *, struct qc_state *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
437 struct quota_format_type { int qf_fmt_id; const struct quota_format_ops *qf_ops; struct module *qf_owner; struct quota_format_type *qf_next; } ;
501 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct mutex dqonoff_mutex; struct inode *files[3U]; struct mem_dqinfo info[3U]; const struct quota_format_ops *ops[3U]; } ;
531 struct address_space ;
532 struct writeback_control ;
533 struct kiocb { struct file *ki_filp; loff_t ki_pos; void (*ki_complete)(struct kiocb *, long, long); void *private; int ki_flags; } ;
371 struct address_space_operations { int (*writepage)(struct page *, struct writeback_control *); int (*readpage)(struct file *, struct page *); int (*writepages)(struct address_space *, struct writeback_control *); int (*set_page_dirty)(struct page *); int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); int (*write_begin)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page **, void **); int (*write_end)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page *, void *); sector_t (*bmap)(struct address_space *, sector_t ); void (*invalidatepage)(struct page *, unsigned int, unsigned int); int (*releasepage)(struct page *, gfp_t ); void (*freepage)(struct page *); ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *); int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode ); int (*launder_page)(struct page *); int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long); void (*is_dirty_writeback)(struct page *, bool *, bool *); int (*error_remove_page)(struct address_space *, struct page *); int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); void (*swap_deactivate)(struct file *); } ;
428 struct address_space { struct inode *host; struct radix_tree_root page_tree; spinlock_t tree_lock; atomic_t i_mmap_writable; struct rb_root i_mmap; struct rw_semaphore i_mmap_rwsem; unsigned long nrpages; unsigned long nrexceptional; unsigned long writeback_index; const struct address_space_operations *a_ops; unsigned long flags; spinlock_t private_lock; struct list_head private_list; void *private_data; } ;
449 struct request_queue ;
450 struct hd_struct ;
450 struct gendisk ;
450 struct block_device { dev_t bd_dev; int bd_openers; struct inode *bd_inode; struct super_block *bd_super; struct mutex bd_mutex; struct list_head bd_inodes; void *bd_claiming; void *bd_holder; int bd_holders; bool bd_write_holder; struct list_head bd_holder_disks; struct block_device *bd_contains; unsigned int bd_block_size; struct hd_struct *bd_part; unsigned int bd_part_count; int bd_invalidated; struct gendisk *bd_disk; struct request_queue *bd_queue; struct list_head bd_list; unsigned long bd_private; int bd_fsfreeze_count; struct mutex bd_fsfreeze_mutex; } ;
566 struct posix_acl ;
592 struct inode_operations ;
592 union __anonunion____missing_field_name_246 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
592 union __anonunion____missing_field_name_247 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
592 struct file_lock_context ;
592 union __anonunion____missing_field_name_248 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; unsigned int i_dir_seq; } ;
592 struct inode { umode_t i_mode; unsigned short i_opflags; kuid_t i_uid; kgid_t i_gid; unsigned int i_flags; struct posix_acl *i_acl; struct posix_acl *i_default_acl; const struct inode_operations *i_op; struct super_block *i_sb; struct address_space *i_mapping; void *i_security; unsigned long i_ino; union __anonunion____missing_field_name_246 __annonCompField45; dev_t i_rdev; loff_t i_size; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; spinlock_t i_lock; unsigned short i_bytes; unsigned int i_blkbits; blkcnt_t i_blocks; unsigned long i_state; struct rw_semaphore i_rwsem; unsigned long dirtied_when; unsigned long dirtied_time_when; struct hlist_node i_hash; struct list_head i_io_list; struct bdi_writeback *i_wb; int i_wb_frn_winner; u16 i_wb_frn_avg_time; u16 i_wb_frn_history; struct list_head i_lru; struct list_head i_sb_list; union __anonunion____missing_field_name_247 __annonCompField46; u64 i_version; atomic_t i_count; atomic_t i_dio_count; atomic_t i_writecount; atomic_t i_readcount; const struct file_operations *i_fop; struct file_lock_context *i_flctx; struct address_space i_data; struct list_head i_devices; union __anonunion____missing_field_name_248 __annonCompField47; __u32 i_generation; __u32 i_fsnotify_mask; struct hlist_head i_fsnotify_marks; struct fscrypt_info *i_crypt_info; void *i_private; } ;
870 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
878 struct file_ra_state { unsigned long start; unsigned int size; unsigned int async_size; unsigned int ra_pages; unsigned int mmap_miss; loff_t prev_pos; } ;
901 union __anonunion_f_u_249 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
901 struct file { union __anonunion_f_u_249 f_u; struct path f_path; struct inode *f_inode; const struct file_operations *f_op; spinlock_t f_lock; atomic_long_t f_count; unsigned int f_flags; fmode_t f_mode; struct mutex f_pos_lock; loff_t f_pos; struct fown_struct f_owner; const struct cred *f_cred; struct file_ra_state f_ra; u64 f_version; void *f_security; void *private_data; struct list_head f_ep_links; struct list_head f_tfile_llink; struct address_space *f_mapping; } ;
986 typedef void *fl_owner_t;
987 struct file_lock ;
988 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
994 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); fl_owner_t (*lm_get_owner)(fl_owner_t ); void (*lm_put_owner)(fl_owner_t ); void (*lm_notify)(struct file_lock *); int (*lm_grant)(struct file_lock *, int); bool (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock *, int, struct list_head *); void (*lm_setup)(struct file_lock *, void **); } ;
1021 struct nlm_lockowner ;
1022 struct nfs_lock_info { u32 state; struct nlm_lockowner *owner; struct list_head list; } ;
14 struct nfs4_lock_state ;
15 struct nfs4_lock_info { struct nfs4_lock_state *owner; } ;
19 struct fasync_struct ;
19 struct __anonstruct_afs_251 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_250 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_251 afs; } ;
19 struct file_lock { struct file_lock *fl_next; struct list_head fl_list; struct hlist_node fl_link; struct list_head fl_block; fl_owner_t fl_owner; unsigned int fl_flags; unsigned char fl_type; unsigned int fl_pid; int fl_link_cpu; struct pid *fl_nspid; wait_queue_head_t fl_wait; struct file *fl_file; loff_t fl_start; loff_t fl_end; struct fasync_struct *fl_fasync; unsigned long fl_break_time; unsigned long fl_downgrade_time; const struct file_lock_operations *fl_ops; const struct lock_manager_operations *fl_lmops; union __anonunion_fl_u_250 fl_u; } ;
1074 struct file_lock_context { spinlock_t flc_lock; struct list_head flc_flock; struct list_head flc_posix; struct list_head flc_lease; } ;
1129 struct files_struct ;
1287 struct fasync_struct { spinlock_t fa_lock; int magic; int fa_fd; struct fasync_struct *fa_next; struct file *fa_file; struct callback_head fa_rcu; } ;
1322 struct sb_writers { int frozen; wait_queue_head_t wait_unfrozen; struct percpu_rw_semaphore rw_sem[3U]; } ;
1348 struct super_operations ;
1348 struct xattr_handler ;
1348 struct mtd_info ;
1348 struct super_block { struct list_head s_list; dev_t s_dev; unsigned char s_blocksize_bits; unsigned long s_blocksize; loff_t s_maxbytes; struct file_system_type *s_type; const struct super_operations *s_op; const struct dquot_operations *dq_op; const struct quotactl_ops *s_qcop; const struct export_operations *s_export_op; unsigned long s_flags; unsigned long s_iflags; unsigned long s_magic; struct dentry *s_root; struct rw_semaphore s_umount; int s_count; atomic_t s_active; void *s_security; const struct xattr_handler **s_xattr; const struct fscrypt_operations *s_cop; struct hlist_bl_head s_anon; struct list_head s_mounts; struct block_device *s_bdev; struct backing_dev_info *s_bdi; struct mtd_info *s_mtd; struct hlist_node s_instances; unsigned int s_quota_types; struct quota_info s_dquot; struct sb_writers s_writers; char s_id[32U]; u8 s_uuid[16U]; void *s_fs_info; unsigned int s_max_links; fmode_t s_mode; u32 s_time_gran; struct mutex s_vfs_rename_mutex; char *s_subtype; char *s_options; const struct dentry_operations *s_d_op; int cleancache_poolid; struct shrinker s_shrink; atomic_long_t s_remove_count; int s_readonly_remount; struct workqueue_struct *s_dio_done_wq; struct hlist_head s_pins; struct list_lru s_dentry_lru; struct list_lru s_inode_lru; struct callback_head rcu; struct work_struct destroy_work; struct mutex s_sync_lock; int s_stack_depth; spinlock_t s_inode_list_lock; struct list_head s_inodes; } ;
1594 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1608 struct dir_context ;
1633 struct dir_context { int (*actor)(struct dir_context *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1640 struct file_operations { struct module *owner; loff_t (*llseek)(struct file *, loff_t , int); ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); int (*iterate)(struct file *, struct dir_context *); int (*iterate_shared)(struct file *, struct dir_context *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); int (*flush)(struct file *, fl_owner_t ); int (*release)(struct inode *, struct file *); int (*fsync)(struct file *, loff_t , loff_t , int); int (*aio_fsync)(struct kiocb *, int); int (*fasync)(int, struct file *, int); int (*lock)(struct file *, int, struct file_lock *); ssize_t (*sendpage)(struct file *, struct page *, int, size_t , loff_t *, int); unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); int (*flock)(struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t , unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t , unsigned int); int (*setlease)(struct file *, long, struct file_lock **, void **); long int (*fallocate)(struct file *, int, loff_t , loff_t ); void (*show_fdinfo)(struct seq_file *, struct file *); ssize_t (*copy_file_range)(struct file *, loff_t , struct file *, loff_t , size_t , unsigned int); int (*clone_file_range)(struct file *, loff_t , struct file *, loff_t , u64 ); ssize_t (*dedupe_file_range)(struct file *, u64 , u64 , struct file *, u64 ); } ;
1709 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); int (*create)(struct inode *, struct dentry *, umode_t , bool ); int (*link)(struct dentry *, struct inode *, struct dentry *); int (*unlink)(struct inode *, struct dentry *); int (*symlink)(struct inode *, struct dentry *, const char *); int (*mkdir)(struct inode *, struct dentry *, umode_t ); int (*rmdir)(struct inode *, struct dentry *); int (*mknod)(struct inode *, struct dentry *, umode_t , dev_t ); int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *); int (*rename2)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr)(struct dentry *, struct iattr *); int (*getattr)(struct vfsmount *, struct dentry *, struct kstat *); int (*setxattr)(struct dentry *, struct inode *, const char *, const void *, size_t , int); ssize_t (*getxattr)(struct dentry *, struct inode *, const char *, void *, size_t ); ssize_t (*listxattr)(struct dentry *, char *, size_t ); int (*removexattr)(struct dentry *, const char *); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 , u64 ); int (*update_time)(struct inode *, struct timespec *, int); int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t , int *); int (*tmpfile)(struct inode *, struct dentry *, umode_t ); int (*set_acl)(struct inode *, struct posix_acl *, int); } ;
1766 struct super_operations { struct inode * (*alloc_inode)(struct super_block *); void (*destroy_inode)(struct inode *); void (*dirty_inode)(struct inode *, int); int (*write_inode)(struct inode *, struct writeback_control *); int (*drop_inode)(struct inode *); void (*evict_inode)(struct inode *); void (*put_super)(struct super_block *); int (*sync_fs)(struct super_block *, int); int (*freeze_super)(struct super_block *); int (*freeze_fs)(struct super_block *); int (*thaw_super)(struct super_block *); int (*unfreeze_fs)(struct super_block *); int (*statfs)(struct dentry *, struct kstatfs *); int (*remount_fs)(struct super_block *, int *, char *); void (*umount_begin)(struct super_block *); int (*show_options)(struct seq_file *, struct dentry *); int (*show_devname)(struct seq_file *, struct dentry *); int (*show_path)(struct seq_file *, struct dentry *); int (*show_stats)(struct seq_file *, struct dentry *); ssize_t (*quota_read)(struct super_block *, int, char *, size_t , loff_t ); ssize_t (*quota_write)(struct super_block *, int, const char *, size_t , loff_t ); struct dquot ** (*get_dquots)(struct inode *); int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t ); long int (*nr_cached_objects)(struct super_block *, struct shrink_control *); long int (*free_cached_objects)(struct super_block *, struct shrink_control *); } ;
2005 struct file_system_type { const char *name; int fs_flags; struct dentry * (*mount)(struct file_system_type *, int, const char *, void *); void (*kill_sb)(struct super_block *); struct module *owner; struct file_system_type *next; struct hlist_head fs_supers; struct lock_class_key s_lock_key; struct lock_class_key s_umount_key; struct lock_class_key s_vfs_rename_key; struct lock_class_key s_writers_key[3U]; struct lock_class_key i_lock_key; struct lock_class_key i_mutex_key; struct lock_class_key i_mutex_dir_key; } ;
2334 struct kmem_cache ;
3176 struct assoc_array_ptr ;
3176 struct assoc_array { struct assoc_array_ptr *root; unsigned long nr_leaves_on_tree; } ;
31 typedef int32_t key_serial_t;
34 typedef uint32_t key_perm_t;
35 struct key ;
36 struct user_struct ;
37 struct signal_struct ;
38 struct key_type ;
42 struct keyring_index_key { struct key_type *type; const char *description; size_t desc_len; } ;
91 union key_payload { void *rcu_data0; void *data[4U]; } ;
128 union __anonunion____missing_field_name_252 { struct list_head graveyard_link; struct rb_node serial_node; } ;
128 struct key_user ;
128 union __anonunion____missing_field_name_253 { time_t expiry; time_t revoked_at; } ;
128 struct __anonstruct____missing_field_name_255 { struct key_type *type; char *description; } ;
128 union __anonunion____missing_field_name_254 { struct keyring_index_key index_key; struct __anonstruct____missing_field_name_255 __annonCompField50; } ;
128 struct __anonstruct____missing_field_name_257 { struct list_head name_link; struct assoc_array keys; } ;
128 union __anonunion____missing_field_name_256 { union key_payload payload; struct __anonstruct____missing_field_name_257 __annonCompField52; int reject_error; } ;
128 struct key { atomic_t usage; key_serial_t serial; union __anonunion____missing_field_name_252 __annonCompField48; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion____missing_field_name_253 __annonCompField49; time_t last_used_at; kuid_t uid; kgid_t gid; key_perm_t perm; unsigned short quotalen; unsigned short datalen; unsigned long flags; union __anonunion____missing_field_name_254 __annonCompField51; union __anonunion____missing_field_name_256 __annonCompField53; int (*restrict_link)(struct key *, const struct key_type *, const union key_payload *); } ;
377 struct audit_context ;
27 struct group_info { atomic_t usage; int ngroups; int nblocks; kgid_t small_block[32U]; kgid_t *blocks[0U]; } ;
90 struct cred { atomic_t usage; atomic_t subscribers; void *put_addr; unsigned int magic; kuid_t uid; kgid_t gid; kuid_t suid; kgid_t sgid; kuid_t euid; kgid_t egid; kuid_t fsuid; kgid_t fsgid; unsigned int securebits; kernel_cap_t cap_inheritable; kernel_cap_t cap_permitted; kernel_cap_t cap_effective; kernel_cap_t cap_bset; kernel_cap_t cap_ambient; unsigned char jit_keyring; struct key *session_keyring; struct key *process_keyring; struct key *thread_keyring; struct key *request_key_auth; void *security; struct user_struct *user; struct user_namespace *user_ns; struct group_info *group_info; struct callback_head rcu; } ;
377 struct seq_file { char *buf; size_t size; size_t from; size_t count; size_t pad_until; loff_t index; loff_t read_pos; u64 version; struct mutex lock; const struct seq_operations *op; int poll_event; const struct file *file; void *private; } ;
30 struct seq_operations { void * (*start)(struct seq_file *, loff_t *); void (*stop)(struct seq_file *, void *); void * (*next)(struct seq_file *, void *, loff_t *); int (*show)(struct seq_file *, void *); } ;
222 struct pinctrl ;
223 struct pinctrl_state ;
194 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *init_state; struct pinctrl_state *sleep_state; struct pinctrl_state *idle_state; } ;
48 struct dma_map_ops ;
48 struct dev_archdata { struct dma_map_ops *dma_ops; void *iommu; } ;
21 struct pdev_archdata { } ;
24 struct device_private ;
25 struct device_driver ;
26 struct driver_private ;
27 struct class ;
28 struct subsys_private ;
29 struct bus_type ;
30 struct device_node ;
31 struct fwnode_handle ;
32 struct iommu_ops ;
33 struct iommu_group ;
61 struct device_attribute ;
61 struct bus_type { const char *name; const char *dev_name; struct device *dev_root; struct device_attribute *dev_attrs; const struct attribute_group **bus_groups; const struct attribute_group **dev_groups; const struct attribute_group **drv_groups; int (*match)(struct device *, struct device_driver *); int (*uevent)(struct device *, struct kobj_uevent_env *); int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*online)(struct device *); int (*offline)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
142 struct device_type ;
201 enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ;
207 struct of_device_id ;
207 struct acpi_device_id ;
207 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; enum probe_type probe_type; const struct of_device_id *of_match_table; const struct acpi_device_id *acpi_match_table; int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct attribute_group **groups; const struct dev_pm_ops *pm; struct driver_private *p; } ;
357 struct class_attribute ;
357 struct class { const char *name; struct module *owner; struct class_attribute *class_attrs; const struct attribute_group **dev_groups; struct kobject *dev_kobj; int (*dev_uevent)(struct device *, struct kobj_uevent_env *); char * (*devnode)(struct device *, umode_t *); void (*class_release)(struct class *); void (*dev_release)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device *); const struct dev_pm_ops *pm; struct subsys_private *p; } ;
450 struct class_attribute { struct attribute attr; ssize_t (*show)(struct class *, struct class_attribute *, char *); ssize_t (*store)(struct class *, struct class_attribute *, const char *, size_t ); } ;
518 struct device_type { const char *name; const struct attribute_group **groups; int (*uevent)(struct device *, struct kobj_uevent_env *); char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *); void (*release)(struct device *); const struct dev_pm_ops *pm; } ;
546 struct device_attribute { struct attribute attr; ssize_t (*show)(struct device *, struct device_attribute *, char *); ssize_t (*store)(struct device *, struct device_attribute *, const char *, size_t ); } ;
699 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
708 struct irq_domain ;
708 struct dma_coherent_mem ;
708 struct cma ;
708 struct device { struct device *parent; struct device_private *p; struct kobject kobj; const char *init_name; const struct device_type *type; struct mutex mutex; struct bus_type *bus; struct device_driver *driver; void *platform_data; void *driver_data; struct dev_pm_info power; struct dev_pm_domain *pm_domain; struct irq_domain *msi_domain; struct dev_pin_info *pins; struct list_head msi_list; int numa_node; u64 *dma_mask; u64 coherent_dma_mask; unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; struct list_head dma_pools; struct dma_coherent_mem *dma_mem; struct cma *cma_area; struct dev_archdata archdata; struct device_node *of_node; struct fwnode_handle *fwnode; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class *class; const struct attribute_group **groups; void (*release)(struct device *); struct iommu_group *iommu_group; bool offline_disabled; bool offline; } ;
862 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; struct wake_irq *wakeirq; struct timer_list timer; unsigned long timer_expires; ktime_t total_time; ktime_t max_time; ktime_t last_time; ktime_t start_prevent_time; ktime_t prevent_sleep_time; unsigned long event_count; unsigned long active_count; unsigned long relax_count; unsigned long expire_count; unsigned long wakeup_count; bool active; bool autosleep_enabled; } ;
1339 struct dma_attrs { unsigned long flags[1U]; } ;
89 enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ;
58 struct arch_uprobe_task { unsigned long saved_scratch_register; unsigned int saved_trap_nr; unsigned int saved_tf; } ;
66 enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ;
73 struct __anonstruct____missing_field_name_263 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct____missing_field_name_264 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion____missing_field_name_262 { struct __anonstruct____missing_field_name_263 __annonCompField56; struct __anonstruct____missing_field_name_264 __annonCompField57; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion____missing_field_name_262 __annonCompField58; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
94 struct return_instance { struct uprobe *uprobe; unsigned long func; unsigned long stack; unsigned long orig_ret_vaddr; bool chained; struct return_instance *next; } ;
110 struct xol_area ;
111 struct uprobes_state { struct xol_area *xol_area; } ;
150 union __anonunion____missing_field_name_265 { struct address_space *mapping; void *s_mem; atomic_t compound_mapcount; } ;
150 union __anonunion____missing_field_name_267 { unsigned long index; void *freelist; } ;
150 struct __anonstruct____missing_field_name_271 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
150 union __anonunion____missing_field_name_270 { atomic_t _mapcount; struct __anonstruct____missing_field_name_271 __annonCompField61; int units; } ;
150 struct __anonstruct____missing_field_name_269 { union __anonunion____missing_field_name_270 __annonCompField62; atomic_t _refcount; } ;
150 union __anonunion____missing_field_name_268 { unsigned long counters; struct __anonstruct____missing_field_name_269 __annonCompField63; unsigned int active; } ;
150 struct __anonstruct____missing_field_name_266 { union __anonunion____missing_field_name_267 __annonCompField60; union __anonunion____missing_field_name_268 __annonCompField64; } ;
150 struct dev_pagemap ;
150 struct __anonstruct____missing_field_name_273 { struct page *next; int pages; int pobjects; } ;
150 struct __anonstruct____missing_field_name_274 { unsigned long compound_head; unsigned int compound_dtor; unsigned int compound_order; } ;
150 struct __anonstruct____missing_field_name_275 { unsigned long __pad; pgtable_t pmd_huge_pte; } ;
150 union __anonunion____missing_field_name_272 { struct list_head lru; struct dev_pagemap *pgmap; struct __anonstruct____missing_field_name_273 __annonCompField66; struct callback_head callback_head; struct __anonstruct____missing_field_name_274 __annonCompField67; struct __anonstruct____missing_field_name_275 __annonCompField68; } ;
150 union __anonunion____missing_field_name_276 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; } ;
150 struct page { unsigned long flags; union __anonunion____missing_field_name_265 __annonCompField59; struct __anonstruct____missing_field_name_266 __annonCompField65; union __anonunion____missing_field_name_272 __annonCompField69; union __anonunion____missing_field_name_276 __annonCompField70; struct mem_cgroup *mem_cgroup; } ;
196 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
281 struct userfaultfd_ctx ;
281 struct vm_userfaultfd_ctx { struct userfaultfd_ctx *ctx; } ;
288 struct __anonstruct_shared_277 { struct rb_node rb; unsigned long rb_subtree_last; } ;
288 struct anon_vma ;
288 struct mempolicy ;
288 struct vm_area_struct { unsigned long vm_start; unsigned long vm_end; struct vm_area_struct *vm_next; struct vm_area_struct *vm_prev; struct rb_node vm_rb; unsigned long rb_subtree_gap; struct mm_struct *vm_mm; pgprot_t vm_page_prot; unsigned long vm_flags; struct __anonstruct_shared_277 shared; struct list_head anon_vma_chain; struct anon_vma *anon_vma; const struct vm_operations_struct *vm_ops; unsigned long vm_pgoff; struct file *vm_file; void *vm_private_data; struct mempolicy *vm_policy; struct vm_userfaultfd_ctx vm_userfaultfd_ctx; } ;
361 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
366 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
380 struct task_rss_stat { int events; int count[4U]; } ;
388 struct mm_rss_stat { atomic_long_t count[4U]; } ;
393 struct kioctx_table ;
394 struct linux_binfmt ;
394 struct mmu_notifier_mm ;
394 struct mm_struct { struct vm_area_struct *mmap; struct rb_root mm_rb; u32 vmacache_seqnum; unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; unsigned long highest_vm_end; pgd_t *pgd; atomic_t mm_users; atomic_t mm_count; atomic_long_t nr_ptes; atomic_long_t nr_pmds; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_sem; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; unsigned long pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46U]; struct mm_rss_stat rss_stat; struct linux_binfmt *binfmt; cpumask_var_t cpu_vm_mask_var; mm_context_t context; unsigned long flags; struct core_state *core_state; spinlock_t ioctx_lock; struct kioctx_table *ioctx_table; struct task_struct *owner; struct file *exe_file; struct mmu_notifier_mm *mmu_notifier_mm; struct cpumask cpumask_allocation; unsigned long numa_next_scan; unsigned long numa_scan_offset; int numa_scan_seq; bool tlb_flush_pending; struct uprobes_state uprobes_state; void *bd_addr; atomic_long_t hugetlb_usage; struct work_struct async_put_work; } ;
564 struct vm_fault ;
615 struct percpu_ref ;
55 typedef void percpu_ref_func_t(struct percpu_ref *);
68 struct percpu_ref { atomic_long_t count; unsigned long percpu_count_ptr; percpu_ref_func_t *release; percpu_ref_func_t *confirm_switch; bool force_atomic; struct callback_head rcu; } ;
41 struct rlimit { __kernel_ulong_t rlim_cur; __kernel_ulong_t rlim_max; } ;
273 struct vm_fault { unsigned int flags; gfp_t gfp_mask; unsigned long pgoff; void *virtual_address; struct page *cow_page; struct page *page; void *entry; unsigned long max_pgoff; pte_t *pte; } ;
317 struct vm_operations_struct { void (*open)(struct vm_area_struct *); void (*close)(struct vm_area_struct *); int (*mremap)(struct vm_area_struct *); int (*fault)(struct vm_area_struct *, struct vm_fault *); int (*pmd_fault)(struct vm_area_struct *, unsigned long, pmd_t *, unsigned int); void (*map_pages)(struct vm_area_struct *, struct vm_fault *); int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*pfn_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*access)(struct vm_area_struct *, unsigned long, void *, int, int); const char * (*name)(struct vm_area_struct *); int (*set_policy)(struct vm_area_struct *, struct mempolicy *); struct mempolicy * (*get_policy)(struct vm_area_struct *, unsigned long); struct page * (*find_special_page)(struct vm_area_struct *, unsigned long); } ;
2409 struct scatterlist { unsigned long sg_magic; unsigned long page_link; unsigned int offset; unsigned int length; dma_addr_t dma_address; unsigned int dma_length; } ;
21 struct sg_table { struct scatterlist *sgl; unsigned int nents; unsigned int orig_nents; } ;
158 struct dma_map_ops { void * (*alloc)(struct device *, size_t , dma_addr_t *, gfp_t , struct dma_attrs *); void (*free)(struct device *, size_t , void *, dma_addr_t , struct dma_attrs *); int (*mmap)(struct device *, struct vm_area_struct *, void *, dma_addr_t , size_t , struct dma_attrs *); int (*get_sgtable)(struct device *, struct sg_table *, void *, dma_addr_t , size_t , struct dma_attrs *); dma_addr_t (*map_page)(struct device *, struct page *, unsigned long, size_t , enum dma_data_direction , struct dma_attrs *); void (*unmap_page)(struct device *, dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs *); int (*map_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*unmap_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*sync_single_for_cpu)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_single_for_device)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_sg_for_cpu)(struct device *, struct scatterlist *, int, enum dma_data_direction ); void (*sync_sg_for_device)(struct device *, struct scatterlist *, int, enum dma_data_direction ); int (*mapping_error)(struct device *, dma_addr_t ); int (*dma_supported)(struct device *, u64 ); int (*set_dma_mask)(struct device *, u64 ); int is_phys; } ;
84 struct plist_node { int prio; struct list_head prio_list; struct list_head node_list; } ;
4 typedef unsigned long cputime_t;
25 struct sem_undo_list ;
25 struct sysv_sem { struct sem_undo_list *undo_list; } ;
26 struct sysv_shm { struct list_head shm_clist; } ;
24 struct __anonstruct_sigset_t_289 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_289 sigset_t;
25 struct siginfo ;
17 typedef void __signalfn_t(int);
18 typedef __signalfn_t *__sighandler_t;
20 typedef void __restorefn_t();
21 typedef __restorefn_t *__sigrestore_t;
34 union sigval { int sival_int; void *sival_ptr; } ;
10 typedef union sigval sigval_t;
11 struct __anonstruct__kill_291 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_292 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_293 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_294 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__addr_bnd_297 { void *_lower; void *_upper; } ;
11 union __anonunion____missing_field_name_296 { struct __anonstruct__addr_bnd_297 _addr_bnd; __u32 _pkey; } ;
11 struct __anonstruct__sigfault_295 { void *_addr; short _addr_lsb; union __anonunion____missing_field_name_296 __annonCompField71; } ;
11 struct __anonstruct__sigpoll_298 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_299 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_290 { int _pad[28U]; struct __anonstruct__kill_291 _kill; struct __anonstruct__timer_292 _timer; struct __anonstruct__rt_293 _rt; struct __anonstruct__sigchld_294 _sigchld; struct __anonstruct__sigfault_295 _sigfault; struct __anonstruct__sigpoll_298 _sigpoll; struct __anonstruct__sigsys_299 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_290 _sifields; } ;
118 typedef struct siginfo siginfo_t;
22 struct sigpending { struct list_head list; sigset_t signal; } ;
257 struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; } ;
271 struct k_sigaction { struct sigaction sa; } ;
43 struct seccomp_filter ;
44 struct seccomp { int mode; struct seccomp_filter *filter; } ;
40 struct rt_mutex_waiter ;
100 struct timerqueue_node { struct rb_node node; ktime_t expires; } ;
12 struct timerqueue_head { struct rb_root head; struct timerqueue_node *next; } ;
50 struct hrtimer_clock_base ;
51 struct hrtimer_cpu_base ;
60 enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ;
65 struct hrtimer { struct timerqueue_node node; ktime_t _softexpires; enum hrtimer_restart (*function)(struct hrtimer *); struct hrtimer_clock_base *base; u8 state; u8 is_rel; int start_pid; void *start_site; char start_comm[16U]; } ;
125 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t (*get_time)(); ktime_t offset; } ;
158 struct hrtimer_cpu_base { raw_spinlock_t lock; seqcount_t seq; struct hrtimer *running; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; bool migration_enabled; bool nohz_active; unsigned char in_hrtirq; unsigned char hres_active; unsigned char hang_detected; ktime_t expires_next; struct hrtimer *next_timer; unsigned int nr_events; unsigned int nr_retries; unsigned int nr_hangs; unsigned int max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
12 enum kcov_mode { KCOV_MODE_DISABLED = 0, KCOV_MODE_TRACE = 1 } ;
17 struct task_io_accounting { u64 rchar; u64 wchar; u64 syscr; u64 syscw; u64 read_bytes; u64 write_bytes; u64 cancelled_write_bytes; } ;
45 struct latency_record { unsigned long backtrace[12U]; unsigned int count; unsigned long time; unsigned long max; } ;
41 struct cgroup ;
42 struct cgroup_root ;
43 struct cgroup_subsys ;
44 struct cgroup_taskset ;
88 struct cgroup_file { struct kernfs_node *kn; } ;
90 struct cgroup_subsys_state { struct cgroup *cgroup; struct cgroup_subsys *ss; struct percpu_ref refcnt; struct cgroup_subsys_state *parent; struct list_head sibling; struct list_head children; int id; unsigned int flags; u64 serial_nr; atomic_t online_cnt; struct callback_head callback_head; struct work_struct destroy_work; } ;
141 struct css_set { atomic_t refcount; struct hlist_node hlist; struct list_head tasks; struct list_head mg_tasks; struct list_head cgrp_links; struct cgroup *dfl_cgrp; struct cgroup_subsys_state *subsys[13U]; struct list_head mg_preload_node; struct list_head mg_node; struct cgroup *mg_src_cgrp; struct cgroup *mg_dst_cgrp; struct css_set *mg_dst_cset; struct list_head e_cset_node[13U]; struct list_head task_iters; bool dead; struct callback_head callback_head; } ;
221 struct cgroup { struct cgroup_subsys_state self; unsigned long flags; int id; int level; int populated_cnt; struct kernfs_node *kn; struct cgroup_file procs_file; struct cgroup_file events_file; u16 subtree_control; u16 subtree_ss_mask; u16 old_subtree_control; u16 old_subtree_ss_mask; struct cgroup_subsys_state *subsys[13U]; struct cgroup_root *root; struct list_head cset_links; struct list_head e_csets[13U]; struct list_head pidlists; struct mutex pidlist_mutex; wait_queue_head_t offline_waitq; struct work_struct release_agent_work; int ancestor_ids[]; } ;
306 struct cgroup_root { struct kernfs_root *kf_root; unsigned int subsys_mask; int hierarchy_id; struct cgroup cgrp; int cgrp_ancestor_id_storage; atomic_t nr_cgrps; struct list_head root_list; unsigned int flags; struct idr cgroup_idr; char release_agent_path[4096U]; char name[64U]; } ;
345 struct cftype { char name[64U]; unsigned long private; size_t max_write_len; unsigned int flags; unsigned int file_offset; struct cgroup_subsys *ss; struct list_head node; struct kernfs_ops *kf_ops; u64 (*read_u64)(struct cgroup_subsys_state *, struct cftype *); s64 (*read_s64)(struct cgroup_subsys_state *, struct cftype *); int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); int (*write_u64)(struct cgroup_subsys_state *, struct cftype *, u64 ); int (*write_s64)(struct cgroup_subsys_state *, struct cftype *, s64 ); ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); struct lock_class_key lockdep_key; } ;
430 struct cgroup_subsys { struct cgroup_subsys_state * (*css_alloc)(struct cgroup_subsys_state *); int (*css_online)(struct cgroup_subsys_state *); void (*css_offline)(struct cgroup_subsys_state *); void (*css_released)(struct cgroup_subsys_state *); void (*css_free)(struct cgroup_subsys_state *); void (*css_reset)(struct cgroup_subsys_state *); int (*can_attach)(struct cgroup_taskset *); void (*cancel_attach)(struct cgroup_taskset *); void (*attach)(struct cgroup_taskset *); void (*post_attach)(); int (*can_fork)(struct task_struct *); void (*cancel_fork)(struct task_struct *); void (*fork)(struct task_struct *); void (*exit)(struct task_struct *); void (*free)(struct task_struct *); void (*bind)(struct cgroup_subsys_state *); bool early_init; bool implicit_on_dfl; bool broken_hierarchy; bool warned_broken_hierarchy; int id; const char *name; const char *legacy_name; struct cgroup_root *root; struct idr css_idr; struct list_head cfts; struct cftype *dfl_cftypes; struct cftype *legacy_cftypes; unsigned int depends_on; } ;
128 struct futex_pi_state ;
129 struct robust_list_head ;
130 struct bio_list ;
131 struct fs_struct ;
132 struct perf_event_context ;
133 struct blk_plug ;
134 struct nameidata ;
188 struct cfs_rq ;
189 struct task_group ;
492 struct sighand_struct { atomic_t count; struct k_sigaction action[64U]; spinlock_t siglock; wait_queue_head_t signalfd_wqh; } ;
534 struct pacct_struct { int ac_flag; long ac_exitcode; unsigned long ac_mem; cputime_t ac_utime; cputime_t ac_stime; unsigned long ac_minflt; unsigned long ac_majflt; } ;
542 struct cpu_itimer { cputime_t expires; cputime_t incr; u32 error; u32 incr_error; } ;
549 struct prev_cputime { cputime_t utime; cputime_t stime; raw_spinlock_t lock; } ;
574 struct task_cputime { cputime_t utime; cputime_t stime; unsigned long long sum_exec_runtime; } ;
590 struct task_cputime_atomic { atomic64_t utime; atomic64_t stime; atomic64_t sum_exec_runtime; } ;
612 struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic; bool running; bool checking_timer; } ;
657 struct autogroup ;
658 struct tty_struct ;
658 struct taskstats ;
658 struct tty_audit_buf ;
658 struct signal_struct { atomic_t sigcnt; atomic_t live; int nr_threads; atomic_t oom_victims; struct list_head thread_head; wait_queue_head_t wait_chldexit; struct task_struct *curr_target; struct sigpending shared_pending; int group_exit_code; int notify_count; struct task_struct *group_exit_task; int group_stop_count; unsigned int flags; unsigned char is_child_subreaper; unsigned char has_child_subreaper; int posix_timer_id; struct list_head posix_timers; struct hrtimer real_timer; struct pid *leader_pid; ktime_t it_real_incr; struct cpu_itimer it[2U]; struct thread_group_cputimer cputimer; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; struct pid *tty_old_pgrp; int leader; struct tty_struct *tty; struct autogroup *autogroup; seqlock_t stats_lock; cputime_t utime; cputime_t stime; cputime_t cutime; cputime_t cstime; cputime_t gtime; cputime_t cgtime; struct prev_cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; unsigned long cnvcsw; unsigned long cnivcsw; unsigned long min_flt; unsigned long maj_flt; unsigned long cmin_flt; unsigned long cmaj_flt; unsigned long inblock; unsigned long oublock; unsigned long cinblock; unsigned long coublock; unsigned long maxrss; unsigned long cmaxrss; struct task_io_accounting ioac; unsigned long long sum_sched_runtime; struct rlimit rlim[16U]; struct pacct_struct pacct; struct taskstats *stats; unsigned int audit_tty; struct tty_audit_buf *tty_audit_buf; bool oom_flag_origin; short oom_score_adj; short oom_score_adj_min; struct mutex cred_guard_mutex; } ;
833 struct user_struct { atomic_t __count; atomic_t processes; atomic_t sigpending; atomic_t inotify_watches; atomic_t inotify_devs; atomic_t fanotify_listeners; atomic_long_t epoll_watches; unsigned long mq_bytes; unsigned long locked_shm; unsigned long unix_inflight; atomic_long_t pipe_bufs; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
878 struct reclaim_state ;
879 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
894 struct task_delay_info { spinlock_t lock; unsigned int flags; u64 blkio_start; u64 blkio_delay; u64 swapin_delay; u32 blkio_count; u32 swapin_count; u64 freepages_start; u64 freepages_delay; u32 freepages_count; } ;
951 struct wake_q_node { struct wake_q_node *next; } ;
1218 struct load_weight { unsigned long weight; u32 inv_weight; } ;
1226 struct sched_avg { u64 last_update_time; u64 load_sum; u32 util_sum; u32 period_contrib; unsigned long load_avg; unsigned long util_avg; } ;
1284 struct sched_statistics { u64 wait_start; u64 wait_max; u64 wait_count; u64 wait_sum; u64 iowait_count; u64 iowait_sum; u64 sleep_start; u64 sleep_max; s64 sum_sleep_runtime; u64 block_start; u64 block_max; u64 exec_max; u64 slice_max; u64 nr_migrations_cold; u64 nr_failed_migrations_affine; u64 nr_failed_migrations_running; u64 nr_failed_migrations_hot; u64 nr_forced_migrations; u64 nr_wakeups; u64 nr_wakeups_sync; u64 nr_wakeups_migrate; u64 nr_wakeups_local; u64 nr_wakeups_remote; u64 nr_wakeups_affine; u64 nr_wakeups_affine_attempts; u64 nr_wakeups_passive; u64 nr_wakeups_idle; } ;
1319 struct sched_entity { struct load_weight load; struct rb_node run_node; struct list_head group_node; unsigned int on_rq; u64 exec_start; u64 sum_exec_runtime; u64 vruntime; u64 prev_sum_exec_runtime; u64 nr_migrations; struct sched_statistics statistics; int depth; struct sched_entity *parent; struct cfs_rq *cfs_rq; struct cfs_rq *my_q; struct sched_avg avg; } ;
1356 struct rt_rq ;
1356 struct sched_rt_entity { struct list_head run_list; unsigned long timeout; unsigned long watchdog_stamp; unsigned int time_slice; unsigned short on_rq; unsigned short on_list; struct sched_rt_entity *back; struct sched_rt_entity *parent; struct rt_rq *rt_rq; struct rt_rq *my_q; } ;
1374 struct sched_dl_entity { struct rb_node rb_node; u64 dl_runtime; u64 dl_deadline; u64 dl_period; u64 dl_bw; s64 runtime; u64 deadline; unsigned int flags; int dl_throttled; int dl_boosted; int dl_yielded; struct hrtimer dl_timer; } ;
1438 struct tlbflush_unmap_batch { struct cpumask cpumask; bool flush_required; bool writable; } ;
1457 struct sched_class ;
1457 struct compat_robust_list_head ;
1457 struct numa_group ;
1457 struct kcov ;
1457 struct task_struct { volatile long state; void *stack; atomic_t usage; unsigned int flags; unsigned int ptrace; struct llist_node wake_entry; int on_cpu; unsigned int wakee_flips; unsigned long wakee_flip_decay_ts; struct task_struct *last_wakee; int wake_cpu; int on_rq; int prio; int static_prio; int normal_prio; unsigned int rt_priority; const struct sched_class *sched_class; struct sched_entity se; struct sched_rt_entity rt; struct task_group *sched_task_group; struct sched_dl_entity dl; struct hlist_head preempt_notifiers; unsigned int policy; int nr_cpus_allowed; cpumask_t cpus_allowed; unsigned long rcu_tasks_nvcsw; bool rcu_tasks_holdout; struct list_head rcu_tasks_holdout_list; int rcu_tasks_idle_cpu; struct sched_info sched_info; struct list_head tasks; struct plist_node pushable_tasks; struct rb_node pushable_dl_tasks; struct mm_struct *mm; struct mm_struct *active_mm; u32 vmacache_seqnum; struct vm_area_struct *vmacache[4U]; struct task_rss_stat rss_stat; int exit_state; int exit_code; int exit_signal; int pdeath_signal; unsigned long jobctl; unsigned int personality; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned char sched_migrated; unsigned char sched_remote_wakeup; unsigned char; unsigned char in_execve; unsigned char in_iowait; unsigned char memcg_may_oom; unsigned char memcg_kmem_skip_account; unsigned char brk_randomized; unsigned long atomic_flags; struct restart_block restart_block; pid_t pid; pid_t tgid; struct task_struct *real_parent; struct task_struct *parent; struct list_head children; struct list_head sibling; struct task_struct *group_leader; struct list_head ptraced; struct list_head ptrace_entry; struct pid_link pids[3U]; struct list_head thread_group; struct list_head thread_node; struct completion *vfork_done; int *set_child_tid; int *clear_child_tid; cputime_t utime; cputime_t stime; cputime_t utimescaled; cputime_t stimescaled; cputime_t gtime; struct prev_cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; u64 start_time; u64 real_start_time; unsigned long min_flt; unsigned long maj_flt; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; const struct cred *real_cred; const struct cred *cred; char comm[16U]; struct nameidata *nameidata; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; struct fs_struct *fs; struct files_struct *files; struct nsproxy *nsproxy; struct signal_struct *signal; struct sighand_struct *sighand; sigset_t blocked; sigset_t real_blocked; sigset_t saved_sigmask; struct sigpending pending; unsigned long sas_ss_sp; size_t sas_ss_size; unsigned int sas_ss_flags; struct callback_head *task_works; struct audit_context *audit_context; kuid_t loginuid; unsigned int sessionid; struct seccomp seccomp; u32 parent_exec_id; u32 self_exec_id; spinlock_t alloc_lock; raw_spinlock_t pi_lock; struct wake_q_node wake_q; struct rb_root pi_waiters; struct rb_node *pi_waiters_leftmost; struct rt_mutex_waiter *pi_blocked_on; struct mutex_waiter *blocked_on; unsigned int irq_events; unsigned long hardirq_enable_ip; unsigned long hardirq_disable_ip; unsigned int hardirq_enable_event; unsigned int hardirq_disable_event; int hardirqs_enabled; int hardirq_context; unsigned long softirq_disable_ip; unsigned long softirq_enable_ip; unsigned int softirq_disable_event; unsigned int softirq_enable_event; int softirqs_enabled; int softirq_context; u64 curr_chain_key; int lockdep_depth; unsigned int lockdep_recursion; struct held_lock held_locks[48U]; gfp_t lockdep_reclaim_gfp; unsigned int in_ubsan; void *journal_info; struct bio_list *bio_list; struct blk_plug *plug; struct reclaim_state *reclaim_state; struct backing_dev_info *backing_dev_info; struct io_context *io_context; unsigned long ptrace_message; siginfo_t *last_siginfo; struct task_io_accounting ioac; u64 acct_rss_mem1; u64 acct_vm_mem1; cputime_t acct_timexpd; nodemask_t mems_allowed; seqcount_t mems_allowed_seq; int cpuset_mem_spread_rotor; int cpuset_slab_spread_rotor; struct css_set *cgroups; struct list_head cg_list; struct robust_list_head *robust_list; struct compat_robust_list_head *compat_robust_list; struct list_head pi_state_list; struct futex_pi_state *pi_state_cache; struct perf_event_context *perf_event_ctxp[2U]; struct mutex perf_event_mutex; struct list_head perf_event_list; struct mempolicy *mempolicy; short il_next; short pref_node_fork; int numa_scan_seq; unsigned int numa_scan_period; unsigned int numa_scan_period_max; int numa_preferred_nid; unsigned long numa_migrate_retry; u64 node_stamp; u64 last_task_numa_placement; u64 last_sum_exec_runtime; struct callback_head numa_work; struct list_head numa_entry; struct numa_group *numa_group; unsigned long *numa_faults; unsigned long total_numa_faults; unsigned long numa_faults_locality[3U]; unsigned long numa_pages_migrated; struct tlbflush_unmap_batch tlb_ubc; struct callback_head rcu; struct pipe_inode_info *splice_pipe; struct page_frag task_frag; struct task_delay_info *delays; int make_it_fail; int nr_dirtied; int nr_dirtied_pause; unsigned long dirty_paused_when; int latency_record_count; struct latency_record latency_record[32U]; u64 timer_slack_ns; u64 default_timer_slack_ns; unsigned int kasan_depth; unsigned long trace; unsigned long trace_recursion; enum kcov_mode kcov_mode; unsigned int kcov_size; void *kcov_area; struct kcov *kcov; struct mem_cgroup *memcg_in_oom; gfp_t memcg_oom_gfp_mask; int memcg_oom_order; unsigned int memcg_nr_pages_over_high; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; unsigned long task_state_change; int pagefault_disabled; struct task_struct *oom_reaper_list; struct thread_struct thread; } ;
63 struct exception_table_entry { int insn; int fixup; int handler; } ;
13 enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ;
16 typedef enum irqreturn irqreturn_t;
414 struct proc_dir_entry ;
13 typedef unsigned long kernel_ulong_t;
14 struct pci_device_id { __u32 vendor; __u32 device; __u32 subvendor; __u32 subdevice; __u32 class; __u32 class_mask; kernel_ulong_t driver_data; } ;
186 struct acpi_device_id { __u8 id[9U]; kernel_ulong_t driver_data; __u32 cls; __u32 cls_msk; } ;
229 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
484 struct platform_device_id { char name[20U]; kernel_ulong_t driver_data; } ;
70 struct hotplug_slot ;
70 struct pci_slot { struct pci_bus *bus; struct list_head list; struct hotplug_slot *hotplug; unsigned char number; struct kobject kobj; } ;
104 typedef int pci_power_t;
131 typedef unsigned int pci_channel_state_t;
132 enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ;
157 typedef unsigned short pci_dev_flags_t;
184 typedef unsigned short pci_bus_flags_t;
241 struct pcie_link_state ;
242 struct pci_vpd ;
243 struct pci_sriov ;
245 struct pci_driver ;
245 union __anonunion____missing_field_name_336 { struct pci_sriov *sriov; struct pci_dev *physfn; } ;
245 struct pci_dev { struct list_head bus_list; struct pci_bus *bus; struct pci_bus *subordinate; void *sysdata; struct proc_dir_entry *procent; struct pci_slot *slot; unsigned int devfn; unsigned short vendor; unsigned short device; unsigned short subsystem_vendor; unsigned short subsystem_device; unsigned int class; u8 revision; u8 hdr_type; u8 pcie_cap; u8 msi_cap; u8 msix_cap; unsigned char pcie_mpss; u8 rom_base_reg; u8 pin; u16 pcie_flags_reg; unsigned long *dma_alias_mask; struct pci_driver *driver; u64 dma_mask; struct device_dma_parameters dma_parms; pci_power_t current_state; u8 pm_cap; unsigned char pme_support; unsigned char pme_interrupt; unsigned char pme_poll; unsigned char d1_support; unsigned char d2_support; unsigned char no_d1d2; unsigned char no_d3cold; unsigned char d3cold_allowed; unsigned char mmio_always_on; unsigned char wakeup_prepared; unsigned char runtime_d3cold; unsigned char ignore_hotplug; unsigned int d3_delay; unsigned int d3cold_delay; struct pcie_link_state *link_state; pci_channel_state_t error_state; struct device dev; int cfg_size; unsigned int irq; struct resource resource[17U]; bool match_driver; unsigned char transparent; unsigned char multifunction; unsigned char is_added; unsigned char is_busmaster; unsigned char no_msi; unsigned char no_64bit_msi; unsigned char block_cfg_access; unsigned char broken_parity_status; unsigned char irq_reroute_variant; unsigned char msi_enabled; unsigned char msix_enabled; unsigned char ari_enabled; unsigned char ats_enabled; unsigned char is_managed; unsigned char needs_freset; unsigned char state_saved; unsigned char is_physfn; unsigned char is_virtfn; unsigned char reset_fn; unsigned char is_hotplug_bridge; unsigned char __aer_firmware_first_valid; unsigned char __aer_firmware_first; unsigned char broken_intx_masking; unsigned char io_window_1k; unsigned char irq_managed; unsigned char has_secondary_link; unsigned char non_compliant_bars; pci_dev_flags_t dev_flags; atomic_t enable_cnt; u32 saved_config_space[16U]; struct hlist_head saved_cap_space; struct bin_attribute *rom_attr; int rom_attr_enabled; struct bin_attribute *res_attr[17U]; struct bin_attribute *res_attr_wc[17U]; const struct attribute_group **msi_irq_groups; struct pci_vpd *vpd; union __anonunion____missing_field_name_336 __annonCompField85; u16 ats_cap; u8 ats_stu; atomic_t ats_ref_cnt; phys_addr_t rom; size_t romlen; char *driver_override; } ;
446 struct pci_ops ;
446 struct msi_controller ;
446 struct pci_bus { struct list_head node; struct pci_bus *parent; struct list_head children; struct list_head devices; struct pci_dev *self; struct list_head slots; struct resource *resource[4U]; struct list_head resources; struct resource busn_res; struct pci_ops *ops; struct msi_controller *msi; void *sysdata; struct proc_dir_entry *procdir; unsigned char number; unsigned char primary; unsigned char max_bus_speed; unsigned char cur_bus_speed; char name[48U]; unsigned short bridge_ctl; pci_bus_flags_t bus_flags; struct device *bridge; struct device dev; struct bin_attribute *legacy_io; struct bin_attribute *legacy_mem; unsigned char is_added; } ;
570 struct pci_ops { int (*add_bus)(struct pci_bus *); void (*remove_bus)(struct pci_bus *); void * (*map_bus)(struct pci_bus *, unsigned int, int); int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); int (*write)(struct pci_bus *, unsigned int, int, int, u32 ); } ;
600 struct pci_dynids { spinlock_t lock; struct list_head list; } ;
614 typedef unsigned int pci_ers_result_t;
624 struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev *, enum pci_channel_state ); pci_ers_result_t (*mmio_enabled)(struct pci_dev *); pci_ers_result_t (*link_reset)(struct pci_dev *); pci_ers_result_t (*slot_reset)(struct pci_dev *); void (*reset_notify)(struct pci_dev *, bool ); void (*resume)(struct pci_dev *); } ;
657 struct pci_driver { struct list_head node; const char *name; const struct pci_device_id *id_table; int (*probe)(struct pci_dev *, const struct pci_device_id *); void (*remove)(struct pci_dev *); int (*suspend)(struct pci_dev *, pm_message_t ); int (*suspend_late)(struct pci_dev *, pm_message_t ); int (*resume_early)(struct pci_dev *); int (*resume)(struct pci_dev *); void (*shutdown)(struct pci_dev *); int (*sriov_configure)(struct pci_dev *, int); const struct pci_error_handlers *err_handler; struct device_driver driver; struct pci_dynids dynids; } ;
134 struct mfd_cell ;
136 struct platform_device { const char *name; int id; bool id_auto; struct device dev; u32 num_resources; struct resource *resource; const struct platform_device_id *id_entry; char *driver_override; struct mfd_cell *mfd_cell; struct pdev_archdata archdata; } ;
352 struct pollfd { int fd; short events; short revents; } ;
32 struct poll_table_struct { void (*_qproc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); unsigned long _key; } ;
85 typedef unsigned int drm_magic_t;
86 struct drm_clip_rect { unsigned short x1; unsigned short y1; unsigned short x2; unsigned short y2; } ;
121 struct drm_hw_lock { volatile unsigned int lock; char padding[60U]; } ;
370 struct drm_mode_fb_cmd2 { __u32 fb_id; __u32 width; __u32 height; __u32 pixel_format; __u32 flags; __u32 handles[4U]; __u32 pitches[4U]; __u32 offsets[4U]; __u64 modifier[4U]; } ;
557 struct drm_mode_create_dumb { __u32 height; __u32 width; __u32 bpp; __u32 flags; __u32 handle; __u32 pitch; __u64 size; } ;
629 struct drm_event { __u32 type; __u32 length; } ;
843 struct drm_event_vblank { struct drm_event base; __u64 user_data; __u32 tv_sec; __u32 tv_usec; __u32 sequence; __u32 reserved; } ;
855 struct drm_device ;
856 struct drm_file ;
857 struct drm_agp_head { struct agp_kern_info agp_info; struct list_head memory; unsigned long mode; struct agp_bridge_data *bridge; int enabled; int acquired; unsigned long base; int agp_mtrr; int cant_use_aperture; unsigned long page_mask; } ;
64 enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_ACPI_DATA = 3, FWNODE_PDATA = 4, FWNODE_IRQCHIP = 5 } ;
73 struct fwnode_handle { enum fwnode_type type; struct fwnode_handle *secondary; } ;
32 typedef u32 phandle;
34 struct property { char *name; int length; void *value; struct property *next; unsigned long _flags; unsigned int unique_id; struct bin_attribute attr; } ;
44 struct device_node { const char *name; const char *type; phandle phandle; const char *full_name; struct fwnode_handle fwnode; struct property *properties; struct property *deadprops; struct device_node *parent; struct device_node *child; struct device_node *sibling; struct kobject kobj; unsigned long _flags; void *data; } ;
76 enum hdmi_picture_aspect { HDMI_PICTURE_ASPECT_NONE = 0, HDMI_PICTURE_ASPECT_4_3 = 1, HDMI_PICTURE_ASPECT_16_9 = 2, HDMI_PICTURE_ASPECT_RESERVED = 3 } ;
334 struct ww_class { atomic_long_t stamp; struct lock_class_key acquire_key; struct lock_class_key mutex_key; const char *acquire_name; const char *mutex_name; } ;
26 struct ww_mutex ;
26 struct ww_acquire_ctx { struct task_struct *task; unsigned long stamp; unsigned int acquired; unsigned int done_acquire; struct ww_class *ww_class; struct ww_mutex *contending_lock; struct lockdep_map dep_map; unsigned int deadlock_inject_interval; unsigned int deadlock_inject_countdown; } ;
43 struct ww_mutex { struct mutex base; struct ww_acquire_ctx *ctx; struct ww_class *ww_class; } ;
377 struct drm_modeset_lock ;
378 struct drm_modeset_acquire_ctx { struct ww_acquire_ctx ww_ctx; struct drm_modeset_lock *contended; struct list_head locked; bool trylock_only; } ;
63 struct drm_modeset_lock { struct ww_mutex mutex; struct list_head head; } ;
127 struct drm_crtc ;
128 struct drm_plane ;
142 struct drm_mode_set ;
143 struct drm_framebuffer ;
144 struct drm_object_properties ;
145 struct fence ;
146 struct drm_mode_object { uint32_t id; uint32_t type; struct drm_object_properties *properties; struct kref refcount; void (*free_cb)(struct kref *); } ;
55 struct drm_property ;
55 struct drm_object_properties { int count; int atomic_count; struct drm_property *properties[24U]; uint64_t values[24U]; } ;
79 enum drm_connector_force { DRM_FORCE_UNSPECIFIED = 0, DRM_FORCE_OFF = 1, DRM_FORCE_ON = 2, DRM_FORCE_ON_DIGITAL = 3 } ;
86 enum drm_mode_status { MODE_OK = 0, MODE_HSYNC = 1, MODE_VSYNC = 2, MODE_H_ILLEGAL = 3, MODE_V_ILLEGAL = 4, MODE_BAD_WIDTH = 5, MODE_NOMODE = 6, MODE_NO_INTERLACE = 7, MODE_NO_DBLESCAN = 8, MODE_NO_VSCAN = 9, MODE_MEM = 10, MODE_VIRTUAL_X = 11, MODE_VIRTUAL_Y = 12, MODE_MEM_VIRT = 13, MODE_NOCLOCK = 14, MODE_CLOCK_HIGH = 15, MODE_CLOCK_LOW = 16, MODE_CLOCK_RANGE = 17, MODE_BAD_HVALUE = 18, MODE_BAD_VVALUE = 19, MODE_BAD_VSCAN = 20, MODE_HSYNC_NARROW = 21, MODE_HSYNC_WIDE = 22, MODE_HBLANK_NARROW = 23, MODE_HBLANK_WIDE = 24, MODE_VSYNC_NARROW = 25, MODE_VSYNC_WIDE = 26, MODE_VBLANK_NARROW = 27, MODE_VBLANK_WIDE = 28, MODE_PANEL = 29, MODE_INTERLACE_WIDTH = 30, MODE_ONE_WIDTH = 31, MODE_ONE_HEIGHT = 32, MODE_ONE_SIZE = 33, MODE_NO_REDUCED = 34, MODE_NO_STEREO = 35, MODE_STALE = -3, MODE_BAD = -2, MODE_ERROR = -1 } ;
128 struct drm_display_mode { struct list_head head; struct drm_mode_object base; char name[32U]; enum drm_mode_status status; unsigned int type; int clock; int hdisplay; int hsync_start; int hsync_end; int htotal; int hskew; int vdisplay; int vsync_start; int vsync_end; int vtotal; int vscan; unsigned int flags; int width_mm; int height_mm; int crtc_clock; int crtc_hdisplay; int crtc_hblank_start; int crtc_hblank_end; int crtc_hsync_start; int crtc_hsync_end; int crtc_htotal; int crtc_hskew; int crtc_vdisplay; int crtc_vblank_start; int crtc_vblank_end; int crtc_vsync_start; int crtc_vsync_end; int crtc_vtotal; int *private; int private_flags; int vrefresh; int hsync; enum hdmi_picture_aspect picture_aspect_ratio; } ;
400 struct drm_cmdline_mode { bool specified; bool refresh_specified; bool bpp_specified; int xres; int yres; int bpp; int refresh; bool rb; bool interlace; bool cvt; bool margins; enum drm_connector_force force; } ;
428 struct drm_connector ;
495 enum drm_connector_status { connector_status_connected = 1, connector_status_disconnected = 2, connector_status_unknown = 3 } ;
501 enum subpixel_order { SubPixelUnknown = 0, SubPixelHorizontalRGB = 1, SubPixelHorizontalBGR = 2, SubPixelVerticalRGB = 3, SubPixelVerticalBGR = 4, SubPixelNone = 5 } ;
510 struct drm_display_info { char name[32U]; unsigned int width_mm; unsigned int height_mm; unsigned int min_vfreq; unsigned int max_vfreq; unsigned int min_hfreq; unsigned int max_hfreq; unsigned int pixel_clock; unsigned int bpc; enum subpixel_order subpixel_order; u32 color_formats; const u32 *bus_formats; unsigned int num_bus_formats; u32 bus_flags; u8 edid_hdmi_dc_modes; u8 cea_rev; } ;
157 struct drm_tile_group { struct kref refcount; struct drm_device *dev; int id; u8 group_data[8U]; } ;
165 struct drm_framebuffer_funcs { void (*destroy)(struct drm_framebuffer *); int (*create_handle)(struct drm_framebuffer *, struct drm_file *, unsigned int *); int (*dirty)(struct drm_framebuffer *, struct drm_file *, unsigned int, unsigned int, struct drm_clip_rect *, unsigned int); } ;
223 struct drm_framebuffer { struct drm_device *dev; struct list_head head; struct drm_mode_object base; const struct drm_framebuffer_funcs *funcs; unsigned int pitches[4U]; unsigned int offsets[4U]; uint64_t modifier[4U]; unsigned int width; unsigned int height; unsigned int depth; int bits_per_pixel; int flags; uint32_t pixel_format; struct list_head filp_head; } ;
258 struct drm_property_blob { struct drm_mode_object base; struct drm_device *dev; struct list_head head_global; struct list_head head_file; size_t length; unsigned char data[]; } ;
273 struct drm_property { struct list_head head; struct drm_mode_object base; uint32_t flags; char name[32U]; uint32_t num_values; uint64_t *values; struct drm_device *dev; struct list_head enum_list; } ;
285 struct drm_encoder ;
286 struct drm_pending_vblank_event ;
287 struct drm_bridge ;
288 struct drm_atomic_state ;
289 struct drm_crtc_helper_funcs ;
290 struct drm_encoder_helper_funcs ;
291 struct drm_connector_helper_funcs ;
292 struct drm_plane_helper_funcs ;
293 struct drm_crtc_state { struct drm_crtc *crtc; bool enable; bool active; bool planes_changed; bool mode_changed; bool active_changed; bool connectors_changed; bool color_mgmt_changed; u32 plane_mask; u32 connector_mask; u32 encoder_mask; u32 last_vblank_count; struct drm_display_mode adjusted_mode; struct drm_display_mode mode; struct drm_property_blob *mode_blob; struct drm_property_blob *degamma_lut; struct drm_property_blob *ctm; struct drm_property_blob *gamma_lut; struct drm_pending_vblank_event *event; struct drm_atomic_state *state; } ;
375 struct drm_crtc_funcs { void (*reset)(struct drm_crtc *); int (*cursor_set)(struct drm_crtc *, struct drm_file *, uint32_t , uint32_t , uint32_t ); int (*cursor_set2)(struct drm_crtc *, struct drm_file *, uint32_t , uint32_t , uint32_t , int32_t , int32_t ); int (*cursor_move)(struct drm_crtc *, int, int); void (*gamma_set)(struct drm_crtc *, u16 *, u16 *, u16 *, uint32_t , uint32_t ); void (*destroy)(struct drm_crtc *); int (*set_config)(struct drm_mode_set *); int (*page_flip)(struct drm_crtc *, struct drm_framebuffer *, struct drm_pending_vblank_event *, uint32_t ); int (*set_property)(struct drm_crtc *, struct drm_property *, uint64_t ); struct drm_crtc_state * (*atomic_duplicate_state)(struct drm_crtc *); void (*atomic_destroy_state)(struct drm_crtc *, struct drm_crtc_state *); int (*atomic_set_property)(struct drm_crtc *, struct drm_crtc_state *, struct drm_property *, uint64_t ); int (*atomic_get_property)(struct drm_crtc *, const struct drm_crtc_state *, struct drm_property *, uint64_t *); } ;
702 struct drm_crtc { struct drm_device *dev; struct device_node *port; struct list_head head; char *name; struct drm_modeset_lock mutex; struct drm_mode_object base; struct drm_plane *primary; struct drm_plane *cursor; int cursor_x; int cursor_y; bool enabled; struct drm_display_mode mode; struct drm_display_mode hwmode; int x; int y; const struct drm_crtc_funcs *funcs; uint32_t gamma_size; uint16_t *gamma_store; const struct drm_crtc_helper_funcs *helper_private; struct drm_object_properties properties; struct drm_crtc_state *state; struct drm_modeset_acquire_ctx *acquire_ctx; } ;
790 struct drm_connector_state { struct drm_connector *connector; struct drm_crtc *crtc; struct drm_encoder *best_encoder; struct drm_atomic_state *state; } ;
807 struct drm_connector_funcs { int (*dpms)(struct drm_connector *, int); void (*reset)(struct drm_connector *); enum drm_connector_status (*detect)(struct drm_connector *, bool ); void (*force)(struct drm_connector *); int (*fill_modes)(struct drm_connector *, uint32_t , uint32_t ); int (*set_property)(struct drm_connector *, struct drm_property *, uint64_t ); void (*destroy)(struct drm_connector *); struct drm_connector_state * (*atomic_duplicate_state)(struct drm_connector *); void (*atomic_destroy_state)(struct drm_connector *, struct drm_connector_state *); int (*atomic_set_property)(struct drm_connector *, struct drm_connector_state *, struct drm_property *, uint64_t ); int (*atomic_get_property)(struct drm_connector *, const struct drm_connector_state *, struct drm_property *, uint64_t *); } ;
1045 struct drm_encoder_funcs { void (*reset)(struct drm_encoder *); void (*destroy)(struct drm_encoder *); } ;
1073 struct drm_encoder { struct drm_device *dev; struct list_head head; struct drm_mode_object base; char *name; int encoder_type; uint32_t possible_crtcs; uint32_t possible_clones; struct drm_crtc *crtc; struct drm_bridge *bridge; const struct drm_encoder_funcs *funcs; const struct drm_encoder_helper_funcs *helper_private; } ;
1108 struct drm_connector { struct drm_device *dev; struct device *kdev; struct device_attribute *attr; struct list_head head; struct drm_mode_object base; char *name; int connector_id; int connector_type; int connector_type_id; bool interlace_allowed; bool doublescan_allowed; bool stereo_allowed; struct list_head modes; enum drm_connector_status status; struct list_head probed_modes; struct drm_display_info display_info; const struct drm_connector_funcs *funcs; struct drm_property_blob *edid_blob_ptr; struct drm_object_properties properties; struct drm_property_blob *path_blob_ptr; struct drm_property_blob *tile_blob_ptr; uint8_t polled; int dpms; const struct drm_connector_helper_funcs *helper_private; struct drm_cmdline_mode cmdline_mode; enum drm_connector_force force; bool override_edid; uint32_t encoder_ids[3U]; struct drm_encoder *encoder; uint8_t eld[128U]; bool dvi_dual; int max_tmds_clock; bool latency_present[2U]; int video_latency[2U]; int audio_latency[2U]; int null_edid_counter; unsigned int bad_edid_counter; bool edid_corrupt; struct dentry *debugfs_entry; struct drm_connector_state *state; bool has_tile; struct drm_tile_group *tile_group; bool tile_is_single_monitor; uint8_t num_h_tile; uint8_t num_v_tile; uint8_t tile_h_loc; uint8_t tile_v_loc; uint16_t tile_h_size; uint16_t tile_v_size; } ;
1249 struct drm_plane_state { struct drm_plane *plane; struct drm_crtc *crtc; struct drm_framebuffer *fb; struct fence *fence; int32_t crtc_x; int32_t crtc_y; uint32_t crtc_w; uint32_t crtc_h; uint32_t src_x; uint32_t src_y; uint32_t src_h; uint32_t src_w; unsigned int rotation; struct drm_atomic_state *state; } ;
1288 struct drm_plane_funcs { int (*update_plane)(struct drm_plane *, struct drm_crtc *, struct drm_framebuffer *, int, int, unsigned int, unsigned int, uint32_t , uint32_t , uint32_t , uint32_t ); int (*disable_plane)(struct drm_plane *); void (*destroy)(struct drm_plane *); void (*reset)(struct drm_plane *); int (*set_property)(struct drm_plane *, struct drm_property *, uint64_t ); struct drm_plane_state * (*atomic_duplicate_state)(struct drm_plane *); void (*atomic_destroy_state)(struct drm_plane *, struct drm_plane_state *); int (*atomic_set_property)(struct drm_plane *, struct drm_plane_state *, struct drm_property *, uint64_t ); int (*atomic_get_property)(struct drm_plane *, const struct drm_plane_state *, struct drm_property *, uint64_t *); } ;
1491 enum drm_plane_type { DRM_PLANE_TYPE_OVERLAY = 0, DRM_PLANE_TYPE_PRIMARY = 1, DRM_PLANE_TYPE_CURSOR = 2 } ;
1497 struct drm_plane { struct drm_device *dev; struct list_head head; char *name; struct drm_modeset_lock mutex; struct drm_mode_object base; uint32_t possible_crtcs; uint32_t *format_types; unsigned int format_count; bool format_default; struct drm_crtc *crtc; struct drm_framebuffer *fb; struct drm_framebuffer *old_fb; const struct drm_plane_funcs *funcs; struct drm_object_properties properties; enum drm_plane_type type; const struct drm_plane_helper_funcs *helper_private; struct drm_plane_state *state; } ;
1550 struct drm_bridge_funcs { int (*attach)(struct drm_bridge *); bool (*mode_fixup)(struct drm_bridge *, const struct drm_display_mode *, struct drm_display_mode *); void (*disable)(struct drm_bridge *); void (*post_disable)(struct drm_bridge *); void (*mode_set)(struct drm_bridge *, struct drm_display_mode *, struct drm_display_mode *); void (*pre_enable)(struct drm_bridge *); void (*enable)(struct drm_bridge *); } ;
1672 struct drm_bridge { struct drm_device *dev; struct drm_encoder *encoder; struct drm_bridge *next; struct device_node *of_node; struct list_head list; const struct drm_bridge_funcs *funcs; void *driver_private; } ;
1695 struct drm_atomic_state { struct drm_device *dev; bool allow_modeset; bool legacy_cursor_update; bool legacy_set_config; struct drm_plane **planes; struct drm_plane_state **plane_states; struct drm_crtc **crtcs; struct drm_crtc_state **crtc_states; int num_connector; struct drm_connector **connectors; struct drm_connector_state **connector_states; struct drm_modeset_acquire_ctx *acquire_ctx; } ;
1726 struct drm_mode_set { struct drm_framebuffer *fb; struct drm_crtc *crtc; struct drm_display_mode *mode; uint32_t x; uint32_t y; struct drm_connector **connectors; size_t num_connectors; } ;
1754 struct drm_mode_config_funcs { struct drm_framebuffer * (*fb_create)(struct drm_device *, struct drm_file *, const struct drm_mode_fb_cmd2 *); void (*output_poll_changed)(struct drm_device *); int (*atomic_check)(struct drm_device *, struct drm_atomic_state *); int (*atomic_commit)(struct drm_device *, struct drm_atomic_state *, bool ); struct drm_atomic_state * (*atomic_state_alloc)(struct drm_device *); void (*atomic_state_clear)(struct drm_atomic_state *); void (*atomic_state_free)(struct drm_atomic_state *); } ;
2018 struct drm_mode_config { struct mutex mutex; struct drm_modeset_lock connection_mutex; struct drm_modeset_acquire_ctx *acquire_ctx; struct mutex idr_mutex; struct idr crtc_idr; struct idr tile_idr; struct mutex fb_lock; int num_fb; struct list_head fb_list; int num_connector; struct ida connector_ida; struct list_head connector_list; int num_encoder; struct list_head encoder_list; int num_overlay_plane; int num_total_plane; struct list_head plane_list; int num_crtc; struct list_head crtc_list; struct list_head property_list; int min_width; int min_height; int max_width; int max_height; const struct drm_mode_config_funcs *funcs; resource_size_t fb_base; bool poll_enabled; bool poll_running; bool delayed_event; struct delayed_work output_poll_work; struct mutex blob_lock; struct list_head property_blob_list; struct drm_property *edid_property; struct drm_property *dpms_property; struct drm_property *path_property; struct drm_property *tile_property; struct drm_property *plane_type_property; struct drm_property *rotation_property; struct drm_property *prop_src_x; struct drm_property *prop_src_y; struct drm_property *prop_src_w; struct drm_property *prop_src_h; struct drm_property *prop_crtc_x; struct drm_property *prop_crtc_y; struct drm_property *prop_crtc_w; struct drm_property *prop_crtc_h; struct drm_property *prop_fb_id; struct drm_property *prop_crtc_id; struct drm_property *prop_active; struct drm_property *prop_mode_id; struct drm_property *dvi_i_subconnector_property; struct drm_property *dvi_i_select_subconnector_property; struct drm_property *tv_subconnector_property; struct drm_property *tv_select_subconnector_property; struct drm_property *tv_mode_property; struct drm_property *tv_left_margin_property; struct drm_property *tv_right_margin_property; struct drm_property *tv_top_margin_property; struct drm_property *tv_bottom_margin_property; struct drm_property *tv_brightness_property; struct drm_property *tv_contrast_property; struct drm_property *tv_flicker_reduction_property; struct drm_property *tv_overscan_property; struct drm_property *tv_saturation_property; struct drm_property *tv_hue_property; struct drm_property *scaling_mode_property; struct drm_property *aspect_ratio_property; struct drm_property *dirty_info_property; struct drm_property *degamma_lut_property; struct drm_property *degamma_lut_size_property; struct drm_property *ctm_property; struct drm_property *gamma_lut_property; struct drm_property *gamma_lut_size_property; struct drm_property *suggested_x_property; struct drm_property *suggested_y_property; uint32_t preferred_depth; uint32_t prefer_shadow; bool async_page_flip; bool allow_fb_modifiers; uint32_t cursor_width; uint32_t cursor_height; } ;
46 struct drm_open_hash { struct hlist_head *table; u8 order; } ;
91 struct drm_mm ;
91 struct drm_mm_node { struct list_head node_list; struct list_head hole_stack; unsigned char hole_follows; unsigned char scanned_block; unsigned char scanned_prev_free; unsigned char scanned_next_free; unsigned char scanned_preceeds_hole; unsigned char allocated; unsigned long color; u64 start; u64 size; struct drm_mm *mm; } ;
75 struct drm_mm { struct list_head hole_stack; struct drm_mm_node head_node; unsigned char scan_check_range; unsigned int scan_alignment; unsigned long scan_color; u64 scan_size; u64 scan_hit_start; u64 scan_hit_end; unsigned int scanned_blocks; u64 scan_start; u64 scan_end; struct drm_mm_node *prev_scanned_node; void (*color_adjust)(struct drm_mm_node *, unsigned long, u64 *, u64 *); } ;
19 struct vdso_image { void *data; unsigned long size; unsigned long alt; unsigned long alt_len; long sym_vvar_start; long sym_vvar_page; long sym_hpet_page; long sym_pvclock_page; long sym_VDSO32_NOTE_MASK; long sym___kernel_sigreturn; long sym___kernel_rt_sigreturn; long sym___kernel_vsyscall; long sym_int80_landing_pad; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
18 typedef __u64 Elf64_Off;
20 typedef __u32 Elf64_Word;
21 typedef __u64 Elf64_Xword;
190 struct elf64_sym { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } ;
198 typedef struct elf64_sym Elf64_Sym;
219 struct elf64_hdr { unsigned char e_ident[16U]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; Elf64_Off e_phoff; Elf64_Off e_shoff; Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } ;
235 typedef struct elf64_hdr Elf64_Ehdr;
313 struct elf64_shdr { Elf64_Word sh_name; Elf64_Word sh_type; Elf64_Xword sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; Elf64_Xword sh_size; Elf64_Word sh_link; Elf64_Word sh_info; Elf64_Xword sh_addralign; Elf64_Xword sh_entsize; } ;
325 typedef struct elf64_shdr Elf64_Shdr;
53 struct latch_tree_node { struct rb_node node[2U]; } ;
211 struct mod_arch_specific { } ;
38 struct module_param_attrs ;
38 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
48 struct module_attribute { struct attribute attr; ssize_t (*show)(struct module_attribute *, struct module_kobject *, char *); ssize_t (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t ); void (*setup)(struct module *, const char *); int (*test)(struct module *); void (*free)(struct module *); } ;
290 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
297 struct mod_tree_node { struct module *mod; struct latch_tree_node node; } ;
304 struct module_layout { void *base; unsigned int size; unsigned int text_size; unsigned int ro_size; struct mod_tree_node mtn; } ;
318 struct mod_kallsyms { Elf64_Sym *symtab; unsigned int num_symtab; char *strtab; } ;
332 struct klp_modinfo { Elf64_Ehdr hdr; Elf64_Shdr *sechdrs; char *secstrings; unsigned int symndx; } ;
340 struct module_sect_attrs ;
340 struct module_notes_attrs ;
340 struct trace_event_call ;
340 struct trace_enum_map ;
340 struct module { enum module_state state; struct list_head list; char name[56U]; struct module_kobject mkobj; struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; struct kobject *holders_dir; const struct kernel_symbol *syms; const unsigned long *crcs; unsigned int num_syms; struct mutex param_lock; struct kernel_param *kp; unsigned int num_kp; unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const unsigned long *gpl_crcs; const struct kernel_symbol *unused_syms; const unsigned long *unused_crcs; unsigned int num_unused_syms; unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const unsigned long *unused_gpl_crcs; bool sig_ok; bool async_probe_requested; const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; unsigned int num_gpl_future_syms; unsigned int num_exentries; struct exception_table_entry *extable; int (*init)(); struct module_layout core_layout; struct module_layout init_layout; struct mod_arch_specific arch; unsigned int taints; unsigned int num_bugs; struct list_head bug_list; struct bug_entry *bug_table; struct mod_kallsyms *kallsyms; struct mod_kallsyms core_kallsyms; struct module_sect_attrs *sect_attrs; struct module_notes_attrs *notes_attrs; char *args; void *percpu; unsigned int percpu_size; unsigned int num_tracepoints; const struct tracepoint **tracepoints_ptrs; unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; struct trace_event_call **trace_events; unsigned int num_trace_events; struct trace_enum_map **trace_enums; unsigned int num_trace_enums; bool klp; bool klp_alive; struct klp_modinfo *klp_info; struct list_head source_list; struct list_head target_list; void (*exit)(); atomic_t refcnt; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
46 struct drm_vma_offset_manager { rwlock_t vm_lock; struct rb_root vm_addr_space_rb; struct drm_mm vm_addr_space_mm; } ;
233 struct drm_local_map ;
234 struct drm_device_dma ;
236 struct drm_gem_object ;
237 struct reservation_object ;
238 struct dma_buf_attachment ;
246 typedef int drm_ioctl_t(struct drm_device *, void *, struct drm_file *);
250 struct drm_ioctl_desc { unsigned int cmd; int flags; drm_ioctl_t *func; const char *name; } ;
268 struct drm_pending_event { struct drm_event *event; struct list_head link; struct list_head pending_link; struct drm_file *file_priv; pid_t pid; void (*destroy)(struct drm_pending_event *); } ;
292 struct drm_prime_file_private { struct list_head head; struct mutex lock; } ;
298 struct drm_minor ;
298 struct drm_master ;
298 struct drm_file { unsigned char authenticated; unsigned char is_master; unsigned char stereo_allowed; unsigned char universal_planes; unsigned char atomic; unsigned char allowed_master; struct pid *pid; kuid_t uid; drm_magic_t magic; struct list_head lhead; struct drm_minor *minor; unsigned long lock_count; struct idr object_idr; spinlock_t table_lock; struct file *filp; void *driver_priv; struct drm_master *master; struct list_head fbs; struct mutex fbs_lock; struct list_head blobs; wait_queue_head_t event_wait; struct list_head pending_event_list; struct list_head event_list; int event_space; struct mutex event_read_lock; struct drm_prime_file_private prime; } ;
358 struct drm_lock_data { struct drm_hw_lock *hw_lock; struct drm_file *file_priv; wait_queue_head_t lock_queue; unsigned long lock_time; spinlock_t spinlock; uint32_t kernel_waiters; uint32_t user_waiters; int idle_has_lock; } ;
373 struct drm_master { struct kref refcount; struct drm_minor *minor; char *unique; int unique_len; struct idr magic_map; struct drm_lock_data lock; void *driver_priv; } ;
394 struct dma_buf ;
394 struct drm_driver { int (*load)(struct drm_device *, unsigned long); int (*firstopen)(struct drm_device *); int (*open)(struct drm_device *, struct drm_file *); void (*preclose)(struct drm_device *, struct drm_file *); void (*postclose)(struct drm_device *, struct drm_file *); void (*lastclose)(struct drm_device *); int (*unload)(struct drm_device *); int (*suspend)(struct drm_device *, pm_message_t ); int (*resume)(struct drm_device *); int (*dma_ioctl)(struct drm_device *, void *, struct drm_file *); int (*dma_quiescent)(struct drm_device *); int (*context_dtor)(struct drm_device *, int); int (*set_busid)(struct drm_device *, struct drm_master *); u32 (*get_vblank_counter)(struct drm_device *, unsigned int); int (*enable_vblank)(struct drm_device *, unsigned int); void (*disable_vblank)(struct drm_device *, unsigned int); int (*device_is_agp)(struct drm_device *); int (*get_scanout_position)(struct drm_device *, unsigned int, unsigned int, int *, int *, ktime_t *, ktime_t *, const struct drm_display_mode *); int (*get_vblank_timestamp)(struct drm_device *, unsigned int, int *, struct timeval *, unsigned int); irqreturn_t (*irq_handler)(int, void *); void (*irq_preinstall)(struct drm_device *); int (*irq_postinstall)(struct drm_device *); void (*irq_uninstall)(struct drm_device *); int (*master_create)(struct drm_device *, struct drm_master *); void (*master_destroy)(struct drm_device *, struct drm_master *); int (*master_set)(struct drm_device *, struct drm_file *, bool ); void (*master_drop)(struct drm_device *, struct drm_file *, bool ); int (*debugfs_init)(struct drm_minor *); void (*debugfs_cleanup)(struct drm_minor *); void (*gem_free_object)(struct drm_gem_object *); void (*gem_free_object_unlocked)(struct drm_gem_object *); int (*gem_open_object)(struct drm_gem_object *, struct drm_file *); void (*gem_close_object)(struct drm_gem_object *, struct drm_file *); struct drm_gem_object * (*gem_create_object)(struct drm_device *, size_t ); int (*prime_handle_to_fd)(struct drm_device *, struct drm_file *, uint32_t , uint32_t , int *); int (*prime_fd_to_handle)(struct drm_device *, struct drm_file *, int, uint32_t *); struct dma_buf * (*gem_prime_export)(struct drm_device *, struct drm_gem_object *, int); struct drm_gem_object * (*gem_prime_import)(struct drm_device *, struct dma_buf *); int (*gem_prime_pin)(struct drm_gem_object *); void (*gem_prime_unpin)(struct drm_gem_object *); struct reservation_object * (*gem_prime_res_obj)(struct drm_gem_object *); struct sg_table * (*gem_prime_get_sg_table)(struct drm_gem_object *); struct drm_gem_object * (*gem_prime_import_sg_table)(struct drm_device *, struct dma_buf_attachment *, struct sg_table *); void * (*gem_prime_vmap)(struct drm_gem_object *); void (*gem_prime_vunmap)(struct drm_gem_object *, void *); int (*gem_prime_mmap)(struct drm_gem_object *, struct vm_area_struct *); void (*vgaarb_irq)(struct drm_device *, bool ); int (*dumb_create)(struct drm_file *, struct drm_device *, struct drm_mode_create_dumb *); int (*dumb_map_offset)(struct drm_file *, struct drm_device *, uint32_t , uint64_t *); int (*dumb_destroy)(struct drm_file *, struct drm_device *, uint32_t ); const struct vm_operations_struct *gem_vm_ops; int major; int minor; int patchlevel; char *name; char *desc; char *date; u32 driver_features; int dev_priv_size; const struct drm_ioctl_desc *ioctls; int num_ioctls; const struct file_operations *fops; struct list_head legacy_dev_list; } ;
697 struct drm_minor { int index; int type; struct device *kdev; struct drm_device *dev; struct dentry *debugfs_root; struct list_head debugfs_list; struct mutex debugfs_lock; struct drm_master *master; } ;
715 struct drm_pending_vblank_event { struct drm_pending_event base; unsigned int pipe; struct drm_event_vblank event; } ;
722 struct drm_vblank_crtc { struct drm_device *dev; wait_queue_head_t queue; struct timer_list disable_timer; u32 count; struct timeval time[2U]; atomic_t refcount; u32 last; u32 last_wait; unsigned int inmodeset; unsigned int pipe; int framedur_ns; int linedur_ns; bool enabled; } ;
743 struct virtio_device ;
743 struct drm_sg_mem ;
743 struct __anonstruct_sigdata_354 { int context; struct drm_hw_lock *lock; } ;
743 struct drm_device { struct list_head legacy_dev_list; int if_version; struct kref ref; struct device *dev; struct drm_driver *driver; void *dev_private; struct drm_minor *control; struct drm_minor *primary; struct drm_minor *render; atomic_t unplugged; struct inode *anon_inode; char *unique; struct mutex struct_mutex; struct mutex master_mutex; int open_count; spinlock_t buf_lock; int buf_use; atomic_t buf_alloc; struct mutex filelist_mutex; struct list_head filelist; struct list_head maplist; struct drm_open_hash map_hash; struct list_head ctxlist; struct mutex ctxlist_mutex; struct idr ctx_idr; struct list_head vmalist; struct drm_device_dma *dma; volatile long context_flag; int last_context; bool irq_enabled; int irq; bool vblank_disable_immediate; struct drm_vblank_crtc *vblank; spinlock_t vblank_time_lock; spinlock_t vbl_lock; u32 max_vblank_count; struct list_head vblank_event_list; spinlock_t event_lock; struct drm_agp_head *agp; struct pci_dev *pdev; struct platform_device *platformdev; struct virtio_device *virtdev; struct drm_sg_mem *sg; unsigned int num_crtcs; struct __anonstruct_sigdata_354 sigdata; struct drm_local_map *agp_buffer_map; unsigned int agp_buffer_token; struct drm_mode_config mode_config; struct mutex object_name_lock; struct idr object_name_idr; struct drm_vma_offset_manager *vma_offset_manager; int switch_power_state; } ;
171 enum mode_set_atomic ;
172 struct drm_crtc_helper_funcs { void (*dpms)(struct drm_crtc *, int); void (*prepare)(struct drm_crtc *); void (*commit)(struct drm_crtc *); bool (*mode_fixup)(struct drm_crtc *, const struct drm_display_mode *, struct drm_display_mode *); int (*mode_set)(struct drm_crtc *, struct drm_display_mode *, struct drm_display_mode *, int, int, struct drm_framebuffer *); void (*mode_set_nofb)(struct drm_crtc *); int (*mode_set_base)(struct drm_crtc *, int, int, struct drm_framebuffer *); int (*mode_set_base_atomic)(struct drm_crtc *, struct drm_framebuffer *, int, int, int); void (*load_lut)(struct drm_crtc *); void (*disable)(struct drm_crtc *); void (*enable)(struct drm_crtc *); int (*atomic_check)(struct drm_crtc *, struct drm_crtc_state *); void (*atomic_begin)(struct drm_crtc *, struct drm_crtc_state *); void (*atomic_flush)(struct drm_crtc *, struct drm_crtc_state *); } ;
406 struct drm_encoder_helper_funcs { void (*dpms)(struct drm_encoder *, int); bool (*mode_fixup)(struct drm_encoder *, const struct drm_display_mode *, struct drm_display_mode *); void (*prepare)(struct drm_encoder *); void (*commit)(struct drm_encoder *); void (*mode_set)(struct drm_encoder *, struct drm_display_mode *, struct drm_display_mode *); struct drm_crtc * (*get_crtc)(struct drm_encoder *); enum drm_connector_status (*detect)(struct drm_encoder *, struct drm_connector *); void (*disable)(struct drm_encoder *); void (*enable)(struct drm_encoder *); int (*atomic_check)(struct drm_encoder *, struct drm_crtc_state *, struct drm_connector_state *); } ;
653 struct drm_connector_helper_funcs { int (*get_modes)(struct drm_connector *); enum drm_mode_status (*mode_valid)(struct drm_connector *, struct drm_display_mode *); struct drm_encoder * (*best_encoder)(struct drm_connector *); struct drm_encoder * (*atomic_best_encoder)(struct drm_connector *, struct drm_connector_state *); } ;
786 struct drm_plane_helper_funcs { int (*prepare_fb)(struct drm_plane *, const struct drm_plane_state *); void (*cleanup_fb)(struct drm_plane *, const struct drm_plane_state *); int (*atomic_check)(struct drm_plane *, struct drm_plane_state *); void (*atomic_update)(struct drm_plane *, struct drm_plane_state *); void (*atomic_disable)(struct drm_plane *, struct drm_plane_state *); } ;
20 struct rt_mutex { raw_spinlock_t wait_lock; struct rb_root waiters; struct rb_node *waiters_leftmost; struct task_struct *owner; int save_state; const char *name; const char *file; int line; void *magic; } ;
1150 struct i2c_msg { __u16 addr; __u16 flags; __u16 len; __u8 *buf; } ;
83 union i2c_smbus_data { __u8 byte; __u16 word; __u8 block[34U]; } ;
39 struct i2c_algorithm ;
40 struct i2c_adapter ;
41 struct i2c_client ;
44 enum i2c_slave_event ;
199 struct i2c_client { unsigned short flags; unsigned short addr; char name[20U]; struct i2c_adapter *adapter; struct device dev; int irq; struct list_head detected; int (*slave_cb)(struct i2c_client *, enum i2c_slave_event , u8 *); } ;
254 enum i2c_slave_event { I2C_SLAVE_READ_REQUESTED = 0, I2C_SLAVE_WRITE_REQUESTED = 1, I2C_SLAVE_READ_PROCESSED = 2, I2C_SLAVE_WRITE_RECEIVED = 3, I2C_SLAVE_STOP = 4 } ;
362 struct i2c_algorithm { int (*master_xfer)(struct i2c_adapter *, struct i2c_msg *, int); int (*smbus_xfer)(struct i2c_adapter *, u16 , unsigned short, char, u8 , int, union i2c_smbus_data *); u32 (*functionality)(struct i2c_adapter *); int (*reg_slave)(struct i2c_client *); int (*unreg_slave)(struct i2c_client *); } ;
431 struct i2c_bus_recovery_info { int (*recover_bus)(struct i2c_adapter *); int (*get_scl)(struct i2c_adapter *); void (*set_scl)(struct i2c_adapter *, int); int (*get_sda)(struct i2c_adapter *); void (*prepare_recovery)(struct i2c_adapter *); void (*unprepare_recovery)(struct i2c_adapter *); int scl_gpio; int sda_gpio; } ;
470 struct i2c_adapter_quirks { u64 flags; int max_num_msgs; u16 max_write_len; u16 max_read_len; u16 max_comb_1st_msg_len; u16 max_comb_2nd_msg_len; } ;
500 struct i2c_adapter { struct module *owner; unsigned int class; const struct i2c_algorithm *algo; void *algo_data; struct rt_mutex bus_lock; struct rt_mutex mux_lock; int timeout; int retries; struct device dev; int nr; char name[48U]; struct completion dev_released; struct mutex userspace_clients_lock; struct list_head userspace_clients; struct i2c_bus_recovery_info *bus_recovery_info; const struct i2c_adapter_quirks *quirks; void (*lock_bus)(struct i2c_adapter *, unsigned int); int (*trylock_bus)(struct i2c_adapter *, unsigned int); void (*unlock_bus)(struct i2c_adapter *, unsigned int); } ;
683 struct drm_dp_aux_msg { unsigned int address; u8 request; u8 reply; void *buffer; size_t size; } ;
704 struct drm_dp_aux { const char *name; struct i2c_adapter ddc; struct device *dev; struct mutex hw_mutex; ssize_t (*transfer)(struct drm_dp_aux *, struct drm_dp_aux_msg *); unsigned int i2c_nack_count; unsigned int i2c_defer_count; } ;
788 struct drm_dp_link { unsigned char revision; unsigned int rate; unsigned int num_lanes; unsigned long capabilities; } ;
32 typedef __u16 __le16;
27 union __anonunion___u_10___0 { struct list_head *__val; char __c[1U]; } ;
189 union __anonunion___u_14___0 { struct list_head *__val; char __c[1U]; } ;
26 union __anonunion___u_26___0 { int __val; char __c[1U]; } ;
2343 struct edid ;
295 struct est_timings { u8 t1; u8 t2; u8 mfg_rsvd; } ;
44 struct std_timing { u8 hsize; u8 vfreq_aspect; } ;
57 struct detailed_pixel_timing { u8 hactive_lo; u8 hblank_lo; u8 hactive_hblank_hi; u8 vactive_lo; u8 vblank_lo; u8 vactive_vblank_hi; u8 hsync_offset_lo; u8 hsync_pulse_width_lo; u8 vsync_offset_pulse_width_lo; u8 hsync_vsync_offset_pulse_width_hi; u8 width_mm_lo; u8 height_mm_lo; u8 width_height_mm_hi; u8 hborder; u8 vborder; u8 misc; } ;
83 struct detailed_data_string { u8 str[13U]; } ;
88 struct __anonstruct_gtf2_356 { u8 reserved; u8 hfreq_start_khz; u8 c; __le16 m; u8 k; u8 j; } ;
88 struct __anonstruct_cvt_357 { u8 version; u8 data1; u8 data2; u8 supported_aspects; u8 flags; u8 supported_scalings; u8 preferred_refresh; } ;
88 union __anonunion_formula_355 { struct __anonstruct_gtf2_356 gtf2; struct __anonstruct_cvt_357 cvt; } ;
88 struct detailed_data_monitor_range { u8 min_vfreq; u8 max_vfreq; u8 min_hfreq_khz; u8 max_hfreq_khz; u8 pixel_clock_mhz; u8 flags; union __anonunion_formula_355 formula; } ;
116 struct detailed_data_wpindex { u8 white_yx_lo; u8 white_x_hi; u8 white_y_hi; u8 gamma; } ;
130 struct cvt_timing { u8 code[3U]; } ;
134 union __anonunion_data_358 { struct detailed_data_string str; struct detailed_data_monitor_range range; struct detailed_data_wpindex color; struct std_timing timings[6U]; struct cvt_timing cvt[4U]; } ;
134 struct detailed_non_pixel { u8 pad1; u8 type; u8 pad2; union __anonunion_data_358 data; } ;
149 union __anonunion_data_359 { struct detailed_pixel_timing pixel_data; struct detailed_non_pixel other_data; } ;
149 struct detailed_timing { __le16 pixel_clock; union __anonunion_data_359 data; } ;
167 struct edid { u8 header[8U]; u8 mfg_id[2U]; u8 prod_code[2U]; u32 serial; u8 mfg_week; u8 mfg_year; u8 version; u8 revision; u8 input; u8 width_cm; u8 height_cm; u8 gamma; u8 features; u8 red_green_lo; u8 black_white_lo; u8 red_x; u8 red_y; u8 green_x; u8 green_y; u8 blue_x; u8 blue_y; u8 white_x; u8 white_y; struct est_timings established_timings; struct std_timing standard_timings[8U]; struct detailed_timing detailed_timings[4U]; u8 extensions; u8 checksum; } ;
26 union __anonunion___u_25 { int __val; char __c[1U]; } ;
1147 struct drm_rect { int x1; int y1; int x2; int y2; } ;
27 union __anonunion___u_10___1 { struct list_head *__val; char __c[1U]; } ;
189 union __anonunion___u_14___1 { struct list_head *__val; char __c[1U]; } ;
26 union __anonunion___u_43 { int __val; char __c[1U]; } ;
38 union __anonunion___u_45 { int __val; char __c[1U]; } ;
12 struct __wait_queue ;
12 typedef struct __wait_queue wait_queue_t;
15 struct __wait_queue { unsigned int flags; void *private; int (*func)(wait_queue_t *, unsigned int, int, void *); struct list_head task_list; } ;
809 struct drm_dp_mst_branch ;
810 struct drm_dp_vcpi { int vcpi; int pbn; int aligned_pbn; int num_slots; } ;
43 struct drm_dp_mst_topology_mgr ;
43 struct drm_dp_mst_port { struct kref kref; u8 port_num; bool input; bool mcs; bool ddps; u8 pdt; bool ldps; u8 dpcd_rev; u8 num_sdp_streams; u8 num_sdp_stream_sinks; uint16_t available_pbn; struct list_head next; struct drm_dp_mst_branch *mstb; struct drm_dp_aux aux; struct drm_dp_mst_branch *parent; struct drm_dp_vcpi vcpi; struct drm_connector *connector; struct drm_dp_mst_topology_mgr *mgr; struct edid *cached_edid; bool has_audio; } ;
93 struct drm_dp_sideband_msg_tx ;
93 struct drm_dp_mst_branch { struct kref kref; u8 rad[8U]; u8 lct; int num_ports; int msg_slots; struct list_head ports; struct drm_dp_mst_port *port_parent; struct drm_dp_mst_topology_mgr *mgr; struct drm_dp_sideband_msg_tx *tx_slots[2U]; int last_seqno; bool link_address_sent; u8 guid[16U]; } ;
135 struct drm_dp_sideband_msg_hdr { u8 lct; u8 lcr; u8 rad[8U]; bool broadcast; bool path_msg; u8 msg_len; bool somt; bool eomt; bool seqno; } ;
149 struct drm_dp_nak_reply { u8 guid[16U]; u8 reason; u8 nak_data; } ;
155 struct drm_dp_link_addr_reply_port { bool input_port; u8 peer_device_type; u8 port_number; bool mcs; bool ddps; bool legacy_device_plug_status; u8 dpcd_revision; u8 peer_guid[16U]; u8 num_sdp_streams; u8 num_sdp_stream_sinks; } ;
171 struct drm_dp_link_address_ack_reply { u8 guid[16U]; u8 nports; struct drm_dp_link_addr_reply_port ports[16U]; } ;
172 struct drm_dp_remote_dpcd_read_ack_reply { u8 port_number; u8 num_bytes; u8 bytes[255U]; } ;
178 struct drm_dp_remote_dpcd_write_ack_reply { u8 port_number; } ;
182 struct drm_dp_remote_dpcd_write_nak_reply { u8 port_number; u8 reason; u8 bytes_written_before_failure; } ;
188 struct drm_dp_remote_i2c_read_ack_reply { u8 port_number; u8 num_bytes; u8 bytes[255U]; } ;
194 struct drm_dp_remote_i2c_read_nak_reply { u8 port_number; u8 nak_reason; u8 i2c_nak_transaction; } ;
200 struct drm_dp_remote_i2c_write_ack_reply { u8 port_number; } ;
204 struct drm_dp_sideband_msg_rx { u8 chunk[48U]; u8 msg[256U]; u8 curchunk_len; u8 curchunk_idx; u8 curchunk_hdrlen; u8 curlen; bool have_somt; bool have_eomt; struct drm_dp_sideband_msg_hdr initial_hdr; } ;
217 struct drm_dp_allocate_payload { u8 port_number; u8 number_sdp_streams; u8 vcpi; u16 pbn; u8 sdp_stream_sink[16U]; } ;
226 struct drm_dp_allocate_payload_ack_reply { u8 port_number; u8 vcpi; u16 allocated_pbn; } ;
232 struct drm_dp_connection_status_notify { u8 guid[16U]; u8 port_number; bool legacy_device_plug_status; bool displayport_device_plug_status; bool message_capability_status; bool input_port; u8 peer_device_type; } ;
242 struct drm_dp_remote_dpcd_read { u8 port_number; u32 dpcd_address; u8 num_bytes; } ;
248 struct drm_dp_remote_dpcd_write { u8 port_number; u32 dpcd_address; u8 num_bytes; u8 *bytes; } ;
255 struct __anonstruct_transactions_319 { u8 i2c_dev_id; u8 num_bytes; u8 *bytes; u8 no_stop_bit; u8 i2c_transaction_delay; } ;
255 struct drm_dp_remote_i2c_read { u8 num_transactions; u8 port_number; struct __anonstruct_transactions_319 transactions[4U]; u8 read_i2c_device_id; u8 num_bytes_read; } ;
270 struct drm_dp_remote_i2c_write { u8 port_number; u8 write_i2c_device_id; u8 num_bytes; u8 *bytes; } ;
277 struct drm_dp_port_number_req { u8 port_number; } ;
282 struct drm_dp_enum_path_resources_ack_reply { u8 port_number; u16 full_payload_bw_number; u16 avail_payload_bw_number; } ;
288 struct drm_dp_port_number_rep { u8 port_number; } ;
293 struct drm_dp_query_payload { u8 port_number; u8 vcpi; } ;
298 struct drm_dp_resource_status_notify { u8 port_number; u8 guid[16U]; u16 available_pbn; } ;
304 struct drm_dp_query_payload_ack_reply { u8 port_number; u8 allocated_pbn; } ;
309 union ack_req { struct drm_dp_connection_status_notify conn_stat; struct drm_dp_port_number_req port_num; struct drm_dp_resource_status_notify resource_stat; struct drm_dp_query_payload query_payload; struct drm_dp_allocate_payload allocate_payload; struct drm_dp_remote_dpcd_read dpcd_read; struct drm_dp_remote_dpcd_write dpcd_write; struct drm_dp_remote_i2c_read i2c_read; struct drm_dp_remote_i2c_write i2c_write; } ;
326 struct drm_dp_sideband_msg_req_body { u8 req_type; union ack_req u; } ;
327 union ack_replies { struct drm_dp_nak_reply nak; struct drm_dp_link_address_ack_reply link_addr; struct drm_dp_port_number_rep port_number; struct drm_dp_enum_path_resources_ack_reply path_resources; struct drm_dp_allocate_payload_ack_reply allocate_payload; struct drm_dp_query_payload_ack_reply query_payload; struct drm_dp_remote_dpcd_read_ack_reply remote_dpcd_read_ack; struct drm_dp_remote_dpcd_write_ack_reply remote_dpcd_write_ack; struct drm_dp_remote_dpcd_write_nak_reply remote_dpcd_write_nack; struct drm_dp_remote_i2c_read_ack_reply remote_i2c_read_ack; struct drm_dp_remote_i2c_read_nak_reply remote_i2c_read_nack; struct drm_dp_remote_i2c_write_ack_reply remote_i2c_write_ack; } ;
348 struct drm_dp_sideband_msg_reply_body { u8 reply_type; u8 req_type; union ack_replies u; } ;
349 struct drm_dp_sideband_msg_tx { u8 msg[256U]; u8 chunk[48U]; u8 cur_offset; u8 cur_len; struct drm_dp_mst_branch *dst; struct list_head next; int seqno; int state; bool path_msg; struct drm_dp_sideband_msg_reply_body reply; } ;
372 struct drm_dp_mst_topology_cbs { struct drm_connector * (*add_connector)(struct drm_dp_mst_topology_mgr *, struct drm_dp_mst_port *, const char *); void (*register_connector)(struct drm_connector *); void (*destroy_connector)(struct drm_dp_mst_topology_mgr *, struct drm_connector *); void (*hotplug)(struct drm_dp_mst_topology_mgr *); } ;
383 struct drm_dp_payload { int payload_state; int start_slot; int num_slots; int vcpi; } ;
397 struct drm_dp_mst_topology_mgr { struct device *dev; const struct drm_dp_mst_topology_cbs *cbs; int max_dpcd_transaction_bytes; struct drm_dp_aux *aux; int max_payloads; int conn_base_id; struct drm_dp_sideband_msg_rx down_rep_recv; struct drm_dp_sideband_msg_rx up_req_recv; struct mutex lock; bool mst_state; struct drm_dp_mst_branch *mst_primary; u8 dpcd[15U]; u8 sink_count; int pbn_div; int total_slots; int avail_slots; int total_pbn; struct mutex qlock; struct list_head tx_msg_downq; bool tx_down_in_progress; struct mutex payload_lock; struct drm_dp_vcpi **proposed_vcpis; struct drm_dp_payload *payloads; unsigned long payload_mask; unsigned long vcpi_mask; wait_queue_head_t tx_waitq; struct work_struct work; struct work_struct tx_work; struct list_head destroy_connector_list; struct mutex destroy_connector_lock; struct work_struct destroy_connector_work; } ;
27 union __anonunion___u_9 { struct list_head *__val; char __c[1U]; } ;
26 union __anonunion___u_25___0 { int __val; char __c[1U]; } ;
510 struct drm_color_lut { __u16 red; __u16 green; __u16 blue; __u16 reserved; } ;
215 struct fence_ops ;
217 struct fence { struct kref refcount; const struct fence_ops *ops; struct callback_head rcu; struct list_head cb_list; spinlock_t *lock; unsigned int context; unsigned int seqno; unsigned long flags; ktime_t timestamp; int status; struct list_head child_list; struct list_head active_list; } ;
106 struct fence_ops { const char * (*get_driver_name)(struct fence *); const char * (*get_timeline_name)(struct fence *); bool (*enable_signaling)(struct fence *); bool (*signaled)(struct fence *); long int (*wait)(struct fence *, bool , long); void (*release)(struct fence *); int (*fill_driver_data)(struct fence *, void *, int); void (*fence_value_str)(struct fence *, char *, int); void (*timeline_value_str)(struct fence *, char *, int); } ;
63 enum drm_dp_dual_mode_type { DRM_DP_DUAL_MODE_NONE = 0, DRM_DP_DUAL_MODE_UNKNOWN = 1, DRM_DP_DUAL_MODE_TYPE1_DVI = 2, DRM_DP_DUAL_MODE_TYPE1_HDMI = 3, DRM_DP_DUAL_MODE_TYPE2_DVI = 4, DRM_DP_DUAL_MODE_TYPE2_HDMI = 5 } ;
820 struct firmware { size_t size; const u8 *data; struct page **pages; void *priv; } ;
135 struct property_entry ;
61 struct platform_device_info { struct device *parent; struct fwnode_handle *fwnode; const char *name; int id; const struct resource *res; unsigned int num_res; const void *data; size_t size_data; u64 dma_mask; struct property_entry *properties; } ;
143 union __anonunion_pointer_350 { void *raw_data; u8 *u8_data; u16 *u16_data; u32 *u32_data; u64 *u64_data; const char **str; } ;
143 union __anonunion_value_351 { unsigned long long raw_data; u8 u8_data; u16 u16_data; u32 u32_data; u64 u64_data; const char *str; } ;
143 union __anonunion____missing_field_name_349 { union __anonunion_pointer_350 pointer; union __anonunion_value_351 value; } ;
143 struct property_entry { const char *name; size_t length; bool is_array; bool is_string; union __anonunion____missing_field_name_349 __annonCompField86; } ;
21 struct sysrq_key_op { void (*handler)(int); char *help_msg; char *action_msg; int enable_mask; } ;
27 union __anonunion___u_9___0 { struct list_head *__val; char __c[1U]; } ;
189 union __anonunion___u_13 { struct list_head *__val; char __c[1U]; } ;
26 union __anonunion___u_42 { int __val; char __c[1U]; } ;
268 struct notifier_block ;
53 struct notifier_block { int (*notifier_call)(struct notifier_block *, unsigned long, void *); struct notifier_block *next; int priority; } ;
737 struct fb_fix_screeninfo { char id[16U]; unsigned long smem_start; __u32 smem_len; __u32 type; __u32 type_aux; __u32 visual; __u16 xpanstep; __u16 ypanstep; __u16 ywrapstep; __u32 line_length; unsigned long mmio_start; __u32 mmio_len; __u32 accel; __u16 capabilities; __u16 reserved[2U]; } ;
176 struct fb_bitfield { __u32 offset; __u32 length; __u32 msb_right; } ;
192 struct fb_var_screeninfo { __u32 xres; __u32 yres; __u32 xres_virtual; __u32 yres_virtual; __u32 xoffset; __u32 yoffset; __u32 bits_per_pixel; __u32 grayscale; struct fb_bitfield red; struct fb_bitfield green; struct fb_bitfield blue; struct fb_bitfield transp; __u32 nonstd; __u32 activate; __u32 height; __u32 width; __u32 accel_flags; __u32 pixclock; __u32 left_margin; __u32 right_margin; __u32 upper_margin; __u32 lower_margin; __u32 hsync_len; __u32 vsync_len; __u32 sync; __u32 vmode; __u32 rotate; __u32 colorspace; __u32 reserved[4U]; } ;
279 struct fb_cmap { __u32 start; __u32 len; __u16 *red; __u16 *green; __u16 *blue; __u16 *transp; } ;
335 struct fb_copyarea { __u32 dx; __u32 dy; __u32 width; __u32 height; __u32 sx; __u32 sy; } ;
348 struct fb_fillrect { __u32 dx; __u32 dy; __u32 width; __u32 height; __u32 color; __u32 rop; } ;
357 struct fb_image { __u32 dx; __u32 dy; __u32 width; __u32 height; __u32 fg_color; __u32 bg_color; __u8 depth; const char *data; struct fb_cmap cmap; } ;
369 struct fbcurpos { __u16 x; __u16 y; } ;
385 struct fb_cursor { __u16 set; __u16 enable; __u16 rop; const char *mask; struct fbcurpos hot; struct fb_image image; } ;
399 enum backlight_type { BACKLIGHT_RAW = 1, BACKLIGHT_PLATFORM = 2, BACKLIGHT_FIRMWARE = 3, BACKLIGHT_TYPE_MAX = 4 } ;
411 struct backlight_device ;
412 struct fb_info ;
413 struct backlight_ops { unsigned int options; int (*update_status)(struct backlight_device *); int (*get_brightness)(struct backlight_device *); int (*check_fb)(struct backlight_device *, struct fb_info *); } ;
65 struct backlight_properties { int brightness; int max_brightness; int power; int fb_blank; enum backlight_type type; unsigned int state; } ;
84 struct backlight_device { struct backlight_properties props; struct mutex update_lock; struct mutex ops_lock; const struct backlight_ops *ops; struct notifier_block fb_notif; struct list_head entry; struct device dev; bool fb_bl_on[32U]; int use_count; } ;
168 struct fb_chroma { __u32 redx; __u32 greenx; __u32 bluex; __u32 whitex; __u32 redy; __u32 greeny; __u32 bluey; __u32 whitey; } ;
61 struct fb_videomode ;
61 struct fb_monspecs { struct fb_chroma chroma; struct fb_videomode *modedb; __u8 manufacturer[4U]; __u8 monitor[14U]; __u8 serial_no[14U]; __u8 ascii[14U]; __u32 modedb_len; __u32 model; __u32 serial; __u32 year; __u32 week; __u32 hfmin; __u32 hfmax; __u32 dclkmin; __u32 dclkmax; __u16 input; __u16 dpms; __u16 signal; __u16 vfmin; __u16 vfmax; __u16 gamma; unsigned char gtf; __u16 misc; __u8 version; __u8 revision; __u8 max_x; __u8 max_y; } ;
170 struct fb_blit_caps { u32 x; u32 y; u32 len; u32 flags; } ;
182 struct fb_pixmap { u8 *addr; u32 size; u32 offset; u32 buf_align; u32 scan_align; u32 access_align; u32 flags; u32 blit_x; u32 blit_y; void (*writeio)(struct fb_info *, void *, void *, unsigned int); void (*readio)(struct fb_info *, void *, void *, unsigned int); } ;
228 struct fb_deferred_io { unsigned long delay; struct mutex lock; struct list_head pagelist; void (*first_io)(struct fb_info *); void (*deferred_io)(struct fb_info *, struct list_head *); } ;
239 struct fb_ops { struct module *owner; int (*fb_open)(struct fb_info *, int); int (*fb_release)(struct fb_info *, int); ssize_t (*fb_read)(struct fb_info *, char *, size_t , loff_t *); ssize_t (*fb_write)(struct fb_info *, const char *, size_t , loff_t *); int (*fb_check_var)(struct fb_var_screeninfo *, struct fb_info *); int (*fb_set_par)(struct fb_info *); int (*fb_setcolreg)(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, struct fb_info *); int (*fb_setcmap)(struct fb_cmap *, struct fb_info *); int (*fb_blank)(int, struct fb_info *); int (*fb_pan_display)(struct fb_var_screeninfo *, struct fb_info *); void (*fb_fillrect)(struct fb_info *, const struct fb_fillrect *); void (*fb_copyarea)(struct fb_info *, const struct fb_copyarea *); void (*fb_imageblit)(struct fb_info *, const struct fb_image *); int (*fb_cursor)(struct fb_info *, struct fb_cursor *); int (*fb_sync)(struct fb_info *); int (*fb_ioctl)(struct fb_info *, unsigned int, unsigned long); int (*fb_compat_ioctl)(struct fb_info *, unsigned int, unsigned long); int (*fb_mmap)(struct fb_info *, struct vm_area_struct *); void (*fb_get_caps)(struct fb_info *, struct fb_blit_caps *, struct fb_var_screeninfo *); void (*fb_destroy)(struct fb_info *); int (*fb_debug_enter)(struct fb_info *); int (*fb_debug_leave)(struct fb_info *); } ;
324 struct fb_tilemap { __u32 width; __u32 height; __u32 depth; __u32 length; const __u8 *data; } ;
340 struct fb_tilerect { __u32 sx; __u32 sy; __u32 width; __u32 height; __u32 index; __u32 fg; __u32 bg; __u32 rop; } ;
352 struct fb_tilearea { __u32 sx; __u32 sy; __u32 dx; __u32 dy; __u32 width; __u32 height; } ;
361 struct fb_tileblit { __u32 sx; __u32 sy; __u32 width; __u32 height; __u32 fg; __u32 bg; __u32 length; __u32 *indices; } ;
372 struct fb_tilecursor { __u32 sx; __u32 sy; __u32 mode; __u32 shape; __u32 fg; __u32 bg; } ;
381 struct fb_tile_ops { void (*fb_settile)(struct fb_info *, struct fb_tilemap *); void (*fb_tilecopy)(struct fb_info *, struct fb_tilearea *); void (*fb_tilefill)(struct fb_info *, struct fb_tilerect *); void (*fb_tileblit)(struct fb_info *, struct fb_tileblit *); void (*fb_tilecursor)(struct fb_info *, struct fb_tilecursor *); int (*fb_get_tilemax)(struct fb_info *); } ;
400 struct aperture { resource_size_t base; resource_size_t size; } ;
522 struct apertures_struct { unsigned int count; struct aperture ranges[0U]; } ;
523 union __anonunion____missing_field_name_321 { char *screen_base; char *screen_buffer; } ;
523 struct fb_info { atomic_t count; int node; int flags; struct mutex lock; struct mutex mm_lock; struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; struct fb_monspecs monspecs; struct work_struct queue; struct fb_pixmap pixmap; struct fb_pixmap sprite; struct fb_cmap cmap; struct list_head modelist; struct fb_videomode *mode; struct backlight_device *bl_dev; struct mutex bl_curve_mutex; u8 bl_curve[128U]; struct delayed_work deferred_work; struct fb_deferred_io *fbdefio; struct fb_ops *fbops; struct device *device; struct device *dev; int class_flag; struct fb_tile_ops *tileops; union __anonunion____missing_field_name_321 __annonCompField77; unsigned long screen_size; void *pseudo_palette; u32 state; void *fbcon_par; void *par; struct apertures_struct *apertures; bool skip_vt_switch; } ;
783 struct fb_videomode { const char *name; u32 refresh; u32 xres; u32 yres; u32 pixclock; u32 left_margin; u32 right_margin; u32 upper_margin; u32 lower_margin; u32 hsync_len; u32 vsync_len; u32 sync; u32 vmode; u32 flag; } ;
1147 struct drm_fb_helper ;
1153 struct drm_fb_offset { int x; int y; } ;
45 struct drm_fb_helper_crtc { struct drm_mode_set mode_set; struct drm_display_mode *desired_mode; int x; int y; } ;
51 struct drm_fb_helper_surface_size { u32 fb_width; u32 fb_height; u32 surface_width; u32 surface_height; u32 surface_bpp; u32 surface_depth; } ;
79 struct drm_fb_helper_funcs { void (*gamma_set)(struct drm_crtc *, u16 , u16 , u16 , int); void (*gamma_get)(struct drm_crtc *, u16 *, u16 *, u16 *, int); int (*fb_probe)(struct drm_fb_helper *, struct drm_fb_helper_surface_size *); bool (*initial_config)(struct drm_fb_helper *, struct drm_fb_helper_crtc **, struct drm_display_mode **, struct drm_fb_offset *, bool *, int, int); } ;
154 struct drm_fb_helper_connector { struct drm_connector *connector; } ;
162 struct drm_fb_helper { struct drm_framebuffer *fb; struct drm_device *dev; int crtc_count; struct drm_fb_helper_crtc *crtc_info; int connector_count; int connector_info_alloc_count; struct drm_fb_helper_connector **connector_info; const struct drm_fb_helper_funcs *funcs; struct fb_info *fbdev; u32 pseudo_palette[17U]; struct drm_clip_rect dirty_clip; spinlock_t dirty_lock; struct work_struct dirty_work; struct list_head kernel_fb_list; bool delayed_hotplug; bool atomic; } ;
26 union __anonunion___u_25___1 { int __val; char __c[1U]; } ;
39 struct drm_vma_offset_node { rwlock_t vm_lock; struct drm_mm_node vm_node; struct rb_node vm_rb; struct rb_root vm_files; } ;
676 struct drm_info_list { const char *name; int (*show)(struct seq_file *, void *); u32 driver_features; void *data; } ;
687 struct drm_info_node { struct list_head list; struct drm_minor *minor; const struct drm_info_list *info_ent; struct dentry *dent; } ;
84 struct drm_gem_object { struct kref refcount; unsigned int handle_count; struct drm_device *dev; struct file *filp; struct drm_vma_offset_node vma_node; size_t size; int name; uint32_t read_domains; uint32_t write_domain; uint32_t pending_read_domains; uint32_t pending_write_domain; struct dma_buf *dma_buf; struct dma_buf_attachment *import_attach; } ;
243 struct drm_gem_cma_object { struct drm_gem_object base; dma_addr_t paddr; struct sg_table *sgt; void *vaddr; } ;
69 struct drm_fbdev_cma ;
47 struct drm_fb_cma { struct drm_framebuffer fb; struct drm_gem_cma_object *obj[4U]; } ;
35 struct drm_fbdev_cma { struct drm_fb_helper fb_helper; struct drm_fb_cma *fb; } ;
26 union __anonunion___u_25___2 { int __val; char __c[1U]; } ;
38 union __anonunion___u_27 { int __val; char __c[1U]; } ;
480 struct tss_struct ;
212 struct x86_hw_tss { u32 reserved1; u64 sp0; u64 sp1; u64 sp2; u64 reserved2; u64 ist[7U]; u32 reserved3; u32 reserved4; u16 reserved5; u16 io_bitmap_base; } ;
274 struct tss_struct { struct x86_hw_tss x86_tss; unsigned long io_bitmap[1025U]; } ;
495 struct __anonstruct_mm_segment_t_72 { unsigned long seg; } ;
495 typedef struct __anonstruct_mm_segment_t_72 mm_segment_t;
48 struct thread_info { struct task_struct *task; __u32 flags; __u32 status; __u32 cpu; mm_segment_t addr_limit; unsigned char sig_on_uaccess_error; unsigned char uaccess_err; } ;
117 union __anonunion___u_92 { struct idr_layer *__val; char __c[1U]; } ;
120 union __anonunion___u_94 { struct idr_layer *__val; char __c[1U]; } ;
251 struct __large_struct { unsigned long buf[100U]; } ;
1147 struct drm_dp_aux_dev { unsigned int index; struct drm_dp_aux *aux; struct device *dev; struct kref refcount; atomic_t usecount; } ;
48 typedef int ldv_func_ret_type;
1 void * __builtin_memcpy(void *, const void *, unsigned long);
1 long int __builtin_expect(long, long);
220 void __read_once_size(const volatile void *p, void *res, int size);
245 void __write_once_size(volatile void *p, void *res, int size);
448 extern int oops_in_progress;
25 void INIT_LIST_HEAD(struct list_head *list);
48 void __list_add(struct list_head *, struct list_head *, struct list_head *);
75 void list_add_tail(struct list_head *new, struct list_head *head);
112 void __list_del_entry(struct list_head *);
165 void list_move_tail(struct list_head *list, struct list_head *head);
187 int list_empty(const struct list_head *head);
274 void __list_splice(const struct list_head *list, struct list_head *prev, struct list_head *next);
293 void list_splice(const struct list_head *list, struct list_head *head);
24 int atomic_read(const atomic_t *v);
71 void warn_slowpath_null(const char *, const int);
128 int mutex_is_locked(struct mutex *lock);
154 void kfree(const void *);
318 void * __kmalloc(size_t , gfp_t );
466 void * kmalloc(size_t size, gfp_t flags);
620 void * kzalloc(size_t size, gfp_t flags);
373 bool ww_mutex_is_locked(struct ww_mutex *lock);
117 bool drm_modeset_is_locked(struct drm_modeset_lock *lock);
132 void drm_modeset_lock_all(struct drm_device *);
133 void drm_modeset_unlock_all(struct drm_device *);
137 void drm_warn_on_modeset_not_all_locked(struct drm_device *);
433 void drm_mode_destroy(struct drm_device *, struct drm_display_mode *);
439 void drm_mode_debug_printmodeline(const struct drm_display_mode *);
468 void drm_mode_copy(struct drm_display_mode *, const struct drm_display_mode *);
470 struct drm_display_mode * drm_mode_duplicate(struct drm_device *, const struct drm_display_mode *);
472 bool drm_mode_equal(const struct drm_display_mode *, const struct drm_display_mode *);
2233 unsigned int drm_crtc_index(struct drm_crtc *);
2242 uint32_t drm_crtc_mask(struct drm_crtc *crtc);
2271 bool drm_bridge_mode_fixup(struct drm_bridge *, const struct drm_display_mode *, struct drm_display_mode *);
2274 void drm_bridge_disable(struct drm_bridge *);
2275 void drm_bridge_post_disable(struct drm_bridge *);
2276 void drm_bridge_mode_set(struct drm_bridge *, struct drm_display_mode *, struct drm_display_mode *);
2279 void drm_bridge_pre_enable(struct drm_bridge *);
2280 void drm_bridge_enable(struct drm_bridge *);
2296 bool drm_encoder_crtc_ok(struct drm_encoder *encoder, struct drm_crtc *crtc);
2394 void drm_object_attach_property(struct drm_mode_object *, struct drm_property *, uint64_t );
2447 void drm_mode_object_reference(struct drm_mode_object *);
2448 void drm_mode_object_unreference(struct drm_mode_object *);
2543 void drm_fb_get_bpp_depth(uint32_t , unsigned int *, int *);
2665 void drm_connector_reference(struct drm_connector *connector);
2676 void drm_connector_unreference(struct drm_connector *connector);
2693 void assert_drm_connector_list_read_locked(struct drm_mode_config *mode_config);
134 void drm_ut_debug_printk(const char *, const char *, ...);
137 void drm_err(const char *, ...);
1004 void drm_calc_timestamping_constants(struct drm_crtc *, const struct drm_display_mode *);
1029 extern unsigned int drm_debug;
113 int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *, struct drm_display_mode *);
121 void drm_atomic_set_fb_for_plane(struct drm_plane_state *, struct drm_framebuffer *);
45 void drm_helper_disable_unused_functions(struct drm_device *dev);
46 int drm_crtc_helper_set_config(struct drm_mode_set *set);
47 bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode, int x, int y, struct drm_framebuffer *old_fb);
51 void drm_helper_crtc_enable_color_mgmt(struct drm_crtc *crtc, int degamma_lut_size, int gamma_lut_size);
54 bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
55 bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
57 int drm_helper_connector_dpms(struct drm_connector *connector, int mode);
59 void drm_helper_move_panel_connectors_to_head(struct drm_device *dev);
61 void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd);
64 void drm_helper_resume_force_mode(struct drm_device *dev);
66 int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode, int x, int y, struct drm_framebuffer *old_fb);
69 int drm_helper_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb);
74 int drm_plane_helper_commit(struct drm_plane *plane, struct drm_plane_state *plane_state, struct drm_framebuffer *old_fb);
117 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
121 struct drm_crtc_state * drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
123 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state);
126 void drm_atomic_helper_plane_reset(struct drm_plane *plane);
130 struct drm_plane_state * drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
104 const char __kstrtab_drm_helper_move_panel_connectors_to_head[41U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'm', 'o', 'v', 'e', '_', 'p', 'a', 'n', 'e', 'l', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', 's', '_', 't', 'o', '_', 'h', 'e', 'a', 'd', '\x0' };
104 const struct kernel_symbol __ksymtab_drm_helper_move_panel_connectors_to_head;
104 const struct kernel_symbol __ksymtab_drm_helper_move_panel_connectors_to_head = { (unsigned long)(&drm_helper_move_panel_connectors_to_head), (const char *)(&__kstrtab_drm_helper_move_panel_connectors_to_head) };
136 const char __kstrtab_drm_helper_encoder_in_use[26U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'r', '_', 'i', 'n', '_', 'u', 's', 'e', '\x0' };
136 const struct kernel_symbol __ksymtab_drm_helper_encoder_in_use;
136 const struct kernel_symbol __ksymtab_drm_helper_encoder_in_use = { (unsigned long)(&drm_helper_encoder_in_use), (const char *)(&__kstrtab_drm_helper_encoder_in_use) };
166 const char __kstrtab_drm_helper_crtc_in_use[23U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'i', 'n', '_', 'u', 's', 'e', '\x0' };
166 const struct kernel_symbol __ksymtab_drm_helper_crtc_in_use;
166 const struct kernel_symbol __ksymtab_drm_helper_crtc_in_use = { (unsigned long)(&drm_helper_crtc_in_use), (const char *)(&__kstrtab_drm_helper_crtc_in_use) };
169 void drm_encoder_disable(struct drm_encoder *encoder);
186 void __drm_helper_disable_unused_functions(struct drm_device *dev);
239 const char __kstrtab_drm_helper_disable_unused_functions[36U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'u', 'n', 'u', 's', 'e', 'd', '_', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', 's', '\x0' };
239 const struct kernel_symbol __ksymtab_drm_helper_disable_unused_functions;
239 const struct kernel_symbol __ksymtab_drm_helper_disable_unused_functions = { (unsigned long)(&drm_helper_disable_unused_functions), (const char *)(&__kstrtab_drm_helper_disable_unused_functions) };
247 void drm_crtc_prepare_encoders(struct drm_device *dev);
454 const char __kstrtab_drm_crtc_helper_set_mode[25U] = { 'd', 'r', 'm', '_', 'c', 'r', 't', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', '_', 'm', 'o', 'd', 'e', '\x0' };
454 const struct kernel_symbol __ksymtab_drm_crtc_helper_set_mode;
454 const struct kernel_symbol __ksymtab_drm_crtc_helper_set_mode = { (unsigned long)(&drm_crtc_helper_set_mode), (const char *)(&__kstrtab_drm_crtc_helper_set_mode) };
457 void drm_crtc_helper_disable(struct drm_crtc *crtc);
794 const char __kstrtab_drm_crtc_helper_set_config[27U] = { 'd', 'r', 'm', '_', 'c', 'r', 't', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\x0' };
794 const struct kernel_symbol __ksymtab_drm_crtc_helper_set_config;
794 const struct kernel_symbol __ksymtab_drm_crtc_helper_set_config = { (unsigned long)(&drm_crtc_helper_set_config), (const char *)(&__kstrtab_drm_crtc_helper_set_config) };
796 int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder);
810 void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode);
833 int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc);
908 const char __kstrtab_drm_helper_connector_dpms[26U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'p', 'm', 's', '\x0' };
908 const struct kernel_symbol __ksymtab_drm_helper_connector_dpms;
908 const struct kernel_symbol __ksymtab_drm_helper_connector_dpms = { (unsigned long)(&drm_helper_connector_dpms), (const char *)(&__kstrtab_drm_helper_connector_dpms) };
935 const char __kstrtab_drm_helper_mode_fill_fb_struct[31U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'm', 'o', 'd', 'e', '_', 'f', 'i', 'l', 'l', '_', 'f', 'b', '_', 's', 't', 'r', 'u', 'c', 't', '\x0' };
935 const struct kernel_symbol __ksymtab_drm_helper_mode_fill_fb_struct;
935 const struct kernel_symbol __ksymtab_drm_helper_mode_fill_fb_struct = { (unsigned long)(&drm_helper_mode_fill_fb_struct), (const char *)(&__kstrtab_drm_helper_mode_fill_fb_struct) };
1008 const char __kstrtab_drm_helper_resume_force_mode[29U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'r', 'e', 's', 'u', 'm', 'e', '_', 'f', 'o', 'r', 'c', 'e', '_', 'm', 'o', 'd', 'e', '\x0' };
1008 const struct kernel_symbol __ksymtab_drm_helper_resume_force_mode;
1008 const struct kernel_symbol __ksymtab_drm_helper_resume_force_mode = { (unsigned long)(&drm_helper_resume_force_mode), (const char *)(&__kstrtab_drm_helper_resume_force_mode) };
1076 const char __kstrtab_drm_helper_crtc_mode_set[25U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'm', 'o', 'd', 'e', '_', 's', 'e', 't', '\x0' };
1076 const struct kernel_symbol __ksymtab_drm_helper_crtc_mode_set;
1076 const struct kernel_symbol __ksymtab_drm_helper_crtc_mode_set = { (unsigned long)(&drm_helper_crtc_mode_set), (const char *)(&__kstrtab_drm_helper_crtc_mode_set) };
1123 const char __kstrtab_drm_helper_crtc_mode_set_base[30U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'm', 'o', 'd', 'e', '_', 's', 'e', 't', '_', 'b', 'a', 's', 'e', '\x0' };
1123 const struct kernel_symbol __ksymtab_drm_helper_crtc_mode_set_base;
1123 const struct kernel_symbol __ksymtab_drm_helper_crtc_mode_set_base = { (unsigned long)(&drm_helper_crtc_mode_set_base), (const char *)(&__kstrtab_drm_helper_crtc_mode_set_base) };
1156 const char __kstrtab_drm_helper_crtc_enable_color_mgmt[34U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'c', 'o', 'l', 'o', 'r', '_', 'm', 'g', 'm', 't', '\x0' };
1156 const struct kernel_symbol __ksymtab_drm_helper_crtc_enable_color_mgmt;
1156 const struct kernel_symbol __ksymtab_drm_helper_crtc_enable_color_mgmt = { (unsigned long)(&drm_helper_crtc_enable_color_mgmt), (const char *)(&__kstrtab_drm_helper_crtc_enable_color_mgmt) };
33 extern struct module __this_module;
56 void * __memset(void *, int, size_t );
27 size_t strlcpy(char *, const char *, size_t );
119 void __mutex_init(struct mutex *, const char *, struct lock_class_key *);
138 void mutex_lock_nested(struct mutex *, unsigned int);
174 void mutex_unlock(struct mutex *);
87 const char * kobject_name(const struct kobject *kobj);
10 void __const_udelay(unsigned long);
48 void usleep_range(unsigned long, unsigned long);
865 const char * dev_name(const struct device *dev);
642 int i2c_add_adapter(struct i2c_adapter *);
643 void i2c_del_adapter(struct i2c_adapter *);
613 bool drm_dp_channel_eq_ok(const u8 *link_status, int lane_count);
615 bool drm_dp_clock_recovery_ok(const u8 *link_status, int lane_count);
617 u8 drm_dp_get_adjust_request_voltage(const u8 *link_status, int lane);
619 u8 drm_dp_get_adjust_request_pre_emphasis(const u8 *link_status, int lane);
626 void drm_dp_link_train_clock_recovery_delay(const u8 *dpcd);
627 void drm_dp_link_train_channel_eq_delay(const u8 *dpcd);
629 u8 drm_dp_link_rate_to_bw_code(int link_rate);
630 int drm_dp_bw_code_to_link_rate(u8 link_bw);
752 ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset, void *buffer, size_t size);
754 ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset, void *buffer, size_t size);
766 ssize_t drm_dp_dpcd_readb(struct drm_dp_aux *aux, unsigned int offset, u8 *valuep);
781 ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, unsigned int offset, u8 value);
787 int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, u8 *status);
802 int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
803 int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
804 int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
805 int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
807 int drm_dp_aux_register(struct drm_dp_aux *aux);
808 void drm_dp_aux_unregister(struct drm_dp_aux *aux);
37 int drm_dp_aux_register_devnode(struct drm_dp_aux *aux);
38 void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux);
45 u8 dp_link_status(const u8 *link_status, int r);
50 u8 dp_get_lane_status(const u8 *link_status, int lane);
77 const char __kstrtab_drm_dp_channel_eq_ok[21U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '_', 'e', 'q', '_', 'o', 'k', '\x0' };
77 const struct kernel_symbol __ksymtab_drm_dp_channel_eq_ok;
77 const struct kernel_symbol __ksymtab_drm_dp_channel_eq_ok = { (unsigned long)(&drm_dp_channel_eq_ok), (const char *)(&__kstrtab_drm_dp_channel_eq_ok) };
92 const char __kstrtab_drm_dp_clock_recovery_ok[25U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'c', 'l', 'o', 'c', 'k', '_', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'y', '_', 'o', 'k', '\x0' };
92 const struct kernel_symbol __ksymtab_drm_dp_clock_recovery_ok;
92 const struct kernel_symbol __ksymtab_drm_dp_clock_recovery_ok = { (unsigned long)(&drm_dp_clock_recovery_ok), (const char *)(&__kstrtab_drm_dp_clock_recovery_ok) };
105 const char __kstrtab_drm_dp_get_adjust_request_voltage[34U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'g', 'e', 't', '_', 'a', 'd', 'j', 'u', 's', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'v', 'o', 'l', 't', 'a', 'g', 'e', '\x0' };
105 const struct kernel_symbol __ksymtab_drm_dp_get_adjust_request_voltage;
105 const struct kernel_symbol __ksymtab_drm_dp_get_adjust_request_voltage = { (unsigned long)(&drm_dp_get_adjust_request_voltage), (const char *)(&__kstrtab_drm_dp_get_adjust_request_voltage) };
118 const char __kstrtab_drm_dp_get_adjust_request_pre_emphasis[39U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'g', 'e', 't', '_', 'a', 'd', 'j', 'u', 's', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'p', 'r', 'e', '_', 'e', 'm', 'p', 'h', 'a', 's', 'i', 's', '\x0' };
118 const struct kernel_symbol __ksymtab_drm_dp_get_adjust_request_pre_emphasis;
118 const struct kernel_symbol __ksymtab_drm_dp_get_adjust_request_pre_emphasis = { (unsigned long)(&drm_dp_get_adjust_request_pre_emphasis), (const char *)(&__kstrtab_drm_dp_get_adjust_request_pre_emphasis) };
126 const char __kstrtab_drm_dp_link_train_clock_recovery_delay[39U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 't', 'r', 'a', 'i', 'n', '_', 'c', 'l', 'o', 'c', 'k', '_', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'y', '_', 'd', 'e', 'l', 'a', 'y', '\x0' };
126 const struct kernel_symbol __ksymtab_drm_dp_link_train_clock_recovery_delay;
126 const struct kernel_symbol __ksymtab_drm_dp_link_train_clock_recovery_delay = { (unsigned long)(&drm_dp_link_train_clock_recovery_delay), (const char *)(&__kstrtab_drm_dp_link_train_clock_recovery_delay) };
134 const char __kstrtab_drm_dp_link_train_channel_eq_delay[35U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 't', 'r', 'a', 'i', 'n', '_', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '_', 'e', 'q', '_', 'd', 'e', 'l', 'a', 'y', '\x0' };
134 const struct kernel_symbol __ksymtab_drm_dp_link_train_channel_eq_delay;
134 const struct kernel_symbol __ksymtab_drm_dp_link_train_channel_eq_delay = { (unsigned long)(&drm_dp_link_train_channel_eq_delay), (const char *)(&__kstrtab_drm_dp_link_train_channel_eq_delay) };
148 const char __kstrtab_drm_dp_link_rate_to_bw_code[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 'r', 'a', 't', 'e', '_', 't', 'o', '_', 'b', 'w', '_', 'c', 'o', 'd', 'e', '\x0' };
148 const struct kernel_symbol __ksymtab_drm_dp_link_rate_to_bw_code;
148 const struct kernel_symbol __ksymtab_drm_dp_link_rate_to_bw_code = { (unsigned long)(&drm_dp_link_rate_to_bw_code), (const char *)(&__kstrtab_drm_dp_link_rate_to_bw_code) };
162 const char __kstrtab_drm_dp_bw_code_to_link_rate[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'b', 'w', '_', 'c', 'o', 'd', 'e', '_', 't', 'o', '_', 'l', 'i', 'n', 'k', '_', 'r', 'a', 't', 'e', '\x0' };
162 const struct kernel_symbol __ksymtab_drm_dp_bw_code_to_link_rate;
162 const struct kernel_symbol __ksymtab_drm_dp_bw_code_to_link_rate = { (unsigned long)(&drm_dp_bw_code_to_link_rate), (const char *)(&__kstrtab_drm_dp_bw_code_to_link_rate) };
178 int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, unsigned int offset, void *buffer, size_t size);
274 const char __kstrtab_drm_dp_dpcd_read[17U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'p', 'c', 'd', '_', 'r', 'e', 'a', 'd', '\x0' };
274 const struct kernel_symbol __ksymtab_drm_dp_dpcd_read;
274 const struct kernel_symbol __ksymtab_drm_dp_dpcd_read = { (unsigned long)(&drm_dp_dpcd_read), (const char *)(&__kstrtab_drm_dp_dpcd_read) };
296 const char __kstrtab_drm_dp_dpcd_write[18U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'p', 'c', 'd', '_', 'w', 'r', 'i', 't', 'e', '\x0' };
296 const struct kernel_symbol __ksymtab_drm_dp_dpcd_write;
296 const struct kernel_symbol __ksymtab_drm_dp_dpcd_write = { (unsigned long)(&drm_dp_dpcd_write), (const char *)(&__kstrtab_drm_dp_dpcd_write) };
312 const char __kstrtab_drm_dp_dpcd_read_link_status[29U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'p', 'c', 'd', '_', 'r', 'e', 'a', 'd', '_', 'l', 'i', 'n', 'k', '_', 's', 't', 'a', 't', 'u', 's', '\x0' };
312 const struct kernel_symbol __ksymtab_drm_dp_dpcd_read_link_status;
312 const struct kernel_symbol __ksymtab_drm_dp_dpcd_read_link_status = { (unsigned long)(&drm_dp_dpcd_read_link_status), (const char *)(&__kstrtab_drm_dp_dpcd_read_link_status) };
345 const char __kstrtab_drm_dp_link_probe[18U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 'p', 'r', 'o', 'b', 'e', '\x0' };
345 const struct kernel_symbol __ksymtab_drm_dp_link_probe;
345 const struct kernel_symbol __ksymtab_drm_dp_link_probe = { (unsigned long)(&drm_dp_link_probe), (const char *)(&__kstrtab_drm_dp_link_probe) };
383 const char __kstrtab_drm_dp_link_power_up[21U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 'p', 'o', 'w', 'e', 'r', '_', 'u', 'p', '\x0' };
383 const struct kernel_symbol __ksymtab_drm_dp_link_power_up;
383 const struct kernel_symbol __ksymtab_drm_dp_link_power_up = { (unsigned long)(&drm_dp_link_power_up), (const char *)(&__kstrtab_drm_dp_link_power_up) };
414 const char __kstrtab_drm_dp_link_power_down[23U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 'p', 'o', 'w', 'e', 'r', '_', 'd', 'o', 'w', 'n', '\x0' };
414 const struct kernel_symbol __ksymtab_drm_dp_link_power_down;
414 const struct kernel_symbol __ksymtab_drm_dp_link_power_down = { (unsigned long)(&drm_dp_link_power_down), (const char *)(&__kstrtab_drm_dp_link_power_down) };
440 const char __kstrtab_drm_dp_link_configure[22U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'l', 'i', 'n', 'k', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '\x0' };
440 const struct kernel_symbol __ksymtab_drm_dp_link_configure;
440 const struct kernel_symbol __ksymtab_drm_dp_link_configure = { (unsigned long)(&drm_dp_link_configure), (const char *)(&__kstrtab_drm_dp_link_configure) };
446 u32 drm_dp_i2c_functionality(struct i2c_adapter *adapter);
454 void drm_dp_i2c_msg_write_status_update(struct drm_dp_aux_msg *msg);
479 int drm_dp_aux_req_duration(const struct drm_dp_aux_msg *msg);
490 int drm_dp_aux_reply_duration(const struct drm_dp_aux_msg *msg);
518 int drm_dp_i2c_msg_duration(const struct drm_dp_aux_msg *msg, int i2c_speed_khz);
532 int drm_dp_i2c_retry_count(const struct drm_dp_aux_msg *msg, int i2c_speed_khz);
546 int dp_aux_i2c_speed_khz = 10;
559 int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg);
653 void drm_dp_i2c_msg_set_request(struct drm_dp_aux_msg *msg, const struct i2c_msg *i2c_msg);
666 int drm_dp_i2c_drain_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *orig_msg);
694 int dp_aux_i2c_transfer_size = 16;
699 int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num);
773 const struct i2c_algorithm drm_dp_i2c_algo = { &drm_dp_i2c_xfer, 0, &drm_dp_i2c_functionality, 0, 0 };
814 const char __kstrtab_drm_dp_aux_register[20U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '\x0' };
814 const struct kernel_symbol __ksymtab_drm_dp_aux_register;
814 const struct kernel_symbol __ksymtab_drm_dp_aux_register = { (unsigned long)(&drm_dp_aux_register), (const char *)(&__kstrtab_drm_dp_aux_register) };
825 const char __kstrtab_drm_dp_aux_unregister[22U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'u', 'n', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '\x0' };
825 const struct kernel_symbol __ksymtab_drm_dp_aux_unregister;
825 const struct kernel_symbol __ksymtab_drm_dp_aux_unregister = { (unsigned long)(&drm_dp_aux_unregister), (const char *)(&__kstrtab_drm_dp_aux_unregister) };
843 void ldv_check_final_state();
852 void ldv_initialize();
855 void ldv_handler_precall();
858 int nondet_int();
861 int LDV_IN_INTERRUPT = 0;
864 void ldv_main1_sequence_infinite_withcheck_stateful();
25 void INIT_LIST_HEAD___0(struct list_head *list);
187 int list_empty___0(const struct list_head *head);
24 int atomic_read___0(const atomic_t *v);
281 void lockdep_init_map(struct lockdep_map *, const char *, struct lock_class_key *, int);
128 int mutex_is_locked___0(struct mutex *lock);
88 void init_timer_key(struct timer_list *, unsigned int, const char *, struct lock_class_key *);
20 void delayed_work_timer_fn(unsigned long);
136 struct delayed_work * to_delayed_work(struct work_struct *work);
181 void __init_work(struct work_struct *, int);
353 extern struct workqueue_struct *system_wq;
432 bool queue_delayed_work_on(int, struct workqueue_struct *, struct delayed_work *, unsigned long);
449 bool cancel_delayed_work_sync(struct delayed_work *);
484 bool queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, unsigned long delay);
586 bool schedule_delayed_work(struct delayed_work *dwork, unsigned long delay);
373 bool ww_mutex_is_locked___0(struct ww_mutex *lock);
117 bool drm_modeset_is_locked___0(struct drm_modeset_lock *lock);
438 void drm_mode_probed_add(struct drm_connector *, struct drm_display_mode *);
464 int drm_mode_vrefresh(const struct drm_display_mode *);
466 void drm_mode_set_crtcinfo(struct drm_display_mode *, int);
480 enum drm_mode_status drm_mode_validate_basic(const struct drm_display_mode *);
481 enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *, int, int);
483 void drm_mode_prune_invalid(struct drm_device *, struct list_head *, bool );
485 void drm_mode_sort(struct list_head *);
486 void drm_mode_connector_list_update(struct drm_connector *);
494 struct drm_display_mode * drm_mode_create_from_cmdline_mode(struct drm_device *, struct drm_cmdline_mode *);
2332 const char * drm_get_connector_status_name(enum drm_connector_status );
2348 int drm_add_edid_modes(struct drm_connector *, struct edid *);
2356 int drm_mode_connector_update_edid_property(struct drm_connector *, const struct edid *);
2505 int drm_add_modes_noedid(struct drm_connector *, int, int);
2693 void assert_drm_connector_list_read_locked___0(struct drm_mode_config *mode_config);
1076 void drm_sysfs_hotplug_event(struct drm_device *);
73 int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
76 void drm_kms_helper_poll_init(struct drm_device *dev);
77 void drm_kms_helper_poll_fini(struct drm_device *dev);
78 bool drm_helper_hpd_irq_event(struct drm_device *dev);
79 void drm_kms_helper_hotplug_event(struct drm_device *dev);
81 void drm_kms_helper_poll_disable(struct drm_device *dev);
82 void drm_kms_helper_poll_enable(struct drm_device *dev);
83 void drm_kms_helper_poll_enable_locked(struct drm_device *dev);
325 void drm_edid_to_eld(struct drm_connector *, struct edid *);
333 int drm_load_edid_firmware(struct drm_connector *connector);
61 _Bool drm_kms_helper_poll = 1;
65 enum drm_mode_status drm_mode_validate_flag(const struct drm_display_mode *mode, int flags);
83 int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector);
130 const char __kstrtab_drm_kms_helper_poll_enable_locked[34U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'o', 'l', 'l', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'l', 'o', 'c', 'k', 'e', 'd', '\x0' };
130 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_enable_locked;
130 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_enable_locked = { (unsigned long)(&drm_kms_helper_poll_enable_locked), (const char *)(&__kstrtab_drm_kms_helper_poll_enable_locked) };
322 const char __kstrtab_drm_helper_probe_single_connector_modes[40U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'r', 'o', 'b', 'e', '_', 's', 'i', 'n', 'g', 'l', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'm', 'o', 'd', 'e', 's', '\x0' };
322 const struct kernel_symbol __ksymtab_drm_helper_probe_single_connector_modes;
322 const struct kernel_symbol __ksymtab_drm_helper_probe_single_connector_modes = { (unsigned long)(&drm_helper_probe_single_connector_modes), (const char *)(&__kstrtab_drm_helper_probe_single_connector_modes) };
347 const char __kstrtab_drm_kms_helper_hotplug_event[29U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'h', 'o', 't', 'p', 'l', 'u', 'g', '_', 'e', 'v', 'e', 'n', 't', '\x0' };
347 const struct kernel_symbol __ksymtab_drm_kms_helper_hotplug_event;
347 const struct kernel_symbol __ksymtab_drm_kms_helper_hotplug_event = { (unsigned long)(&drm_kms_helper_hotplug_event), (const char *)(&__kstrtab_drm_kms_helper_hotplug_event) };
349 void output_poll_execute(struct work_struct *work);
446 const char __kstrtab_drm_kms_helper_poll_disable[28U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'o', 'l', 'l', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '\x0' };
446 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_disable;
446 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_disable = { (unsigned long)(&drm_kms_helper_poll_disable), (const char *)(&__kstrtab_drm_kms_helper_poll_disable) };
464 const char __kstrtab_drm_kms_helper_poll_enable[27U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'o', 'l', 'l', '_', 'e', 'n', 'a', 'b', 'l', 'e', '\x0' };
464 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_enable;
464 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_enable = { (unsigned long)(&drm_kms_helper_poll_enable), (const char *)(&__kstrtab_drm_kms_helper_poll_enable) };
492 const char __kstrtab_drm_kms_helper_poll_init[25U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'o', 'l', 'l', '_', 'i', 'n', 'i', 't', '\x0' };
492 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_init;
492 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_init = { (unsigned long)(&drm_kms_helper_poll_init), (const char *)(&__kstrtab_drm_kms_helper_poll_init) };
502 const char __kstrtab_drm_kms_helper_poll_fini[25U] = { 'd', 'r', 'm', '_', 'k', 'm', 's', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'o', 'l', 'l', '_', 'f', 'i', 'n', 'i', '\x0' };
502 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_fini;
502 const struct kernel_symbol __ksymtab_drm_kms_helper_poll_fini = { (unsigned long)(&drm_kms_helper_poll_fini), (const char *)(&__kstrtab_drm_kms_helper_poll_fini) };
562 const char __kstrtab_drm_helper_hpd_irq_event[25U] = { 'd', 'r', 'm', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'h', 'p', 'd', '_', 'i', 'r', 'q', '_', 'e', 'v', 'e', 'n', 't', '\x0' };
562 const struct kernel_symbol __ksymtab_drm_helper_hpd_irq_event;
562 const struct kernel_symbol __ksymtab_drm_helper_hpd_irq_event = { (unsigned long)(&drm_helper_hpd_irq_event), (const char *)(&__kstrtab_drm_helper_hpd_irq_event) };
24 int atomic_read___1(const atomic_t *v);
128 int mutex_is_locked___1(struct mutex *lock);
373 bool ww_mutex_is_locked___1(struct ww_mutex *lock);
117 bool drm_modeset_is_locked___1(struct drm_modeset_lock *lock);
2226 int drm_crtc_init_with_planes(struct drm_device *, struct drm_crtc *, struct drm_plane *, struct drm_plane *, const struct drm_crtc_funcs *, const char *, ...);
2303 int drm_universal_plane_init(struct drm_device *, struct drm_plane *, unsigned long, const struct drm_plane_funcs *, const uint32_t *, unsigned int, enum drm_plane_type , const char *, ...);
2317 void drm_plane_cleanup(struct drm_plane *);
2693 void assert_drm_connector_list_read_locked___1(struct drm_mode_config *mode_config);
987 int drm_crtc_vblank_get(struct drm_crtc *);
988 void drm_crtc_vblank_put(struct drm_crtc *);
990 void drm_crtc_wait_one_vblank(struct drm_crtc *);
142 bool drm_rect_equals(const struct drm_rect *r1, const struct drm_rect *r2);
150 bool drm_rect_clip_scaled(struct drm_rect *, struct drm_rect *, const struct drm_rect *, int, int);
153 int drm_rect_calc_hscale(const struct drm_rect *, const struct drm_rect *, int, int);
156 int drm_rect_calc_vscale(const struct drm_rect *, const struct drm_rect *, int, int);
165 void drm_rect_debug_print(const char *, const struct drm_rect *, bool );
40 int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, const struct drm_crtc_funcs *funcs);
43 int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, const struct drm_rect *clip, int min_scale, int max_scale, bool can_position, bool can_update_disabled, bool *visible);
54 int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h);
61 int drm_primary_helper_disable(struct drm_plane *plane);
62 void drm_primary_helper_destroy(struct drm_plane *plane);
63 const struct drm_plane_funcs drm_primary_helper_funcs;
65 int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h);
71 int drm_plane_helper_disable(struct drm_plane *plane);
132 void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state);
192 bool drm_atomic_plane_disabling(struct drm_plane *plane, struct drm_plane_state *old_state);
74 const uint32_t safe_modeset_formats[2U] = { 875713112U, 875713089U };
84 int get_connectors_for_crtc(struct drm_crtc *crtc, struct drm_connector **connector_list, int num_connectors);
197 const char __kstrtab_drm_plane_helper_check_update[30U] = { 'd', 'r', 'm', '_', 'p', 'l', 'a', 'n', 'e', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'h', 'e', 'c', 'k', '_', 'u', 'p', 'd', 'a', 't', 'e', '\x0' };
197 const struct kernel_symbol __ksymtab_drm_plane_helper_check_update;
197 const struct kernel_symbol __ksymtab_drm_plane_helper_check_update = { (unsigned long)(&drm_plane_helper_check_update), (const char *)(&__kstrtab_drm_plane_helper_check_update) };
308 const char __kstrtab_drm_primary_helper_update[26U] = { 'd', 'r', 'm', '_', 'p', 'r', 'i', 'm', 'a', 'r', 'y', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'p', 'd', 'a', 't', 'e', '\x0' };
308 const struct kernel_symbol __ksymtab_drm_primary_helper_update;
308 const struct kernel_symbol __ksymtab_drm_primary_helper_update = { (unsigned long)(&drm_primary_helper_update), (const char *)(&__kstrtab_drm_primary_helper_update) };
333 const char __kstrtab_drm_primary_helper_disable[27U] = { 'd', 'r', 'm', '_', 'p', 'r', 'i', 'm', 'a', 'r', 'y', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '\x0' };
333 const struct kernel_symbol __ksymtab_drm_primary_helper_disable;
333 const struct kernel_symbol __ksymtab_drm_primary_helper_disable = { (unsigned long)(&drm_primary_helper_disable), (const char *)(&__kstrtab_drm_primary_helper_disable) };
348 const char __kstrtab_drm_primary_helper_destroy[27U] = { 'd', 'r', 'm', '_', 'p', 'r', 'i', 'm', 'a', 'r', 'y', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '\x0' };
348 const struct kernel_symbol __ksymtab_drm_primary_helper_destroy;
348 const struct kernel_symbol __ksymtab_drm_primary_helper_destroy = { (unsigned long)(&drm_primary_helper_destroy), (const char *)(&__kstrtab_drm_primary_helper_destroy) };
350 const struct drm_plane_funcs drm_primary_helper_funcs = { &drm_primary_helper_update, &drm_primary_helper_disable, &drm_primary_helper_destroy, 0, 0, 0, 0, 0, 0 };
355 const char __kstrtab_drm_primary_helper_funcs[25U] = { 'd', 'r', 'm', '_', 'p', 'r', 'i', 'm', 'a', 'r', 'y', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'f', 'u', 'n', 'c', 's', '\x0' };
355 const struct kernel_symbol __ksymtab_drm_primary_helper_funcs;
355 const struct kernel_symbol __ksymtab_drm_primary_helper_funcs = { (unsigned long)(&drm_primary_helper_funcs), (const char *)(&__kstrtab_drm_primary_helper_funcs) };
357 struct drm_plane * create_primary_plane(struct drm_device *dev);
409 const char __kstrtab_drm_crtc_init[14U] = { 'd', 'r', 'm', '_', 'c', 'r', 't', 'c', '_', 'i', 'n', 'i', 't', '\x0' };
409 const struct kernel_symbol __ksymtab_drm_crtc_init;
409 const struct kernel_symbol __ksymtab_drm_crtc_init = { (unsigned long)(&drm_crtc_init), (const char *)(&__kstrtab_drm_crtc_init) };
562 const char __kstrtab_drm_plane_helper_update[24U] = { 'd', 'r', 'm', '_', 'p', 'l', 'a', 'n', 'e', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'p', 'd', 'a', 't', 'e', '\x0' };
562 const struct kernel_symbol __ksymtab_drm_plane_helper_update;
562 const struct kernel_symbol __ksymtab_drm_plane_helper_update = { (unsigned long)(&drm_plane_helper_update), (const char *)(&__kstrtab_drm_plane_helper_update) };
603 const char __kstrtab_drm_plane_helper_disable[25U] = { 'd', 'r', 'm', '_', 'p', 'l', 'a', 'n', 'e', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '\x0' };
603 const struct kernel_symbol __ksymtab_drm_plane_helper_disable;
603 const struct kernel_symbol __ksymtab_drm_plane_helper_disable = { (unsigned long)(&drm_plane_helper_disable), (const char *)(&__kstrtab_drm_plane_helper_disable) };
642 void ldv_main3_sequence_infinite_withcheck_stateful();
72 void set_bit(long nr, volatile unsigned long *addr);
110 void clear_bit(long nr, volatile unsigned long *addr);
53 unsigned long int find_first_zero_bit(const unsigned long *, unsigned long);
443 void print_hex_dump(const char *, const char *, int, int, int, const void *, size_t , bool );
185 void __might_sleep(const char *, int, int);
415 int snprintf(char *, size_t , const char *, ...);
25 void INIT_LIST_HEAD___1(struct list_head *list);
61 void list_add(struct list_head *new, struct list_head *head);
113 void list_del(struct list_head *);
187 int list_empty___1(const struct list_head *head);
31 void * __memcpy(void *, const void *, size_t );
62 int memcmp(const void *, const void *, size_t );
39 size_t strlcat(char *, const char *, __kernel_size_t );
16 void __xadd_wrong_size();
24 int atomic_read___2(const atomic_t *v);
36 void atomic_set(atomic_t *v, int i);
78 int atomic_sub_and_test(int i, atomic_t *v);
154 int atomic_add_return(int i, atomic_t *v);
36 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder);
78 extern volatile unsigned long jiffies;
83 u64 get_jiffies_64();
72 void __init_waitqueue_head(wait_queue_head_t *, const char *, struct lock_class_key *);
200 void __wake_up(wait_queue_head_t *, unsigned int, int, void *);
977 long int prepare_to_wait_event(wait_queue_head_t *, wait_queue_t *, int);
978 void finish_wait(wait_queue_head_t *, wait_queue_t *);
128 int mutex_is_locked___2(struct mutex *lock);
355 extern struct workqueue_struct *system_long_wq;
430 bool queue_work_on(int, struct workqueue_struct *, struct work_struct *);
444 bool flush_work(struct work_struct *);
470 bool queue_work(struct workqueue_struct *wq, struct work_struct *work);
529 bool schedule_work(struct work_struct *work);
435 long int schedule_timeout(long);
117 void seq_printf(struct seq_file *, const char *, ...);
31 void kref_init(struct kref *kref);
40 void kref_get(struct kref *kref);
67 int kref_sub(struct kref *kref, unsigned int count, void (*release)(struct kref *));
96 int kref_put(struct kref *kref, void (*release)(struct kref *));
468 int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, struct device *dev, struct drm_dp_aux *aux, int max_dpcd_transaction_bytes, int max_payloads, int conn_base_id);
470 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
473 int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool mst_state);
476 int drm_dp_mst_hpd_irq(struct drm_dp_mst_topology_mgr *mgr, u8 *esi, bool *handled);
479 enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
481 bool drm_dp_mst_port_has_audio(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
483 struct edid * drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
486 int drm_dp_calc_pbn_mode(int clock, int bpp);
489 bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int pbn, int *slots);
491 int drm_dp_mst_get_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
494 void drm_dp_mst_reset_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
497 void drm_dp_mst_deallocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
501 int drm_dp_find_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, int pbn);
505 int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr);
508 int drm_dp_update_payload_part2(struct drm_dp_mst_topology_mgr *mgr);
510 int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr);
512 void drm_dp_mst_dump_topology(struct seq_file *m, struct drm_dp_mst_topology_mgr *mgr);
515 void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr);
516 int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr);
564 void * kmalloc_array(size_t n, size_t size, gfp_t flags);
577 void * kcalloc(size_t n, size_t size, gfp_t flags);
2343 struct edid * drm_get_edid(struct drm_connector *, struct i2c_adapter *);
2347 struct edid * drm_edid_duplicate(const struct edid *);
2355 int drm_mode_connector_set_tile_property(struct drm_connector *);
2501 bool drm_detect_monitor_audio(struct edid *);
2514 void drm_edid_get_monitor_name(struct edid *, char *, int);
84 int drm_fixp2int(s64 a);
89 int drm_fixp2int_ceil(s64 a);
149 s64 drm_fixp_from_fraction(s64 a, s64 b);
43 bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, char *buf);
45 int test_calc_pbn_mode();
47 void drm_dp_put_port(struct drm_dp_mst_port *port);
49 int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr, int id, struct drm_dp_payload *payload);
53 int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes);
57 void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb);
59 int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb, struct drm_dp_mst_port *port);
62 bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, u8 *guid);
65 int drm_dp_mst_register_i2c_bus(struct drm_dp_aux *aux);
66 void drm_dp_mst_unregister_i2c_bus(struct drm_dp_aux *aux);
67 void drm_dp_mst_kick_tx(struct drm_dp_mst_topology_mgr *mgr);
69 u8 drm_dp_msg_header_crc4(const uint8_t *data, size_t num_nibbles);
103 u8 drm_dp_msg_data_crc4(const uint8_t *data, u8 number_of_bytes);
136 u8 drm_dp_calc_sb_hdr_size(struct drm_dp_sideband_msg_hdr *hdr);
143 void drm_dp_encode_sideband_msg_hdr(struct drm_dp_sideband_msg_hdr *hdr, u8 *buf, int *len);
162 bool drm_dp_decode_sideband_msg_hdr(struct drm_dp_sideband_msg_hdr *hdr, u8 *buf, int buflen, u8 *hdrlen);
199 void drm_dp_encode_sideband_req(struct drm_dp_sideband_msg_req_body *req, struct drm_dp_sideband_msg_tx *raw);
300 void drm_dp_crc_sideband_chunk_req(u8 *msg, u8 len);
307 void drm_dp_encode_sideband_reply(struct drm_dp_sideband_msg_reply_body *rep, struct drm_dp_sideband_msg_tx *raw);
319 bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, u8 *replybuf, u8 replybuflen, bool hdr);
367 bool drm_dp_sideband_parse_link_address(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
419 bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
438 bool drm_dp_sideband_parse_remote_dpcd_write(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
452 bool drm_dp_sideband_parse_remote_i2c_read_ack(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
471 bool drm_dp_sideband_parse_enum_path_resources_ack(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
493 bool drm_dp_sideband_parse_allocate_payload_ack(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
515 bool drm_dp_sideband_parse_query_payload_ack(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *repmsg);
533 bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *msg);
568 bool drm_dp_sideband_parse_connection_status_notify(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg);
595 bool drm_dp_sideband_parse_resource_status_notify(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg);
618 bool drm_dp_sideband_parse_req(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg);
635 int build_dpcd_write(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_bytes, u8 *bytes);
649 int build_link_address(struct drm_dp_sideband_msg_tx *msg);
658 int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg, int port_num);
669 int build_allocate_payload(struct drm_dp_sideband_msg_tx *msg, int port_num, u8 vcpi, uint16_t pbn, u8 number_sdp_streams, u8 *sdp_stream_sink);
688 int drm_dp_mst_assign_payload_id(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_vcpi *vcpi);
717 void drm_dp_mst_put_payload_id(struct drm_dp_mst_topology_mgr *mgr, int vcpi);
738 bool check_txmsg_state(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg);
753 int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb, struct drm_dp_sideband_msg_tx *txmsg);
791 struct drm_dp_mst_branch * drm_dp_add_mst_branch_device(u8 lct, u8 *rad);
807 void drm_dp_free_mst_port(struct kref *kref);
809 void drm_dp_free_mst_branch_device(struct kref *kref);
819 void drm_dp_destroy_mst_branch_device(struct kref *kref);
864 void drm_dp_put_mst_branch_device(struct drm_dp_mst_branch *mstb);
870 void drm_dp_port_teardown_pdt(struct drm_dp_mst_port *port, int old_pdt);
888 void drm_dp_destroy_port(struct kref *kref);
927 struct drm_dp_mst_branch * drm_dp_mst_get_validated_mstb_ref_locked(struct drm_dp_mst_branch *mstb, struct drm_dp_mst_branch *to_find);
945 struct drm_dp_mst_branch * drm_dp_get_validated_mstb_ref(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb);
955 struct drm_dp_mst_port * drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_branch *mstb, struct drm_dp_mst_port *to_find);
973 struct drm_dp_mst_port * drm_dp_get_validated_port_ref(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
983 struct drm_dp_mst_port * drm_dp_get_port(struct drm_dp_mst_branch *mstb, u8 port_num);
1002 u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port, u8 *rad);
1021 bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port);
1045 void drm_dp_check_mstb_guid(struct drm_dp_mst_branch *mstb, u8 *guid);
1070 void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, int pnum, char *proppath, size_t proppath_size);
1088 void drm_dp_add_port(struct drm_dp_mst_branch *mstb, struct device *dev, struct drm_dp_link_addr_reply_port *port_msg);
1175 void drm_dp_update_port(struct drm_dp_mst_branch *mstb, struct drm_dp_connection_status_notify *conn_stat);
1213 struct drm_dp_mst_branch * drm_dp_get_mst_branch_device(struct drm_dp_mst_topology_mgr *mgr, u8 lct, u8 *rad);
1246 struct drm_dp_mst_branch * get_mst_branch_device_by_guid_helper(struct drm_dp_mst_branch *mstb, uint8_t *guid);
1270 struct drm_dp_mst_branch * drm_dp_get_mst_branch_device_by_guid(struct drm_dp_mst_topology_mgr *mgr, uint8_t *guid);
1288 void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb);
1316 void drm_dp_mst_link_probe_work(struct work_struct *work);
1362 int drm_dp_send_sideband_msg(struct drm_dp_mst_topology_mgr *mgr, bool up___0, u8 *msg, int len);
1394 int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, struct drm_dp_sideband_msg_tx *txmsg);
1433 int process_single_tx_qlock(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg, bool up___0);
1489 void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr);
1523 void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg);
1537 void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_sideband_msg_tx *txmsg);
1634 struct drm_dp_mst_port * drm_dp_get_last_connected_port_to_mstb(struct drm_dp_mst_branch *mstb);
1645 struct drm_dp_mst_branch * drm_dp_get_last_connected_port_and_mstb(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb, int *port_num);
1665 int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int id, int pbn);
1721 int drm_dp_create_payload_step1(struct drm_dp_mst_topology_mgr *mgr, int id, struct drm_dp_payload *payload);
1736 int drm_dp_create_payload_step2(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int id, struct drm_dp_payload *payload);
1749 int drm_dp_destroy_payload_step1(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int id, struct drm_dp_payload *payload);
1765 int drm_dp_destroy_payload_step2(struct drm_dp_mst_topology_mgr *mgr, int id, struct drm_dp_payload *payload);
1859 const char __kstrtab_drm_dp_update_payload_part1[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '_', 'p', 'a', 'r', 't', '1', '\x0' };
1859 const struct kernel_symbol __ksymtab_drm_dp_update_payload_part1;
1859 const struct kernel_symbol __ksymtab_drm_dp_update_payload_part1 = { (unsigned long)(&drm_dp_update_payload_part1), (const char *)(&__kstrtab_drm_dp_update_payload_part1) };
1897 const char __kstrtab_drm_dp_update_payload_part2[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '_', 'p', 'a', 'r', 't', '2', '\x0' };
1897 const struct kernel_symbol __ksymtab_drm_dp_update_payload_part2;
1897 const struct kernel_symbol __ksymtab_drm_dp_update_payload_part2 = { (unsigned long)(&drm_dp_update_payload_part2), (const char *)(&__kstrtab_drm_dp_update_payload_part2) };
1957 int drm_dp_encode_up_ack_reply(struct drm_dp_sideband_msg_tx *msg, u8 req_type);
1967 int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_branch *mstb, int req_type, int seqno, bool broadcast);
1991 bool drm_dp_get_vc_payload_bw(int dp_link_bw, int dp_link_count, int *out);
2102 const char __kstrtab_drm_dp_mst_topology_mgr_set_mst[32U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '_', 'm', 'g', 'r', '_', 's', 'e', 't', '_', 'm', 's', 't', '\x0' };
2102 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_set_mst;
2102 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_set_mst = { (unsigned long)(&drm_dp_mst_topology_mgr_set_mst), (const char *)(&__kstrtab_drm_dp_mst_topology_mgr_set_mst) };
2120 const char __kstrtab_drm_dp_mst_topology_mgr_suspend[32U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '_', 'm', 'g', 'r', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\x0' };
2120 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_suspend;
2120 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_suspend = { (unsigned long)(&drm_dp_mst_topology_mgr_suspend), (const char *)(&__kstrtab_drm_dp_mst_topology_mgr_suspend) };
2174 const char __kstrtab_drm_dp_mst_topology_mgr_resume[31U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '_', 'm', 'g', 'r', '_', 'r', 'e', 's', 'u', 'm', 'e', '\x0' };
2174 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_resume;
2174 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_resume = { (unsigned long)(&drm_dp_mst_topology_mgr_resume), (const char *)(&__kstrtab_drm_dp_mst_topology_mgr_resume) };
2176 void drm_dp_get_one_sb_msg(struct drm_dp_mst_topology_mgr *mgr, bool up___0);
2218 int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr);
2275 int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr);
2372 const char __kstrtab_drm_dp_mst_hpd_irq[19U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'h', 'p', 'd', '_', 'i', 'r', 'q', '\x0' };
2372 const struct kernel_symbol __ksymtab_drm_dp_mst_hpd_irq;
2372 const struct kernel_symbol __ksymtab_drm_dp_mst_hpd_irq = { (unsigned long)(&drm_dp_mst_hpd_irq), (const char *)(&__kstrtab_drm_dp_mst_hpd_irq) };
2416 const char __kstrtab_drm_dp_mst_detect_port[23U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'd', 'e', 't', 'e', 'c', 't', '_', 'p', 'o', 'r', 't', '\x0' };
2416 const struct kernel_symbol __ksymtab_drm_dp_mst_detect_port;
2416 const struct kernel_symbol __ksymtab_drm_dp_mst_detect_port = { (unsigned long)(&drm_dp_mst_detect_port), (const char *)(&__kstrtab_drm_dp_mst_detect_port) };
2437 const char __kstrtab_drm_dp_mst_port_has_audio[26U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'p', 'o', 'r', 't', '_', 'h', 'a', 's', '_', 'a', 'u', 'd', 'i', 'o', '\x0' };
2437 const struct kernel_symbol __ksymtab_drm_dp_mst_port_has_audio;
2437 const struct kernel_symbol __ksymtab_drm_dp_mst_port_has_audio = { (unsigned long)(&drm_dp_mst_port_has_audio), (const char *)(&__kstrtab_drm_dp_mst_port_has_audio) };
2468 const char __kstrtab_drm_dp_mst_get_edid[20U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'g', 'e', 't', '_', 'e', 'd', 'i', 'd', '\x0' };
2468 const struct kernel_symbol __ksymtab_drm_dp_mst_get_edid;
2468 const struct kernel_symbol __ksymtab_drm_dp_mst_get_edid = { (unsigned long)(&drm_dp_mst_get_edid), (const char *)(&__kstrtab_drm_dp_mst_get_edid) };
2486 const char __kstrtab_drm_dp_find_vcpi_slots[23U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'f', 'i', 'n', 'd', '_', 'v', 'c', 'p', 'i', '_', 's', 'l', 'o', 't', 's', '\x0' };
2486 const struct kernel_symbol __ksymtab_drm_dp_find_vcpi_slots;
2486 const struct kernel_symbol __ksymtab_drm_dp_find_vcpi_slots = { (unsigned long)(&drm_dp_find_vcpi_slots), (const char *)(&__kstrtab_drm_dp_find_vcpi_slots) };
2488 int drm_dp_init_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_vcpi *vcpi, int pbn);
2546 const char __kstrtab_drm_dp_mst_allocate_vcpi[25U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'a', 'l', 'l', 'o', 'c', 'a', 't', 'e', '_', 'v', 'c', 'p', 'i', '\x0' };
2546 const struct kernel_symbol __ksymtab_drm_dp_mst_allocate_vcpi;
2546 const struct kernel_symbol __ksymtab_drm_dp_mst_allocate_vcpi = { (unsigned long)(&drm_dp_mst_allocate_vcpi), (const char *)(&__kstrtab_drm_dp_mst_allocate_vcpi) };
2559 const char __kstrtab_drm_dp_mst_get_vcpi_slots[26U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'g', 'e', 't', '_', 'v', 'c', 'p', 'i', '_', 's', 'l', 'o', 't', 's', '\x0' };
2559 const struct kernel_symbol __ksymtab_drm_dp_mst_get_vcpi_slots;
2559 const struct kernel_symbol __ksymtab_drm_dp_mst_get_vcpi_slots = { (unsigned long)(&drm_dp_mst_get_vcpi_slots), (const char *)(&__kstrtab_drm_dp_mst_get_vcpi_slots) };
2576 const char __kstrtab_drm_dp_mst_reset_vcpi_slots[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'r', 'e', 's', 'e', 't', '_', 'v', 'c', 'p', 'i', '_', 's', 'l', 'o', 't', 's', '\x0' };
2576 const struct kernel_symbol __ksymtab_drm_dp_mst_reset_vcpi_slots;
2576 const struct kernel_symbol __ksymtab_drm_dp_mst_reset_vcpi_slots = { (unsigned long)(&drm_dp_mst_reset_vcpi_slots), (const char *)(&__kstrtab_drm_dp_mst_reset_vcpi_slots) };
2596 const char __kstrtab_drm_dp_mst_deallocate_vcpi[27U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'd', 'e', 'a', 'l', 'l', 'o', 'c', 'a', 't', 'e', '_', 'v', 'c', 'p', 'i', '\x0' };
2596 const struct kernel_symbol __ksymtab_drm_dp_mst_deallocate_vcpi;
2596 const struct kernel_symbol __ksymtab_drm_dp_mst_deallocate_vcpi = { (unsigned long)(&drm_dp_mst_deallocate_vcpi), (const char *)(&__kstrtab_drm_dp_mst_deallocate_vcpi) };
2677 const char __kstrtab_drm_dp_check_act_status[24U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'c', 'h', 'e', 'c', 'k', '_', 'a', 'c', 't', '_', 's', 't', 'a', 't', 'u', 's', '\x0' };
2677 const struct kernel_symbol __ksymtab_drm_dp_check_act_status;
2677 const struct kernel_symbol __ksymtab_drm_dp_check_act_status = { (unsigned long)(&drm_dp_check_act_status), (const char *)(&__kstrtab_drm_dp_check_act_status) };
2714 const char __kstrtab_drm_dp_calc_pbn_mode[21U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'c', 'a', 'l', 'c', '_', 'p', 'b', 'n', '_', 'm', 'o', 'd', 'e', '\x0' };
2714 const struct kernel_symbol __ksymtab_drm_dp_calc_pbn_mode;
2714 const struct kernel_symbol __ksymtab_drm_dp_calc_pbn_mode = { (unsigned long)(&drm_dp_calc_pbn_mode), (const char *)(&__kstrtab_drm_dp_calc_pbn_mode) };
2746 void drm_dp_mst_dump_mstb(struct seq_file *m, struct drm_dp_mst_branch *mstb);
2781 void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, char *name, int namelen);
2884 const char __kstrtab_drm_dp_mst_dump_topology[25U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 'd', 'u', 'm', 'p', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '\x0' };
2884 const struct kernel_symbol __ksymtab_drm_dp_mst_dump_topology;
2884 const struct kernel_symbol __ksymtab_drm_dp_mst_dump_topology = { (unsigned long)(&drm_dp_mst_dump_topology), (const char *)(&__kstrtab_drm_dp_mst_dump_topology) };
2886 void drm_dp_tx_work(struct work_struct *work);
2903 void drm_dp_destroy_connector_work(struct work_struct *work);
2991 const char __kstrtab_drm_dp_mst_topology_mgr_init[29U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '_', 'm', 'g', 'r', '_', 'i', 'n', 'i', 't', '\x0' };
2991 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_init;
2991 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_init = { (unsigned long)(&drm_dp_mst_topology_mgr_init), (const char *)(&__kstrtab_drm_dp_mst_topology_mgr_init) };
3010 const char __kstrtab_drm_dp_mst_topology_mgr_destroy[32U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'm', 's', 't', '_', 't', 'o', 'p', 'o', 'l', 'o', 'g', 'y', '_', 'm', 'g', 'r', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '\x0' };
3010 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_destroy;
3010 const struct kernel_symbol __ksymtab_drm_dp_mst_topology_mgr_destroy = { (unsigned long)(&drm_dp_mst_topology_mgr_destroy), (const char *)(&__kstrtab_drm_dp_mst_topology_mgr_destroy) };
3013 int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num);
3084 u32 drm_dp_mst_i2c_functionality(struct i2c_adapter *adapter);
3092 const struct i2c_algorithm drm_dp_mst_i2c_algo = { &drm_dp_mst_i2c_xfer, 0, &drm_dp_mst_i2c_functionality, 0, 0 };
3166 void ldv_main4_sequence_infinite_withcheck_stateful();
3 bool ldv_is_err(const void *ptr);
5 void * ldv_err_ptr(long error);
6 long int ldv_ptr_err(const void *ptr);
25 void INIT_LIST_HEAD___2(struct list_head *list);
23 void * ERR_PTR(long error);
32 long int PTR_ERR(const void *ptr);
41 bool IS_ERR(const void *ptr);
24 int atomic_read___3(const atomic_t *v);
66 void warn_slowpath_fmt(const char *, const int, const char *, ...);
128 int mutex_is_locked___3(struct mutex *lock);
292 unsigned long int __msecs_to_jiffies(const unsigned int);
354 unsigned long int msecs_to_jiffies(const unsigned int m);
373 bool ww_mutex_is_locked___2(struct ww_mutex *lock);
87 void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *, uint32_t );
89 void drm_modeset_acquire_fini(struct drm_modeset_acquire_ctx *);
90 void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *);
91 void drm_modeset_backoff(struct drm_modeset_acquire_ctx *);
117 bool drm_modeset_is_locked___2(struct drm_modeset_lock *lock);
122 int drm_modeset_lock(struct drm_modeset_lock *, struct drm_modeset_acquire_ctx *);
139 struct drm_modeset_acquire_ctx * drm_modeset_legacy_acquire_ctx(struct drm_crtc *);
141 int drm_modeset_lock_all_ctx(struct drm_device *, struct drm_modeset_acquire_ctx *);
2257 unsigned int drm_connector_index(struct drm_connector *connector);
2287 unsigned int drm_encoder_index(struct drm_encoder *);
2318 unsigned int drm_plane_index(struct drm_plane *);
2323 void drm_crtc_get_hv_timing(const struct drm_display_mode *, int *, int *);
2350 void drm_mode_config_reset(struct drm_device *);
2379 int drm_object_property_set_value(struct drm_mode_object *, struct drm_property *, uint64_t );
2418 struct drm_property_blob * drm_property_create_blob(struct drm_device *, size_t , const void *);
2423 struct drm_property_blob * drm_property_reference_blob(struct drm_property_blob *);
2424 void drm_property_unreference_blob(struct drm_property_blob *);
2445 struct drm_mode_object * drm_mode_object_find(struct drm_device *, uint32_t , uint32_t );
2575 struct drm_encoder * drm_encoder_find(struct drm_device *dev, uint32_t id);
2632 void drm_framebuffer_reference(struct drm_framebuffer *fb);
2643 void drm_framebuffer_unreference(struct drm_framebuffer *fb);
2693 void assert_drm_connector_list_read_locked___2(struct drm_mode_config *mode_config);
970 u32 drm_crtc_vblank_count(struct drm_crtc *);
34 struct drm_atomic_state * drm_atomic_state_alloc(struct drm_device *);
35 void drm_atomic_state_clear(struct drm_atomic_state *);
36 void drm_atomic_state_free(struct drm_atomic_state *);
44 struct drm_crtc_state * drm_atomic_get_crtc_state(struct drm_atomic_state *, struct drm_crtc *);
46 int drm_atomic_crtc_set_property(struct drm_crtc *, struct drm_crtc_state *, struct drm_property *, uint64_t );
50 struct drm_plane_state * drm_atomic_get_plane_state(struct drm_atomic_state *, struct drm_plane *);
52 int drm_atomic_plane_set_property(struct drm_plane *, struct drm_plane_state *, struct drm_property *, uint64_t );
56 struct drm_connector_state * drm_atomic_get_connector_state(struct drm_atomic_state *, struct drm_connector *);
58 int drm_atomic_connector_set_property(struct drm_connector *, struct drm_connector_state *, struct drm_property *, uint64_t );
71 struct drm_crtc_state * drm_atomic_get_existing_crtc_state(struct drm_atomic_state *state, struct drm_crtc *crtc);
86 struct drm_plane_state * drm_atomic_get_existing_plane_state(struct drm_atomic_state *state, struct drm_plane *plane);
101 struct drm_connector_state * drm_atomic_get_existing_connector_state(struct drm_atomic_state *state, struct drm_connector *connector);
116 int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *, struct drm_property_blob *);
119 int drm_atomic_set_crtc_for_plane(struct drm_plane_state *, struct drm_crtc *);
124 int drm_atomic_set_crtc_for_connector(struct drm_connector_state *, struct drm_crtc *);
127 int drm_atomic_add_affected_connectors(struct drm_atomic_state *, struct drm_crtc *);
130 int drm_atomic_add_affected_planes(struct drm_atomic_state *, struct drm_crtc *);
133 void drm_atomic_legacy_backoff(struct drm_atomic_state *);
139 int drm_atomic_commit(struct drm_atomic_state *);
140 int drm_atomic_nonblocking_commit(struct drm_atomic_state *);
166 bool drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state);
35 int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state);
37 int drm_atomic_helper_check_planes(struct drm_device *dev, struct drm_atomic_state *state);
39 int drm_atomic_helper_check(struct drm_device *dev, struct drm_atomic_state *state);
41 int drm_atomic_helper_commit(struct drm_device *dev, struct drm_atomic_state *state, bool nonblock);
45 void drm_atomic_helper_wait_for_fences(struct drm_device *dev, struct drm_atomic_state *state);
47 bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev, struct drm_atomic_state *old_state, struct drm_crtc *crtc);
51 void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, struct drm_atomic_state *old_state);
55 void drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev, struct drm_atomic_state *old_state);
58 void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev, struct drm_atomic_state *old_state);
60 void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *old_state);
63 int drm_atomic_helper_prepare_planes(struct drm_device *dev, struct drm_atomic_state *state);
65 void drm_atomic_helper_commit_planes(struct drm_device *dev, struct drm_atomic_state *old_state, bool active_only);
68 void drm_atomic_helper_cleanup_planes(struct drm_device *dev, struct drm_atomic_state *old_state);
70 void drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state);
71 void drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc *crtc, bool atomic);
74 void drm_atomic_helper_swap_state(struct drm_device *dev, struct drm_atomic_state *state);
78 int drm_atomic_helper_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h);
85 int drm_atomic_helper_disable_plane(struct drm_plane *plane);
86 int __drm_atomic_helper_disable_plane(struct drm_plane *plane, struct drm_plane_state *plane_state);
88 int drm_atomic_helper_set_config(struct drm_mode_set *set);
89 int __drm_atomic_helper_set_config(struct drm_mode_set *set, struct drm_atomic_state *state);
92 int drm_atomic_helper_disable_all(struct drm_device *dev, struct drm_modeset_acquire_ctx *ctx);
94 struct drm_atomic_state * drm_atomic_helper_suspend(struct drm_device *dev);
95 int drm_atomic_helper_resume(struct drm_device *dev, struct drm_atomic_state *state);
98 int drm_atomic_helper_crtc_set_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t val);
101 int drm_atomic_helper_plane_set_property(struct drm_plane *plane, struct drm_property *property, uint64_t val);
104 int drm_atomic_helper_connector_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val);
107 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event, uint32_t flags);
111 int drm_atomic_helper_connector_dpms(struct drm_connector *connector, int mode);
114 struct drm_encoder * drm_atomic_helper_best_encoder(struct drm_connector *connector);
118 void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, struct drm_crtc_state *state);
122 void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
127 void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, struct drm_plane_state *state);
131 void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state);
135 void __drm_atomic_helper_connector_reset(struct drm_connector *connector, struct drm_connector_state *conn_state);
137 void drm_atomic_helper_connector_reset(struct drm_connector *connector);
139 void __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, struct drm_connector_state *state);
142 struct drm_connector_state * drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector);
144 struct drm_atomic_state * drm_atomic_helper_duplicate_state(struct drm_device *dev, struct drm_modeset_acquire_ctx *ctx);
147 void __drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state);
148 void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, struct drm_connector_state *state);
150 void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, uint32_t start, uint32_t size);
183 void fence_release(struct kref *);
217 void fence_put(struct fence *fence);
325 long int fence_wait_timeout(struct fence *, bool , long);
342 long int fence_wait(struct fence *fence, bool intr);
63 void drm_atomic_helper_plane_changed(struct drm_atomic_state *state, struct drm_plane_state *plane_state, struct drm_plane *plane);
90 int handle_conflicting_encoders(struct drm_atomic_state *state, bool disable_conflicting_encoders);
191 void set_best_encoder(struct drm_atomic_state *state, struct drm_connector_state *conn_state, struct drm_encoder *encoder);
232 void steal_encoder(struct drm_atomic_state *state, struct drm_encoder *encoder);
262 int update_connector_routing(struct drm_atomic_state *state, struct drm_connector *connector, struct drm_connector_state *connector_state);
352 int mode_fixup(struct drm_atomic_state *state);
561 const char __kstrtab_drm_atomic_helper_check_modeset[32U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'h', 'e', 'c', 'k', '_', 'm', 'o', 'd', 'e', 's', 'e', 't', '\x0' };
561 const struct kernel_symbol __ksymtab_drm_atomic_helper_check_modeset;
561 const struct kernel_symbol __ksymtab_drm_atomic_helper_check_modeset = { (unsigned long)(&drm_atomic_helper_check_modeset), (const char *)(&__kstrtab_drm_atomic_helper_check_modeset) };
624 const char __kstrtab_drm_atomic_helper_check_planes[31U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'h', 'e', 'c', 'k', '_', 'p', 'l', 'a', 'n', 'e', 's', '\x0' };
624 const struct kernel_symbol __ksymtab_drm_atomic_helper_check_planes;
624 const struct kernel_symbol __ksymtab_drm_atomic_helper_check_planes = { (unsigned long)(&drm_atomic_helper_check_planes), (const char *)(&__kstrtab_drm_atomic_helper_check_planes) };
661 const char __kstrtab_drm_atomic_helper_check[24U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'h', 'e', 'c', 'k', '\x0' };
661 const struct kernel_symbol __ksymtab_drm_atomic_helper_check;
661 const struct kernel_symbol __ksymtab_drm_atomic_helper_check = { (unsigned long)(&drm_atomic_helper_check), (const char *)(&__kstrtab_drm_atomic_helper_check) };
664 void disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state);
824 const char __kstrtab_drm_atomic_helper_update_legacy_modeset_state[46U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'm', 'o', 'd', 'e', 's', 'e', 't', '_', 's', 't', 'a', 't', 'e', '\x0' };
824 const struct kernel_symbol __ksymtab_drm_atomic_helper_update_legacy_modeset_state;
824 const struct kernel_symbol __ksymtab_drm_atomic_helper_update_legacy_modeset_state = { (unsigned long)(&drm_atomic_helper_update_legacy_modeset_state), (const char *)(&__kstrtab_drm_atomic_helper_update_legacy_modeset_state) };
827 void crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state);
906 const char __kstrtab_drm_atomic_helper_commit_modeset_disables[42U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'm', 'm', 'i', 't', '_', 'm', 'o', 'd', 'e', 's', 'e', 't', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', 's', '\x0' };
906 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_modeset_disables;
906 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_modeset_disables = { (unsigned long)(&drm_atomic_helper_commit_modeset_disables), (const char *)(&__kstrtab_drm_atomic_helper_commit_modeset_disables) };
987 const char __kstrtab_drm_atomic_helper_commit_modeset_enables[41U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'm', 'm', 'i', 't', '_', 'm', 'o', 'd', 'e', 's', 'e', 't', '_', 'e', 'n', 'a', 'b', 'l', 'e', 's', '\x0' };
987 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_modeset_enables;
987 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_modeset_enables = { (unsigned long)(&drm_atomic_helper_commit_modeset_enables), (const char *)(&__kstrtab_drm_atomic_helper_commit_modeset_enables) };
1017 const char __kstrtab_drm_atomic_helper_wait_for_fences[34U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'w', 'a', 'i', 't', '_', 'f', 'o', 'r', '_', 'f', 'e', 'n', 'c', 'e', 's', '\x0' };
1017 const struct kernel_symbol __ksymtab_drm_atomic_helper_wait_for_fences;
1017 const struct kernel_symbol __ksymtab_drm_atomic_helper_wait_for_fences = { (unsigned long)(&drm_atomic_helper_wait_for_fences), (const char *)(&__kstrtab_drm_atomic_helper_wait_for_fences) };
1052 const char __kstrtab_drm_atomic_helper_framebuffer_changed[38U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'f', 'r', 'a', 'm', 'e', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'c', 'h', 'a', 'n', 'g', 'e', 'd', '\x0' };
1052 const struct kernel_symbol __ksymtab_drm_atomic_helper_framebuffer_changed;
1052 const struct kernel_symbol __ksymtab_drm_atomic_helper_framebuffer_changed = { (unsigned long)(&drm_atomic_helper_framebuffer_changed), (const char *)(&__kstrtab_drm_atomic_helper_framebuffer_changed) };
1113 const char __kstrtab_drm_atomic_helper_wait_for_vblanks[35U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'w', 'a', 'i', 't', '_', 'f', 'o', 'r', '_', 'v', 'b', 'l', 'a', 'n', 'k', 's', '\x0' };
1113 const struct kernel_symbol __ksymtab_drm_atomic_helper_wait_for_vblanks;
1113 const struct kernel_symbol __ksymtab_drm_atomic_helper_wait_for_vblanks = { (unsigned long)(&drm_atomic_helper_wait_for_vblanks), (const char *)(&__kstrtab_drm_atomic_helper_wait_for_vblanks) };
1197 const char __kstrtab_drm_atomic_helper_commit[25U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'm', 'm', 'i', 't', '\x0' };
1197 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit;
1197 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit = { (unsigned long)(&drm_atomic_helper_commit), (const char *)(&__kstrtab_drm_atomic_helper_commit) };
1292 const char __kstrtab_drm_atomic_helper_prepare_planes[33U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'r', 'e', 'p', 'a', 'r', 'e', '_', 'p', 'l', 'a', 'n', 'e', 's', '\x0' };
1292 const struct kernel_symbol __ksymtab_drm_atomic_helper_prepare_planes;
1292 const struct kernel_symbol __ksymtab_drm_atomic_helper_prepare_planes = { (unsigned long)(&drm_atomic_helper_prepare_planes), (const char *)(&__kstrtab_drm_atomic_helper_prepare_planes) };
1294 bool plane_crtc_active(struct drm_plane_state *state);
1405 const char __kstrtab_drm_atomic_helper_commit_planes[32U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'm', 'm', 'i', 't', '_', 'p', 'l', 'a', 'n', 'e', 's', '\x0' };
1405 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_planes;
1405 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_planes = { (unsigned long)(&drm_atomic_helper_commit_planes), (const char *)(&__kstrtab_drm_atomic_helper_commit_planes) };
1463 const char __kstrtab_drm_atomic_helper_commit_planes_on_crtc[40U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'm', 'm', 'i', 't', '_', 'p', 'l', 'a', 'n', 'e', 's', '_', 'o', 'n', '_', 'c', 'r', 't', 'c', '\x0' };
1463 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_planes_on_crtc;
1463 const struct kernel_symbol __ksymtab_drm_atomic_helper_commit_planes_on_crtc = { (unsigned long)(&drm_atomic_helper_commit_planes_on_crtc), (const char *)(&__kstrtab_drm_atomic_helper_commit_planes_on_crtc) };
1506 const char __kstrtab_drm_atomic_helper_disable_planes_on_crtc[41U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'p', 'l', 'a', 'n', 'e', 's', '_', 'o', 'n', '_', 'c', 'r', 't', 'c', '\x0' };
1506 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_planes_on_crtc;
1506 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_planes_on_crtc = { (unsigned long)(&drm_atomic_helper_disable_planes_on_crtc), (const char *)(&__kstrtab_drm_atomic_helper_disable_planes_on_crtc) };
1536 const char __kstrtab_drm_atomic_helper_cleanup_planes[33U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'l', 'e', 'a', 'n', 'u', 'p', '_', 'p', 'l', 'a', 'n', 'e', 's', '\x0' };
1536 const struct kernel_symbol __ksymtab_drm_atomic_helper_cleanup_planes;
1536 const struct kernel_symbol __ksymtab_drm_atomic_helper_cleanup_planes = { (unsigned long)(&drm_atomic_helper_cleanup_planes), (const char *)(&__kstrtab_drm_atomic_helper_cleanup_planes) };
1601 const char __kstrtab_drm_atomic_helper_swap_state[29U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'w', 'a', 'p', '_', 's', 't', 'a', 't', 'e', '\x0' };
1601 const struct kernel_symbol __ksymtab_drm_atomic_helper_swap_state;
1601 const struct kernel_symbol __ksymtab_drm_atomic_helper_swap_state = { (unsigned long)(&drm_atomic_helper_swap_state), (const char *)(&__kstrtab_drm_atomic_helper_swap_state) };
1688 const char __kstrtab_drm_atomic_helper_update_plane[31U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'p', 'l', 'a', 'n', 'e', '\x0' };
1688 const struct kernel_symbol __ksymtab_drm_atomic_helper_update_plane;
1688 const struct kernel_symbol __ksymtab_drm_atomic_helper_update_plane = { (unsigned long)(&drm_atomic_helper_update_plane), (const char *)(&__kstrtab_drm_atomic_helper_update_plane) };
1761 const char __kstrtab_drm_atomic_helper_disable_plane[32U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'p', 'l', 'a', 'n', 'e', '\x0' };
1761 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_plane;
1761 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_plane = { (unsigned long)(&drm_atomic_helper_disable_plane), (const char *)(&__kstrtab_drm_atomic_helper_disable_plane) };
1786 int update_output_state(struct drm_atomic_state *state, struct drm_mode_set *set);
1901 const char __kstrtab_drm_atomic_helper_set_config[29U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\x0' };
1901 const struct kernel_symbol __ksymtab_drm_atomic_helper_set_config;
1901 const struct kernel_symbol __ksymtab_drm_atomic_helper_set_config = { (unsigned long)(&drm_atomic_helper_set_config), (const char *)(&__kstrtab_drm_atomic_helper_set_config) };
2036 const char __kstrtab_drm_atomic_helper_disable_all[30U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'a', 'l', 'l', '\x0' };
2036 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_all;
2036 const struct kernel_symbol __ksymtab_drm_atomic_helper_disable_all = { (unsigned long)(&drm_atomic_helper_disable_all), (const char *)(&__kstrtab_drm_atomic_helper_disable_all) };
2099 const char __kstrtab_drm_atomic_helper_suspend[26U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\x0' };
2099 const struct kernel_symbol __ksymtab_drm_atomic_helper_suspend;
2099 const struct kernel_symbol __ksymtab_drm_atomic_helper_suspend = { (unsigned long)(&drm_atomic_helper_suspend), (const char *)(&__kstrtab_drm_atomic_helper_suspend) };
2131 const char __kstrtab_drm_atomic_helper_resume[25U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'r', 'e', 's', 'u', 'm', 'e', '\x0' };
2131 const struct kernel_symbol __ksymtab_drm_atomic_helper_resume;
2131 const struct kernel_symbol __ksymtab_drm_atomic_helper_resume = { (unsigned long)(&drm_atomic_helper_resume), (const char *)(&__kstrtab_drm_atomic_helper_resume) };
2191 const char __kstrtab_drm_atomic_helper_crtc_set_property[36U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 's', 'e', 't', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '\x0' };
2191 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_set_property;
2191 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_set_property = { (unsigned long)(&drm_atomic_helper_crtc_set_property), (const char *)(&__kstrtab_drm_atomic_helper_crtc_set_property) };
2251 const char __kstrtab_drm_atomic_helper_plane_set_property[37U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 's', 'e', 't', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '\x0' };
2251 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_set_property;
2251 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_set_property = { (unsigned long)(&drm_atomic_helper_plane_set_property), (const char *)(&__kstrtab_drm_atomic_helper_plane_set_property) };
2311 const char __kstrtab_drm_atomic_helper_connector_set_property[41U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 's', 'e', 't', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'y', '\x0' };
2311 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_set_property;
2311 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_set_property = { (unsigned long)(&drm_atomic_helper_connector_set_property), (const char *)(&__kstrtab_drm_atomic_helper_connector_set_property) };
2402 const char __kstrtab_drm_atomic_helper_page_flip[28U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'a', 'g', 'e', '_', 'f', 'l', 'i', 'p', '\x0' };
2402 const struct kernel_symbol __ksymtab_drm_atomic_helper_page_flip;
2402 const struct kernel_symbol __ksymtab_drm_atomic_helper_page_flip = { (unsigned long)(&drm_atomic_helper_page_flip), (const char *)(&__kstrtab_drm_atomic_helper_page_flip) };
2483 const char __kstrtab_drm_atomic_helper_connector_dpms[33U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'p', 'm', 's', '\x0' };
2483 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_dpms;
2483 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_dpms = { (unsigned long)(&drm_atomic_helper_connector_dpms), (const char *)(&__kstrtab_drm_atomic_helper_connector_dpms) };
2500 const char __kstrtab_drm_atomic_helper_best_encoder[31U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'b', 'e', 's', 't', '_', 'e', 'n', 'c', 'o', 'd', 'e', 'r', '\x0' };
2500 const struct kernel_symbol __ksymtab_drm_atomic_helper_best_encoder;
2500 const struct kernel_symbol __ksymtab_drm_atomic_helper_best_encoder = { (unsigned long)(&drm_atomic_helper_best_encoder), (const char *)(&__kstrtab_drm_atomic_helper_best_encoder) };
2541 const char __kstrtab_drm_atomic_helper_crtc_reset[29U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'r', 'e', 's', 'e', 't', '\x0' };
2541 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_reset;
2541 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_reset = { (unsigned long)(&drm_atomic_helper_crtc_reset), (const char *)(&__kstrtab_drm_atomic_helper_crtc_reset) };
2571 const char __kstrtab___drm_atomic_helper_crtc_duplicate_state[41U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2571 const struct kernel_symbol __ksymtab___drm_atomic_helper_crtc_duplicate_state;
2571 const struct kernel_symbol __ksymtab___drm_atomic_helper_crtc_duplicate_state = { (unsigned long)(&__drm_atomic_helper_crtc_duplicate_state), (const char *)(&__kstrtab___drm_atomic_helper_crtc_duplicate_state) };
2594 const char __kstrtab_drm_atomic_helper_crtc_duplicate_state[39U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2594 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_duplicate_state;
2594 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_duplicate_state = { (unsigned long)(&drm_atomic_helper_crtc_duplicate_state), (const char *)(&__kstrtab_drm_atomic_helper_crtc_duplicate_state) };
2611 const char __kstrtab___drm_atomic_helper_crtc_destroy_state[39U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2611 const struct kernel_symbol __ksymtab___drm_atomic_helper_crtc_destroy_state;
2611 const struct kernel_symbol __ksymtab___drm_atomic_helper_crtc_destroy_state = { (unsigned long)(&__drm_atomic_helper_crtc_destroy_state), (const char *)(&__kstrtab___drm_atomic_helper_crtc_destroy_state) };
2627 const char __kstrtab_drm_atomic_helper_crtc_destroy_state[37U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'r', 't', 'c', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2627 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_destroy_state;
2627 const struct kernel_symbol __ksymtab_drm_atomic_helper_crtc_destroy_state = { (unsigned long)(&drm_atomic_helper_crtc_destroy_state), (const char *)(&__kstrtab_drm_atomic_helper_crtc_destroy_state) };
2649 const char __kstrtab_drm_atomic_helper_plane_reset[30U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 'r', 'e', 's', 'e', 't', '\x0' };
2649 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_reset;
2649 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_reset = { (unsigned long)(&drm_atomic_helper_plane_reset), (const char *)(&__kstrtab_drm_atomic_helper_plane_reset) };
2667 const char __kstrtab___drm_atomic_helper_plane_duplicate_state[42U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2667 const struct kernel_symbol __ksymtab___drm_atomic_helper_plane_duplicate_state;
2667 const struct kernel_symbol __ksymtab___drm_atomic_helper_plane_duplicate_state = { (unsigned long)(&__drm_atomic_helper_plane_duplicate_state), (const char *)(&__kstrtab___drm_atomic_helper_plane_duplicate_state) };
2690 const char __kstrtab_drm_atomic_helper_plane_duplicate_state[40U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2690 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_duplicate_state;
2690 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_duplicate_state = { (unsigned long)(&drm_atomic_helper_plane_duplicate_state), (const char *)(&__kstrtab_drm_atomic_helper_plane_duplicate_state) };
2705 const char __kstrtab___drm_atomic_helper_plane_destroy_state[40U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2705 const struct kernel_symbol __ksymtab___drm_atomic_helper_plane_destroy_state;
2705 const struct kernel_symbol __ksymtab___drm_atomic_helper_plane_destroy_state = { (unsigned long)(&__drm_atomic_helper_plane_destroy_state), (const char *)(&__kstrtab___drm_atomic_helper_plane_destroy_state) };
2721 const char __kstrtab_drm_atomic_helper_plane_destroy_state[38U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'l', 'a', 'n', 'e', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2721 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_destroy_state;
2721 const struct kernel_symbol __ksymtab_drm_atomic_helper_plane_destroy_state = { (unsigned long)(&drm_atomic_helper_plane_destroy_state), (const char *)(&__kstrtab_drm_atomic_helper_plane_destroy_state) };
2743 const char __kstrtab___drm_atomic_helper_connector_reset[36U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'r', 'e', 's', 'e', 't', '\x0' };
2743 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_reset;
2743 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_reset = { (unsigned long)(&__drm_atomic_helper_connector_reset), (const char *)(&__kstrtab___drm_atomic_helper_connector_reset) };
2764 const char __kstrtab_drm_atomic_helper_connector_reset[34U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'r', 'e', 's', 'e', 't', '\x0' };
2764 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_reset;
2764 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_reset = { (unsigned long)(&drm_atomic_helper_connector_reset), (const char *)(&__kstrtab_drm_atomic_helper_connector_reset) };
2782 const char __kstrtab___drm_atomic_helper_connector_duplicate_state[46U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2782 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_duplicate_state;
2782 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_duplicate_state = { (unsigned long)(&__drm_atomic_helper_connector_duplicate_state), (const char *)(&__kstrtab___drm_atomic_helper_connector_duplicate_state) };
2805 const char __kstrtab_drm_atomic_helper_connector_duplicate_state[44U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2805 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_duplicate_state;
2805 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_duplicate_state = { (unsigned long)(&drm_atomic_helper_connector_duplicate_state), (const char *)(&__kstrtab_drm_atomic_helper_connector_duplicate_state) };
2888 const char __kstrtab_drm_atomic_helper_duplicate_state[34U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', '_', 's', 't', 'a', 't', 'e', '\x0' };
2888 const struct kernel_symbol __ksymtab_drm_atomic_helper_duplicate_state;
2888 const struct kernel_symbol __ksymtab_drm_atomic_helper_duplicate_state = { (unsigned long)(&drm_atomic_helper_duplicate_state), (const char *)(&__kstrtab_drm_atomic_helper_duplicate_state) };
2909 const char __kstrtab___drm_atomic_helper_connector_destroy_state[44U] = { '_', '_', 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2909 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_destroy_state;
2909 const struct kernel_symbol __ksymtab___drm_atomic_helper_connector_destroy_state = { (unsigned long)(&__drm_atomic_helper_connector_destroy_state), (const char *)(&__kstrtab___drm_atomic_helper_connector_destroy_state) };
2925 const char __kstrtab_drm_atomic_helper_connector_destroy_state[42U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '_', 's', 't', 'a', 't', 'e', '\x0' };
2925 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_destroy_state;
2925 const struct kernel_symbol __ksymtab_drm_atomic_helper_connector_destroy_state = { (unsigned long)(&drm_atomic_helper_connector_destroy_state), (const char *)(&__kstrtab_drm_atomic_helper_connector_destroy_state) };
3020 const char __kstrtab_drm_atomic_helper_legacy_gamma_set[35U] = { 'd', 'r', 'm', '_', 'a', 't', 'o', 'm', 'i', 'c', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'g', 'a', 'm', 'm', 'a', '_', 's', 'e', 't', '\x0' };
3020 const struct kernel_symbol __ksymtab_drm_atomic_helper_legacy_gamma_set;
3020 const struct kernel_symbol __ksymtab_drm_atomic_helper_legacy_gamma_set = { (unsigned long)(&drm_atomic_helper_legacy_gamma_set), (const char *)(&__kstrtab_drm_atomic_helper_legacy_gamma_set) };
229 int drm_fb_helper_modinit();
35 int drm_dp_aux_dev_init();
36 void drm_dp_aux_dev_exit();
37 int drm_kms_helper_init();
54 void drm_kms_helper_exit();
100 void ldv_main6_sequence_infinite_withcheck_stateful();
69 int i2c_transfer(struct i2c_adapter *, struct i2c_msg *, int);
60 ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter, u8 offset, void *buffer, size_t size);
62 ssize_t drm_dp_dual_mode_write(struct i2c_adapter *adapter, u8 offset, const void *buffer, size_t size);
83 enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter);
84 int drm_dp_dual_mode_max_tmds_clock(enum drm_dp_dual_mode_type type, struct i2c_adapter *adapter);
86 int drm_dp_dual_mode_get_tmds_output(enum drm_dp_dual_mode_type type, struct i2c_adapter *adapter, bool *enabled);
88 int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type, struct i2c_adapter *adapter, bool enable);
90 const char * drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type);
88 const char __kstrtab_drm_dp_dual_mode_read[22U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 'r', 'e', 'a', 'd', '\x0' };
88 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_read;
88 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_read = { (unsigned long)(&drm_dp_dual_mode_read), (const char *)(&__kstrtab_drm_dp_dual_mode_read) };
135 const char __kstrtab_drm_dp_dual_mode_write[23U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 'w', 'r', 'i', 't', 'e', '\x0' };
135 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_write;
135 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_write = { (unsigned long)(&drm_dp_dual_mode_write), (const char *)(&__kstrtab_drm_dp_dual_mode_write) };
137 bool is_hdmi_adaptor(const char *hdmi_id);
146 bool is_type2_adaptor(uint8_t adaptor_id);
220 const char __kstrtab_drm_dp_dual_mode_detect[24U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 'd', 'e', 't', 'e', 'c', 't', '\x0' };
220 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_detect;
220 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_detect = { (unsigned long)(&drm_dp_dual_mode_detect), (const char *)(&__kstrtab_drm_dp_dual_mode_detect) };
263 const char __kstrtab_drm_dp_dual_mode_max_tmds_clock[32U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 'm', 'a', 'x', '_', 't', 'm', 'd', 's', '_', 'c', 'l', 'o', 'c', 'k', '\x0' };
263 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_max_tmds_clock;
263 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_max_tmds_clock = { (unsigned long)(&drm_dp_dual_mode_max_tmds_clock), (const char *)(&__kstrtab_drm_dp_dual_mode_max_tmds_clock) };
304 const char __kstrtab_drm_dp_dual_mode_get_tmds_output[33U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 'g', 'e', 't', '_', 't', 'm', 'd', 's', '_', 'o', 'u', 't', 'p', 'u', 't', '\x0' };
304 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_get_tmds_output;
304 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_get_tmds_output = { (unsigned long)(&drm_dp_dual_mode_get_tmds_output), (const char *)(&__kstrtab_drm_dp_dual_mode_get_tmds_output) };
340 const char __kstrtab_drm_dp_dual_mode_set_tmds_output[33U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 's', 'e', 't', '_', 't', 'm', 'd', 's', '_', 'o', 'u', 't', 'p', 'u', 't', '\x0' };
340 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_set_tmds_output;
340 const struct kernel_symbol __ksymtab_drm_dp_dual_mode_set_tmds_output = { (unsigned long)(&drm_dp_dual_mode_set_tmds_output), (const char *)(&__kstrtab_drm_dp_dual_mode_set_tmds_output) };
367 const char __kstrtab_drm_dp_get_dual_mode_type_name[31U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'g', 'e', 't', '_', 'd', 'u', 'a', 'l', '_', 'm', 'o', 'd', 'e', '_', 't', 'y', 'p', 'e', '_', 'n', 'a', 'm', 'e', '\x0' };
367 const struct kernel_symbol __ksymtab_drm_dp_get_dual_mode_type_name;
367 const struct kernel_symbol __ksymtab_drm_dp_get_dual_mode_type_name = { (unsigned long)(&drm_dp_get_dual_mode_type_name), (const char *)(&__kstrtab_drm_dp_get_dual_mode_type_name) };
406 void ldv_main7_sequence_infinite_withcheck_stateful();
154 int printk(const char *, ...);
4 bool ldv_is_err_or_null(const void *ptr);
63 size_t strlen(const char *);
45 int strncmp(const char *, const char *, __kernel_size_t );
54 char * strchr(const char *, int);
90 char * strsep(char **, const char *);
122 char * kstrdup(const char *, gfp_t );
125 void * kmemdup(const void *, size_t , gfp_t );
137 int match_string(const const char **, size_t , const char *);
50 bool IS_ERR_OR_NULL(const void *ptr);
54 void * ERR_CAST(const void *ptr);
42 int request_firmware(const struct firmware **, const char *, struct device *);
51 void release_firmware(const struct firmware *);
153 void * krealloc(const void *, size_t , gfp_t );
46 void platform_device_unregister(struct platform_device *);
78 struct platform_device * platform_device_register_full(const struct platform_device_info *);
95 struct platform_device * platform_device_register_resndata(struct device *parent, const char *name, int id, const struct resource *res, unsigned int num, const void *data, size_t size);
136 struct platform_device * platform_device_register_simple(const char *name, int id, const struct resource *res, unsigned int num);
2511 bool drm_edid_block_valid(u8 *, int, bool , bool *);
29 char edid_firmware[4096U] = { };
35 const const char *generic_edid_name[6U] = { "edid/800x600.bin", "edid/1024x768.bin", "edid/1280x1024.bin", "edid/1600x1200.bin", "edid/1680x1050.bin", "edid/1920x1080.bin" };
44 const u8 generic_edid[6U][128U] = { { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 27U, 20U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 1U, 0U, 0U, 69U, 64U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 160U, 15U, 32U, 0U, 49U, 88U, 28U, 32U, 40U, 128U, 20U, 0U, 21U, 208U, 16U, 0U, 0U, 30U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 36U, 38U, 5U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 83U, 86U, 71U, 65U, 10U, 32U, 32U, 0U, 194U }, { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 35U, 26U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 0U, 8U, 0U, 97U, 64U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 100U, 25U, 0U, 64U, 65U, 0U, 38U, 48U, 8U, 144U, 54U, 0U, 99U, 10U, 17U, 0U, 0U, 24U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 47U, 49U, 7U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 88U, 71U, 65U, 10U, 32U, 32U, 32U, 0U, 85U }, { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 44U, 35U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 0U, 0U, 0U, 129U, 128U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 48U, 42U, 0U, 152U, 81U, 0U, 42U, 64U, 48U, 112U, 19U, 0U, 188U, 99U, 17U, 0U, 0U, 30U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 62U, 64U, 11U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 83U, 88U, 71U, 65U, 10U, 32U, 32U, 0U, 160U }, { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 55U, 41U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 0U, 0U, 0U, 169U, 64U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 72U, 63U, 64U, 48U, 98U, 176U, 50U, 64U, 64U, 192U, 19U, 0U, 43U, 160U, 33U, 0U, 0U, 30U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 74U, 76U, 17U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 85U, 88U, 71U, 65U, 10U, 32U, 32U, 0U, 157U }, { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 43U, 27U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 0U, 0U, 0U, 179U, 0U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 33U, 57U, 144U, 48U, 98U, 26U, 39U, 64U, 104U, 176U, 54U, 0U, 181U, 17U, 17U, 0U, 0U, 30U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 64U, 66U, 15U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 87U, 83U, 88U, 71U, 65U, 10U, 32U, 0U, 38U }, { 0U, 255U, 255U, 255U, 255U, 255U, 255U, 0U, 49U, 216U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 22U, 1U, 3U, 109U, 50U, 28U, 120U, 234U, 94U, 192U, 164U, 89U, 74U, 152U, 37U, 32U, 80U, 84U, 0U, 0U, 0U, 209U, 192U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 2U, 58U, 128U, 24U, 113U, 56U, 45U, 64U, 88U, 44U, 69U, 0U, 244U, 25U, 17U, 0U, 0U, 30U, 0U, 0U, 0U, 255U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 35U, 48U, 10U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 253U, 0U, 59U, 61U, 66U, 68U, 15U, 0U, 10U, 32U, 32U, 32U, 32U, 32U, 32U, 0U, 0U, 0U, 252U, 0U, 76U, 105U, 110U, 117U, 120U, 32U, 70U, 72U, 68U, 10U, 32U, 32U, 32U, 0U, 5U } };
155 int edid_size(const u8 *edid, int data_size);
163 void * edid_load(struct drm_connector *connector, const char *name, const char *connector_name);
47 int register_sysrq_key(int, struct sysrq_key_op *);
48 int unregister_sysrq_key(int, struct sysrq_key_op *);
25 void INIT_LIST_HEAD___3(struct list_head *list);
187 int list_empty___2(const struct list_head *head);
87 void __bad_percpu_size();
295 void __bad_size_call_parameter();
24 int atomic_read___4(const atomic_t *v);
93 void __raw_spin_lock_init(raw_spinlock_t *, const char *, struct lock_class_key *);
34 unsigned long int _raw_spin_lock_irqsave(raw_spinlock_t *);
45 void _raw_spin_unlock_irqrestore(raw_spinlock_t *, unsigned long);
289 raw_spinlock_t * spinlock_check(spinlock_t *lock);
360 void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags);
128 int mutex_is_locked___4(struct mutex *lock);
28 extern int cpu_number;
318 extern struct __anonstruct_atomic_t_6 kgdb_active;
1141 void _dev_info(const struct device *, const char *, ...);
527 struct apertures_struct * alloc_apertures(unsigned int max_num);
617 void cfb_fillrect(struct fb_info *, const struct fb_fillrect *);
618 void cfb_copyarea(struct fb_info *, const struct fb_copyarea *);
619 void cfb_imageblit(struct fb_info *, const struct fb_image *);
623 void sys_fillrect(struct fb_info *, const struct fb_fillrect *);
624 void sys_copyarea(struct fb_info *, const struct fb_copyarea *);
625 void sys_imageblit(struct fb_info *, const struct fb_image *);
626 ssize_t fb_sys_read(struct fb_info *, char *, size_t , loff_t *);
628 ssize_t fb_sys_write(struct fb_info *, const char *, size_t , loff_t *);
632 int register_framebuffer(struct fb_info *);
633 int unregister_framebuffer(struct fb_info *);
634 int unlink_framebuffer(struct fb_info *);
643 void fb_set_suspend(struct fb_info *, int);
705 struct fb_info * framebuffer_alloc(size_t , struct device *);
706 void framebuffer_release(struct fb_info *);
774 int fb_alloc_cmap(struct fb_cmap *, int, int);
776 void fb_dealloc_cmap(struct fb_cmap *);
373 bool ww_mutex_is_locked___3(struct ww_mutex *lock);
117 bool drm_modeset_is_locked___3(struct drm_modeset_lock *lock);
2320 void drm_plane_force_disable(struct drm_plane *);
2459 int drm_mode_set_config_internal(struct drm_mode_set *);
2523 struct drm_display_mode * drm_mode_find_dmt(struct drm_device *, int, int, int, bool );
2537 int drm_mode_plane_set_obj_prop(struct drm_plane *, struct drm_property *, uint64_t );
2693 void assert_drm_connector_list_read_locked___3(struct drm_mode_config *mode_config);
880 int drm_core_check_feature(struct drm_device *dev, int feature);
230 void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, const struct drm_fb_helper_funcs *funcs);
232 int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *fb_helper, int crtc_count, int max_conn_count);
235 void drm_fb_helper_fini(struct drm_fb_helper *fb_helper);
236 int drm_fb_helper_blank(int blank, struct fb_info *info);
237 int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
239 int drm_fb_helper_set_par(struct fb_info *info);
240 int drm_fb_helper_check_var(struct fb_var_screeninfo *var, struct fb_info *info);
243 int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
245 struct fb_info * drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper);
246 void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper);
247 void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper);
248 void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, uint32_t fb_width, uint32_t fb_height);
250 void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, uint32_t depth);
253 void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
255 void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagelist);
258 ssize_t drm_fb_helper_sys_read(struct fb_info *info, char *buf, size_t count, loff_t *ppos);
260 ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char *buf, size_t count, loff_t *ppos);
263 void drm_fb_helper_sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
265 void drm_fb_helper_sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
267 void drm_fb_helper_sys_imageblit(struct fb_info *info, const struct fb_image *image);
270 void drm_fb_helper_cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
272 void drm_fb_helper_cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
274 void drm_fb_helper_cfb_imageblit(struct fb_info *info, const struct fb_image *image);
277 void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state);
279 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
281 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
282 int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
283 int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
284 int drm_fb_helper_debug_enter(struct fb_info *info);
285 int drm_fb_helper_debug_leave(struct fb_info *info);
287 struct drm_display_mode * drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector, int width, int height);
290 struct drm_display_mode * drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn, int width, int height);
293 int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
294 int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
136 void drm_atomic_clean_old_fb(struct drm_device *, unsigned int, int);
45 _Bool drm_fbdev_emulation = 1;
50 struct list_head kernel_fb_helper_list = { &kernel_fb_helper_list, &kernel_fb_helper_list };
141 const char __kstrtab_drm_fb_helper_single_add_all_connectors[40U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'i', 'n', 'g', 'l', 'e', '_', 'a', 'd', 'd', '_', 'a', 'l', 'l', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', 's', '\x0' };
141 const struct kernel_symbol __ksymtab_drm_fb_helper_single_add_all_connectors;
141 const struct kernel_symbol __ksymtab_drm_fb_helper_single_add_all_connectors = { (unsigned long)(&drm_fb_helper_single_add_all_connectors), (const char *)(&__kstrtab_drm_fb_helper_single_add_all_connectors) };
171 const char __kstrtab_drm_fb_helper_add_one_connector[32U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'a', 'd', 'd', '_', 'o', 'n', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '\x0' };
171 const struct kernel_symbol __ksymtab_drm_fb_helper_add_one_connector;
171 const struct kernel_symbol __ksymtab_drm_fb_helper_add_one_connector = { (unsigned long)(&drm_fb_helper_add_one_connector), (const char *)(&__kstrtab_drm_fb_helper_add_one_connector) };
202 const char __kstrtab_drm_fb_helper_remove_one_connector[35U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'o', 'n', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', '\x0' };
202 const struct kernel_symbol __ksymtab_drm_fb_helper_remove_one_connector;
202 const struct kernel_symbol __ksymtab_drm_fb_helper_remove_one_connector = { (unsigned long)(&drm_fb_helper_remove_one_connector), (const char *)(&__kstrtab_drm_fb_helper_remove_one_connector) };
204 void drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper);
220 void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc);
264 const char __kstrtab_drm_fb_helper_debug_enter[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'e', 'b', 'u', 'g', '_', 'e', 'n', 't', 'e', 'r', '\x0' };
264 const struct kernel_symbol __ksymtab_drm_fb_helper_debug_enter;
264 const struct kernel_symbol __ksymtab_drm_fb_helper_debug_enter = { (unsigned long)(&drm_fb_helper_debug_enter), (const char *)(&__kstrtab_drm_fb_helper_debug_enter) };
267 struct drm_framebuffer * drm_mode_config_fb(struct drm_crtc *crtc);
313 const char __kstrtab_drm_fb_helper_debug_leave[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'e', 'b', 'u', 'g', '_', 'l', 'e', 'a', 'v', 'e', '\x0' };
313 const struct kernel_symbol __ksymtab_drm_fb_helper_debug_leave;
313 const struct kernel_symbol __ksymtab_drm_fb_helper_debug_leave = { (unsigned long)(&drm_fb_helper_debug_leave), (const char *)(&__kstrtab_drm_fb_helper_debug_leave) };
315 int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper);
381 int restore_fbdev_mode(struct drm_fb_helper *fb_helper);
458 const char __kstrtab_drm_fb_helper_restore_fbdev_mode_unlocked[42U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'r', 'e', 's', 't', 'o', 'r', 'e', '_', 'f', 'b', 'd', 'e', 'v', '_', 'm', 'o', 'd', 'e', '_', 'u', 'n', 'l', 'o', 'c', 'k', 'e', 'd', '\x0' };
458 const struct kernel_symbol __ksymtab_drm_fb_helper_restore_fbdev_mode_unlocked;
458 const struct kernel_symbol __ksymtab_drm_fb_helper_restore_fbdev_mode_unlocked = { (unsigned long)(&drm_fb_helper_restore_fbdev_mode_unlocked), (const char *)(&__kstrtab_drm_fb_helper_restore_fbdev_mode_unlocked) };
460 bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper);
489 bool drm_fb_helper_force_kernel_mode();
512 void drm_fb_helper_restore_work_fn(struct work_struct *ignored);
519 struct work_struct drm_fb_helper_restore_work = { { 137438953424L }, { &(drm_fb_helper_restore_work.entry), &(drm_fb_helper_restore_work.entry) }, &drm_fb_helper_restore_work_fn, { (struct lock_class_key *)(&drm_fb_helper_restore_work), { 0, 0 }, "drm_fb_helper_restore_work", 0, 0UL } };
521 void drm_fb_helper_sysrq(int dummy1);
526 struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { &drm_fb_helper_sysrq, (char *)"force-fb(V)", (char *)"Restore framebuffer console", 0 };
535 void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode);
603 const char __kstrtab_drm_fb_helper_blank[20U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'b', 'l', 'a', 'n', 'k', '\x0' };
603 const struct kernel_symbol __ksymtab_drm_fb_helper_blank;
603 const struct kernel_symbol __ksymtab_drm_fb_helper_blank = { (unsigned long)(&drm_fb_helper_blank), (const char *)(&__kstrtab_drm_fb_helper_blank) };
605 void drm_fb_helper_crtc_free(struct drm_fb_helper *helper);
622 void drm_fb_helper_dirty_work(struct work_struct *work);
658 const char __kstrtab_drm_fb_helper_prepare[22U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'r', 'e', 'p', 'a', 'r', 'e', '\x0' };
658 const struct kernel_symbol __ksymtab_drm_fb_helper_prepare;
658 const struct kernel_symbol __ksymtab_drm_fb_helper_prepare = { (unsigned long)(&drm_fb_helper_prepare), (const char *)(&__kstrtab_drm_fb_helper_prepare) };
727 const char __kstrtab_drm_fb_helper_init[19U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'i', 'n', 'i', 't', '\x0' };
727 const struct kernel_symbol __ksymtab_drm_fb_helper_init;
727 const struct kernel_symbol __ksymtab_drm_fb_helper_init = { (unsigned long)(&drm_fb_helper_init), (const char *)(&__kstrtab_drm_fb_helper_init) };
770 const char __kstrtab_drm_fb_helper_alloc_fbi[24U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'a', 'l', 'l', 'o', 'c', '_', 'f', 'b', 'i', '\x0' };
770 const struct kernel_symbol __ksymtab_drm_fb_helper_alloc_fbi;
770 const struct kernel_symbol __ksymtab_drm_fb_helper_alloc_fbi = { (unsigned long)(&drm_fb_helper_alloc_fbi), (const char *)(&__kstrtab_drm_fb_helper_alloc_fbi) };
784 const char __kstrtab_drm_fb_helper_unregister_fbi[29U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'n', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 'f', 'b', 'i', '\x0' };
784 const struct kernel_symbol __ksymtab_drm_fb_helper_unregister_fbi;
784 const struct kernel_symbol __ksymtab_drm_fb_helper_unregister_fbi = { (unsigned long)(&drm_fb_helper_unregister_fbi), (const char *)(&__kstrtab_drm_fb_helper_unregister_fbi) };
807 const char __kstrtab_drm_fb_helper_release_fbi[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'r', 'e', 'l', 'e', 'a', 's', 'e', '_', 'f', 'b', 'i', '\x0' };
807 const struct kernel_symbol __ksymtab_drm_fb_helper_release_fbi;
807 const struct kernel_symbol __ksymtab_drm_fb_helper_release_fbi = { (unsigned long)(&drm_fb_helper_release_fbi), (const char *)(&__kstrtab_drm_fb_helper_release_fbi) };
824 const char __kstrtab_drm_fb_helper_fini[19U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'f', 'i', 'n', 'i', '\x0' };
824 const struct kernel_symbol __ksymtab_drm_fb_helper_fini;
824 const struct kernel_symbol __ksymtab_drm_fb_helper_fini = { (unsigned long)(&drm_fb_helper_fini), (const char *)(&__kstrtab_drm_fb_helper_fini) };
837 const char __kstrtab_drm_fb_helper_unlink_fbi[25U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'u', 'n', 'l', 'i', 'n', 'k', '_', 'f', 'b', 'i', '\x0' };
837 const struct kernel_symbol __ksymtab_drm_fb_helper_unlink_fbi;
837 const struct kernel_symbol __ksymtab_drm_fb_helper_unlink_fbi = { (unsigned long)(&drm_fb_helper_unlink_fbi), (const char *)(&__kstrtab_drm_fb_helper_unlink_fbi) };
839 void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
890 const char __kstrtab_drm_fb_helper_deferred_io[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'd', 'e', 'f', 'e', 'r', 'r', 'e', 'd', '_', 'i', 'o', '\x0' };
890 const struct kernel_symbol __ksymtab_drm_fb_helper_deferred_io;
890 const struct kernel_symbol __ksymtab_drm_fb_helper_deferred_io = { (unsigned long)(&drm_fb_helper_deferred_io), (const char *)(&__kstrtab_drm_fb_helper_deferred_io) };
906 const char __kstrtab_drm_fb_helper_sys_read[23U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'y', 's', '_', 'r', 'e', 'a', 'd', '\x0' };
906 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_read;
906 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_read = { (unsigned long)(&drm_fb_helper_sys_read), (const char *)(&__kstrtab_drm_fb_helper_sys_read) };
929 const char __kstrtab_drm_fb_helper_sys_write[24U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'y', 's', '_', 'w', 'r', 'i', 't', 'e', '\x0' };
929 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_write;
929 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_write = { (unsigned long)(&drm_fb_helper_sys_write), (const char *)(&__kstrtab_drm_fb_helper_sys_write) };
945 const char __kstrtab_drm_fb_helper_sys_fillrect[27U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'y', 's', '_', 'f', 'i', 'l', 'l', 'r', 'e', 'c', 't', '\x0' };
945 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_fillrect;
945 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_fillrect = { (unsigned long)(&drm_fb_helper_sys_fillrect), (const char *)(&__kstrtab_drm_fb_helper_sys_fillrect) };
961 const char __kstrtab_drm_fb_helper_sys_copyarea[27U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'y', 's', '_', 'c', 'o', 'p', 'y', 'a', 'r', 'e', 'a', '\x0' };
961 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_copyarea;
961 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_copyarea = { (unsigned long)(&drm_fb_helper_sys_copyarea), (const char *)(&__kstrtab_drm_fb_helper_sys_copyarea) };
977 const char __kstrtab_drm_fb_helper_sys_imageblit[28U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'y', 's', '_', 'i', 'm', 'a', 'g', 'e', 'b', 'l', 'i', 't', '\x0' };
977 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_imageblit;
977 const struct kernel_symbol __ksymtab_drm_fb_helper_sys_imageblit = { (unsigned long)(&drm_fb_helper_sys_imageblit), (const char *)(&__kstrtab_drm_fb_helper_sys_imageblit) };
993 const char __kstrtab_drm_fb_helper_cfb_fillrect[27U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'f', 'b', '_', 'f', 'i', 'l', 'l', 'r', 'e', 'c', 't', '\x0' };
993 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_fillrect;
993 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_fillrect = { (unsigned long)(&drm_fb_helper_cfb_fillrect), (const char *)(&__kstrtab_drm_fb_helper_cfb_fillrect) };
1009 const char __kstrtab_drm_fb_helper_cfb_copyarea[27U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'f', 'b', '_', 'c', 'o', 'p', 'y', 'a', 'r', 'e', 'a', '\x0' };
1009 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_copyarea;
1009 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_copyarea = { (unsigned long)(&drm_fb_helper_cfb_copyarea), (const char *)(&__kstrtab_drm_fb_helper_cfb_copyarea) };
1025 const char __kstrtab_drm_fb_helper_cfb_imageblit[28U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'f', 'b', '_', 'i', 'm', 'a', 'g', 'e', 'b', 'l', 'i', 't', '\x0' };
1025 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_imageblit;
1025 const struct kernel_symbol __ksymtab_drm_fb_helper_cfb_imageblit = { (unsigned long)(&drm_fb_helper_cfb_imageblit), (const char *)(&__kstrtab_drm_fb_helper_cfb_imageblit) };
1039 const char __kstrtab_drm_fb_helper_set_suspend[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\x0' };
1039 const struct kernel_symbol __ksymtab_drm_fb_helper_set_suspend;
1039 const struct kernel_symbol __ksymtab_drm_fb_helper_set_suspend = { (unsigned long)(&drm_fb_helper_set_suspend), (const char *)(&__kstrtab_drm_fb_helper_set_suspend) };
1041 int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, u16 regno, struct fb_info *info);
1168 const char __kstrtab_drm_fb_helper_setcmap[22U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', 'c', 'm', 'a', 'p', '\x0' };
1168 const struct kernel_symbol __ksymtab_drm_fb_helper_setcmap;
1168 const struct kernel_symbol __ksymtab_drm_fb_helper_setcmap = { (unsigned long)(&drm_fb_helper_setcmap), (const char *)(&__kstrtab_drm_fb_helper_setcmap) };
1265 const char __kstrtab_drm_fb_helper_check_var[24U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'c', 'h', 'e', 'c', 'k', '_', 'v', 'a', 'r', '\x0' };
1265 const struct kernel_symbol __ksymtab_drm_fb_helper_check_var;
1265 const struct kernel_symbol __ksymtab_drm_fb_helper_check_var = { (unsigned long)(&drm_fb_helper_check_var), (const char *)(&__kstrtab_drm_fb_helper_check_var) };
1292 const char __kstrtab_drm_fb_helper_set_par[22U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 's', 'e', 't', '_', 'p', 'a', 'r', '\x0' };
1292 const struct kernel_symbol __ksymtab_drm_fb_helper_set_par;
1292 const struct kernel_symbol __ksymtab_drm_fb_helper_set_par = { (unsigned long)(&drm_fb_helper_set_par), (const char *)(&__kstrtab_drm_fb_helper_set_par) };
1294 int pan_display_atomic(struct fb_var_screeninfo *var, struct fb_info *info);
1400 const char __kstrtab_drm_fb_helper_pan_display[26U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'p', 'a', 'n', '_', 'd', 'i', 's', 'p', 'l', 'a', 'y', '\x0' };
1400 const struct kernel_symbol __ksymtab_drm_fb_helper_pan_display;
1400 const struct kernel_symbol __ksymtab_drm_fb_helper_pan_display = { (unsigned long)(&drm_fb_helper_pan_display), (const char *)(&__kstrtab_drm_fb_helper_pan_display) };
1407 int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, int preferred_bpp);
1576 const char __kstrtab_drm_fb_helper_fill_fix[23U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'f', 'i', 'l', 'l', '_', 'f', 'i', 'x', '\x0' };
1576 const struct kernel_symbol __ksymtab_drm_fb_helper_fill_fix;
1576 const struct kernel_symbol __ksymtab_drm_fb_helper_fill_fix = { (unsigned long)(&drm_fb_helper_fill_fix), (const char *)(&__kstrtab_drm_fb_helper_fill_fix) };
1664 const char __kstrtab_drm_fb_helper_fill_var[23U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'f', 'i', 'l', 'l', '_', 'v', 'a', 'r', '\x0' };
1664 const struct kernel_symbol __ksymtab_drm_fb_helper_fill_var;
1664 const struct kernel_symbol __ksymtab_drm_fb_helper_fill_var = { (unsigned long)(&drm_fb_helper_fill_var), (const char *)(&__kstrtab_drm_fb_helper_fill_var) };
1666 int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper, uint32_t maxX, uint32_t maxY);
1695 const char __kstrtab_drm_has_preferred_mode[23U] = { 'd', 'r', 'm', '_', 'h', 'a', 's', '_', 'p', 'r', 'e', 'f', 'e', 'r', 'r', 'e', 'd', '_', 'm', 'o', 'd', 'e', '\x0' };
1695 const struct kernel_symbol __ksymtab_drm_has_preferred_mode;
1695 const struct kernel_symbol __ksymtab_drm_has_preferred_mode = { (unsigned long)(&drm_has_preferred_mode), (const char *)(&__kstrtab_drm_has_preferred_mode) };
1697 bool drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector);
1753 const char __kstrtab_drm_pick_cmdline_mode[22U] = { 'd', 'r', 'm', '_', 'p', 'i', 'c', 'k', '_', 'c', 'm', 'd', 'l', 'i', 'n', 'e', '_', 'm', 'o', 'd', 'e', '\x0' };
1753 const struct kernel_symbol __ksymtab_drm_pick_cmdline_mode;
1753 const struct kernel_symbol __ksymtab_drm_pick_cmdline_mode = { (unsigned long)(&drm_pick_cmdline_mode), (const char *)(&__kstrtab_drm_pick_cmdline_mode) };
1755 bool drm_connector_enabled(struct drm_connector *connector, bool strict);
1767 void drm_enable_connectors(struct drm_fb_helper *fb_helper, bool *enabled);
1791 bool drm_target_cloned(struct drm_fb_helper *fb_helper, struct drm_display_mode **modes, struct drm_fb_offset *offsets, bool *enabled, int width, int height);
1865 int drm_get_tile_offsets(struct drm_fb_helper *fb_helper, struct drm_display_mode **modes, struct drm_fb_offset *offsets, int idx, int h_idx, int v_idx);
1897 bool drm_target_preferred(struct drm_fb_helper *fb_helper, struct drm_display_mode **modes, struct drm_fb_offset *offsets, bool *enabled, int width, int height);
1966 int drm_pick_crtcs(struct drm_fb_helper *fb_helper, struct drm_fb_helper_crtc **best_crtcs, struct drm_display_mode **modes, int n, int width, int height);
2045 void drm_setup_crtcs(struct drm_fb_helper *fb_helper);
2210 const char __kstrtab_drm_fb_helper_initial_config[29U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\x0' };
2210 const struct kernel_symbol __ksymtab_drm_fb_helper_initial_config;
2210 const struct kernel_symbol __ksymtab_drm_fb_helper_initial_config = { (unsigned long)(&drm_fb_helper_initial_config), (const char *)(&__kstrtab_drm_fb_helper_initial_config) };
2262 const char __kstrtab_drm_fb_helper_hotplug_event[28U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'h', 'o', 't', 'p', 'l', 'u', 'g', '_', 'e', 'v', 'e', 'n', 't', '\x0' };
2262 const struct kernel_symbol __ksymtab_drm_fb_helper_hotplug_event;
2262 const struct kernel_symbol __ksymtab_drm_fb_helper_hotplug_event = { (unsigned long)(&drm_fb_helper_hotplug_event), (const char *)(&__kstrtab_drm_fb_helper_hotplug_event) };
2283 const char __kstrtab_drm_fb_helper_modinit[22U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'h', 'e', 'l', 'p', 'e', 'r', '_', 'm', 'o', 'd', 'i', 'n', 'i', 't', '\x0' };
2283 const struct kernel_symbol __ksymtab_drm_fb_helper_modinit;
2283 const struct kernel_symbol __ksymtab_drm_fb_helper_modinit = { (unsigned long)(&drm_fb_helper_modinit), (const char *)(&__kstrtab_drm_fb_helper_modinit) };
2322 void ldv_main9_sequence_infinite_withcheck_stateful();
24 int atomic_read___5(const atomic_t *v);
424 pgprot_t pgprot_writecombine(pgprot_t );
23 unsigned long int __phys_addr(unsigned long);
128 int mutex_is_locked___5(struct mutex *lock);
1135 void dev_err(const struct device *, const char *, ...);
676 int fb_deferred_io_mmap(struct fb_info *, struct vm_area_struct *);
677 void fb_deferred_io_init(struct fb_info *);
681 void fb_deferred_io_cleanup(struct fb_info *);
2385 int drm_framebuffer_init(struct drm_device *, struct drm_framebuffer *, const struct drm_framebuffer_funcs *);
2391 void drm_framebuffer_cleanup(struct drm_framebuffer *);
2392 void drm_framebuffer_unregister_private(struct drm_framebuffer *);
2474 uint32_t drm_mode_legacy_fb_format(uint32_t , uint32_t );
2545 int drm_format_num_planes(uint32_t );
2546 int drm_format_plane_cpp(uint32_t , int);
2547 int drm_format_horz_chroma_subsampling(uint32_t );
2548 int drm_format_vert_chroma_subsampling(uint32_t );
224 void drm_gem_object_unreference_unlocked(struct drm_gem_object *);
227 int drm_gem_handle_create(struct drm_file *, struct drm_gem_object *, u32 *);
241 struct drm_gem_object * drm_gem_object_lookup(struct drm_file *, u32 );
24 struct drm_gem_cma_object * to_drm_gem_cma_obj(struct drm_gem_object *gem_obj);
51 struct drm_gem_cma_object * drm_gem_cma_create(struct drm_device *, size_t );
57 void drm_gem_cma_describe(struct drm_gem_cma_object *, struct seq_file *);
16 struct drm_fbdev_cma * drm_fbdev_cma_init_with_funcs(struct drm_device *dev, unsigned int preferred_bpp, unsigned int num_crtc, unsigned int max_conn_count, const struct drm_fb_helper_funcs *funcs);
19 struct drm_fbdev_cma * drm_fbdev_cma_init(struct drm_device *dev, unsigned int preferred_bpp, unsigned int num_crtc, unsigned int max_conn_count);
22 void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
24 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
25 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
26 int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes, const struct drm_framebuffer_funcs *funcs);
30 void drm_fb_cma_destroy(struct drm_framebuffer *fb);
31 int drm_fb_cma_create_handle(struct drm_framebuffer *fb, struct drm_file *file_priv, unsigned int *handle);
34 struct drm_framebuffer * drm_fb_cma_create_with_funcs(struct drm_device *dev, struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd, const struct drm_framebuffer_funcs *funcs);
37 struct drm_framebuffer * drm_fb_cma_create(struct drm_device *dev, struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
40 struct drm_gem_cma_object * drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, unsigned int plane);
46 int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
94 struct drm_fbdev_cma * to_fbdev_cma(struct drm_fb_helper *helper);
99 struct drm_fb_cma * to_fb_cma(struct drm_framebuffer *fb);
117 const char __kstrtab_drm_fb_cma_destroy[19U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '\x0' };
117 const struct kernel_symbol __ksymtab_drm_fb_cma_destroy;
117 const struct kernel_symbol __ksymtab_drm_fb_cma_destroy = { (unsigned long)(&drm_fb_cma_destroy), (const char *)(&__kstrtab_drm_fb_cma_destroy) };
127 const char __kstrtab_drm_fb_cma_create_handle[25U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'c', 'r', 'e', 'a', 't', 'e', '_', 'h', 'a', 'n', 'd', 'l', 'e', '\x0' };
127 const struct kernel_symbol __ksymtab_drm_fb_cma_create_handle;
127 const struct kernel_symbol __ksymtab_drm_fb_cma_create_handle = { (unsigned long)(&drm_fb_cma_create_handle), (const char *)(&__kstrtab_drm_fb_cma_create_handle) };
129 struct drm_framebuffer_funcs drm_fb_cma_funcs = { &drm_fb_cma_destroy, &drm_fb_cma_create_handle, 0 };
134 struct drm_fb_cma * drm_fb_cma_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_cma_object **obj, unsigned int num_planes, const struct drm_framebuffer_funcs *funcs);
223 const char __kstrtab_drm_fb_cma_create_with_funcs[29U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'c', 'r', 'e', 'a', 't', 'e', '_', 'w', 'i', 't', 'h', '_', 'f', 'u', 'n', 'c', 's', '\x0' };
223 const struct kernel_symbol __ksymtab_drm_fb_cma_create_with_funcs;
223 const struct kernel_symbol __ksymtab_drm_fb_cma_create_with_funcs = { (unsigned long)(&drm_fb_cma_create_with_funcs), (const char *)(&__kstrtab_drm_fb_cma_create_with_funcs) };
238 const char __kstrtab_drm_fb_cma_create[18U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'c', 'r', 'e', 'a', 't', 'e', '\x0' };
238 const struct kernel_symbol __ksymtab_drm_fb_cma_create;
238 const struct kernel_symbol __ksymtab_drm_fb_cma_create = { (unsigned long)(&drm_fb_cma_create), (const char *)(&__kstrtab_drm_fb_cma_create) };
259 const char __kstrtab_drm_fb_cma_get_gem_obj[23U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'g', 'e', 't', '_', 'g', 'e', 'm', '_', 'o', 'b', 'j', '\x0' };
259 const struct kernel_symbol __ksymtab_drm_fb_cma_get_gem_obj;
259 const struct kernel_symbol __ksymtab_drm_fb_cma_get_gem_obj = { (unsigned long)(&drm_fb_cma_get_gem_obj), (const char *)(&__kstrtab_drm_fb_cma_get_gem_obj) };
266 void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m);
298 const char __kstrtab_drm_fb_cma_debugfs_show[24U] = { 'd', 'r', 'm', '_', 'f', 'b', '_', 'c', 'm', 'a', '_', 'd', 'e', 'b', 'u', 'g', 'f', 's', '_', 's', 'h', 'o', 'w', '\x0' };
298 const struct kernel_symbol __ksymtab_drm_fb_cma_debugfs_show;
298 const struct kernel_symbol __ksymtab_drm_fb_cma_debugfs_show = { (unsigned long)(&drm_fb_cma_debugfs_show), (const char *)(&__kstrtab_drm_fb_cma_debugfs_show) };
301 struct fb_ops drm_fbdev_cma_ops = { &__this_module, 0, 0, 0, 0, &drm_fb_helper_check_var, &drm_fb_helper_set_par, 0, &drm_fb_helper_setcmap, &drm_fb_helper_blank, &drm_fb_helper_pan_display, &drm_fb_helper_sys_fillrect, &drm_fb_helper_sys_copyarea, &drm_fb_helper_sys_imageblit, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
313 int drm_fbdev_cma_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma);
322 int drm_fbdev_cma_defio_init(struct fb_info *fbi, struct drm_gem_cma_object *cma_obj);
357 void drm_fbdev_cma_defio_fini(struct fb_info *fbi);
452 const char __kstrtab_drm_fbdev_cma_create_with_funcs[32U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'c', 'r', 'e', 'a', 't', 'e', '_', 'w', 'i', 't', 'h', '_', 'f', 'u', 'n', 'c', 's', '\x0' };
452 const struct kernel_symbol __ksymtab_drm_fbdev_cma_create_with_funcs;
452 const struct kernel_symbol __ksymtab_drm_fbdev_cma_create_with_funcs = { (unsigned long)(&drm_fbdev_cma_create_with_funcs), (const char *)(&__kstrtab_drm_fbdev_cma_create_with_funcs) };
454 int drm_fbdev_cma_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes);
460 const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { 0, 0, &drm_fbdev_cma_create, 0 };
520 const char __kstrtab_drm_fbdev_cma_init_with_funcs[30U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'i', 'n', 'i', 't', '_', 'w', 'i', 't', 'h', '_', 'f', 'u', 'n', 'c', 's', '\x0' };
520 const struct kernel_symbol __ksymtab_drm_fbdev_cma_init_with_funcs;
520 const struct kernel_symbol __ksymtab_drm_fbdev_cma_init_with_funcs = { (unsigned long)(&drm_fbdev_cma_init_with_funcs), (const char *)(&__kstrtab_drm_fbdev_cma_init_with_funcs) };
538 const char __kstrtab_drm_fbdev_cma_init[19U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'i', 'n', 'i', 't', '\x0' };
538 const struct kernel_symbol __ksymtab_drm_fbdev_cma_init;
538 const struct kernel_symbol __ksymtab_drm_fbdev_cma_init = { (unsigned long)(&drm_fbdev_cma_init), (const char *)(&__kstrtab_drm_fbdev_cma_init) };
558 const char __kstrtab_drm_fbdev_cma_fini[19U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'f', 'i', 'n', 'i', '\x0' };
558 const struct kernel_symbol __ksymtab_drm_fbdev_cma_fini;
558 const struct kernel_symbol __ksymtab_drm_fbdev_cma_fini = { (unsigned long)(&drm_fbdev_cma_fini), (const char *)(&__kstrtab_drm_fbdev_cma_fini) };
571 const char __kstrtab_drm_fbdev_cma_restore_mode[27U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'r', 'e', 's', 't', 'o', 'r', 'e', '_', 'm', 'o', 'd', 'e', '\x0' };
571 const struct kernel_symbol __ksymtab_drm_fbdev_cma_restore_mode;
571 const struct kernel_symbol __ksymtab_drm_fbdev_cma_restore_mode = { (unsigned long)(&drm_fbdev_cma_restore_mode), (const char *)(&__kstrtab_drm_fbdev_cma_restore_mode) };
585 const char __kstrtab_drm_fbdev_cma_hotplug_event[28U] = { 'd', 'r', 'm', '_', 'f', 'b', 'd', 'e', 'v', '_', 'c', 'm', 'a', '_', 'h', 'o', 't', 'p', 'l', 'u', 'g', '_', 'e', 'v', 'e', 'n', 't', '\x0' };
585 const struct kernel_symbol __ksymtab_drm_fbdev_cma_hotplug_event;
585 const struct kernel_symbol __ksymtab_drm_fbdev_cma_hotplug_event = { (unsigned long)(&drm_fbdev_cma_hotplug_event), (const char *)(&__kstrtab_drm_fbdev_cma_hotplug_event) };
624 void ldv_main10_sequence_infinite_withcheck_stateful();
314 int variable_test_bit(long nr, const volatile unsigned long *addr);
255 void __might_fault(const char *, int);
412 int sprintf(char *, const char *, ...);
11 void * ldv_create_class();
13 void ldv_unregister_class();
15 int ldv_register_chrdev(int major);
17 void ldv_unregister_chrdev_region();
10 extern struct task_struct *current_task;
12 struct task_struct * get_current();
14 void __cmpxchg_wrong_size();
24 int atomic_read___6(const atomic_t *v);
36 void atomic_set___0(atomic_t *v, int i);
101 void atomic_dec(atomic_t *v);
174 int atomic_cmpxchg(atomic_t *v, int old, int new);
208 int __atomic_add_unless(atomic_t *v, int a, int u);
445 int atomic_add_unless(atomic_t *v, int a, int u);
310 extern struct tss_struct cpu_tss;
469 unsigned long int current_top_of_stack();
167 struct thread_info * current_thread_info();
90 int test_ti_thread_flag(struct thread_info *ti, int flag);
209 void wake_up_atomic_t(atomic_t *);
213 int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned int);
1214 int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned int mode);
498 int debug_lockdep_rcu_enabled();
79 void * idr_find_slowpath(struct idr *, int);
82 int idr_alloc_cyclic(struct idr *, void *, int, int, gfp_t );
85 void * idr_get_next(struct idr *, int *);
87 void idr_remove(struct idr *, int);
115 void * idr_find(struct idr *idr, int id);
31 void kref_init___0(struct kref *kref);
134 int kref_get_unless_zero(struct kref *kref);
859 unsigned int iminor(const struct inode *inode);
2426 int __register_chrdev(unsigned int, unsigned int, unsigned int, const char *, const struct file_operations *);
2429 void __unregister_chrdev(unsigned int, unsigned int, unsigned int, const char *);
2434 int ldv_register_chrdev_71(unsigned int major, const char *name, const struct file_operations *fops);
2434 int register_chrdev(unsigned int major, const char *name, const struct file_operations *fops);
2444 void ldv_unregister_chrdev_72(unsigned int major, const char *name);
2444 void unregister_chrdev(unsigned int major, const char *name);
2797 loff_t fixed_size_llseek(struct file *, loff_t , int, loff_t );
517 void class_destroy(struct class *);
520 void ldv_class_destroy_73(struct class *ldv_func_arg1);
524 void ldv_class_destroy_74(struct class *ldv_func_arg1);
1072 struct device * device_create(struct class *, struct device *, dev_t , void *, const char *, ...);
1080 void device_destroy(struct class *, dev_t );
440 void schedule();
3057 int test_tsk_thread_flag(struct task_struct *tsk, int flag);
3083 int signal_pending(struct task_struct *p);
5 void kasan_check_read(const void *, unsigned int);
6 void kasan_check_write(const void *, unsigned int);
49 void clac();
55 void stac();
45 bool __chk_range_not_ok(unsigned long addr, unsigned long size, unsigned long limit);
21 unsigned long int copy_user_enhanced_fast_string(void *, const void *, unsigned int);
23 unsigned long int copy_user_generic_string(void *, const void *, unsigned int);
25 unsigned long int copy_user_generic_unrolled(void *, const void *, unsigned int);
28 unsigned long int copy_user_generic(void *to, const void *from, unsigned int len);
53 int __copy_from_user_nocheck(void *dst, const void *src, unsigned int size);
110 int __copy_from_user(void *dst, const void *src, unsigned int size);
118 int __copy_to_user_nocheck(void *dst, const void *src, unsigned int size);
177 int __copy_to_user(void *dst, const void *src, unsigned int size);
50 struct idr aux_idr = { 0, 0, 0, 0, { { { { { 0 } }, 3735899821U, 4294967295U, (void *)-1, { 0, { 0, 0 }, "aux_idr.lock", 0, 0UL } } } }, 0, 0 };
51 struct mutex aux_idr_mutex = { { 1 }, { { { { { 0 } }, 3735899821U, 4294967295U, (void *)-1, { 0, { 0, 0 }, "aux_idr_mutex.wait_lock", 0, 0UL } } } }, { &(aux_idr_mutex.wait_list), &(aux_idr_mutex.wait_list) }, 0, (void *)(&aux_idr_mutex), { 0, { 0, 0 }, "aux_idr_mutex", 0, 0UL } };
52 struct class *drm_dp_aux_dev_class = 0;
53 int drm_dev_major = -1;
55 struct drm_dp_aux_dev * drm_dp_aux_dev_get_by_minor(unsigned int index);
68 struct drm_dp_aux_dev * alloc_drm_dp_aux_dev(struct drm_dp_aux *aux);
93 void release_drm_dp_aux_dev(struct kref *ref);
101 ssize_t name_show(struct device *dev, struct device_attribute *attr, char *buf);
116 struct device_attribute dev_attr_name = { { "name", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &name_show, 0 };
118 struct attribute *drm_dp_aux_attrs[2U] = { &(dev_attr_name.attr), (struct attribute *)0 };
122 const struct attribute_group drm_dp_aux_group = { 0, 0, 0, (struct attribute **)(&drm_dp_aux_attrs), 0 };
122 const struct attribute_group *drm_dp_aux_groups[2U] = { &drm_dp_aux_group, (const struct attribute_group *)0 };
124 int auxdev_open(struct inode *inode, struct file *file);
137 loff_t auxdev_llseek(struct file *file, loff_t offset, int whence);
142 ssize_t auxdev_read(struct file *file, char *buf, size_t count, loff_t *offset);
191 ssize_t auxdev_write(struct file *file, const char *buf, size_t count, loff_t *offset);
242 int auxdev_release(struct inode *inode, struct file *file);
250 const struct file_operations auxdev_fops = { &__this_module, &auxdev_llseek, &auxdev_read, &auxdev_write, 0, 0, 0, 0, 0, 0, 0, 0, &auxdev_open, 0, &auxdev_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
261 struct drm_dp_aux_dev * drm_dp_aux_dev_get_by_aux(struct drm_dp_aux *aux);
282 int auxdev_wait_atomic_t(atomic_t *p);
318 const char __kstrtab_drm_dp_aux_unregister_devnode[30U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'u', 'n', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 'd', 'e', 'v', 'n', 'o', 'd', 'e', '\x0' };
318 const struct kernel_symbol __ksymtab_drm_dp_aux_unregister_devnode;
318 const struct kernel_symbol __ksymtab_drm_dp_aux_unregister_devnode = { (unsigned long)(&drm_dp_aux_unregister_devnode), (const char *)(&__kstrtab_drm_dp_aux_unregister_devnode) };
351 const char __kstrtab_drm_dp_aux_register_devnode[28U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 'd', 'e', 'v', 'n', 'o', 'd', 'e', '\x0' };
351 const struct kernel_symbol __ksymtab_drm_dp_aux_register_devnode;
351 const struct kernel_symbol __ksymtab_drm_dp_aux_register_devnode = { (unsigned long)(&drm_dp_aux_register_devnode), (const char *)(&__kstrtab_drm_dp_aux_register_devnode) };
374 const char __kstrtab_drm_dp_aux_dev_init[20U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'd', 'e', 'v', '_', 'i', 'n', 'i', 't', '\x0' };
374 const struct kernel_symbol __ksymtab_drm_dp_aux_dev_init;
374 const struct kernel_symbol __ksymtab_drm_dp_aux_dev_init = { (unsigned long)(&drm_dp_aux_dev_init), (const char *)(&__kstrtab_drm_dp_aux_dev_init) };
381 const char __kstrtab_drm_dp_aux_dev_exit[20U] = { 'd', 'r', 'm', '_', 'd', 'p', '_', 'a', 'u', 'x', '_', 'd', 'e', 'v', '_', 'e', 'x', 'i', 't', '\x0' };
381 const struct kernel_symbol __ksymtab_drm_dp_aux_dev_exit;
381 const struct kernel_symbol __ksymtab_drm_dp_aux_dev_exit = { (unsigned long)(&drm_dp_aux_dev_exit), (const char *)(&__kstrtab_drm_dp_aux_dev_exit) };
402 void ldv_check_return_value(int);
420 void ldv_main11_sequence_infinite_withcheck_stateful();
10 void ldv_error();
20 void ldv_stop();
25 int ldv_undef_int();
26 void * ldv_undef_ptr();
39 int ldv_undef_int_nonpositive();
28 int ldv_usb_gadget_class = 0;
31 int ldv_usb_gadget_chrdev = 0;
34 int ldv_usb_gadget = 0;
61 int ldv_register_class();
124 int ldv_register_chrdev_region();
158 int ldv_register_usb_gadget();
179 void ldv_unregister_usb_gadget();
return ;
}
-entry_point
{
102 int tmp;
103 int tmp___0;
104 int tmp___1;
112 LDV_IN_INTERRUPT = 1;
121 ldv_initialize() { /* Function call is skipped due to function is undefined */}
127 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
128 -drm_kms_helper_init()
{
39 int ret;
42 -drm_fb_helper_modinit()
{
2281 return 0;;
}
43 assume(!(ret < 0));
46 -drm_dp_aux_dev_init()
{
355 int res;
356 void *tmp;
357 long tmp___0;
358 _Bool tmp___1;
357 -ldv_create_class()
{
40 void *is_got;
43 is_got = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
46 assume(!(((unsigned long)is_got) <= ((unsigned long)((void *)2012))));
57 return is_got;;
}
357 drm_dp_aux_dev_class = (struct class *)tmp;
358 -IS_ERR((const void *)drm_dp_aux_dev_class)
{
36 _Bool tmp;
37 -ldv_is_err(ptr)
{
10 return ((unsigned long)ptr) > 2012UL;;
}
37 return tmp;;
}
358 assume(!(((int)tmp___1) == 0));
359 -PTR_ERR((const void *)drm_dp_aux_dev_class)
{
30 long tmp;
31 -ldv_ptr_err(ptr)
{
24 return (long)(2012UL - ((unsigned long)ptr));;
}
31 return tmp;;
}
359 res = (int)tmp___0;
360 goto out;
370 out:;
371 -ldv_class_destroy_73(drm_dp_aux_dev_class)
{
68 class_destroy(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
70 -ldv_unregister_class()
{
87 assume(!(ldv_usb_gadget != 0));
89 assume(ldv_usb_gadget_class != 1);
89 -ldv_error()
{
15 LDV_ERROR:;
}
}
}
}
}
}
Source code
1 2 #include <linux/kernel.h> 3 bool ldv_is_err(const void *ptr); 4 bool ldv_is_err_or_null(const void *ptr); 5 void* ldv_err_ptr(long error); 6 long ldv_ptr_err(const void *ptr); 7 8 9 // Provide model function prototypes before their usage. 10 11 void *ldv_create_class(void); 12 int ldv_register_class(void); 13 void ldv_unregister_class(void); 14 15 int ldv_register_chrdev(int major); 16 int ldv_register_chrdev_region(void); 17 void ldv_unregister_chrdev_region(void); 18 19 int ldv_register_usb_gadget(void); 20 void ldv_unregister_usb_gadget(void); 21 #line 1 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--106_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/5249/dscv_tempdir/dscv/ri/106_1a/drivers/gpu/drm/drm_atomic_helper.c" 22 /* 23 * Copyright (C) 2014 Red Hat 24 * Copyright (C) 2014 Intel Corp. 25 * 26 * Permission is hereby granted, free of charge, to any person obtaining a 27 * copy of this software and associated documentation files (the "Software"), 28 * to deal in the Software without restriction, including without limitation 29 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 30 * and/or sell copies of the Software, and to permit persons to whom the 31 * Software is furnished to do so, subject to the following conditions: 32 * 33 * The above copyright notice and this permission notice shall be included in 34 * all copies or substantial portions of the Software. 35 * 36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 39 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 40 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 41 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 42 * OTHER DEALINGS IN THE SOFTWARE. 43 * 44 * Authors: 45 * Rob Clark <robdclark@gmail.com> 46 * Daniel Vetter <daniel.vetter@ffwll.ch> 47 */ 48 49 #include <drm/drmP.h> 50 #include <drm/drm_atomic.h> 51 #include <drm/drm_plane_helper.h> 52 #include <drm/drm_crtc_helper.h> 53 #include <drm/drm_atomic_helper.h> 54 #include <linux/fence.h> 55 56 /** 57 * DOC: overview 58 * 59 * This helper library provides implementations of check and commit functions on 60 * top of the CRTC modeset helper callbacks and the plane helper callbacks. It 61 * also provides convenience implementations for the atomic state handling 62 * callbacks for drivers which don't need to subclass the drm core structures to 63 * add their own additional internal state. 64 * 65 * This library also provides default implementations for the check callback in 66 * drm_atomic_helper_check() and for the commit callback with 67 * drm_atomic_helper_commit(). But the individual stages and callbacks are 68 * exposed to allow drivers to mix and match and e.g. use the plane helpers only 69 * together with a driver private modeset implementation. 70 * 71 * This library also provides implementations for all the legacy driver 72 * interfaces on top of the atomic interface. See drm_atomic_helper_set_config(), 73 * drm_atomic_helper_disable_plane(), drm_atomic_helper_disable_plane() and the 74 * various functions to implement set_property callbacks. New drivers must not 75 * implement these functions themselves but must use the provided helpers. 76 * 77 * The atomic helper uses the same function table structures as all other 78 * modesetting helpers. See the documentation for struct &drm_crtc_helper_funcs, 79 * struct &drm_encoder_helper_funcs and struct &drm_connector_helper_funcs. It 80 * also shares the struct &drm_plane_helper_funcs function table with the plane 81 * helpers. 82 */ 83 static void 84 drm_atomic_helper_plane_changed(struct drm_atomic_state *state, 85 struct drm_plane_state *plane_state, 86 struct drm_plane *plane) 87 { 88 struct drm_crtc_state *crtc_state; 89 90 if (plane->state->crtc) { 91 crtc_state = drm_atomic_get_existing_crtc_state(state, 92 plane->state->crtc); 93 94 if (WARN_ON(!crtc_state)) 95 return; 96 97 crtc_state->planes_changed = true; 98 } 99 100 if (plane_state->crtc) { 101 crtc_state = drm_atomic_get_existing_crtc_state(state, 102 plane_state->crtc); 103 104 if (WARN_ON(!crtc_state)) 105 return; 106 107 crtc_state->planes_changed = true; 108 } 109 } 110 111 static int handle_conflicting_encoders(struct drm_atomic_state *state, 112 bool disable_conflicting_encoders) 113 { 114 struct drm_connector_state *conn_state; 115 struct drm_connector *connector; 116 struct drm_encoder *encoder; 117 unsigned encoder_mask = 0; 118 int i, ret; 119 120 /* 121 * First loop, find all newly assigned encoders from the connectors 122 * part of the state. If the same encoder is assigned to multiple 123 * connectors bail out. 124 */ 125 for_each_connector_in_state(state, connector, conn_state, i) { 126 const struct drm_connector_helper_funcs *funcs = connector->helper_private; 127 struct drm_encoder *new_encoder; 128 129 if (!conn_state->crtc) 130 continue; 131 132 if (funcs->atomic_best_encoder) 133 new_encoder = funcs->atomic_best_encoder(connector, conn_state); 134 else 135 new_encoder = funcs->best_encoder(connector); 136 137 if (new_encoder) { 138 if (encoder_mask & (1 << drm_encoder_index(new_encoder))) { 139 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n", 140 new_encoder->base.id, new_encoder->name, 141 connector->base.id, connector->name); 142 143 return -EINVAL; 144 } 145 146 encoder_mask |= 1 << drm_encoder_index(new_encoder); 147 } 148 } 149 150 if (!encoder_mask) 151 return 0; 152 153 /* 154 * Second loop, iterate over all connectors not part of the state. 155 * 156 * If a conflicting encoder is found and disable_conflicting_encoders 157 * is not set, an error is returned. Userspace can provide a solution 158 * through the atomic ioctl. 159 * 160 * If the flag is set conflicting connectors are removed from the crtc 161 * and the crtc is disabled if no encoder is left. This preserves 162 * compatibility with the legacy set_config behavior. 163 */ 164 drm_for_each_connector(connector, state->dev) { 165 struct drm_crtc_state *crtc_state; 166 167 if (drm_atomic_get_existing_connector_state(state, connector)) 168 continue; 169 170 encoder = connector->state->best_encoder; 171 if (!encoder || !(encoder_mask & (1 << drm_encoder_index(encoder)))) 172 continue; 173 174 if (!disable_conflicting_encoders) { 175 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n", 176 encoder->base.id, encoder->name, 177 connector->state->crtc->base.id, 178 connector->state->crtc->name, 179 connector->base.id, connector->name); 180 return -EINVAL; 181 } 182 183 conn_state = drm_atomic_get_connector_state(state, connector); 184 if (IS_ERR(conn_state)) 185 return PTR_ERR(conn_state); 186 187 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n", 188 encoder->base.id, encoder->name, 189 conn_state->crtc->base.id, conn_state->crtc->name, 190 connector->base.id, connector->name); 191 192 crtc_state = drm_atomic_get_existing_crtc_state(state, conn_state->crtc); 193 194 ret = drm_atomic_set_crtc_for_connector(conn_state, NULL); 195 if (ret) 196 return ret; 197 198 if (!crtc_state->connector_mask) { 199 ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, 200 NULL); 201 if (ret < 0) 202 return ret; 203 204 crtc_state->active = false; 205 } 206 } 207 208 return 0; 209 } 210 211 static void 212 set_best_encoder(struct drm_atomic_state *state, 213 struct drm_connector_state *conn_state, 214 struct drm_encoder *encoder) 215 { 216 struct drm_crtc_state *crtc_state; 217 struct drm_crtc *crtc; 218 219 if (conn_state->best_encoder) { 220 /* Unset the encoder_mask in the old crtc state. */ 221 crtc = conn_state->connector->state->crtc; 222 223 /* A NULL crtc is an error here because we should have 224 * duplicated a NULL best_encoder when crtc was NULL. 225 * As an exception restoring duplicated atomic state 226 * during resume is allowed, so don't warn when 227 * best_encoder is equal to encoder we intend to set. 228 */ 229 WARN_ON(!crtc && encoder != conn_state->best_encoder); 230 if (crtc) { 231 crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); 232 233 crtc_state->encoder_mask &= 234 ~(1 << drm_encoder_index(conn_state->best_encoder)); 235 } 236 } 237 238 if (encoder) { 239 crtc = conn_state->crtc; 240 WARN_ON(!crtc); 241 if (crtc) { 242 crtc_state = drm_atomic_get_existing_crtc_state(state, crtc); 243 244 crtc_state->encoder_mask |= 245 1 << drm_encoder_index(encoder); 246 } 247 } 248 249 conn_state->best_encoder = encoder; 250 } 251 252 static void 253 steal_encoder(struct drm_atomic_state *state, 254 struct drm_encoder *encoder) 255 { 256 struct drm_crtc_state *crtc_state; 257 struct drm_connector *connector; 258 struct drm_connector_state *connector_state; 259 int i; 260 261 for_each_connector_in_state(state, connector, connector_state, i) { 262 struct drm_crtc *encoder_crtc; 263 264 if (connector_state->best_encoder != encoder) 265 continue; 266 267 encoder_crtc = connector->state->crtc; 268 269 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n", 270 encoder->base.id, encoder->name, 271 encoder_crtc->base.id, encoder_crtc->name); 272 273 set_best_encoder(state, connector_state, NULL); 274 275 crtc_state = drm_atomic_get_existing_crtc_state(state, encoder_crtc); 276 crtc_state->connectors_changed = true; 277 278 return; 279 } 280 } 281 282 static int 283 update_connector_routing(struct drm_atomic_state *state, 284 struct drm_connector *connector, 285 struct drm_connector_state *connector_state) 286 { 287 const struct drm_connector_helper_funcs *funcs; 288 struct drm_encoder *new_encoder; 289 struct drm_crtc_state *crtc_state; 290 291 DRM_DEBUG_ATOMIC("Updating routing for [CONNECTOR:%d:%s]\n", 292 connector->base.id, 293 connector->name); 294 295 if (connector->state->crtc != connector_state->crtc) { 296 if (connector->state->crtc) { 297 crtc_state = drm_atomic_get_existing_crtc_state(state, connector->state->crtc); 298 crtc_state->connectors_changed = true; 299 } 300 301 if (connector_state->crtc) { 302 crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc); 303 crtc_state->connectors_changed = true; 304 } 305 } 306 307 if (!connector_state->crtc) { 308 DRM_DEBUG_ATOMIC("Disabling [CONNECTOR:%d:%s]\n", 309 connector->base.id, 310 connector->name); 311 312 set_best_encoder(state, connector_state, NULL); 313 314 return 0; 315 } 316 317 funcs = connector->helper_private; 318 319 if (funcs->atomic_best_encoder) 320 new_encoder = funcs->atomic_best_encoder(connector, 321 connector_state); 322 else 323 new_encoder = funcs->best_encoder(connector); 324 325 if (!new_encoder) { 326 DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n", 327 connector->base.id, 328 connector->name); 329 return -EINVAL; 330 } 331 332 if (!drm_encoder_crtc_ok(new_encoder, connector_state->crtc)) { 333 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d]\n", 334 new_encoder->base.id, 335 new_encoder->name, 336 connector_state->crtc->base.id); 337 return -EINVAL; 338 } 339 340 if (new_encoder == connector_state->best_encoder) { 341 set_best_encoder(state, connector_state, new_encoder); 342 343 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n", 344 connector->base.id, 345 connector->name, 346 new_encoder->base.id, 347 new_encoder->name, 348 connector_state->crtc->base.id, 349 connector_state->crtc->name); 350 351 return 0; 352 } 353 354 steal_encoder(state, new_encoder); 355 356 set_best_encoder(state, connector_state, new_encoder); 357 358 crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc); 359 crtc_state->connectors_changed = true; 360 361 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", 362 connector->base.id, 363 connector->name, 364 new_encoder->base.id, 365 new_encoder->name, 366 connector_state->crtc->base.id, 367 connector_state->crtc->name); 368 369 return 0; 370 } 371 372 static int 373 mode_fixup(struct drm_atomic_state *state) 374 { 375 struct drm_crtc *crtc; 376 struct drm_crtc_state *crtc_state; 377 struct drm_connector *connector; 378 struct drm_connector_state *conn_state; 379 int i; 380 bool ret; 381 382 for_each_crtc_in_state(state, crtc, crtc_state, i) { 383 if (!crtc_state->mode_changed && 384 !crtc_state->connectors_changed) 385 continue; 386 387 drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode); 388 } 389 390 for_each_connector_in_state(state, connector, conn_state, i) { 391 const struct drm_encoder_helper_funcs *funcs; 392 struct drm_encoder *encoder; 393 394 WARN_ON(!!conn_state->best_encoder != !!conn_state->crtc); 395 396 if (!conn_state->crtc || !conn_state->best_encoder) 397 continue; 398 399 crtc_state = drm_atomic_get_existing_crtc_state(state, 400 conn_state->crtc); 401 402 /* 403 * Each encoder has at most one connector (since we always steal 404 * it away), so we won't call ->mode_fixup twice. 405 */ 406 encoder = conn_state->best_encoder; 407 funcs = encoder->helper_private; 408 409 ret = drm_bridge_mode_fixup(encoder->bridge, &crtc_state->mode, 410 &crtc_state->adjusted_mode); 411 if (!ret) { 412 DRM_DEBUG_ATOMIC("Bridge fixup failed\n"); 413 return -EINVAL; 414 } 415 416 if (funcs && funcs->atomic_check) { 417 ret = funcs->atomic_check(encoder, crtc_state, 418 conn_state); 419 if (ret) { 420 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] check failed\n", 421 encoder->base.id, encoder->name); 422 return ret; 423 } 424 } else if (funcs && funcs->mode_fixup) { 425 ret = funcs->mode_fixup(encoder, &crtc_state->mode, 426 &crtc_state->adjusted_mode); 427 if (!ret) { 428 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] fixup failed\n", 429 encoder->base.id, encoder->name); 430 return -EINVAL; 431 } 432 } 433 } 434 435 for_each_crtc_in_state(state, crtc, crtc_state, i) { 436 const struct drm_crtc_helper_funcs *funcs; 437 438 if (!crtc_state->mode_changed && 439 !crtc_state->connectors_changed) 440 continue; 441 442 funcs = crtc->helper_private; 443 if (!funcs->mode_fixup) 444 continue; 445 446 ret = funcs->mode_fixup(crtc, &crtc_state->mode, 447 &crtc_state->adjusted_mode); 448 if (!ret) { 449 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] fixup failed\n", 450 crtc->base.id, crtc->name); 451 return -EINVAL; 452 } 453 } 454 455 return 0; 456 } 457 458 /** 459 * drm_atomic_helper_check_modeset - validate state object for modeset changes 460 * @dev: DRM device 461 * @state: the driver state object 462 * 463 * Check the state object to see if the requested state is physically possible. 464 * This does all the crtc and connector related computations for an atomic 465 * update and adds any additional connectors needed for full modesets and calls 466 * down into ->mode_fixup functions of the driver backend. 467 * 468 * crtc_state->mode_changed is set when the input mode is changed. 469 * crtc_state->connectors_changed is set when a connector is added or 470 * removed from the crtc. 471 * crtc_state->active_changed is set when crtc_state->active changes, 472 * which is used for dpms. 473 * 474 * IMPORTANT: 475 * 476 * Drivers which update ->mode_changed (e.g. in their ->atomic_check hooks if a 477 * plane update can't be done without a full modeset) _must_ call this function 478 * afterwards after that change. It is permitted to call this function multiple 479 * times for the same update, e.g. when the ->atomic_check functions depend upon 480 * the adjusted dotclock for fifo space allocation and watermark computation. 481 * 482 * RETURNS 483 * Zero for success or -errno 484 */ 485 int 486 drm_atomic_helper_check_modeset(struct drm_device *dev, 487 struct drm_atomic_state *state) 488 { 489 struct drm_crtc *crtc; 490 struct drm_crtc_state *crtc_state; 491 struct drm_connector *connector; 492 struct drm_connector_state *connector_state; 493 int i, ret; 494 495 for_each_crtc_in_state(state, crtc, crtc_state, i) { 496 if (!drm_mode_equal(&crtc->state->mode, &crtc_state->mode)) { 497 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n", 498 crtc->base.id, crtc->name); 499 crtc_state->mode_changed = true; 500 } 501 502 if (crtc->state->enable != crtc_state->enable) { 503 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enable changed\n", 504 crtc->base.id, crtc->name); 505 506 /* 507 * For clarity this assignment is done here, but 508 * enable == 0 is only true when there are no 509 * connectors and a NULL mode. 510 * 511 * The other way around is true as well. enable != 0 512 * iff connectors are attached and a mode is set. 513 */ 514 crtc_state->mode_changed = true; 515 crtc_state->connectors_changed = true; 516 } 517 } 518 519 ret = handle_conflicting_encoders(state, state->legacy_set_config); 520 if (ret) 521 return ret; 522 523 for_each_connector_in_state(state, connector, connector_state, i) { 524 /* 525 * This only sets crtc->mode_changed for routing changes, 526 * drivers must set crtc->mode_changed themselves when connector 527 * properties need to be updated. 528 */ 529 ret = update_connector_routing(state, connector, 530 connector_state); 531 if (ret) 532 return ret; 533 } 534 535 /* 536 * After all the routing has been prepared we need to add in any 537 * connector which is itself unchanged, but who's crtc changes it's 538 * configuration. This must be done before calling mode_fixup in case a 539 * crtc only changed its mode but has the same set of connectors. 540 */ 541 for_each_crtc_in_state(state, crtc, crtc_state, i) { 542 bool has_connectors = 543 !!crtc_state->connector_mask; 544 545 /* 546 * We must set ->active_changed after walking connectors for 547 * otherwise an update that only changes active would result in 548 * a full modeset because update_connector_routing force that. 549 */ 550 if (crtc->state->active != crtc_state->active) { 551 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] active changed\n", 552 crtc->base.id, crtc->name); 553 crtc_state->active_changed = true; 554 } 555 556 if (!drm_atomic_crtc_needs_modeset(crtc_state)) 557 continue; 558 559 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] needs all connectors, enable: %c, active: %c\n", 560 crtc->base.id, crtc->name, 561 crtc_state->enable ? 'y' : 'n', 562 crtc_state->active ? 'y' : 'n'); 563 564 ret = drm_atomic_add_affected_connectors(state, crtc); 565 if (ret != 0) 566 return ret; 567 568 ret = drm_atomic_add_affected_planes(state, crtc); 569 if (ret != 0) 570 return ret; 571 572 if (crtc_state->enable != has_connectors) { 573 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n", 574 crtc->base.id, crtc->name); 575 576 return -EINVAL; 577 } 578 } 579 580 return mode_fixup(state); 581 } 582 EXPORT_SYMBOL(drm_atomic_helper_check_modeset); 583 584 /** 585 * drm_atomic_helper_check_planes - validate state object for planes changes 586 * @dev: DRM device 587 * @state: the driver state object 588 * 589 * Check the state object to see if the requested state is physically possible. 590 * This does all the plane update related checks using by calling into the 591 * ->atomic_check hooks provided by the driver. 592 * 593 * It also sets crtc_state->planes_changed to indicate that a crtc has 594 * updated planes. 595 * 596 * RETURNS 597 * Zero for success or -errno 598 */ 599 int 600 drm_atomic_helper_check_planes(struct drm_device *dev, 601 struct drm_atomic_state *state) 602 { 603 struct drm_crtc *crtc; 604 struct drm_crtc_state *crtc_state; 605 struct drm_plane *plane; 606 struct drm_plane_state *plane_state; 607 int i, ret = 0; 608 609 for_each_plane_in_state(state, plane, plane_state, i) { 610 const struct drm_plane_helper_funcs *funcs; 611 612 funcs = plane->helper_private; 613 614 drm_atomic_helper_plane_changed(state, plane_state, plane); 615 616 if (!funcs || !funcs->atomic_check) 617 continue; 618 619 ret = funcs->atomic_check(plane, plane_state); 620 if (ret) { 621 DRM_DEBUG_ATOMIC("[PLANE:%d:%s] atomic driver check failed\n", 622 plane->base.id, plane->name); 623 return ret; 624 } 625 } 626 627 for_each_crtc_in_state(state, crtc, crtc_state, i) { 628 const struct drm_crtc_helper_funcs *funcs; 629 630 funcs = crtc->helper_private; 631 632 if (!funcs || !funcs->atomic_check) 633 continue; 634 635 ret = funcs->atomic_check(crtc, state->crtc_states[i]); 636 if (ret) { 637 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] atomic driver check failed\n", 638 crtc->base.id, crtc->name); 639 return ret; 640 } 641 } 642 643 return ret; 644 } 645 EXPORT_SYMBOL(drm_atomic_helper_check_planes); 646 647 /** 648 * drm_atomic_helper_check - validate state object 649 * @dev: DRM device 650 * @state: the driver state object 651 * 652 * Check the state object to see if the requested state is physically possible. 653 * Only crtcs and planes have check callbacks, so for any additional (global) 654 * checking that a driver needs it can simply wrap that around this function. 655 * Drivers without such needs can directly use this as their ->atomic_check() 656 * callback. 657 * 658 * This just wraps the two parts of the state checking for planes and modeset 659 * state in the default order: First it calls drm_atomic_helper_check_modeset() 660 * and then drm_atomic_helper_check_planes(). The assumption is that the 661 * ->atomic_check functions depend upon an updated adjusted_mode.clock to 662 * e.g. properly compute watermarks. 663 * 664 * RETURNS 665 * Zero for success or -errno 666 */ 667 int drm_atomic_helper_check(struct drm_device *dev, 668 struct drm_atomic_state *state) 669 { 670 int ret; 671 672 ret = drm_atomic_helper_check_modeset(dev, state); 673 if (ret) 674 return ret; 675 676 ret = drm_atomic_helper_check_planes(dev, state); 677 if (ret) 678 return ret; 679 680 return ret; 681 } 682 EXPORT_SYMBOL(drm_atomic_helper_check); 683 684 static void 685 disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) 686 { 687 struct drm_connector *connector; 688 struct drm_connector_state *old_conn_state; 689 struct drm_crtc *crtc; 690 struct drm_crtc_state *old_crtc_state; 691 int i; 692 693 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 694 const struct drm_encoder_helper_funcs *funcs; 695 struct drm_encoder *encoder; 696 697 /* Shut down everything that's in the changeset and currently 698 * still on. So need to check the old, saved state. */ 699 if (!old_conn_state->crtc) 700 continue; 701 702 old_crtc_state = drm_atomic_get_existing_crtc_state(old_state, 703 old_conn_state->crtc); 704 705 if (!old_crtc_state->active || 706 !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state)) 707 continue; 708 709 encoder = old_conn_state->best_encoder; 710 711 /* We shouldn't get this far if we didn't previously have 712 * an encoder.. but WARN_ON() rather than explode. 713 */ 714 if (WARN_ON(!encoder)) 715 continue; 716 717 funcs = encoder->helper_private; 718 719 DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n", 720 encoder->base.id, encoder->name); 721 722 /* 723 * Each encoder has at most one connector (since we always steal 724 * it away), so we won't call disable hooks twice. 725 */ 726 drm_bridge_disable(encoder->bridge); 727 728 /* Right function depends upon target state. */ 729 if (funcs) { 730 if (connector->state->crtc && funcs->prepare) 731 funcs->prepare(encoder); 732 else if (funcs->disable) 733 funcs->disable(encoder); 734 else if (funcs->dpms) 735 funcs->dpms(encoder, DRM_MODE_DPMS_OFF); 736 } 737 738 drm_bridge_post_disable(encoder->bridge); 739 } 740 741 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 742 const struct drm_crtc_helper_funcs *funcs; 743 744 /* Shut down everything that needs a full modeset. */ 745 if (!drm_atomic_crtc_needs_modeset(crtc->state)) 746 continue; 747 748 if (!old_crtc_state->active) 749 continue; 750 751 funcs = crtc->helper_private; 752 753 DRM_DEBUG_ATOMIC("disabling [CRTC:%d:%s]\n", 754 crtc->base.id, crtc->name); 755 756 757 /* Right function depends upon target state. */ 758 if (crtc->state->enable && funcs->prepare) 759 funcs->prepare(crtc); 760 else if (funcs->disable) 761 funcs->disable(crtc); 762 else 763 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); 764 } 765 } 766 767 /** 768 * drm_atomic_helper_update_legacy_modeset_state - update legacy modeset state 769 * @dev: DRM device 770 * @old_state: atomic state object with old state structures 771 * 772 * This function updates all the various legacy modeset state pointers in 773 * connectors, encoders and crtcs. It also updates the timestamping constants 774 * used for precise vblank timestamps by calling 775 * drm_calc_timestamping_constants(). 776 * 777 * Drivers can use this for building their own atomic commit if they don't have 778 * a pure helper-based modeset implementation. 779 */ 780 void 781 drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev, 782 struct drm_atomic_state *old_state) 783 { 784 struct drm_connector *connector; 785 struct drm_connector_state *old_conn_state; 786 struct drm_crtc *crtc; 787 struct drm_crtc_state *old_crtc_state; 788 int i; 789 790 /* clear out existing links and update dpms */ 791 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 792 if (connector->encoder) { 793 WARN_ON(!connector->encoder->crtc); 794 795 connector->encoder->crtc = NULL; 796 connector->encoder = NULL; 797 } 798 799 crtc = connector->state->crtc; 800 if ((!crtc && old_conn_state->crtc) || 801 (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) { 802 struct drm_property *dpms_prop = 803 dev->mode_config.dpms_property; 804 int mode = DRM_MODE_DPMS_OFF; 805 806 if (crtc && crtc->state->active) 807 mode = DRM_MODE_DPMS_ON; 808 809 connector->dpms = mode; 810 drm_object_property_set_value(&connector->base, 811 dpms_prop, mode); 812 } 813 } 814 815 /* set new links */ 816 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 817 if (!connector->state->crtc) 818 continue; 819 820 if (WARN_ON(!connector->state->best_encoder)) 821 continue; 822 823 connector->encoder = connector->state->best_encoder; 824 connector->encoder->crtc = connector->state->crtc; 825 } 826 827 /* set legacy state in the crtc structure */ 828 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 829 struct drm_plane *primary = crtc->primary; 830 831 crtc->mode = crtc->state->mode; 832 crtc->enabled = crtc->state->enable; 833 834 if (drm_atomic_get_existing_plane_state(old_state, primary) && 835 primary->state->crtc == crtc) { 836 crtc->x = primary->state->src_x >> 16; 837 crtc->y = primary->state->src_y >> 16; 838 } 839 840 if (crtc->state->enable) 841 drm_calc_timestamping_constants(crtc, 842 &crtc->state->adjusted_mode); 843 } 844 } 845 EXPORT_SYMBOL(drm_atomic_helper_update_legacy_modeset_state); 846 847 static void 848 crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) 849 { 850 struct drm_crtc *crtc; 851 struct drm_crtc_state *old_crtc_state; 852 struct drm_connector *connector; 853 struct drm_connector_state *old_conn_state; 854 int i; 855 856 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 857 const struct drm_crtc_helper_funcs *funcs; 858 859 if (!crtc->state->mode_changed) 860 continue; 861 862 funcs = crtc->helper_private; 863 864 if (crtc->state->enable && funcs->mode_set_nofb) { 865 DRM_DEBUG_ATOMIC("modeset on [CRTC:%d:%s]\n", 866 crtc->base.id, crtc->name); 867 868 funcs->mode_set_nofb(crtc); 869 } 870 } 871 872 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 873 const struct drm_encoder_helper_funcs *funcs; 874 struct drm_crtc_state *new_crtc_state; 875 struct drm_encoder *encoder; 876 struct drm_display_mode *mode, *adjusted_mode; 877 878 if (!connector->state->best_encoder) 879 continue; 880 881 encoder = connector->state->best_encoder; 882 funcs = encoder->helper_private; 883 new_crtc_state = connector->state->crtc->state; 884 mode = &new_crtc_state->mode; 885 adjusted_mode = &new_crtc_state->adjusted_mode; 886 887 if (!new_crtc_state->mode_changed) 888 continue; 889 890 DRM_DEBUG_ATOMIC("modeset on [ENCODER:%d:%s]\n", 891 encoder->base.id, encoder->name); 892 893 /* 894 * Each encoder has at most one connector (since we always steal 895 * it away), so we won't call mode_set hooks twice. 896 */ 897 if (funcs && funcs->mode_set) 898 funcs->mode_set(encoder, mode, adjusted_mode); 899 900 drm_bridge_mode_set(encoder->bridge, mode, adjusted_mode); 901 } 902 } 903 904 /** 905 * drm_atomic_helper_commit_modeset_disables - modeset commit to disable outputs 906 * @dev: DRM device 907 * @old_state: atomic state object with old state structures 908 * 909 * This function shuts down all the outputs that need to be shut down and 910 * prepares them (if required) with the new mode. 911 * 912 * For compatibility with legacy crtc helpers this should be called before 913 * drm_atomic_helper_commit_planes(), which is what the default commit function 914 * does. But drivers with different needs can group the modeset commits together 915 * and do the plane commits at the end. This is useful for drivers doing runtime 916 * PM since planes updates then only happen when the CRTC is actually enabled. 917 */ 918 void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev, 919 struct drm_atomic_state *old_state) 920 { 921 disable_outputs(dev, old_state); 922 923 drm_atomic_helper_update_legacy_modeset_state(dev, old_state); 924 925 crtc_set_mode(dev, old_state); 926 } 927 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_disables); 928 929 /** 930 * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs 931 * @dev: DRM device 932 * @old_state: atomic state object with old state structures 933 * 934 * This function enables all the outputs with the new configuration which had to 935 * be turned off for the update. 936 * 937 * For compatibility with legacy crtc helpers this should be called after 938 * drm_atomic_helper_commit_planes(), which is what the default commit function 939 * does. But drivers with different needs can group the modeset commits together 940 * and do the plane commits at the end. This is useful for drivers doing runtime 941 * PM since planes updates then only happen when the CRTC is actually enabled. 942 */ 943 void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, 944 struct drm_atomic_state *old_state) 945 { 946 struct drm_crtc *crtc; 947 struct drm_crtc_state *old_crtc_state; 948 struct drm_connector *connector; 949 struct drm_connector_state *old_conn_state; 950 int i; 951 952 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 953 const struct drm_crtc_helper_funcs *funcs; 954 955 /* Need to filter out CRTCs where only planes change. */ 956 if (!drm_atomic_crtc_needs_modeset(crtc->state)) 957 continue; 958 959 if (!crtc->state->active) 960 continue; 961 962 funcs = crtc->helper_private; 963 964 if (crtc->state->enable) { 965 DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n", 966 crtc->base.id, crtc->name); 967 968 if (funcs->enable) 969 funcs->enable(crtc); 970 else 971 funcs->commit(crtc); 972 } 973 } 974 975 for_each_connector_in_state(old_state, connector, old_conn_state, i) { 976 const struct drm_encoder_helper_funcs *funcs; 977 struct drm_encoder *encoder; 978 979 if (!connector->state->best_encoder) 980 continue; 981 982 if (!connector->state->crtc->state->active || 983 !drm_atomic_crtc_needs_modeset(connector->state->crtc->state)) 984 continue; 985 986 encoder = connector->state->best_encoder; 987 funcs = encoder->helper_private; 988 989 DRM_DEBUG_ATOMIC("enabling [ENCODER:%d:%s]\n", 990 encoder->base.id, encoder->name); 991 992 /* 993 * Each encoder has at most one connector (since we always steal 994 * it away), so we won't call enable hooks twice. 995 */ 996 drm_bridge_pre_enable(encoder->bridge); 997 998 if (funcs) { 999 if (funcs->enable) 1000 funcs->enable(encoder); 1001 else if (funcs->commit) 1002 funcs->commit(encoder); 1003 } 1004 1005 drm_bridge_enable(encoder->bridge); 1006 } 1007 } 1008 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_enables); 1009 1010 /** 1011 * drm_atomic_helper_wait_for_fences - wait for fences stashed in plane state 1012 * @dev: DRM device 1013 * @state: atomic state object with old state structures 1014 * 1015 * For implicit sync, driver should fish the exclusive fence out from the 1016 * incoming fb's and stash it in the drm_plane_state. This is called after 1017 * drm_atomic_helper_swap_state() so it uses the current plane state (and 1018 * just uses the atomic state to find the changed planes) 1019 */ 1020 void drm_atomic_helper_wait_for_fences(struct drm_device *dev, 1021 struct drm_atomic_state *state) 1022 { 1023 struct drm_plane *plane; 1024 struct drm_plane_state *plane_state; 1025 int i; 1026 1027 for_each_plane_in_state(state, plane, plane_state, i) { 1028 if (!plane->state->fence) 1029 continue; 1030 1031 WARN_ON(!plane->state->fb); 1032 1033 fence_wait(plane->state->fence, false); 1034 fence_put(plane->state->fence); 1035 plane->state->fence = NULL; 1036 } 1037 } 1038 EXPORT_SYMBOL(drm_atomic_helper_wait_for_fences); 1039 1040 /** 1041 * drm_atomic_helper_framebuffer_changed - check if framebuffer has changed 1042 * @dev: DRM device 1043 * @old_state: atomic state object with old state structures 1044 * @crtc: DRM crtc 1045 * 1046 * Checks whether the framebuffer used for this CRTC changes as a result of 1047 * the atomic update. This is useful for drivers which cannot use 1048 * drm_atomic_helper_wait_for_vblanks() and need to reimplement its 1049 * functionality. 1050 * 1051 * Returns: 1052 * true if the framebuffer changed. 1053 */ 1054 bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev, 1055 struct drm_atomic_state *old_state, 1056 struct drm_crtc *crtc) 1057 { 1058 struct drm_plane *plane; 1059 struct drm_plane_state *old_plane_state; 1060 int i; 1061 1062 for_each_plane_in_state(old_state, plane, old_plane_state, i) { 1063 if (plane->state->crtc != crtc && 1064 old_plane_state->crtc != crtc) 1065 continue; 1066 1067 if (plane->state->fb != old_plane_state->fb) 1068 return true; 1069 } 1070 1071 return false; 1072 } 1073 EXPORT_SYMBOL(drm_atomic_helper_framebuffer_changed); 1074 1075 /** 1076 * drm_atomic_helper_wait_for_vblanks - wait for vblank on crtcs 1077 * @dev: DRM device 1078 * @old_state: atomic state object with old state structures 1079 * 1080 * Helper to, after atomic commit, wait for vblanks on all effected 1081 * crtcs (ie. before cleaning up old framebuffers using 1082 * drm_atomic_helper_cleanup_planes()). It will only wait on crtcs where the 1083 * framebuffers have actually changed to optimize for the legacy cursor and 1084 * plane update use-case. 1085 */ 1086 void 1087 drm_atomic_helper_wait_for_vblanks(struct drm_device *dev, 1088 struct drm_atomic_state *old_state) 1089 { 1090 struct drm_crtc *crtc; 1091 struct drm_crtc_state *old_crtc_state; 1092 int i, ret; 1093 1094 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 1095 /* No one cares about the old state, so abuse it for tracking 1096 * and store whether we hold a vblank reference (and should do a 1097 * vblank wait) in the ->enable boolean. */ 1098 old_crtc_state->enable = false; 1099 1100 if (!crtc->state->enable) 1101 continue; 1102 1103 /* Legacy cursor ioctls are completely unsynced, and userspace 1104 * relies on that (by doing tons of cursor updates). */ 1105 if (old_state->legacy_cursor_update) 1106 continue; 1107 1108 if (!drm_atomic_helper_framebuffer_changed(dev, 1109 old_state, crtc)) 1110 continue; 1111 1112 ret = drm_crtc_vblank_get(crtc); 1113 if (ret != 0) 1114 continue; 1115 1116 old_crtc_state->enable = true; 1117 old_crtc_state->last_vblank_count = drm_crtc_vblank_count(crtc); 1118 } 1119 1120 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 1121 if (!old_crtc_state->enable) 1122 continue; 1123 1124 ret = wait_event_timeout(dev->vblank[i].queue, 1125 old_crtc_state->last_vblank_count != 1126 drm_crtc_vblank_count(crtc), 1127 msecs_to_jiffies(50)); 1128 1129 WARN(!ret, "[CRTC:%d] vblank wait timed out\n", crtc->base.id); 1130 1131 drm_crtc_vblank_put(crtc); 1132 } 1133 } 1134 EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks); 1135 1136 /** 1137 * drm_atomic_helper_commit - commit validated state object 1138 * @dev: DRM device 1139 * @state: the driver state object 1140 * @nonblocking: whether nonblocking behavior is requested. 1141 * 1142 * This function commits a with drm_atomic_helper_check() pre-validated state 1143 * object. This can still fail when e.g. the framebuffer reservation fails. For 1144 * now this doesn't implement nonblocking commits. 1145 * 1146 * Note that right now this function does not support nonblocking commits, hence 1147 * driver writers must implement their own version for now. Also note that the 1148 * default ordering of how the various stages are called is to match the legacy 1149 * modeset helper library closest. One peculiarity of that is that it doesn't 1150 * mesh well with runtime PM at all. 1151 * 1152 * For drivers supporting runtime PM the recommended sequence is 1153 * 1154 * drm_atomic_helper_commit_modeset_disables(dev, state); 1155 * 1156 * drm_atomic_helper_commit_modeset_enables(dev, state); 1157 * 1158 * drm_atomic_helper_commit_planes(dev, state, true); 1159 * 1160 * See the kerneldoc entries for these three functions for more details. 1161 * 1162 * RETURNS 1163 * Zero for success or -errno. 1164 */ 1165 int drm_atomic_helper_commit(struct drm_device *dev, 1166 struct drm_atomic_state *state, 1167 bool nonblock) 1168 { 1169 int ret; 1170 1171 if (nonblock) 1172 return -EBUSY; 1173 1174 ret = drm_atomic_helper_prepare_planes(dev, state); 1175 if (ret) 1176 return ret; 1177 1178 /* 1179 * This is the point of no return - everything below never fails except 1180 * when the hw goes bonghits. Which means we can commit the new state on 1181 * the software side now. 1182 */ 1183 1184 drm_atomic_helper_swap_state(dev, state); 1185 1186 /* 1187 * Everything below can be run asynchronously without the need to grab 1188 * any modeset locks at all under one condition: It must be guaranteed 1189 * that the asynchronous work has either been cancelled (if the driver 1190 * supports it, which at least requires that the framebuffers get 1191 * cleaned up with drm_atomic_helper_cleanup_planes()) or completed 1192 * before the new state gets committed on the software side with 1193 * drm_atomic_helper_swap_state(). 1194 * 1195 * This scheme allows new atomic state updates to be prepared and 1196 * checked in parallel to the asynchronous completion of the previous 1197 * update. Which is important since compositors need to figure out the 1198 * composition of the next frame right after having submitted the 1199 * current layout. 1200 */ 1201 1202 drm_atomic_helper_wait_for_fences(dev, state); 1203 1204 drm_atomic_helper_commit_modeset_disables(dev, state); 1205 1206 drm_atomic_helper_commit_planes(dev, state, false); 1207 1208 drm_atomic_helper_commit_modeset_enables(dev, state); 1209 1210 drm_atomic_helper_wait_for_vblanks(dev, state); 1211 1212 drm_atomic_helper_cleanup_planes(dev, state); 1213 1214 drm_atomic_state_free(state); 1215 1216 return 0; 1217 } 1218 EXPORT_SYMBOL(drm_atomic_helper_commit); 1219 1220 /** 1221 * DOC: implementing nonblocking commit 1222 * 1223 * For now the atomic helpers don't support nonblocking commit directly. If 1224 * there is real need it could be added though, using the dma-buf fence 1225 * infrastructure for generic synchronization with outstanding rendering. 1226 * 1227 * For now drivers have to implement nonblocking commit themselves, with the 1228 * following sequence being the recommended one: 1229 * 1230 * 1. Run drm_atomic_helper_prepare_planes() first. This is the only function 1231 * which commit needs to call which can fail, so we want to run it first and 1232 * synchronously. 1233 * 1234 * 2. Synchronize with any outstanding nonblocking commit worker threads which 1235 * might be affected the new state update. This can be done by either cancelling 1236 * or flushing the work items, depending upon whether the driver can deal with 1237 * cancelled updates. Note that it is important to ensure that the framebuffer 1238 * cleanup is still done when cancelling. 1239 * 1240 * For sufficient parallelism it is recommended to have a work item per crtc 1241 * (for updates which don't touch global state) and a global one. Then we only 1242 * need to synchronize with the crtc work items for changed crtcs and the global 1243 * work item, which allows nice concurrent updates on disjoint sets of crtcs. 1244 * 1245 * 3. The software state is updated synchronously with 1246 * drm_atomic_helper_swap_state(). Doing this under the protection of all modeset 1247 * locks means concurrent callers never see inconsistent state. And doing this 1248 * while it's guaranteed that no relevant nonblocking worker runs means that 1249 * nonblocking workers do not need grab any locks. Actually they must not grab 1250 * locks, for otherwise the work flushing will deadlock. 1251 * 1252 * 4. Schedule a work item to do all subsequent steps, using the split-out 1253 * commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and 1254 * then cleaning up the framebuffers after the old framebuffer is no longer 1255 * being displayed. 1256 */ 1257 1258 /** 1259 * drm_atomic_helper_prepare_planes - prepare plane resources before commit 1260 * @dev: DRM device 1261 * @state: atomic state object with new state structures 1262 * 1263 * This function prepares plane state, specifically framebuffers, for the new 1264 * configuration. If any failure is encountered this function will call 1265 * ->cleanup_fb on any already successfully prepared framebuffer. 1266 * 1267 * Returns: 1268 * 0 on success, negative error code on failure. 1269 */ 1270 int drm_atomic_helper_prepare_planes(struct drm_device *dev, 1271 struct drm_atomic_state *state) 1272 { 1273 int nplanes = dev->mode_config.num_total_plane; 1274 int ret, i; 1275 1276 for (i = 0; i < nplanes; i++) { 1277 const struct drm_plane_helper_funcs *funcs; 1278 struct drm_plane *plane = state->planes[i]; 1279 struct drm_plane_state *plane_state = state->plane_states[i]; 1280 1281 if (!plane) 1282 continue; 1283 1284 funcs = plane->helper_private; 1285 1286 if (funcs->prepare_fb) { 1287 ret = funcs->prepare_fb(plane, plane_state); 1288 if (ret) 1289 goto fail; 1290 } 1291 } 1292 1293 return 0; 1294 1295 fail: 1296 for (i--; i >= 0; i--) { 1297 const struct drm_plane_helper_funcs *funcs; 1298 struct drm_plane *plane = state->planes[i]; 1299 struct drm_plane_state *plane_state = state->plane_states[i]; 1300 1301 if (!plane) 1302 continue; 1303 1304 funcs = plane->helper_private; 1305 1306 if (funcs->cleanup_fb) 1307 funcs->cleanup_fb(plane, plane_state); 1308 1309 } 1310 1311 return ret; 1312 } 1313 EXPORT_SYMBOL(drm_atomic_helper_prepare_planes); 1314 1315 bool plane_crtc_active(struct drm_plane_state *state) 1316 { 1317 return state->crtc && state->crtc->state->active; 1318 } 1319 1320 /** 1321 * drm_atomic_helper_commit_planes - commit plane state 1322 * @dev: DRM device 1323 * @old_state: atomic state object with old state structures 1324 * @active_only: Only commit on active CRTC if set 1325 * 1326 * This function commits the new plane state using the plane and atomic helper 1327 * functions for planes and crtcs. It assumes that the atomic state has already 1328 * been pushed into the relevant object state pointers, since this step can no 1329 * longer fail. 1330 * 1331 * It still requires the global state object @old_state to know which planes and 1332 * crtcs need to be updated though. 1333 * 1334 * Note that this function does all plane updates across all CRTCs in one step. 1335 * If the hardware can't support this approach look at 1336 * drm_atomic_helper_commit_planes_on_crtc() instead. 1337 * 1338 * Plane parameters can be updated by applications while the associated CRTC is 1339 * disabled. The DRM/KMS core will store the parameters in the plane state, 1340 * which will be available to the driver when the CRTC is turned on. As a result 1341 * most drivers don't need to be immediately notified of plane updates for a 1342 * disabled CRTC. 1343 * 1344 * Unless otherwise needed, drivers are advised to set the @active_only 1345 * parameters to true in order not to receive plane update notifications related 1346 * to a disabled CRTC. This avoids the need to manually ignore plane updates in 1347 * driver code when the driver and/or hardware can't or just don't need to deal 1348 * with updates on disabled CRTCs, for example when supporting runtime PM. 1349 * 1350 * The drm_atomic_helper_commit() default implementation only sets @active_only 1351 * to false to most closely match the behaviour of the legacy helpers. This should 1352 * not be copied blindly by drivers. 1353 */ 1354 void drm_atomic_helper_commit_planes(struct drm_device *dev, 1355 struct drm_atomic_state *old_state, 1356 bool active_only) 1357 { 1358 struct drm_crtc *crtc; 1359 struct drm_crtc_state *old_crtc_state; 1360 struct drm_plane *plane; 1361 struct drm_plane_state *old_plane_state; 1362 int i; 1363 1364 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 1365 const struct drm_crtc_helper_funcs *funcs; 1366 1367 funcs = crtc->helper_private; 1368 1369 if (!funcs || !funcs->atomic_begin) 1370 continue; 1371 1372 if (active_only && !crtc->state->active) 1373 continue; 1374 1375 funcs->atomic_begin(crtc, old_crtc_state); 1376 } 1377 1378 for_each_plane_in_state(old_state, plane, old_plane_state, i) { 1379 const struct drm_plane_helper_funcs *funcs; 1380 bool disabling; 1381 1382 funcs = plane->helper_private; 1383 1384 if (!funcs) 1385 continue; 1386 1387 disabling = drm_atomic_plane_disabling(plane, old_plane_state); 1388 1389 if (active_only) { 1390 /* 1391 * Skip planes related to inactive CRTCs. If the plane 1392 * is enabled use the state of the current CRTC. If the 1393 * plane is being disabled use the state of the old 1394 * CRTC to avoid skipping planes being disabled on an 1395 * active CRTC. 1396 */ 1397 if (!disabling && !plane_crtc_active(plane->state)) 1398 continue; 1399 if (disabling && !plane_crtc_active(old_plane_state)) 1400 continue; 1401 } 1402 1403 /* 1404 * Special-case disabling the plane if drivers support it. 1405 */ 1406 if (disabling && funcs->atomic_disable) 1407 funcs->atomic_disable(plane, old_plane_state); 1408 else if (plane->state->crtc || disabling) 1409 funcs->atomic_update(plane, old_plane_state); 1410 } 1411 1412 for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) { 1413 const struct drm_crtc_helper_funcs *funcs; 1414 1415 funcs = crtc->helper_private; 1416 1417 if (!funcs || !funcs->atomic_flush) 1418 continue; 1419 1420 if (active_only && !crtc->state->active) 1421 continue; 1422 1423 funcs->atomic_flush(crtc, old_crtc_state); 1424 } 1425 } 1426 EXPORT_SYMBOL(drm_atomic_helper_commit_planes); 1427 1428 /** 1429 * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a crtc 1430 * @old_crtc_state: atomic state object with the old crtc state 1431 * 1432 * This function commits the new plane state using the plane and atomic helper 1433 * functions for planes on the specific crtc. It assumes that the atomic state 1434 * has already been pushed into the relevant object state pointers, since this 1435 * step can no longer fail. 1436 * 1437 * This function is useful when plane updates should be done crtc-by-crtc 1438 * instead of one global step like drm_atomic_helper_commit_planes() does. 1439 * 1440 * This function can only be savely used when planes are not allowed to move 1441 * between different CRTCs because this function doesn't handle inter-CRTC 1442 * depencies. Callers need to ensure that either no such depencies exist, 1443 * resolve them through ordering of commit calls or through some other means. 1444 */ 1445 void 1446 drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state) 1447 { 1448 const struct drm_crtc_helper_funcs *crtc_funcs; 1449 struct drm_crtc *crtc = old_crtc_state->crtc; 1450 struct drm_atomic_state *old_state = old_crtc_state->state; 1451 struct drm_plane *plane; 1452 unsigned plane_mask; 1453 1454 plane_mask = old_crtc_state->plane_mask; 1455 plane_mask |= crtc->state->plane_mask; 1456 1457 crtc_funcs = crtc->helper_private; 1458 if (crtc_funcs && crtc_funcs->atomic_begin) 1459 crtc_funcs->atomic_begin(crtc, old_crtc_state); 1460 1461 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { 1462 struct drm_plane_state *old_plane_state = 1463 drm_atomic_get_existing_plane_state(old_state, plane); 1464 const struct drm_plane_helper_funcs *plane_funcs; 1465 1466 plane_funcs = plane->helper_private; 1467 1468 if (!old_plane_state || !plane_funcs) 1469 continue; 1470 1471 WARN_ON(plane->state->crtc && plane->state->crtc != crtc); 1472 1473 if (drm_atomic_plane_disabling(plane, old_plane_state) && 1474 plane_funcs->atomic_disable) 1475 plane_funcs->atomic_disable(plane, old_plane_state); 1476 else if (plane->state->crtc || 1477 drm_atomic_plane_disabling(plane, old_plane_state)) 1478 plane_funcs->atomic_update(plane, old_plane_state); 1479 } 1480 1481 if (crtc_funcs && crtc_funcs->atomic_flush) 1482 crtc_funcs->atomic_flush(crtc, old_crtc_state); 1483 } 1484 EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc); 1485 1486 /** 1487 * drm_atomic_helper_disable_planes_on_crtc - helper to disable CRTC's planes 1488 * @crtc: CRTC 1489 * @atomic: if set, synchronize with CRTC's atomic_begin/flush hooks 1490 * 1491 * Disables all planes associated with the given CRTC. This can be 1492 * used for instance in the CRTC helper disable callback to disable 1493 * all planes before shutting down the display pipeline. 1494 * 1495 * If the atomic-parameter is set the function calls the CRTC's 1496 * atomic_begin hook before and atomic_flush hook after disabling the 1497 * planes. 1498 * 1499 * It is a bug to call this function without having implemented the 1500 * ->atomic_disable() plane hook. 1501 */ 1502 void drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc *crtc, 1503 bool atomic) 1504 { 1505 const struct drm_crtc_helper_funcs *crtc_funcs = 1506 crtc->helper_private; 1507 struct drm_plane *plane; 1508 1509 if (atomic && crtc_funcs && crtc_funcs->atomic_begin) 1510 crtc_funcs->atomic_begin(crtc, NULL); 1511 1512 drm_for_each_plane(plane, crtc->dev) { 1513 const struct drm_plane_helper_funcs *plane_funcs = 1514 plane->helper_private; 1515 1516 if (plane->state->crtc != crtc || !plane_funcs) 1517 continue; 1518 1519 WARN_ON(!plane_funcs->atomic_disable); 1520 if (plane_funcs->atomic_disable) 1521 plane_funcs->atomic_disable(plane, NULL); 1522 } 1523 1524 if (atomic && crtc_funcs && crtc_funcs->atomic_flush) 1525 crtc_funcs->atomic_flush(crtc, NULL); 1526 } 1527 EXPORT_SYMBOL(drm_atomic_helper_disable_planes_on_crtc); 1528 1529 /** 1530 * drm_atomic_helper_cleanup_planes - cleanup plane resources after commit 1531 * @dev: DRM device 1532 * @old_state: atomic state object with old state structures 1533 * 1534 * This function cleans up plane state, specifically framebuffers, from the old 1535 * configuration. Hence the old configuration must be perserved in @old_state to 1536 * be able to call this function. 1537 * 1538 * This function must also be called on the new state when the atomic update 1539 * fails at any point after calling drm_atomic_helper_prepare_planes(). 1540 */ 1541 void drm_atomic_helper_cleanup_planes(struct drm_device *dev, 1542 struct drm_atomic_state *old_state) 1543 { 1544 struct drm_plane *plane; 1545 struct drm_plane_state *plane_state; 1546 int i; 1547 1548 for_each_plane_in_state(old_state, plane, plane_state, i) { 1549 const struct drm_plane_helper_funcs *funcs; 1550 1551 funcs = plane->helper_private; 1552 1553 if (funcs->cleanup_fb) 1554 funcs->cleanup_fb(plane, plane_state); 1555 } 1556 } 1557 EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); 1558 1559 /** 1560 * drm_atomic_helper_swap_state - store atomic state into current sw state 1561 * @dev: DRM device 1562 * @state: atomic state 1563 * 1564 * This function stores the atomic state into the current state pointers in all 1565 * driver objects. It should be called after all failing steps have been done 1566 * and succeeded, but before the actual hardware state is committed. 1567 * 1568 * For cleanup and error recovery the current state for all changed objects will 1569 * be swaped into @state. 1570 * 1571 * With that sequence it fits perfectly into the plane prepare/cleanup sequence: 1572 * 1573 * 1. Call drm_atomic_helper_prepare_planes() with the staged atomic state. 1574 * 1575 * 2. Do any other steps that might fail. 1576 * 1577 * 3. Put the staged state into the current state pointers with this function. 1578 * 1579 * 4. Actually commit the hardware state. 1580 * 1581 * 5. Call drm_atomic_helper_cleanup_planes() with @state, which since step 3 1582 * contains the old state. Also do any other cleanup required with that state. 1583 */ 1584 void drm_atomic_helper_swap_state(struct drm_device *dev, 1585 struct drm_atomic_state *state) 1586 { 1587 int i; 1588 1589 for (i = 0; i < state->num_connector; i++) { 1590 struct drm_connector *connector = state->connectors[i]; 1591 1592 if (!connector) 1593 continue; 1594 1595 connector->state->state = state; 1596 swap(state->connector_states[i], connector->state); 1597 connector->state->state = NULL; 1598 } 1599 1600 for (i = 0; i < dev->mode_config.num_crtc; i++) { 1601 struct drm_crtc *crtc = state->crtcs[i]; 1602 1603 if (!crtc) 1604 continue; 1605 1606 crtc->state->state = state; 1607 swap(state->crtc_states[i], crtc->state); 1608 crtc->state->state = NULL; 1609 } 1610 1611 for (i = 0; i < dev->mode_config.num_total_plane; i++) { 1612 struct drm_plane *plane = state->planes[i]; 1613 1614 if (!plane) 1615 continue; 1616 1617 plane->state->state = state; 1618 swap(state->plane_states[i], plane->state); 1619 plane->state->state = NULL; 1620 } 1621 } 1622 EXPORT_SYMBOL(drm_atomic_helper_swap_state); 1623 1624 /** 1625 * drm_atomic_helper_update_plane - Helper for primary plane update using atomic 1626 * @plane: plane object to update 1627 * @crtc: owning CRTC of owning plane 1628 * @fb: framebuffer to flip onto plane 1629 * @crtc_x: x offset of primary plane on crtc 1630 * @crtc_y: y offset of primary plane on crtc 1631 * @crtc_w: width of primary plane rectangle on crtc 1632 * @crtc_h: height of primary plane rectangle on crtc 1633 * @src_x: x offset of @fb for panning 1634 * @src_y: y offset of @fb for panning 1635 * @src_w: width of source rectangle in @fb 1636 * @src_h: height of source rectangle in @fb 1637 * 1638 * Provides a default plane update handler using the atomic driver interface. 1639 * 1640 * RETURNS: 1641 * Zero on success, error code on failure 1642 */ 1643 int drm_atomic_helper_update_plane(struct drm_plane *plane, 1644 struct drm_crtc *crtc, 1645 struct drm_framebuffer *fb, 1646 int crtc_x, int crtc_y, 1647 unsigned int crtc_w, unsigned int crtc_h, 1648 uint32_t src_x, uint32_t src_y, 1649 uint32_t src_w, uint32_t src_h) 1650 { 1651 struct drm_atomic_state *state; 1652 struct drm_plane_state *plane_state; 1653 int ret = 0; 1654 1655 state = drm_atomic_state_alloc(plane->dev); 1656 if (!state) 1657 return -ENOMEM; 1658 1659 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); 1660 retry: 1661 plane_state = drm_atomic_get_plane_state(state, plane); 1662 if (IS_ERR(plane_state)) { 1663 ret = PTR_ERR(plane_state); 1664 goto fail; 1665 } 1666 1667 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); 1668 if (ret != 0) 1669 goto fail; 1670 drm_atomic_set_fb_for_plane(plane_state, fb); 1671 plane_state->crtc_x = crtc_x; 1672 plane_state->crtc_y = crtc_y; 1673 plane_state->crtc_w = crtc_w; 1674 plane_state->crtc_h = crtc_h; 1675 plane_state->src_x = src_x; 1676 plane_state->src_y = src_y; 1677 plane_state->src_w = src_w; 1678 plane_state->src_h = src_h; 1679 1680 if (plane == crtc->cursor) 1681 state->legacy_cursor_update = true; 1682 1683 ret = drm_atomic_commit(state); 1684 if (ret != 0) 1685 goto fail; 1686 1687 /* Driver takes ownership of state on successful commit. */ 1688 return 0; 1689 fail: 1690 if (ret == -EDEADLK) 1691 goto backoff; 1692 1693 drm_atomic_state_free(state); 1694 1695 return ret; 1696 backoff: 1697 drm_atomic_state_clear(state); 1698 drm_atomic_legacy_backoff(state); 1699 1700 /* 1701 * Someone might have exchanged the framebuffer while we dropped locks 1702 * in the backoff code. We need to fix up the fb refcount tracking the 1703 * core does for us. 1704 */ 1705 plane->old_fb = plane->fb; 1706 1707 goto retry; 1708 } 1709 EXPORT_SYMBOL(drm_atomic_helper_update_plane); 1710 1711 /** 1712 * drm_atomic_helper_disable_plane - Helper for primary plane disable using * atomic 1713 * @plane: plane to disable 1714 * 1715 * Provides a default plane disable handler using the atomic driver interface. 1716 * 1717 * RETURNS: 1718 * Zero on success, error code on failure 1719 */ 1720 int drm_atomic_helper_disable_plane(struct drm_plane *plane) 1721 { 1722 struct drm_atomic_state *state; 1723 struct drm_plane_state *plane_state; 1724 int ret = 0; 1725 1726 /* 1727 * FIXME: Without plane->crtc set we can't get at the implicit legacy 1728 * acquire context. The real fix will be to wire the acquire ctx through 1729 * everywhere we need it, but meanwhile prevent chaos by just skipping 1730 * this noop. The critical case is the cursor ioctls which a) only grab 1731 * crtc/cursor-plane locks (so we need the crtc to get at the right 1732 * acquire context) and b) can try to disable the plane multiple times. 1733 */ 1734 if (!plane->crtc) 1735 return 0; 1736 1737 state = drm_atomic_state_alloc(plane->dev); 1738 if (!state) 1739 return -ENOMEM; 1740 1741 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(plane->crtc); 1742 retry: 1743 plane_state = drm_atomic_get_plane_state(state, plane); 1744 if (IS_ERR(plane_state)) { 1745 ret = PTR_ERR(plane_state); 1746 goto fail; 1747 } 1748 1749 if (plane_state->crtc && (plane == plane->crtc->cursor)) 1750 plane_state->state->legacy_cursor_update = true; 1751 1752 ret = __drm_atomic_helper_disable_plane(plane, plane_state); 1753 if (ret != 0) 1754 goto fail; 1755 1756 ret = drm_atomic_commit(state); 1757 if (ret != 0) 1758 goto fail; 1759 1760 /* Driver takes ownership of state on successful commit. */ 1761 return 0; 1762 fail: 1763 if (ret == -EDEADLK) 1764 goto backoff; 1765 1766 drm_atomic_state_free(state); 1767 1768 return ret; 1769 backoff: 1770 drm_atomic_state_clear(state); 1771 drm_atomic_legacy_backoff(state); 1772 1773 /* 1774 * Someone might have exchanged the framebuffer while we dropped locks 1775 * in the backoff code. We need to fix up the fb refcount tracking the 1776 * core does for us. 1777 */ 1778 plane->old_fb = plane->fb; 1779 1780 goto retry; 1781 } 1782 EXPORT_SYMBOL(drm_atomic_helper_disable_plane); 1783 1784 /* just used from fb-helper and atomic-helper: */ 1785 int __drm_atomic_helper_disable_plane(struct drm_plane *plane, 1786 struct drm_plane_state *plane_state) 1787 { 1788 int ret; 1789 1790 ret = drm_atomic_set_crtc_for_plane(plane_state, NULL); 1791 if (ret != 0) 1792 return ret; 1793 1794 drm_atomic_set_fb_for_plane(plane_state, NULL); 1795 plane_state->crtc_x = 0; 1796 plane_state->crtc_y = 0; 1797 plane_state->crtc_w = 0; 1798 plane_state->crtc_h = 0; 1799 plane_state->src_x = 0; 1800 plane_state->src_y = 0; 1801 plane_state->src_w = 0; 1802 plane_state->src_h = 0; 1803 1804 return 0; 1805 } 1806 1807 static int update_output_state(struct drm_atomic_state *state, 1808 struct drm_mode_set *set) 1809 { 1810 struct drm_device *dev = set->crtc->dev; 1811 struct drm_crtc *crtc; 1812 struct drm_crtc_state *crtc_state; 1813 struct drm_connector *connector; 1814 struct drm_connector_state *conn_state; 1815 int ret, i; 1816 1817 ret = drm_modeset_lock(&dev->mode_config.connection_mutex, 1818 state->acquire_ctx); 1819 if (ret) 1820 return ret; 1821 1822 /* First disable all connectors on the target crtc. */ 1823 ret = drm_atomic_add_affected_connectors(state, set->crtc); 1824 if (ret) 1825 return ret; 1826 1827 for_each_connector_in_state(state, connector, conn_state, i) { 1828 if (conn_state->crtc == set->crtc) { 1829 ret = drm_atomic_set_crtc_for_connector(conn_state, 1830 NULL); 1831 if (ret) 1832 return ret; 1833 } 1834 } 1835 1836 /* Then set all connectors from set->connectors on the target crtc */ 1837 for (i = 0; i < set->num_connectors; i++) { 1838 conn_state = drm_atomic_get_connector_state(state, 1839 set->connectors[i]); 1840 if (IS_ERR(conn_state)) 1841 return PTR_ERR(conn_state); 1842 1843 ret = drm_atomic_set_crtc_for_connector(conn_state, 1844 set->crtc); 1845 if (ret) 1846 return ret; 1847 } 1848 1849 for_each_crtc_in_state(state, crtc, crtc_state, i) { 1850 /* Don't update ->enable for the CRTC in the set_config request, 1851 * since a mismatch would indicate a bug in the upper layers. 1852 * The actual modeset code later on will catch any 1853 * inconsistencies here. */ 1854 if (crtc == set->crtc) 1855 continue; 1856 1857 if (!crtc_state->connector_mask) { 1858 ret = drm_atomic_set_mode_prop_for_crtc(crtc_state, 1859 NULL); 1860 if (ret < 0) 1861 return ret; 1862 1863 crtc_state->active = false; 1864 } 1865 } 1866 1867 return 0; 1868 } 1869 1870 /** 1871 * drm_atomic_helper_set_config - set a new config from userspace 1872 * @set: mode set configuration 1873 * 1874 * Provides a default crtc set_config handler using the atomic driver interface. 1875 * 1876 * Returns: 1877 * Returns 0 on success, negative errno numbers on failure. 1878 */ 1879 int drm_atomic_helper_set_config(struct drm_mode_set *set) 1880 { 1881 struct drm_atomic_state *state; 1882 struct drm_crtc *crtc = set->crtc; 1883 int ret = 0; 1884 1885 state = drm_atomic_state_alloc(crtc->dev); 1886 if (!state) 1887 return -ENOMEM; 1888 1889 state->legacy_set_config = true; 1890 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); 1891 retry: 1892 ret = __drm_atomic_helper_set_config(set, state); 1893 if (ret != 0) 1894 goto fail; 1895 1896 ret = drm_atomic_commit(state); 1897 if (ret != 0) 1898 goto fail; 1899 1900 /* Driver takes ownership of state on successful commit. */ 1901 return 0; 1902 fail: 1903 if (ret == -EDEADLK) 1904 goto backoff; 1905 1906 drm_atomic_state_free(state); 1907 1908 return ret; 1909 backoff: 1910 drm_atomic_state_clear(state); 1911 drm_atomic_legacy_backoff(state); 1912 1913 /* 1914 * Someone might have exchanged the framebuffer while we dropped locks 1915 * in the backoff code. We need to fix up the fb refcount tracking the 1916 * core does for us. 1917 */ 1918 crtc->primary->old_fb = crtc->primary->fb; 1919 1920 goto retry; 1921 } 1922 EXPORT_SYMBOL(drm_atomic_helper_set_config); 1923 1924 /* just used from fb-helper and atomic-helper: */ 1925 int __drm_atomic_helper_set_config(struct drm_mode_set *set, 1926 struct drm_atomic_state *state) 1927 { 1928 struct drm_crtc_state *crtc_state; 1929 struct drm_plane_state *primary_state; 1930 struct drm_crtc *crtc = set->crtc; 1931 int hdisplay, vdisplay; 1932 int ret; 1933 1934 crtc_state = drm_atomic_get_crtc_state(state, crtc); 1935 if (IS_ERR(crtc_state)) 1936 return PTR_ERR(crtc_state); 1937 1938 primary_state = drm_atomic_get_plane_state(state, crtc->primary); 1939 if (IS_ERR(primary_state)) 1940 return PTR_ERR(primary_state); 1941 1942 if (!set->mode) { 1943 WARN_ON(set->fb); 1944 WARN_ON(set->num_connectors); 1945 1946 ret = drm_atomic_set_mode_for_crtc(crtc_state, NULL); 1947 if (ret != 0) 1948 return ret; 1949 1950 crtc_state->active = false; 1951 1952 ret = drm_atomic_set_crtc_for_plane(primary_state, NULL); 1953 if (ret != 0) 1954 return ret; 1955 1956 drm_atomic_set_fb_for_plane(primary_state, NULL); 1957 1958 goto commit; 1959 } 1960 1961 WARN_ON(!set->fb); 1962 WARN_ON(!set->num_connectors); 1963 1964 ret = drm_atomic_set_mode_for_crtc(crtc_state, set->mode); 1965 if (ret != 0) 1966 return ret; 1967 1968 crtc_state->active = true; 1969 1970 ret = drm_atomic_set_crtc_for_plane(primary_state, crtc); 1971 if (ret != 0) 1972 return ret; 1973 1974 drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay); 1975 1976 drm_atomic_set_fb_for_plane(primary_state, set->fb); 1977 primary_state->crtc_x = 0; 1978 primary_state->crtc_y = 0; 1979 primary_state->crtc_w = hdisplay; 1980 primary_state->crtc_h = vdisplay; 1981 primary_state->src_x = set->x << 16; 1982 primary_state->src_y = set->y << 16; 1983 if (primary_state->rotation & (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270))) { 1984 primary_state->src_w = vdisplay << 16; 1985 primary_state->src_h = hdisplay << 16; 1986 } else { 1987 primary_state->src_w = hdisplay << 16; 1988 primary_state->src_h = vdisplay << 16; 1989 } 1990 1991 commit: 1992 ret = update_output_state(state, set); 1993 if (ret) 1994 return ret; 1995 1996 return 0; 1997 } 1998 1999 /** 2000 * drm_atomic_helper_disable_all - disable all currently active outputs 2001 * @dev: DRM device 2002 * @ctx: lock acquisition context 2003 * 2004 * Loops through all connectors, finding those that aren't turned off and then 2005 * turns them off by setting their DPMS mode to OFF and deactivating the CRTC 2006 * that they are connected to. 2007 * 2008 * This is used for example in suspend/resume to disable all currently active 2009 * functions when suspending. 2010 * 2011 * Note that if callers haven't already acquired all modeset locks this might 2012 * return -EDEADLK, which must be handled by calling drm_modeset_backoff(). 2013 * 2014 * Returns: 2015 * 0 on success or a negative error code on failure. 2016 * 2017 * See also: 2018 * drm_atomic_helper_suspend(), drm_atomic_helper_resume() 2019 */ 2020 int drm_atomic_helper_disable_all(struct drm_device *dev, 2021 struct drm_modeset_acquire_ctx *ctx) 2022 { 2023 struct drm_atomic_state *state; 2024 struct drm_connector *conn; 2025 int err; 2026 2027 state = drm_atomic_state_alloc(dev); 2028 if (!state) 2029 return -ENOMEM; 2030 2031 state->acquire_ctx = ctx; 2032 2033 drm_for_each_connector(conn, dev) { 2034 struct drm_crtc *crtc = conn->state->crtc; 2035 struct drm_crtc_state *crtc_state; 2036 2037 if (!crtc || conn->dpms != DRM_MODE_DPMS_ON) 2038 continue; 2039 2040 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2041 if (IS_ERR(crtc_state)) { 2042 err = PTR_ERR(crtc_state); 2043 goto free; 2044 } 2045 2046 crtc_state->active = false; 2047 } 2048 2049 err = drm_atomic_commit(state); 2050 2051 free: 2052 if (err < 0) 2053 drm_atomic_state_free(state); 2054 2055 return err; 2056 } 2057 EXPORT_SYMBOL(drm_atomic_helper_disable_all); 2058 2059 /** 2060 * drm_atomic_helper_suspend - subsystem-level suspend helper 2061 * @dev: DRM device 2062 * 2063 * Duplicates the current atomic state, disables all active outputs and then 2064 * returns a pointer to the original atomic state to the caller. Drivers can 2065 * pass this pointer to the drm_atomic_helper_resume() helper upon resume to 2066 * restore the output configuration that was active at the time the system 2067 * entered suspend. 2068 * 2069 * Note that it is potentially unsafe to use this. The atomic state object 2070 * returned by this function is assumed to be persistent. Drivers must ensure 2071 * that this holds true. Before calling this function, drivers must make sure 2072 * to suspend fbdev emulation so that nothing can be using the device. 2073 * 2074 * Returns: 2075 * A pointer to a copy of the state before suspend on success or an ERR_PTR()- 2076 * encoded error code on failure. Drivers should store the returned atomic 2077 * state object and pass it to the drm_atomic_helper_resume() helper upon 2078 * resume. 2079 * 2080 * See also: 2081 * drm_atomic_helper_duplicate_state(), drm_atomic_helper_disable_all(), 2082 * drm_atomic_helper_resume() 2083 */ 2084 struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev) 2085 { 2086 struct drm_modeset_acquire_ctx ctx; 2087 struct drm_atomic_state *state; 2088 int err; 2089 2090 drm_modeset_acquire_init(&ctx, 0); 2091 2092 retry: 2093 err = drm_modeset_lock_all_ctx(dev, &ctx); 2094 if (err < 0) { 2095 state = ERR_PTR(err); 2096 goto unlock; 2097 } 2098 2099 state = drm_atomic_helper_duplicate_state(dev, &ctx); 2100 if (IS_ERR(state)) 2101 goto unlock; 2102 2103 err = drm_atomic_helper_disable_all(dev, &ctx); 2104 if (err < 0) { 2105 drm_atomic_state_free(state); 2106 state = ERR_PTR(err); 2107 goto unlock; 2108 } 2109 2110 unlock: 2111 if (PTR_ERR(state) == -EDEADLK) { 2112 drm_modeset_backoff(&ctx); 2113 goto retry; 2114 } 2115 2116 drm_modeset_drop_locks(&ctx); 2117 drm_modeset_acquire_fini(&ctx); 2118 return state; 2119 } 2120 EXPORT_SYMBOL(drm_atomic_helper_suspend); 2121 2122 /** 2123 * drm_atomic_helper_resume - subsystem-level resume helper 2124 * @dev: DRM device 2125 * @state: atomic state to resume to 2126 * 2127 * Calls drm_mode_config_reset() to synchronize hardware and software states, 2128 * grabs all modeset locks and commits the atomic state object. This can be 2129 * used in conjunction with the drm_atomic_helper_suspend() helper to 2130 * implement suspend/resume for drivers that support atomic mode-setting. 2131 * 2132 * Returns: 2133 * 0 on success or a negative error code on failure. 2134 * 2135 * See also: 2136 * drm_atomic_helper_suspend() 2137 */ 2138 int drm_atomic_helper_resume(struct drm_device *dev, 2139 struct drm_atomic_state *state) 2140 { 2141 struct drm_mode_config *config = &dev->mode_config; 2142 int err; 2143 2144 drm_mode_config_reset(dev); 2145 drm_modeset_lock_all(dev); 2146 state->acquire_ctx = config->acquire_ctx; 2147 err = drm_atomic_commit(state); 2148 drm_modeset_unlock_all(dev); 2149 2150 return err; 2151 } 2152 EXPORT_SYMBOL(drm_atomic_helper_resume); 2153 2154 /** 2155 * drm_atomic_helper_crtc_set_property - helper for crtc properties 2156 * @crtc: DRM crtc 2157 * @property: DRM property 2158 * @val: value of property 2159 * 2160 * Provides a default crtc set_property handler using the atomic driver 2161 * interface. 2162 * 2163 * RETURNS: 2164 * Zero on success, error code on failure 2165 */ 2166 int 2167 drm_atomic_helper_crtc_set_property(struct drm_crtc *crtc, 2168 struct drm_property *property, 2169 uint64_t val) 2170 { 2171 struct drm_atomic_state *state; 2172 struct drm_crtc_state *crtc_state; 2173 int ret = 0; 2174 2175 state = drm_atomic_state_alloc(crtc->dev); 2176 if (!state) 2177 return -ENOMEM; 2178 2179 /* ->set_property is always called with all locks held. */ 2180 state->acquire_ctx = crtc->dev->mode_config.acquire_ctx; 2181 retry: 2182 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2183 if (IS_ERR(crtc_state)) { 2184 ret = PTR_ERR(crtc_state); 2185 goto fail; 2186 } 2187 2188 ret = drm_atomic_crtc_set_property(crtc, crtc_state, 2189 property, val); 2190 if (ret) 2191 goto fail; 2192 2193 ret = drm_atomic_commit(state); 2194 if (ret != 0) 2195 goto fail; 2196 2197 /* Driver takes ownership of state on successful commit. */ 2198 return 0; 2199 fail: 2200 if (ret == -EDEADLK) 2201 goto backoff; 2202 2203 drm_atomic_state_free(state); 2204 2205 return ret; 2206 backoff: 2207 drm_atomic_state_clear(state); 2208 drm_atomic_legacy_backoff(state); 2209 2210 goto retry; 2211 } 2212 EXPORT_SYMBOL(drm_atomic_helper_crtc_set_property); 2213 2214 /** 2215 * drm_atomic_helper_plane_set_property - helper for plane properties 2216 * @plane: DRM plane 2217 * @property: DRM property 2218 * @val: value of property 2219 * 2220 * Provides a default plane set_property handler using the atomic driver 2221 * interface. 2222 * 2223 * RETURNS: 2224 * Zero on success, error code on failure 2225 */ 2226 int 2227 drm_atomic_helper_plane_set_property(struct drm_plane *plane, 2228 struct drm_property *property, 2229 uint64_t val) 2230 { 2231 struct drm_atomic_state *state; 2232 struct drm_plane_state *plane_state; 2233 int ret = 0; 2234 2235 state = drm_atomic_state_alloc(plane->dev); 2236 if (!state) 2237 return -ENOMEM; 2238 2239 /* ->set_property is always called with all locks held. */ 2240 state->acquire_ctx = plane->dev->mode_config.acquire_ctx; 2241 retry: 2242 plane_state = drm_atomic_get_plane_state(state, plane); 2243 if (IS_ERR(plane_state)) { 2244 ret = PTR_ERR(plane_state); 2245 goto fail; 2246 } 2247 2248 ret = drm_atomic_plane_set_property(plane, plane_state, 2249 property, val); 2250 if (ret) 2251 goto fail; 2252 2253 ret = drm_atomic_commit(state); 2254 if (ret != 0) 2255 goto fail; 2256 2257 /* Driver takes ownership of state on successful commit. */ 2258 return 0; 2259 fail: 2260 if (ret == -EDEADLK) 2261 goto backoff; 2262 2263 drm_atomic_state_free(state); 2264 2265 return ret; 2266 backoff: 2267 drm_atomic_state_clear(state); 2268 drm_atomic_legacy_backoff(state); 2269 2270 goto retry; 2271 } 2272 EXPORT_SYMBOL(drm_atomic_helper_plane_set_property); 2273 2274 /** 2275 * drm_atomic_helper_connector_set_property - helper for connector properties 2276 * @connector: DRM connector 2277 * @property: DRM property 2278 * @val: value of property 2279 * 2280 * Provides a default connector set_property handler using the atomic driver 2281 * interface. 2282 * 2283 * RETURNS: 2284 * Zero on success, error code on failure 2285 */ 2286 int 2287 drm_atomic_helper_connector_set_property(struct drm_connector *connector, 2288 struct drm_property *property, 2289 uint64_t val) 2290 { 2291 struct drm_atomic_state *state; 2292 struct drm_connector_state *connector_state; 2293 int ret = 0; 2294 2295 state = drm_atomic_state_alloc(connector->dev); 2296 if (!state) 2297 return -ENOMEM; 2298 2299 /* ->set_property is always called with all locks held. */ 2300 state->acquire_ctx = connector->dev->mode_config.acquire_ctx; 2301 retry: 2302 connector_state = drm_atomic_get_connector_state(state, connector); 2303 if (IS_ERR(connector_state)) { 2304 ret = PTR_ERR(connector_state); 2305 goto fail; 2306 } 2307 2308 ret = drm_atomic_connector_set_property(connector, connector_state, 2309 property, val); 2310 if (ret) 2311 goto fail; 2312 2313 ret = drm_atomic_commit(state); 2314 if (ret != 0) 2315 goto fail; 2316 2317 /* Driver takes ownership of state on successful commit. */ 2318 return 0; 2319 fail: 2320 if (ret == -EDEADLK) 2321 goto backoff; 2322 2323 drm_atomic_state_free(state); 2324 2325 return ret; 2326 backoff: 2327 drm_atomic_state_clear(state); 2328 drm_atomic_legacy_backoff(state); 2329 2330 goto retry; 2331 } 2332 EXPORT_SYMBOL(drm_atomic_helper_connector_set_property); 2333 2334 /** 2335 * drm_atomic_helper_page_flip - execute a legacy page flip 2336 * @crtc: DRM crtc 2337 * @fb: DRM framebuffer 2338 * @event: optional DRM event to signal upon completion 2339 * @flags: flip flags for non-vblank sync'ed updates 2340 * 2341 * Provides a default page flip implementation using the atomic driver interface. 2342 * 2343 * Note that for now so called async page flips (i.e. updates which are not 2344 * synchronized to vblank) are not supported, since the atomic interfaces have 2345 * no provisions for this yet. 2346 * 2347 * Returns: 2348 * Returns 0 on success, negative errno numbers on failure. 2349 */ 2350 int drm_atomic_helper_page_flip(struct drm_crtc *crtc, 2351 struct drm_framebuffer *fb, 2352 struct drm_pending_vblank_event *event, 2353 uint32_t flags) 2354 { 2355 struct drm_plane *plane = crtc->primary; 2356 struct drm_atomic_state *state; 2357 struct drm_plane_state *plane_state; 2358 struct drm_crtc_state *crtc_state; 2359 int ret = 0; 2360 2361 if (flags & DRM_MODE_PAGE_FLIP_ASYNC) 2362 return -EINVAL; 2363 2364 state = drm_atomic_state_alloc(plane->dev); 2365 if (!state) 2366 return -ENOMEM; 2367 2368 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); 2369 retry: 2370 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2371 if (IS_ERR(crtc_state)) { 2372 ret = PTR_ERR(crtc_state); 2373 goto fail; 2374 } 2375 crtc_state->event = event; 2376 2377 plane_state = drm_atomic_get_plane_state(state, plane); 2378 if (IS_ERR(plane_state)) { 2379 ret = PTR_ERR(plane_state); 2380 goto fail; 2381 } 2382 2383 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); 2384 if (ret != 0) 2385 goto fail; 2386 drm_atomic_set_fb_for_plane(plane_state, fb); 2387 2388 /* Make sure we don't accidentally do a full modeset. */ 2389 state->allow_modeset = false; 2390 if (!crtc_state->active) { 2391 DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n", 2392 crtc->base.id); 2393 ret = -EINVAL; 2394 goto fail; 2395 } 2396 2397 ret = drm_atomic_nonblocking_commit(state); 2398 if (ret != 0) 2399 goto fail; 2400 2401 /* Driver takes ownership of state on successful commit. */ 2402 return 0; 2403 fail: 2404 if (ret == -EDEADLK) 2405 goto backoff; 2406 2407 drm_atomic_state_free(state); 2408 2409 return ret; 2410 backoff: 2411 drm_atomic_state_clear(state); 2412 drm_atomic_legacy_backoff(state); 2413 2414 /* 2415 * Someone might have exchanged the framebuffer while we dropped locks 2416 * in the backoff code. We need to fix up the fb refcount tracking the 2417 * core does for us. 2418 */ 2419 plane->old_fb = plane->fb; 2420 2421 goto retry; 2422 } 2423 EXPORT_SYMBOL(drm_atomic_helper_page_flip); 2424 2425 /** 2426 * drm_atomic_helper_connector_dpms() - connector dpms helper implementation 2427 * @connector: affected connector 2428 * @mode: DPMS mode 2429 * 2430 * This is the main helper function provided by the atomic helper framework for 2431 * implementing the legacy DPMS connector interface. It computes the new desired 2432 * ->active state for the corresponding CRTC (if the connector is enabled) and 2433 * updates it. 2434 * 2435 * Returns: 2436 * Returns 0 on success, negative errno numbers on failure. 2437 */ 2438 int drm_atomic_helper_connector_dpms(struct drm_connector *connector, 2439 int mode) 2440 { 2441 struct drm_mode_config *config = &connector->dev->mode_config; 2442 struct drm_atomic_state *state; 2443 struct drm_crtc_state *crtc_state; 2444 struct drm_crtc *crtc; 2445 struct drm_connector *tmp_connector; 2446 int ret; 2447 bool active = false; 2448 int old_mode = connector->dpms; 2449 2450 if (mode != DRM_MODE_DPMS_ON) 2451 mode = DRM_MODE_DPMS_OFF; 2452 2453 connector->dpms = mode; 2454 crtc = connector->state->crtc; 2455 2456 if (!crtc) 2457 return 0; 2458 2459 state = drm_atomic_state_alloc(connector->dev); 2460 if (!state) 2461 return -ENOMEM; 2462 2463 state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); 2464 retry: 2465 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2466 if (IS_ERR(crtc_state)) { 2467 ret = PTR_ERR(crtc_state); 2468 goto fail; 2469 } 2470 2471 WARN_ON(!drm_modeset_is_locked(&config->connection_mutex)); 2472 2473 drm_for_each_connector(tmp_connector, connector->dev) { 2474 if (tmp_connector->state->crtc != crtc) 2475 continue; 2476 2477 if (tmp_connector->dpms == DRM_MODE_DPMS_ON) { 2478 active = true; 2479 break; 2480 } 2481 } 2482 crtc_state->active = active; 2483 2484 ret = drm_atomic_commit(state); 2485 if (ret != 0) 2486 goto fail; 2487 2488 /* Driver takes ownership of state on successful commit. */ 2489 return 0; 2490 fail: 2491 if (ret == -EDEADLK) 2492 goto backoff; 2493 2494 connector->dpms = old_mode; 2495 drm_atomic_state_free(state); 2496 2497 return ret; 2498 backoff: 2499 drm_atomic_state_clear(state); 2500 drm_atomic_legacy_backoff(state); 2501 2502 goto retry; 2503 } 2504 EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); 2505 2506 /** 2507 * drm_atomic_helper_best_encoder - Helper for &drm_connector_helper_funcs 2508 * ->best_encoder callback 2509 * @connector: Connector control structure 2510 * 2511 * This is a &drm_connector_helper_funcs ->best_encoder callback helper for 2512 * connectors that support exactly 1 encoder, statically determined at driver 2513 * init time. 2514 */ 2515 struct drm_encoder * 2516 drm_atomic_helper_best_encoder(struct drm_connector *connector) 2517 { 2518 WARN_ON(connector->encoder_ids[1]); 2519 return drm_encoder_find(connector->dev, connector->encoder_ids[0]); 2520 } 2521 EXPORT_SYMBOL(drm_atomic_helper_best_encoder); 2522 2523 /** 2524 * DOC: atomic state reset and initialization 2525 * 2526 * Both the drm core and the atomic helpers assume that there is always the full 2527 * and correct atomic software state for all connectors, CRTCs and planes 2528 * available. Which is a bit a problem on driver load and also after system 2529 * suspend. One way to solve this is to have a hardware state read-out 2530 * infrastructure which reconstructs the full software state (e.g. the i915 2531 * driver). 2532 * 2533 * The simpler solution is to just reset the software state to everything off, 2534 * which is easiest to do by calling drm_mode_config_reset(). To facilitate this 2535 * the atomic helpers provide default reset implementations for all hooks. 2536 * 2537 * On the upside the precise state tracking of atomic simplifies system suspend 2538 * and resume a lot. For drivers using drm_mode_config_reset() a complete recipe 2539 * is implemented in drm_atomic_helper_suspend() and drm_atomic_helper_resume(). 2540 * For other drivers the building blocks are split out, see the documentation 2541 * for these functions. 2542 */ 2543 2544 /** 2545 * drm_atomic_helper_crtc_reset - default ->reset hook for CRTCs 2546 * @crtc: drm CRTC 2547 * 2548 * Resets the atomic state for @crtc by freeing the state pointer (which might 2549 * be NULL, e.g. at driver load time) and allocating a new empty state object. 2550 */ 2551 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc) 2552 { 2553 if (crtc->state) 2554 __drm_atomic_helper_crtc_destroy_state(crtc->state); 2555 2556 kfree(crtc->state); 2557 crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL); 2558 2559 if (crtc->state) 2560 crtc->state->crtc = crtc; 2561 } 2562 EXPORT_SYMBOL(drm_atomic_helper_crtc_reset); 2563 2564 /** 2565 * __drm_atomic_helper_crtc_duplicate_state - copy atomic CRTC state 2566 * @crtc: CRTC object 2567 * @state: atomic CRTC state 2568 * 2569 * Copies atomic state from a CRTC's current state and resets inferred values. 2570 * This is useful for drivers that subclass the CRTC state. 2571 */ 2572 void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, 2573 struct drm_crtc_state *state) 2574 { 2575 memcpy(state, crtc->state, sizeof(*state)); 2576 2577 if (state->mode_blob) 2578 drm_property_reference_blob(state->mode_blob); 2579 if (state->degamma_lut) 2580 drm_property_reference_blob(state->degamma_lut); 2581 if (state->ctm) 2582 drm_property_reference_blob(state->ctm); 2583 if (state->gamma_lut) 2584 drm_property_reference_blob(state->gamma_lut); 2585 state->mode_changed = false; 2586 state->active_changed = false; 2587 state->planes_changed = false; 2588 state->connectors_changed = false; 2589 state->color_mgmt_changed = false; 2590 state->event = NULL; 2591 } 2592 EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state); 2593 2594 /** 2595 * drm_atomic_helper_crtc_duplicate_state - default state duplicate hook 2596 * @crtc: drm CRTC 2597 * 2598 * Default CRTC state duplicate hook for drivers which don't have their own 2599 * subclassed CRTC state structure. 2600 */ 2601 struct drm_crtc_state * 2602 drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) 2603 { 2604 struct drm_crtc_state *state; 2605 2606 if (WARN_ON(!crtc->state)) 2607 return NULL; 2608 2609 state = kmalloc(sizeof(*state), GFP_KERNEL); 2610 if (state) 2611 __drm_atomic_helper_crtc_duplicate_state(crtc, state); 2612 2613 return state; 2614 } 2615 EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state); 2616 2617 /** 2618 * __drm_atomic_helper_crtc_destroy_state - release CRTC state 2619 * @state: CRTC state object to release 2620 * 2621 * Releases all resources stored in the CRTC state without actually freeing 2622 * the memory of the CRTC state. This is useful for drivers that subclass the 2623 * CRTC state. 2624 */ 2625 void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state) 2626 { 2627 drm_property_unreference_blob(state->mode_blob); 2628 drm_property_unreference_blob(state->degamma_lut); 2629 drm_property_unreference_blob(state->ctm); 2630 drm_property_unreference_blob(state->gamma_lut); 2631 } 2632 EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state); 2633 2634 /** 2635 * drm_atomic_helper_crtc_destroy_state - default state destroy hook 2636 * @crtc: drm CRTC 2637 * @state: CRTC state object to release 2638 * 2639 * Default CRTC state destroy hook for drivers which don't have their own 2640 * subclassed CRTC state structure. 2641 */ 2642 void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, 2643 struct drm_crtc_state *state) 2644 { 2645 __drm_atomic_helper_crtc_destroy_state(state); 2646 kfree(state); 2647 } 2648 EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state); 2649 2650 /** 2651 * drm_atomic_helper_plane_reset - default ->reset hook for planes 2652 * @plane: drm plane 2653 * 2654 * Resets the atomic state for @plane by freeing the state pointer (which might 2655 * be NULL, e.g. at driver load time) and allocating a new empty state object. 2656 */ 2657 void drm_atomic_helper_plane_reset(struct drm_plane *plane) 2658 { 2659 if (plane->state) 2660 __drm_atomic_helper_plane_destroy_state(plane->state); 2661 2662 kfree(plane->state); 2663 plane->state = kzalloc(sizeof(*plane->state), GFP_KERNEL); 2664 2665 if (plane->state) { 2666 plane->state->plane = plane; 2667 plane->state->rotation = BIT(DRM_ROTATE_0); 2668 } 2669 } 2670 EXPORT_SYMBOL(drm_atomic_helper_plane_reset); 2671 2672 /** 2673 * __drm_atomic_helper_plane_duplicate_state - copy atomic plane state 2674 * @plane: plane object 2675 * @state: atomic plane state 2676 * 2677 * Copies atomic state from a plane's current state. This is useful for 2678 * drivers that subclass the plane state. 2679 */ 2680 void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane, 2681 struct drm_plane_state *state) 2682 { 2683 memcpy(state, plane->state, sizeof(*state)); 2684 2685 if (state->fb) 2686 drm_framebuffer_reference(state->fb); 2687 } 2688 EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state); 2689 2690 /** 2691 * drm_atomic_helper_plane_duplicate_state - default state duplicate hook 2692 * @plane: drm plane 2693 * 2694 * Default plane state duplicate hook for drivers which don't have their own 2695 * subclassed plane state structure. 2696 */ 2697 struct drm_plane_state * 2698 drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane) 2699 { 2700 struct drm_plane_state *state; 2701 2702 if (WARN_ON(!plane->state)) 2703 return NULL; 2704 2705 state = kmalloc(sizeof(*state), GFP_KERNEL); 2706 if (state) 2707 __drm_atomic_helper_plane_duplicate_state(plane, state); 2708 2709 return state; 2710 } 2711 EXPORT_SYMBOL(drm_atomic_helper_plane_duplicate_state); 2712 2713 /** 2714 * __drm_atomic_helper_plane_destroy_state - release plane state 2715 * @state: plane state object to release 2716 * 2717 * Releases all resources stored in the plane state without actually freeing 2718 * the memory of the plane state. This is useful for drivers that subclass the 2719 * plane state. 2720 */ 2721 void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state) 2722 { 2723 if (state->fb) 2724 drm_framebuffer_unreference(state->fb); 2725 } 2726 EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state); 2727 2728 /** 2729 * drm_atomic_helper_plane_destroy_state - default state destroy hook 2730 * @plane: drm plane 2731 * @state: plane state object to release 2732 * 2733 * Default plane state destroy hook for drivers which don't have their own 2734 * subclassed plane state structure. 2735 */ 2736 void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, 2737 struct drm_plane_state *state) 2738 { 2739 __drm_atomic_helper_plane_destroy_state(state); 2740 kfree(state); 2741 } 2742 EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state); 2743 2744 /** 2745 * __drm_atomic_helper_connector_reset - reset state on connector 2746 * @connector: drm connector 2747 * @conn_state: connector state to assign 2748 * 2749 * Initializes the newly allocated @conn_state and assigns it to 2750 * #connector ->state, usually required when initializing the drivers 2751 * or when called from the ->reset hook. 2752 * 2753 * This is useful for drivers that subclass the connector state. 2754 */ 2755 void 2756 __drm_atomic_helper_connector_reset(struct drm_connector *connector, 2757 struct drm_connector_state *conn_state) 2758 { 2759 if (conn_state) 2760 conn_state->connector = connector; 2761 2762 connector->state = conn_state; 2763 } 2764 EXPORT_SYMBOL(__drm_atomic_helper_connector_reset); 2765 2766 /** 2767 * drm_atomic_helper_connector_reset - default ->reset hook for connectors 2768 * @connector: drm connector 2769 * 2770 * Resets the atomic state for @connector by freeing the state pointer (which 2771 * might be NULL, e.g. at driver load time) and allocating a new empty state 2772 * object. 2773 */ 2774 void drm_atomic_helper_connector_reset(struct drm_connector *connector) 2775 { 2776 struct drm_connector_state *conn_state = 2777 kzalloc(sizeof(*conn_state), GFP_KERNEL); 2778 2779 if (connector->state) 2780 __drm_atomic_helper_connector_destroy_state(connector->state); 2781 2782 kfree(connector->state); 2783 __drm_atomic_helper_connector_reset(connector, conn_state); 2784 } 2785 EXPORT_SYMBOL(drm_atomic_helper_connector_reset); 2786 2787 /** 2788 * __drm_atomic_helper_connector_duplicate_state - copy atomic connector state 2789 * @connector: connector object 2790 * @state: atomic connector state 2791 * 2792 * Copies atomic state from a connector's current state. This is useful for 2793 * drivers that subclass the connector state. 2794 */ 2795 void 2796 __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, 2797 struct drm_connector_state *state) 2798 { 2799 memcpy(state, connector->state, sizeof(*state)); 2800 if (state->crtc) 2801 drm_connector_reference(connector); 2802 } 2803 EXPORT_SYMBOL(__drm_atomic_helper_connector_duplicate_state); 2804 2805 /** 2806 * drm_atomic_helper_connector_duplicate_state - default state duplicate hook 2807 * @connector: drm connector 2808 * 2809 * Default connector state duplicate hook for drivers which don't have their own 2810 * subclassed connector state structure. 2811 */ 2812 struct drm_connector_state * 2813 drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector) 2814 { 2815 struct drm_connector_state *state; 2816 2817 if (WARN_ON(!connector->state)) 2818 return NULL; 2819 2820 state = kmalloc(sizeof(*state), GFP_KERNEL); 2821 if (state) 2822 __drm_atomic_helper_connector_duplicate_state(connector, state); 2823 2824 return state; 2825 } 2826 EXPORT_SYMBOL(drm_atomic_helper_connector_duplicate_state); 2827 2828 /** 2829 * drm_atomic_helper_duplicate_state - duplicate an atomic state object 2830 * @dev: DRM device 2831 * @ctx: lock acquisition context 2832 * 2833 * Makes a copy of the current atomic state by looping over all objects and 2834 * duplicating their respective states. This is used for example by suspend/ 2835 * resume support code to save the state prior to suspend such that it can 2836 * be restored upon resume. 2837 * 2838 * Note that this treats atomic state as persistent between save and restore. 2839 * Drivers must make sure that this is possible and won't result in confusion 2840 * or erroneous behaviour. 2841 * 2842 * Note that if callers haven't already acquired all modeset locks this might 2843 * return -EDEADLK, which must be handled by calling drm_modeset_backoff(). 2844 * 2845 * Returns: 2846 * A pointer to the copy of the atomic state object on success or an 2847 * ERR_PTR()-encoded error code on failure. 2848 * 2849 * See also: 2850 * drm_atomic_helper_suspend(), drm_atomic_helper_resume() 2851 */ 2852 struct drm_atomic_state * 2853 drm_atomic_helper_duplicate_state(struct drm_device *dev, 2854 struct drm_modeset_acquire_ctx *ctx) 2855 { 2856 struct drm_atomic_state *state; 2857 struct drm_connector *conn; 2858 struct drm_plane *plane; 2859 struct drm_crtc *crtc; 2860 int err = 0; 2861 2862 state = drm_atomic_state_alloc(dev); 2863 if (!state) 2864 return ERR_PTR(-ENOMEM); 2865 2866 state->acquire_ctx = ctx; 2867 2868 drm_for_each_crtc(crtc, dev) { 2869 struct drm_crtc_state *crtc_state; 2870 2871 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2872 if (IS_ERR(crtc_state)) { 2873 err = PTR_ERR(crtc_state); 2874 goto free; 2875 } 2876 } 2877 2878 drm_for_each_plane(plane, dev) { 2879 struct drm_plane_state *plane_state; 2880 2881 plane_state = drm_atomic_get_plane_state(state, plane); 2882 if (IS_ERR(plane_state)) { 2883 err = PTR_ERR(plane_state); 2884 goto free; 2885 } 2886 } 2887 2888 drm_for_each_connector(conn, dev) { 2889 struct drm_connector_state *conn_state; 2890 2891 conn_state = drm_atomic_get_connector_state(state, conn); 2892 if (IS_ERR(conn_state)) { 2893 err = PTR_ERR(conn_state); 2894 goto free; 2895 } 2896 } 2897 2898 /* clear the acquire context so that it isn't accidentally reused */ 2899 state->acquire_ctx = NULL; 2900 2901 free: 2902 if (err < 0) { 2903 drm_atomic_state_free(state); 2904 state = ERR_PTR(err); 2905 } 2906 2907 return state; 2908 } 2909 EXPORT_SYMBOL(drm_atomic_helper_duplicate_state); 2910 2911 /** 2912 * __drm_atomic_helper_connector_destroy_state - release connector state 2913 * @state: connector state object to release 2914 * 2915 * Releases all resources stored in the connector state without actually 2916 * freeing the memory of the connector state. This is useful for drivers that 2917 * subclass the connector state. 2918 */ 2919 void 2920 __drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state) 2921 { 2922 /* 2923 * This is currently a placeholder so that drivers that subclass the 2924 * state will automatically do the right thing if code is ever added 2925 * to this function. 2926 */ 2927 if (state->crtc) 2928 drm_connector_unreference(state->connector); 2929 } 2930 EXPORT_SYMBOL(__drm_atomic_helper_connector_destroy_state); 2931 2932 /** 2933 * drm_atomic_helper_connector_destroy_state - default state destroy hook 2934 * @connector: drm connector 2935 * @state: connector state object to release 2936 * 2937 * Default connector state destroy hook for drivers which don't have their own 2938 * subclassed connector state structure. 2939 */ 2940 void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, 2941 struct drm_connector_state *state) 2942 { 2943 __drm_atomic_helper_connector_destroy_state(state); 2944 kfree(state); 2945 } 2946 EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state); 2947 2948 /** 2949 * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table 2950 * @crtc: CRTC object 2951 * @red: red correction table 2952 * @green: green correction table 2953 * @blue: green correction table 2954 * @start: 2955 * @size: size of the tables 2956 * 2957 * Implements support for legacy gamma correction table for drivers 2958 * that support color management through the DEGAMMA_LUT/GAMMA_LUT 2959 * properties. 2960 */ 2961 void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, 2962 u16 *red, u16 *green, u16 *blue, 2963 uint32_t start, uint32_t size) 2964 { 2965 struct drm_device *dev = crtc->dev; 2966 struct drm_mode_config *config = &dev->mode_config; 2967 struct drm_atomic_state *state; 2968 struct drm_crtc_state *crtc_state; 2969 struct drm_property_blob *blob = NULL; 2970 struct drm_color_lut *blob_data; 2971 int i, ret = 0; 2972 2973 state = drm_atomic_state_alloc(crtc->dev); 2974 if (!state) 2975 return; 2976 2977 blob = drm_property_create_blob(dev, 2978 sizeof(struct drm_color_lut) * size, 2979 NULL); 2980 if (IS_ERR(blob)) { 2981 ret = PTR_ERR(blob); 2982 blob = NULL; 2983 goto fail; 2984 } 2985 2986 /* Prepare GAMMA_LUT with the legacy values. */ 2987 blob_data = (struct drm_color_lut *) blob->data; 2988 for (i = 0; i < size; i++) { 2989 blob_data[i].red = red[i]; 2990 blob_data[i].green = green[i]; 2991 blob_data[i].blue = blue[i]; 2992 } 2993 2994 state->acquire_ctx = crtc->dev->mode_config.acquire_ctx; 2995 retry: 2996 crtc_state = drm_atomic_get_crtc_state(state, crtc); 2997 if (IS_ERR(crtc_state)) { 2998 ret = PTR_ERR(crtc_state); 2999 goto fail; 3000 } 3001 3002 /* Reset DEGAMMA_LUT and CTM properties. */ 3003 ret = drm_atomic_crtc_set_property(crtc, crtc_state, 3004 config->degamma_lut_property, 0); 3005 if (ret) 3006 goto fail; 3007 3008 ret = drm_atomic_crtc_set_property(crtc, crtc_state, 3009 config->ctm_property, 0); 3010 if (ret) 3011 goto fail; 3012 3013 ret = drm_atomic_crtc_set_property(crtc, crtc_state, 3014 config->gamma_lut_property, blob->base.id); 3015 if (ret) 3016 goto fail; 3017 3018 ret = drm_atomic_commit(state); 3019 if (ret) 3020 goto fail; 3021 3022 /* Driver takes ownership of state on successful commit. */ 3023 3024 drm_property_unreference_blob(blob); 3025 3026 return; 3027 fail: 3028 if (ret == -EDEADLK) 3029 goto backoff; 3030 3031 drm_atomic_state_free(state); 3032 drm_property_unreference_blob(blob); 3033 3034 return; 3035 backoff: 3036 drm_atomic_state_clear(state); 3037 drm_atomic_legacy_backoff(state); 3038 3039 goto retry; 3040 } 3041 EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set); 3042 3043 #line 21 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--106_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/5249/dscv_tempdir/dscv/ri/106_1a/drivers/gpu/drm/drm_atomic_helper.o.c.prepared"
1 2 /* 3 * Copyright © 2015 Intel Corporation 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice (including the next 13 * paragraph) shall be included in all copies or substantial portions of the 14 * Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 * IN THE SOFTWARE. 23 * 24 * Authors: 25 * Rafael Antognolli <rafael.antognolli@intel.com> 26 * 27 */ 28 29 #include <linux/device.h> 30 #include <linux/fs.h> 31 #include <linux/slab.h> 32 #include <linux/init.h> 33 #include <linux/kernel.h> 34 #include <linux/module.h> 35 #include <linux/uaccess.h> 36 #include <drm/drm_dp_helper.h> 37 #include <drm/drm_crtc.h> 38 #include <drm/drmP.h> 39 40 struct drm_dp_aux_dev { 41 unsigned index; 42 struct drm_dp_aux *aux; 43 struct device *dev; 44 struct kref refcount; 45 atomic_t usecount; 46 }; 47 48 #define DRM_AUX_MINORS 256 49 #define AUX_MAX_OFFSET (1 << 20) 50 static DEFINE_IDR(aux_idr); 51 static DEFINE_MUTEX(aux_idr_mutex); 52 static struct class *drm_dp_aux_dev_class; 53 static int drm_dev_major = -1; 54 55 static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_minor(unsigned index) 56 { 57 struct drm_dp_aux_dev *aux_dev = NULL; 58 59 mutex_lock(&aux_idr_mutex); 60 aux_dev = idr_find(&aux_idr, index); 61 if (!kref_get_unless_zero(&aux_dev->refcount)) 62 aux_dev = NULL; 63 mutex_unlock(&aux_idr_mutex); 64 65 return aux_dev; 66 } 67 68 static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) 69 { 70 struct drm_dp_aux_dev *aux_dev; 71 int index; 72 73 aux_dev = kzalloc(sizeof(*aux_dev), GFP_KERNEL); 74 if (!aux_dev) 75 return ERR_PTR(-ENOMEM); 76 aux_dev->aux = aux; 77 atomic_set(&aux_dev->usecount, 1); 78 kref_init(&aux_dev->refcount); 79 80 mutex_lock(&aux_idr_mutex); 81 index = idr_alloc_cyclic(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, 82 GFP_KERNEL); 83 mutex_unlock(&aux_idr_mutex); 84 if (index < 0) { 85 kfree(aux_dev); 86 return ERR_PTR(index); 87 } 88 aux_dev->index = index; 89 90 return aux_dev; 91 } 92 93 static void release_drm_dp_aux_dev(struct kref *ref) 94 { 95 struct drm_dp_aux_dev *aux_dev = 96 container_of(ref, struct drm_dp_aux_dev, refcount); 97 98 kfree(aux_dev); 99 } 100 101 static ssize_t name_show(struct device *dev, 102 struct device_attribute *attr, char *buf) 103 { 104 ssize_t res; 105 struct drm_dp_aux_dev *aux_dev = 106 drm_dp_aux_dev_get_by_minor(MINOR(dev->devt)); 107 108 if (!aux_dev) 109 return -ENODEV; 110 111 res = sprintf(buf, "%s\n", aux_dev->aux->name); 112 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 113 114 return res; 115 } 116 static DEVICE_ATTR_RO(name); 117 118 static struct attribute *drm_dp_aux_attrs[] = { 119 &dev_attr_name.attr, 120 NULL, 121 }; 122 ATTRIBUTE_GROUPS(drm_dp_aux); 123 124 static int auxdev_open(struct inode *inode, struct file *file) 125 { 126 unsigned int minor = iminor(inode); 127 struct drm_dp_aux_dev *aux_dev; 128 129 aux_dev = drm_dp_aux_dev_get_by_minor(minor); 130 if (!aux_dev) 131 return -ENODEV; 132 133 file->private_data = aux_dev; 134 return 0; 135 } 136 137 static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence) 138 { 139 return fixed_size_llseek(file, offset, whence, AUX_MAX_OFFSET); 140 } 141 142 static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, 143 loff_t *offset) 144 { 145 size_t bytes_pending, num_bytes_processed = 0; 146 struct drm_dp_aux_dev *aux_dev = file->private_data; 147 ssize_t res = 0; 148 149 if (!atomic_inc_not_zero(&aux_dev->usecount)) 150 return -ENODEV; 151 152 bytes_pending = min((loff_t)count, AUX_MAX_OFFSET - (*offset)); 153 154 if (!access_ok(VERIFY_WRITE, buf, bytes_pending)) { 155 res = -EFAULT; 156 goto out; 157 } 158 159 while (bytes_pending > 0) { 160 uint8_t localbuf[DP_AUX_MAX_PAYLOAD_BYTES]; 161 ssize_t todo = min_t(size_t, bytes_pending, sizeof(localbuf)); 162 163 if (signal_pending(current)) { 164 res = num_bytes_processed ? 165 num_bytes_processed : -ERESTARTSYS; 166 goto out; 167 } 168 169 res = drm_dp_dpcd_read(aux_dev->aux, *offset, localbuf, todo); 170 if (res <= 0) { 171 res = num_bytes_processed ? num_bytes_processed : res; 172 goto out; 173 } 174 if (__copy_to_user(buf + num_bytes_processed, localbuf, res)) { 175 res = num_bytes_processed ? 176 num_bytes_processed : -EFAULT; 177 goto out; 178 } 179 bytes_pending -= res; 180 *offset += res; 181 num_bytes_processed += res; 182 res = num_bytes_processed; 183 } 184 185 out: 186 atomic_dec(&aux_dev->usecount); 187 wake_up_atomic_t(&aux_dev->usecount); 188 return res; 189 } 190 191 static ssize_t auxdev_write(struct file *file, const char __user *buf, 192 size_t count, loff_t *offset) 193 { 194 size_t bytes_pending, num_bytes_processed = 0; 195 struct drm_dp_aux_dev *aux_dev = file->private_data; 196 ssize_t res = 0; 197 198 if (!atomic_inc_not_zero(&aux_dev->usecount)) 199 return -ENODEV; 200 201 bytes_pending = min((loff_t)count, AUX_MAX_OFFSET - *offset); 202 203 if (!access_ok(VERIFY_READ, buf, bytes_pending)) { 204 res = -EFAULT; 205 goto out; 206 } 207 208 while (bytes_pending > 0) { 209 uint8_t localbuf[DP_AUX_MAX_PAYLOAD_BYTES]; 210 ssize_t todo = min_t(size_t, bytes_pending, sizeof(localbuf)); 211 212 if (signal_pending(current)) { 213 res = num_bytes_processed ? 214 num_bytes_processed : -ERESTARTSYS; 215 goto out; 216 } 217 218 if (__copy_from_user(localbuf, 219 buf + num_bytes_processed, todo)) { 220 res = num_bytes_processed ? 221 num_bytes_processed : -EFAULT; 222 goto out; 223 } 224 225 res = drm_dp_dpcd_write(aux_dev->aux, *offset, localbuf, todo); 226 if (res <= 0) { 227 res = num_bytes_processed ? num_bytes_processed : res; 228 goto out; 229 } 230 bytes_pending -= res; 231 *offset += res; 232 num_bytes_processed += res; 233 res = num_bytes_processed; 234 } 235 236 out: 237 atomic_dec(&aux_dev->usecount); 238 wake_up_atomic_t(&aux_dev->usecount); 239 return res; 240 } 241 242 static int auxdev_release(struct inode *inode, struct file *file) 243 { 244 struct drm_dp_aux_dev *aux_dev = file->private_data; 245 246 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 247 return 0; 248 } 249 250 static const struct file_operations auxdev_fops = { 251 .owner = THIS_MODULE, 252 .llseek = auxdev_llseek, 253 .read = auxdev_read, 254 .write = auxdev_write, 255 .open = auxdev_open, 256 .release = auxdev_release, 257 }; 258 259 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 260 261 static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_aux(struct drm_dp_aux *aux) 262 { 263 struct drm_dp_aux_dev *iter, *aux_dev = NULL; 264 int id; 265 266 /* don't increase kref count here because this function should only be 267 * used by drm_dp_aux_unregister_devnode. Thus, it will always have at 268 * least one reference - the one that drm_dp_aux_register_devnode 269 * created 270 */ 271 mutex_lock(&aux_idr_mutex); 272 idr_for_each_entry(&aux_idr, iter, id) { 273 if (iter->aux == aux) { 274 aux_dev = iter; 275 break; 276 } 277 } 278 mutex_unlock(&aux_idr_mutex); 279 return aux_dev; 280 } 281 282 static int auxdev_wait_atomic_t(atomic_t *p) 283 { 284 schedule(); 285 return 0; 286 } 287 /** 288 * drm_dp_aux_unregister_devnode() - unregister a devnode for this aux channel 289 * @aux: DisplayPort AUX channel 290 * 291 * Returns 0 on success or a negative error code on failure. 292 */ 293 void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux) 294 { 295 struct drm_dp_aux_dev *aux_dev; 296 unsigned int minor; 297 298 aux_dev = drm_dp_aux_dev_get_by_aux(aux); 299 if (!aux_dev) /* attach must have failed */ 300 return; 301 302 mutex_lock(&aux_idr_mutex); 303 idr_remove(&aux_idr, aux_dev->index); 304 mutex_unlock(&aux_idr_mutex); 305 306 atomic_dec(&aux_dev->usecount); 307 wait_on_atomic_t(&aux_dev->usecount, auxdev_wait_atomic_t, 308 TASK_UNINTERRUPTIBLE); 309 310 minor = aux_dev->index; 311 if (aux_dev->dev) 312 device_destroy(drm_dp_aux_dev_class, 313 MKDEV(drm_dev_major, minor)); 314 315 DRM_DEBUG("drm_dp_aux_dev: aux [%s] unregistering\n", aux->name); 316 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 317 } 318 EXPORT_SYMBOL(drm_dp_aux_unregister_devnode); 319 320 /** 321 * drm_dp_aux_register_devnode() - register a devnode for this aux channel 322 * @aux: DisplayPort AUX channel 323 * 324 * Returns 0 on success or a negative error code on failure. 325 */ 326 int drm_dp_aux_register_devnode(struct drm_dp_aux *aux) 327 { 328 struct drm_dp_aux_dev *aux_dev; 329 int res; 330 331 aux_dev = alloc_drm_dp_aux_dev(aux); 332 if (IS_ERR(aux_dev)) 333 return PTR_ERR(aux_dev); 334 335 aux_dev->dev = device_create(drm_dp_aux_dev_class, aux->dev, 336 MKDEV(drm_dev_major, aux_dev->index), NULL, 337 "drm_dp_aux%d", aux_dev->index); 338 if (IS_ERR(aux_dev->dev)) { 339 res = PTR_ERR(aux_dev->dev); 340 aux_dev->dev = NULL; 341 goto error; 342 } 343 344 DRM_DEBUG("drm_dp_aux_dev: aux [%s] registered as minor %d\n", 345 aux->name, aux_dev->index); 346 return 0; 347 error: 348 drm_dp_aux_unregister_devnode(aux); 349 return res; 350 } 351 EXPORT_SYMBOL(drm_dp_aux_register_devnode); 352 353 int drm_dp_aux_dev_init(void) 354 { 355 int res; 356 357 drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev"); 358 if (IS_ERR(drm_dp_aux_dev_class)) { 359 res = PTR_ERR(drm_dp_aux_dev_class); 360 goto out; 361 } 362 drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups; 363 364 res = register_chrdev(0, "aux", &auxdev_fops); 365 if (res < 0) 366 goto out; 367 drm_dev_major = res; 368 369 return 0; 370 out: 371 class_destroy(drm_dp_aux_dev_class); 372 return res; 373 } 374 EXPORT_SYMBOL(drm_dp_aux_dev_init); 375 376 void drm_dp_aux_dev_exit(void) 377 { 378 unregister_chrdev(drm_dev_major, "aux"); 379 class_destroy(drm_dp_aux_dev_class); 380 } 381 EXPORT_SYMBOL(drm_dp_aux_dev_exit); 382 383 384 385 386 387 /* LDV_COMMENT_BEGIN_MAIN */ 388 #ifdef LDV_MAIN11_sequence_infinite_withcheck_stateful 389 390 /*###########################################################################*/ 391 392 /*############## Driver Environment Generator 0.2 output ####################*/ 393 394 /*###########################################################################*/ 395 396 397 398 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */ 399 void ldv_check_final_state(void); 400 401 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 402 void ldv_check_return_value(int res); 403 404 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 405 void ldv_check_return_value_probe(int res); 406 407 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 408 void ldv_initialize(void); 409 410 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 411 void ldv_handler_precall(void); 412 413 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 414 int nondet_int(void); 415 416 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 417 int LDV_IN_INTERRUPT; 418 419 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 420 void ldv_main11_sequence_infinite_withcheck_stateful(void) { 421 422 423 424 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 425 /*============================= VARIABLE DECLARATION PART =============================*/ 426 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 427 /* content: static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence)*/ 428 /* LDV_COMMENT_BEGIN_PREP */ 429 #define DRM_AUX_MINORS 256 430 #define AUX_MAX_OFFSET (1 << 20) 431 /* LDV_COMMENT_END_PREP */ 432 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 433 struct file * var_group1; 434 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 435 loff_t var_auxdev_llseek_5_p1; 436 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 437 int var_auxdev_llseek_5_p2; 438 /* LDV_COMMENT_BEGIN_PREP */ 439 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 440 /* LDV_COMMENT_END_PREP */ 441 /* content: static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, loff_t *offset)*/ 442 /* LDV_COMMENT_BEGIN_PREP */ 443 #define DRM_AUX_MINORS 256 444 #define AUX_MAX_OFFSET (1 << 20) 445 /* LDV_COMMENT_END_PREP */ 446 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 447 char __user * var_auxdev_read_6_p1; 448 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 449 size_t var_auxdev_read_6_p2; 450 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 451 loff_t * var_auxdev_read_6_p3; 452 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_read" */ 453 static ssize_t res_auxdev_read_6; 454 /* LDV_COMMENT_BEGIN_PREP */ 455 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 456 /* LDV_COMMENT_END_PREP */ 457 /* content: static ssize_t auxdev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)*/ 458 /* LDV_COMMENT_BEGIN_PREP */ 459 #define DRM_AUX_MINORS 256 460 #define AUX_MAX_OFFSET (1 << 20) 461 /* LDV_COMMENT_END_PREP */ 462 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 463 const char __user * var_auxdev_write_7_p1; 464 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 465 size_t var_auxdev_write_7_p2; 466 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 467 loff_t * var_auxdev_write_7_p3; 468 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_write" */ 469 static ssize_t res_auxdev_write_7; 470 /* LDV_COMMENT_BEGIN_PREP */ 471 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 472 /* LDV_COMMENT_END_PREP */ 473 /* content: static int auxdev_open(struct inode *inode, struct file *file)*/ 474 /* LDV_COMMENT_BEGIN_PREP */ 475 #define DRM_AUX_MINORS 256 476 #define AUX_MAX_OFFSET (1 << 20) 477 /* LDV_COMMENT_END_PREP */ 478 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_open" */ 479 struct inode * var_group2; 480 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_open" */ 481 static int res_auxdev_open_4; 482 /* LDV_COMMENT_BEGIN_PREP */ 483 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 484 /* LDV_COMMENT_END_PREP */ 485 /* content: static int auxdev_release(struct inode *inode, struct file *file)*/ 486 /* LDV_COMMENT_BEGIN_PREP */ 487 #define DRM_AUX_MINORS 256 488 #define AUX_MAX_OFFSET (1 << 20) 489 /* LDV_COMMENT_END_PREP */ 490 /* LDV_COMMENT_BEGIN_PREP */ 491 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 492 /* LDV_COMMENT_END_PREP */ 493 494 495 496 497 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 498 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 499 /*============================= VARIABLE INITIALIZING PART =============================*/ 500 LDV_IN_INTERRUPT=1; 501 502 503 504 505 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 506 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 507 /*============================= FUNCTION CALL SECTION =============================*/ 508 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 509 ldv_initialize(); 510 int ldv_s_auxdev_fops_file_operations = 0; 511 512 513 while( nondet_int() 514 || !(ldv_s_auxdev_fops_file_operations == 0) 515 ) { 516 517 switch(nondet_int()) { 518 519 case 0: { 520 521 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 522 if(ldv_s_auxdev_fops_file_operations==0) { 523 524 /* content: static int auxdev_open(struct inode *inode, struct file *file)*/ 525 /* LDV_COMMENT_BEGIN_PREP */ 526 #define DRM_AUX_MINORS 256 527 #define AUX_MAX_OFFSET (1 << 20) 528 /* LDV_COMMENT_END_PREP */ 529 /* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 530 ldv_handler_precall(); 531 res_auxdev_open_4 = auxdev_open( var_group2, var_group1); 532 ldv_check_return_value(res_auxdev_open_4); 533 if(res_auxdev_open_4) 534 goto ldv_module_exit; 535 /* LDV_COMMENT_BEGIN_PREP */ 536 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 537 /* LDV_COMMENT_END_PREP */ 538 ldv_s_auxdev_fops_file_operations++; 539 540 } 541 542 } 543 544 break; 545 case 1: { 546 547 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 548 if(ldv_s_auxdev_fops_file_operations==1) { 549 550 /* content: static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, loff_t *offset)*/ 551 /* LDV_COMMENT_BEGIN_PREP */ 552 #define DRM_AUX_MINORS 256 553 #define AUX_MAX_OFFSET (1 << 20) 554 /* LDV_COMMENT_END_PREP */ 555 /* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 556 ldv_handler_precall(); 557 res_auxdev_read_6 = auxdev_read( var_group1, var_auxdev_read_6_p1, var_auxdev_read_6_p2, var_auxdev_read_6_p3); 558 ldv_check_return_value(res_auxdev_read_6); 559 if(res_auxdev_read_6 < 0) 560 goto ldv_module_exit; 561 /* LDV_COMMENT_BEGIN_PREP */ 562 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 563 /* LDV_COMMENT_END_PREP */ 564 ldv_s_auxdev_fops_file_operations++; 565 566 } 567 568 } 569 570 break; 571 case 2: { 572 573 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 574 if(ldv_s_auxdev_fops_file_operations==2) { 575 576 /* content: static ssize_t auxdev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)*/ 577 /* LDV_COMMENT_BEGIN_PREP */ 578 #define DRM_AUX_MINORS 256 579 #define AUX_MAX_OFFSET (1 << 20) 580 /* LDV_COMMENT_END_PREP */ 581 /* LDV_COMMENT_FUNCTION_CALL Function from field "write" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 582 ldv_handler_precall(); 583 res_auxdev_write_7 = auxdev_write( var_group1, var_auxdev_write_7_p1, var_auxdev_write_7_p2, var_auxdev_write_7_p3); 584 ldv_check_return_value(res_auxdev_write_7); 585 if(res_auxdev_write_7 < 0) 586 goto ldv_module_exit; 587 /* LDV_COMMENT_BEGIN_PREP */ 588 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 589 /* LDV_COMMENT_END_PREP */ 590 ldv_s_auxdev_fops_file_operations++; 591 592 } 593 594 } 595 596 break; 597 case 3: { 598 599 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 600 if(ldv_s_auxdev_fops_file_operations==3) { 601 602 /* content: static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence)*/ 603 /* LDV_COMMENT_BEGIN_PREP */ 604 #define DRM_AUX_MINORS 256 605 #define AUX_MAX_OFFSET (1 << 20) 606 /* LDV_COMMENT_END_PREP */ 607 /* LDV_COMMENT_FUNCTION_CALL Function from field "llseek" from driver structure with callbacks "auxdev_fops" */ 608 ldv_handler_precall(); 609 auxdev_llseek( var_group1, var_auxdev_llseek_5_p1, var_auxdev_llseek_5_p2); 610 /* LDV_COMMENT_BEGIN_PREP */ 611 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 612 /* LDV_COMMENT_END_PREP */ 613 ldv_s_auxdev_fops_file_operations++; 614 615 } 616 617 } 618 619 break; 620 case 4: { 621 622 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 623 if(ldv_s_auxdev_fops_file_operations==4) { 624 625 /* content: static int auxdev_release(struct inode *inode, struct file *file)*/ 626 /* LDV_COMMENT_BEGIN_PREP */ 627 #define DRM_AUX_MINORS 256 628 #define AUX_MAX_OFFSET (1 << 20) 629 /* LDV_COMMENT_END_PREP */ 630 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "auxdev_fops" */ 631 ldv_handler_precall(); 632 auxdev_release( var_group2, var_group1); 633 /* LDV_COMMENT_BEGIN_PREP */ 634 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 635 /* LDV_COMMENT_END_PREP */ 636 ldv_s_auxdev_fops_file_operations=0; 637 638 } 639 640 } 641 642 break; 643 default: break; 644 645 } 646 647 } 648 649 ldv_module_exit: 650 651 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 652 ldv_final: ldv_check_final_state(); 653 654 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 655 return; 656 657 } 658 #endif 659 660 /* LDV_COMMENT_END_MAIN */
1 2 #include <linux/kernel.h> 3 bool ldv_is_err(const void *ptr); 4 bool ldv_is_err_or_null(const void *ptr); 5 void* ldv_err_ptr(long error); 6 long ldv_ptr_err(const void *ptr); 7 8 9 // Provide model function prototypes before their usage. 10 11 void *ldv_create_class(void); 12 int ldv_register_class(void); 13 void ldv_unregister_class(void); 14 15 int ldv_register_chrdev(int major); 16 int ldv_register_chrdev_region(void); 17 void ldv_unregister_chrdev_region(void); 18 19 int ldv_register_usb_gadget(void); 20 void ldv_unregister_usb_gadget(void); 21 #line 1 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--106_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/5249/dscv_tempdir/dscv/ri/106_1a/drivers/gpu/drm/drm_dp_aux_dev.c" 22 23 /* 24 * Copyright © 2015 Intel Corporation 25 * 26 * Permission is hereby granted, free of charge, to any person obtaining a 27 * copy of this software and associated documentation files (the "Software"), 28 * to deal in the Software without restriction, including without limitation 29 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 30 * and/or sell copies of the Software, and to permit persons to whom the 31 * Software is furnished to do so, subject to the following conditions: 32 * 33 * The above copyright notice and this permission notice (including the next 34 * paragraph) shall be included in all copies or substantial portions of the 35 * Software. 36 * 37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 40 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 43 * IN THE SOFTWARE. 44 * 45 * Authors: 46 * Rafael Antognolli <rafael.antognolli@intel.com> 47 * 48 */ 49 50 #include <linux/device.h> 51 #include <linux/fs.h> 52 #include <linux/slab.h> 53 #include <linux/init.h> 54 #include <linux/kernel.h> 55 #include <linux/module.h> 56 #include <linux/uaccess.h> 57 #include <drm/drm_dp_helper.h> 58 #include <drm/drm_crtc.h> 59 #include <drm/drmP.h> 60 61 struct drm_dp_aux_dev { 62 unsigned index; 63 struct drm_dp_aux *aux; 64 struct device *dev; 65 struct kref refcount; 66 atomic_t usecount; 67 }; 68 69 #define DRM_AUX_MINORS 256 70 #define AUX_MAX_OFFSET (1 << 20) 71 static DEFINE_IDR(aux_idr); 72 static DEFINE_MUTEX(aux_idr_mutex); 73 static struct class *drm_dp_aux_dev_class; 74 static int drm_dev_major = -1; 75 76 static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_minor(unsigned index) 77 { 78 struct drm_dp_aux_dev *aux_dev = NULL; 79 80 mutex_lock(&aux_idr_mutex); 81 aux_dev = idr_find(&aux_idr, index); 82 if (!kref_get_unless_zero(&aux_dev->refcount)) 83 aux_dev = NULL; 84 mutex_unlock(&aux_idr_mutex); 85 86 return aux_dev; 87 } 88 89 static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) 90 { 91 struct drm_dp_aux_dev *aux_dev; 92 int index; 93 94 aux_dev = kzalloc(sizeof(*aux_dev), GFP_KERNEL); 95 if (!aux_dev) 96 return ERR_PTR(-ENOMEM); 97 aux_dev->aux = aux; 98 atomic_set(&aux_dev->usecount, 1); 99 kref_init(&aux_dev->refcount); 100 101 mutex_lock(&aux_idr_mutex); 102 index = idr_alloc_cyclic(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, 103 GFP_KERNEL); 104 mutex_unlock(&aux_idr_mutex); 105 if (index < 0) { 106 kfree(aux_dev); 107 return ERR_PTR(index); 108 } 109 aux_dev->index = index; 110 111 return aux_dev; 112 } 113 114 static void release_drm_dp_aux_dev(struct kref *ref) 115 { 116 struct drm_dp_aux_dev *aux_dev = 117 container_of(ref, struct drm_dp_aux_dev, refcount); 118 119 kfree(aux_dev); 120 } 121 122 static ssize_t name_show(struct device *dev, 123 struct device_attribute *attr, char *buf) 124 { 125 ssize_t res; 126 struct drm_dp_aux_dev *aux_dev = 127 drm_dp_aux_dev_get_by_minor(MINOR(dev->devt)); 128 129 if (!aux_dev) 130 return -ENODEV; 131 132 res = sprintf(buf, "%s\n", aux_dev->aux->name); 133 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 134 135 return res; 136 } 137 static DEVICE_ATTR_RO(name); 138 139 static struct attribute *drm_dp_aux_attrs[] = { 140 &dev_attr_name.attr, 141 NULL, 142 }; 143 ATTRIBUTE_GROUPS(drm_dp_aux); 144 145 static int auxdev_open(struct inode *inode, struct file *file) 146 { 147 unsigned int minor = iminor(inode); 148 struct drm_dp_aux_dev *aux_dev; 149 150 aux_dev = drm_dp_aux_dev_get_by_minor(minor); 151 if (!aux_dev) 152 return -ENODEV; 153 154 file->private_data = aux_dev; 155 return 0; 156 } 157 158 static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence) 159 { 160 return fixed_size_llseek(file, offset, whence, AUX_MAX_OFFSET); 161 } 162 163 static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, 164 loff_t *offset) 165 { 166 size_t bytes_pending, num_bytes_processed = 0; 167 struct drm_dp_aux_dev *aux_dev = file->private_data; 168 ssize_t res = 0; 169 170 if (!atomic_inc_not_zero(&aux_dev->usecount)) 171 return -ENODEV; 172 173 bytes_pending = min((loff_t)count, AUX_MAX_OFFSET - (*offset)); 174 175 if (!access_ok(VERIFY_WRITE, buf, bytes_pending)) { 176 res = -EFAULT; 177 goto out; 178 } 179 180 while (bytes_pending > 0) { 181 uint8_t localbuf[DP_AUX_MAX_PAYLOAD_BYTES]; 182 ssize_t todo = min_t(size_t, bytes_pending, sizeof(localbuf)); 183 184 if (signal_pending(current)) { 185 res = num_bytes_processed ? 186 num_bytes_processed : -ERESTARTSYS; 187 goto out; 188 } 189 190 res = drm_dp_dpcd_read(aux_dev->aux, *offset, localbuf, todo); 191 if (res <= 0) { 192 res = num_bytes_processed ? num_bytes_processed : res; 193 goto out; 194 } 195 if (__copy_to_user(buf + num_bytes_processed, localbuf, res)) { 196 res = num_bytes_processed ? 197 num_bytes_processed : -EFAULT; 198 goto out; 199 } 200 bytes_pending -= res; 201 *offset += res; 202 num_bytes_processed += res; 203 res = num_bytes_processed; 204 } 205 206 out: 207 atomic_dec(&aux_dev->usecount); 208 wake_up_atomic_t(&aux_dev->usecount); 209 return res; 210 } 211 212 static ssize_t auxdev_write(struct file *file, const char __user *buf, 213 size_t count, loff_t *offset) 214 { 215 size_t bytes_pending, num_bytes_processed = 0; 216 struct drm_dp_aux_dev *aux_dev = file->private_data; 217 ssize_t res = 0; 218 219 if (!atomic_inc_not_zero(&aux_dev->usecount)) 220 return -ENODEV; 221 222 bytes_pending = min((loff_t)count, AUX_MAX_OFFSET - *offset); 223 224 if (!access_ok(VERIFY_READ, buf, bytes_pending)) { 225 res = -EFAULT; 226 goto out; 227 } 228 229 while (bytes_pending > 0) { 230 uint8_t localbuf[DP_AUX_MAX_PAYLOAD_BYTES]; 231 ssize_t todo = min_t(size_t, bytes_pending, sizeof(localbuf)); 232 233 if (signal_pending(current)) { 234 res = num_bytes_processed ? 235 num_bytes_processed : -ERESTARTSYS; 236 goto out; 237 } 238 239 if (__copy_from_user(localbuf, 240 buf + num_bytes_processed, todo)) { 241 res = num_bytes_processed ? 242 num_bytes_processed : -EFAULT; 243 goto out; 244 } 245 246 res = drm_dp_dpcd_write(aux_dev->aux, *offset, localbuf, todo); 247 if (res <= 0) { 248 res = num_bytes_processed ? num_bytes_processed : res; 249 goto out; 250 } 251 bytes_pending -= res; 252 *offset += res; 253 num_bytes_processed += res; 254 res = num_bytes_processed; 255 } 256 257 out: 258 atomic_dec(&aux_dev->usecount); 259 wake_up_atomic_t(&aux_dev->usecount); 260 return res; 261 } 262 263 static int auxdev_release(struct inode *inode, struct file *file) 264 { 265 struct drm_dp_aux_dev *aux_dev = file->private_data; 266 267 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 268 return 0; 269 } 270 271 static const struct file_operations auxdev_fops = { 272 .owner = THIS_MODULE, 273 .llseek = auxdev_llseek, 274 .read = auxdev_read, 275 .write = auxdev_write, 276 .open = auxdev_open, 277 .release = auxdev_release, 278 }; 279 280 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 281 282 static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_aux(struct drm_dp_aux *aux) 283 { 284 struct drm_dp_aux_dev *iter, *aux_dev = NULL; 285 int id; 286 287 /* don't increase kref count here because this function should only be 288 * used by drm_dp_aux_unregister_devnode. Thus, it will always have at 289 * least one reference - the one that drm_dp_aux_register_devnode 290 * created 291 */ 292 mutex_lock(&aux_idr_mutex); 293 idr_for_each_entry(&aux_idr, iter, id) { 294 if (iter->aux == aux) { 295 aux_dev = iter; 296 break; 297 } 298 } 299 mutex_unlock(&aux_idr_mutex); 300 return aux_dev; 301 } 302 303 static int auxdev_wait_atomic_t(atomic_t *p) 304 { 305 schedule(); 306 return 0; 307 } 308 /** 309 * drm_dp_aux_unregister_devnode() - unregister a devnode for this aux channel 310 * @aux: DisplayPort AUX channel 311 * 312 * Returns 0 on success or a negative error code on failure. 313 */ 314 void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux) 315 { 316 struct drm_dp_aux_dev *aux_dev; 317 unsigned int minor; 318 319 aux_dev = drm_dp_aux_dev_get_by_aux(aux); 320 if (!aux_dev) /* attach must have failed */ 321 return; 322 323 mutex_lock(&aux_idr_mutex); 324 idr_remove(&aux_idr, aux_dev->index); 325 mutex_unlock(&aux_idr_mutex); 326 327 atomic_dec(&aux_dev->usecount); 328 wait_on_atomic_t(&aux_dev->usecount, auxdev_wait_atomic_t, 329 TASK_UNINTERRUPTIBLE); 330 331 minor = aux_dev->index; 332 if (aux_dev->dev) 333 device_destroy(drm_dp_aux_dev_class, 334 MKDEV(drm_dev_major, minor)); 335 336 DRM_DEBUG("drm_dp_aux_dev: aux [%s] unregistering\n", aux->name); 337 kref_put(&aux_dev->refcount, release_drm_dp_aux_dev); 338 } 339 EXPORT_SYMBOL(drm_dp_aux_unregister_devnode); 340 341 /** 342 * drm_dp_aux_register_devnode() - register a devnode for this aux channel 343 * @aux: DisplayPort AUX channel 344 * 345 * Returns 0 on success or a negative error code on failure. 346 */ 347 int drm_dp_aux_register_devnode(struct drm_dp_aux *aux) 348 { 349 struct drm_dp_aux_dev *aux_dev; 350 int res; 351 352 aux_dev = alloc_drm_dp_aux_dev(aux); 353 if (IS_ERR(aux_dev)) 354 return PTR_ERR(aux_dev); 355 356 aux_dev->dev = device_create(drm_dp_aux_dev_class, aux->dev, 357 MKDEV(drm_dev_major, aux_dev->index), NULL, 358 "drm_dp_aux%d", aux_dev->index); 359 if (IS_ERR(aux_dev->dev)) { 360 res = PTR_ERR(aux_dev->dev); 361 aux_dev->dev = NULL; 362 goto error; 363 } 364 365 DRM_DEBUG("drm_dp_aux_dev: aux [%s] registered as minor %d\n", 366 aux->name, aux_dev->index); 367 return 0; 368 error: 369 drm_dp_aux_unregister_devnode(aux); 370 return res; 371 } 372 EXPORT_SYMBOL(drm_dp_aux_register_devnode); 373 374 int drm_dp_aux_dev_init(void) 375 { 376 int res; 377 378 drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev"); 379 if (IS_ERR(drm_dp_aux_dev_class)) { 380 res = PTR_ERR(drm_dp_aux_dev_class); 381 goto out; 382 } 383 drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups; 384 385 res = register_chrdev(0, "aux", &auxdev_fops); 386 if (res < 0) 387 goto out; 388 drm_dev_major = res; 389 390 return 0; 391 out: 392 class_destroy(drm_dp_aux_dev_class); 393 return res; 394 } 395 EXPORT_SYMBOL(drm_dp_aux_dev_init); 396 397 void drm_dp_aux_dev_exit(void) 398 { 399 unregister_chrdev(drm_dev_major, "aux"); 400 class_destroy(drm_dp_aux_dev_class); 401 } 402 EXPORT_SYMBOL(drm_dp_aux_dev_exit); 403 404 405 406 407 408 /* LDV_COMMENT_BEGIN_MAIN */ 409 #ifdef LDV_MAIN11_sequence_infinite_withcheck_stateful 410 411 /*###########################################################################*/ 412 413 /*############## Driver Environment Generator 0.2 output ####################*/ 414 415 /*###########################################################################*/ 416 417 418 419 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */ 420 void ldv_check_final_state(void); 421 422 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 423 void ldv_check_return_value(int res); 424 425 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 426 void ldv_check_return_value_probe(int res); 427 428 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 429 void ldv_initialize(void); 430 431 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 432 void ldv_handler_precall(void); 433 434 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 435 int nondet_int(void); 436 437 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 438 int LDV_IN_INTERRUPT; 439 440 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 441 void ldv_main11_sequence_infinite_withcheck_stateful(void) { 442 443 444 445 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 446 /*============================= VARIABLE DECLARATION PART =============================*/ 447 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 448 /* content: static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence)*/ 449 /* LDV_COMMENT_BEGIN_PREP */ 450 #define DRM_AUX_MINORS 256 451 #define AUX_MAX_OFFSET (1 << 20) 452 /* LDV_COMMENT_END_PREP */ 453 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 454 struct file * var_group1; 455 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 456 loff_t var_auxdev_llseek_5_p1; 457 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_llseek" */ 458 int var_auxdev_llseek_5_p2; 459 /* LDV_COMMENT_BEGIN_PREP */ 460 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 461 /* LDV_COMMENT_END_PREP */ 462 /* content: static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, loff_t *offset)*/ 463 /* LDV_COMMENT_BEGIN_PREP */ 464 #define DRM_AUX_MINORS 256 465 #define AUX_MAX_OFFSET (1 << 20) 466 /* LDV_COMMENT_END_PREP */ 467 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 468 char __user * var_auxdev_read_6_p1; 469 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 470 size_t var_auxdev_read_6_p2; 471 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_read" */ 472 loff_t * var_auxdev_read_6_p3; 473 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_read" */ 474 static ssize_t res_auxdev_read_6; 475 /* LDV_COMMENT_BEGIN_PREP */ 476 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 477 /* LDV_COMMENT_END_PREP */ 478 /* content: static ssize_t auxdev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)*/ 479 /* LDV_COMMENT_BEGIN_PREP */ 480 #define DRM_AUX_MINORS 256 481 #define AUX_MAX_OFFSET (1 << 20) 482 /* LDV_COMMENT_END_PREP */ 483 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 484 const char __user * var_auxdev_write_7_p1; 485 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 486 size_t var_auxdev_write_7_p2; 487 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_write" */ 488 loff_t * var_auxdev_write_7_p3; 489 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_write" */ 490 static ssize_t res_auxdev_write_7; 491 /* LDV_COMMENT_BEGIN_PREP */ 492 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 493 /* LDV_COMMENT_END_PREP */ 494 /* content: static int auxdev_open(struct inode *inode, struct file *file)*/ 495 /* LDV_COMMENT_BEGIN_PREP */ 496 #define DRM_AUX_MINORS 256 497 #define AUX_MAX_OFFSET (1 << 20) 498 /* LDV_COMMENT_END_PREP */ 499 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "auxdev_open" */ 500 struct inode * var_group2; 501 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "auxdev_open" */ 502 static int res_auxdev_open_4; 503 /* LDV_COMMENT_BEGIN_PREP */ 504 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 505 /* LDV_COMMENT_END_PREP */ 506 /* content: static int auxdev_release(struct inode *inode, struct file *file)*/ 507 /* LDV_COMMENT_BEGIN_PREP */ 508 #define DRM_AUX_MINORS 256 509 #define AUX_MAX_OFFSET (1 << 20) 510 /* LDV_COMMENT_END_PREP */ 511 /* LDV_COMMENT_BEGIN_PREP */ 512 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 513 /* LDV_COMMENT_END_PREP */ 514 515 516 517 518 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 519 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 520 /*============================= VARIABLE INITIALIZING PART =============================*/ 521 LDV_IN_INTERRUPT=1; 522 523 524 525 526 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 527 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 528 /*============================= FUNCTION CALL SECTION =============================*/ 529 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 530 ldv_initialize(); 531 int ldv_s_auxdev_fops_file_operations = 0; 532 533 534 while( nondet_int() 535 || !(ldv_s_auxdev_fops_file_operations == 0) 536 ) { 537 538 switch(nondet_int()) { 539 540 case 0: { 541 542 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 543 if(ldv_s_auxdev_fops_file_operations==0) { 544 545 /* content: static int auxdev_open(struct inode *inode, struct file *file)*/ 546 /* LDV_COMMENT_BEGIN_PREP */ 547 #define DRM_AUX_MINORS 256 548 #define AUX_MAX_OFFSET (1 << 20) 549 /* LDV_COMMENT_END_PREP */ 550 /* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 551 ldv_handler_precall(); 552 res_auxdev_open_4 = auxdev_open( var_group2, var_group1); 553 ldv_check_return_value(res_auxdev_open_4); 554 if(res_auxdev_open_4) 555 goto ldv_module_exit; 556 /* LDV_COMMENT_BEGIN_PREP */ 557 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 558 /* LDV_COMMENT_END_PREP */ 559 ldv_s_auxdev_fops_file_operations++; 560 561 } 562 563 } 564 565 break; 566 case 1: { 567 568 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 569 if(ldv_s_auxdev_fops_file_operations==1) { 570 571 /* content: static ssize_t auxdev_read(struct file *file, char __user *buf, size_t count, loff_t *offset)*/ 572 /* LDV_COMMENT_BEGIN_PREP */ 573 #define DRM_AUX_MINORS 256 574 #define AUX_MAX_OFFSET (1 << 20) 575 /* LDV_COMMENT_END_PREP */ 576 /* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 577 ldv_handler_precall(); 578 res_auxdev_read_6 = auxdev_read( var_group1, var_auxdev_read_6_p1, var_auxdev_read_6_p2, var_auxdev_read_6_p3); 579 ldv_check_return_value(res_auxdev_read_6); 580 if(res_auxdev_read_6 < 0) 581 goto ldv_module_exit; 582 /* LDV_COMMENT_BEGIN_PREP */ 583 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 584 /* LDV_COMMENT_END_PREP */ 585 ldv_s_auxdev_fops_file_operations++; 586 587 } 588 589 } 590 591 break; 592 case 2: { 593 594 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 595 if(ldv_s_auxdev_fops_file_operations==2) { 596 597 /* content: static ssize_t auxdev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)*/ 598 /* LDV_COMMENT_BEGIN_PREP */ 599 #define DRM_AUX_MINORS 256 600 #define AUX_MAX_OFFSET (1 << 20) 601 /* LDV_COMMENT_END_PREP */ 602 /* LDV_COMMENT_FUNCTION_CALL Function from field "write" from driver structure with callbacks "auxdev_fops". Standart function test for correct return result. */ 603 ldv_handler_precall(); 604 res_auxdev_write_7 = auxdev_write( var_group1, var_auxdev_write_7_p1, var_auxdev_write_7_p2, var_auxdev_write_7_p3); 605 ldv_check_return_value(res_auxdev_write_7); 606 if(res_auxdev_write_7 < 0) 607 goto ldv_module_exit; 608 /* LDV_COMMENT_BEGIN_PREP */ 609 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 610 /* LDV_COMMENT_END_PREP */ 611 ldv_s_auxdev_fops_file_operations++; 612 613 } 614 615 } 616 617 break; 618 case 3: { 619 620 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 621 if(ldv_s_auxdev_fops_file_operations==3) { 622 623 /* content: static loff_t auxdev_llseek(struct file *file, loff_t offset, int whence)*/ 624 /* LDV_COMMENT_BEGIN_PREP */ 625 #define DRM_AUX_MINORS 256 626 #define AUX_MAX_OFFSET (1 << 20) 627 /* LDV_COMMENT_END_PREP */ 628 /* LDV_COMMENT_FUNCTION_CALL Function from field "llseek" from driver structure with callbacks "auxdev_fops" */ 629 ldv_handler_precall(); 630 auxdev_llseek( var_group1, var_auxdev_llseek_5_p1, var_auxdev_llseek_5_p2); 631 /* LDV_COMMENT_BEGIN_PREP */ 632 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 633 /* LDV_COMMENT_END_PREP */ 634 ldv_s_auxdev_fops_file_operations++; 635 636 } 637 638 } 639 640 break; 641 case 4: { 642 643 /** STRUCT: struct type: file_operations, struct name: auxdev_fops **/ 644 if(ldv_s_auxdev_fops_file_operations==4) { 645 646 /* content: static int auxdev_release(struct inode *inode, struct file *file)*/ 647 /* LDV_COMMENT_BEGIN_PREP */ 648 #define DRM_AUX_MINORS 256 649 #define AUX_MAX_OFFSET (1 << 20) 650 /* LDV_COMMENT_END_PREP */ 651 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "auxdev_fops" */ 652 ldv_handler_precall(); 653 auxdev_release( var_group2, var_group1); 654 /* LDV_COMMENT_BEGIN_PREP */ 655 #define to_auxdev(d) container_of(d, struct drm_dp_aux_dev, aux) 656 /* LDV_COMMENT_END_PREP */ 657 ldv_s_auxdev_fops_file_operations=0; 658 659 } 660 661 } 662 663 break; 664 default: break; 665 666 } 667 668 } 669 670 ldv_module_exit: 671 672 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 673 ldv_final: ldv_check_final_state(); 674 675 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 676 return; 677 678 } 679 #endif 680 681 /* LDV_COMMENT_END_MAIN */ 682 683 #line 21 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--106_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/5249/dscv_tempdir/dscv/ri/106_1a/drivers/gpu/drm/drm_dp_aux_dev.o.c.prepared"
1 2 /* 3 * Copyright (c) 2006-2009 Red Hat Inc. 4 * Copyright (c) 2006-2008 Intel Corporation 5 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> 6 * 7 * DRM framebuffer helper functions 8 * 9 * Permission to use, copy, modify, distribute, and sell this software and its 10 * documentation for any purpose is hereby granted without fee, provided that 11 * the above copyright notice appear in all copies and that both that copyright 12 * notice and this permission notice appear in supporting documentation, and 13 * that the name of the copyright holders not be used in advertising or 14 * publicity pertaining to distribution of the software without specific, 15 * written prior permission. The copyright holders make no representations 16 * about the suitability of this software for any purpose. It is provided "as 17 * is" without express or implied warranty. 18 * 19 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 20 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 21 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 22 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 23 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 24 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 25 * OF THIS SOFTWARE. 26 * 27 * Authors: 28 * Dave Airlie <airlied@linux.ie> 29 * Jesse Barnes <jesse.barnes@intel.com> 30 */ 31 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 32 33 #include <linux/kernel.h> 34 #include <linux/sysrq.h> 35 #include <linux/slab.h> 36 #include <linux/fb.h> 37 #include <linux/module.h> 38 #include <drm/drmP.h> 39 #include <drm/drm_crtc.h> 40 #include <drm/drm_fb_helper.h> 41 #include <drm/drm_crtc_helper.h> 42 #include <drm/drm_atomic.h> 43 #include <drm/drm_atomic_helper.h> 44 45 static bool drm_fbdev_emulation = true; 46 module_param_named(fbdev_emulation, drm_fbdev_emulation, bool, 0600); 47 MODULE_PARM_DESC(fbdev_emulation, 48 "Enable legacy fbdev emulation [default=true]"); 49 50 static LIST_HEAD(kernel_fb_helper_list); 51 52 /** 53 * DOC: fbdev helpers 54 * 55 * The fb helper functions are useful to provide an fbdev on top of a drm kernel 56 * mode setting driver. They can be used mostly independently from the crtc 57 * helper functions used by many drivers to implement the kernel mode setting 58 * interfaces. 59 * 60 * Initialization is done as a four-step process with drm_fb_helper_prepare(), 61 * drm_fb_helper_init(), drm_fb_helper_single_add_all_connectors() and 62 * drm_fb_helper_initial_config(). Drivers with fancier requirements than the 63 * default behaviour can override the third step with their own code. 64 * Teardown is done with drm_fb_helper_fini(). 65 * 66 * At runtime drivers should restore the fbdev console by calling 67 * drm_fb_helper_restore_fbdev_mode_unlocked() from their ->lastclose callback. 68 * They should also notify the fb helper code from updates to the output 69 * configuration by calling drm_fb_helper_hotplug_event(). For easier 70 * integration with the output polling code in drm_crtc_helper.c the modeset 71 * code provides a ->output_poll_changed callback. 72 * 73 * All other functions exported by the fb helper library can be used to 74 * implement the fbdev driver interface by the driver. 75 * 76 * It is possible, though perhaps somewhat tricky, to implement race-free 77 * hotplug detection using the fbdev helpers. The drm_fb_helper_prepare() 78 * helper must be called first to initialize the minimum required to make 79 * hotplug detection work. Drivers also need to make sure to properly set up 80 * the dev->mode_config.funcs member. After calling drm_kms_helper_poll_init() 81 * it is safe to enable interrupts and start processing hotplug events. At the 82 * same time, drivers should initialize all modeset objects such as CRTCs, 83 * encoders and connectors. To finish up the fbdev helper initialization, the 84 * drm_fb_helper_init() function is called. To probe for all attached displays 85 * and set up an initial configuration using the detected hardware, drivers 86 * should call drm_fb_helper_single_add_all_connectors() followed by 87 * drm_fb_helper_initial_config(). 88 * 89 * If &drm_framebuffer_funcs ->dirty is set, the 90 * drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will 91 * accumulate changes and schedule &drm_fb_helper ->dirty_work to run right 92 * away. This worker then calls the dirty() function ensuring that it will 93 * always run in process context since the fb_*() function could be running in 94 * atomic context. If drm_fb_helper_deferred_io() is used as the deferred_io 95 * callback it will also schedule dirty_work with the damage collected from the 96 * mmap page writes. 97 */ 98 99 /** 100 * drm_fb_helper_single_add_all_connectors() - add all connectors to fbdev 101 * emulation helper 102 * @fb_helper: fbdev initialized with drm_fb_helper_init 103 * 104 * This functions adds all the available connectors for use with the given 105 * fb_helper. This is a separate step to allow drivers to freely assign 106 * connectors to the fbdev, e.g. if some are reserved for special purposes or 107 * not adequate to be used for the fbcon. 108 * 109 * This function is protected against concurrent connector hotadds/removals 110 * using drm_fb_helper_add_one_connector() and 111 * drm_fb_helper_remove_one_connector(). 112 */ 113 int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper) 114 { 115 struct drm_device *dev = fb_helper->dev; 116 struct drm_connector *connector; 117 int i, ret; 118 119 if (!drm_fbdev_emulation) 120 return 0; 121 122 mutex_lock(&dev->mode_config.mutex); 123 drm_for_each_connector(connector, dev) { 124 ret = drm_fb_helper_add_one_connector(fb_helper, connector); 125 126 if (ret) 127 goto fail; 128 } 129 mutex_unlock(&dev->mode_config.mutex); 130 return 0; 131 fail: 132 for (i = 0; i < fb_helper->connector_count; i++) { 133 kfree(fb_helper->connector_info[i]); 134 fb_helper->connector_info[i] = NULL; 135 } 136 fb_helper->connector_count = 0; 137 mutex_unlock(&dev->mode_config.mutex); 138 139 return ret; 140 } 141 EXPORT_SYMBOL(drm_fb_helper_single_add_all_connectors); 142 143 int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector) 144 { 145 struct drm_fb_helper_connector **temp; 146 struct drm_fb_helper_connector *fb_helper_connector; 147 148 if (!drm_fbdev_emulation) 149 return 0; 150 151 WARN_ON(!mutex_is_locked(&fb_helper->dev->mode_config.mutex)); 152 if (fb_helper->connector_count + 1 > fb_helper->connector_info_alloc_count) { 153 temp = krealloc(fb_helper->connector_info, sizeof(struct drm_fb_helper_connector *) * (fb_helper->connector_count + 1), GFP_KERNEL); 154 if (!temp) 155 return -ENOMEM; 156 157 fb_helper->connector_info_alloc_count = fb_helper->connector_count + 1; 158 fb_helper->connector_info = temp; 159 } 160 161 162 fb_helper_connector = kzalloc(sizeof(struct drm_fb_helper_connector), GFP_KERNEL); 163 if (!fb_helper_connector) 164 return -ENOMEM; 165 166 drm_connector_reference(connector); 167 fb_helper_connector->connector = connector; 168 fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector; 169 return 0; 170 } 171 EXPORT_SYMBOL(drm_fb_helper_add_one_connector); 172 173 int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, 174 struct drm_connector *connector) 175 { 176 struct drm_fb_helper_connector *fb_helper_connector; 177 int i, j; 178 179 if (!drm_fbdev_emulation) 180 return 0; 181 182 WARN_ON(!mutex_is_locked(&fb_helper->dev->mode_config.mutex)); 183 184 for (i = 0; i < fb_helper->connector_count; i++) { 185 if (fb_helper->connector_info[i]->connector == connector) 186 break; 187 } 188 189 if (i == fb_helper->connector_count) 190 return -EINVAL; 191 fb_helper_connector = fb_helper->connector_info[i]; 192 drm_connector_unreference(fb_helper_connector->connector); 193 194 for (j = i + 1; j < fb_helper->connector_count; j++) { 195 fb_helper->connector_info[j - 1] = fb_helper->connector_info[j]; 196 } 197 fb_helper->connector_count--; 198 kfree(fb_helper_connector); 199 200 return 0; 201 } 202 EXPORT_SYMBOL(drm_fb_helper_remove_one_connector); 203 204 static void drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper) 205 { 206 uint16_t *r_base, *g_base, *b_base; 207 int i; 208 209 if (helper->funcs->gamma_get == NULL) 210 return; 211 212 r_base = crtc->gamma_store; 213 g_base = r_base + crtc->gamma_size; 214 b_base = g_base + crtc->gamma_size; 215 216 for (i = 0; i < crtc->gamma_size; i++) 217 helper->funcs->gamma_get(crtc, &r_base[i], &g_base[i], &b_base[i], i); 218 } 219 220 static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc) 221 { 222 uint16_t *r_base, *g_base, *b_base; 223 224 if (crtc->funcs->gamma_set == NULL) 225 return; 226 227 r_base = crtc->gamma_store; 228 g_base = r_base + crtc->gamma_size; 229 b_base = g_base + crtc->gamma_size; 230 231 crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size); 232 } 233 234 /** 235 * drm_fb_helper_debug_enter - implementation for ->fb_debug_enter 236 * @info: fbdev registered by the helper 237 */ 238 int drm_fb_helper_debug_enter(struct fb_info *info) 239 { 240 struct drm_fb_helper *helper = info->par; 241 const struct drm_crtc_helper_funcs *funcs; 242 int i; 243 244 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 245 for (i = 0; i < helper->crtc_count; i++) { 246 struct drm_mode_set *mode_set = 247 &helper->crtc_info[i].mode_set; 248 249 if (!mode_set->crtc->enabled) 250 continue; 251 252 funcs = mode_set->crtc->helper_private; 253 drm_fb_helper_save_lut_atomic(mode_set->crtc, helper); 254 funcs->mode_set_base_atomic(mode_set->crtc, 255 mode_set->fb, 256 mode_set->x, 257 mode_set->y, 258 ENTER_ATOMIC_MODE_SET); 259 } 260 } 261 262 return 0; 263 } 264 EXPORT_SYMBOL(drm_fb_helper_debug_enter); 265 266 /* Find the real fb for a given fb helper CRTC */ 267 static struct drm_framebuffer *drm_mode_config_fb(struct drm_crtc *crtc) 268 { 269 struct drm_device *dev = crtc->dev; 270 struct drm_crtc *c; 271 272 drm_for_each_crtc(c, dev) { 273 if (crtc->base.id == c->base.id) 274 return c->primary->fb; 275 } 276 277 return NULL; 278 } 279 280 /** 281 * drm_fb_helper_debug_leave - implementation for ->fb_debug_leave 282 * @info: fbdev registered by the helper 283 */ 284 int drm_fb_helper_debug_leave(struct fb_info *info) 285 { 286 struct drm_fb_helper *helper = info->par; 287 struct drm_crtc *crtc; 288 const struct drm_crtc_helper_funcs *funcs; 289 struct drm_framebuffer *fb; 290 int i; 291 292 for (i = 0; i < helper->crtc_count; i++) { 293 struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set; 294 crtc = mode_set->crtc; 295 funcs = crtc->helper_private; 296 fb = drm_mode_config_fb(crtc); 297 298 if (!crtc->enabled) 299 continue; 300 301 if (!fb) { 302 DRM_ERROR("no fb to restore??\n"); 303 continue; 304 } 305 306 drm_fb_helper_restore_lut_atomic(mode_set->crtc); 307 funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x, 308 crtc->y, LEAVE_ATOMIC_MODE_SET); 309 } 310 311 return 0; 312 } 313 EXPORT_SYMBOL(drm_fb_helper_debug_leave); 314 315 static int restore_fbdev_mode_atomic(struct drm_fb_helper *fb_helper) 316 { 317 struct drm_device *dev = fb_helper->dev; 318 struct drm_plane *plane; 319 struct drm_atomic_state *state; 320 int i, ret; 321 unsigned plane_mask; 322 323 state = drm_atomic_state_alloc(dev); 324 if (!state) 325 return -ENOMEM; 326 327 state->acquire_ctx = dev->mode_config.acquire_ctx; 328 retry: 329 plane_mask = 0; 330 drm_for_each_plane(plane, dev) { 331 struct drm_plane_state *plane_state; 332 333 plane_state = drm_atomic_get_plane_state(state, plane); 334 if (IS_ERR(plane_state)) { 335 ret = PTR_ERR(plane_state); 336 goto fail; 337 } 338 339 plane_state->rotation = BIT(DRM_ROTATE_0); 340 341 plane->old_fb = plane->fb; 342 plane_mask |= 1 << drm_plane_index(plane); 343 344 /* disable non-primary: */ 345 if (plane->type == DRM_PLANE_TYPE_PRIMARY) 346 continue; 347 348 ret = __drm_atomic_helper_disable_plane(plane, plane_state); 349 if (ret != 0) 350 goto fail; 351 } 352 353 for(i = 0; i < fb_helper->crtc_count; i++) { 354 struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; 355 356 ret = __drm_atomic_helper_set_config(mode_set, state); 357 if (ret != 0) 358 goto fail; 359 } 360 361 ret = drm_atomic_commit(state); 362 363 fail: 364 drm_atomic_clean_old_fb(dev, plane_mask, ret); 365 366 if (ret == -EDEADLK) 367 goto backoff; 368 369 if (ret != 0) 370 drm_atomic_state_free(state); 371 372 return ret; 373 374 backoff: 375 drm_atomic_state_clear(state); 376 drm_atomic_legacy_backoff(state); 377 378 goto retry; 379 } 380 381 static int restore_fbdev_mode(struct drm_fb_helper *fb_helper) 382 { 383 struct drm_device *dev = fb_helper->dev; 384 struct drm_plane *plane; 385 int i; 386 387 drm_warn_on_modeset_not_all_locked(dev); 388 389 if (fb_helper->atomic) 390 return restore_fbdev_mode_atomic(fb_helper); 391 392 drm_for_each_plane(plane, dev) { 393 if (plane->type != DRM_PLANE_TYPE_PRIMARY) 394 drm_plane_force_disable(plane); 395 396 if (dev->mode_config.rotation_property) { 397 drm_mode_plane_set_obj_prop(plane, 398 dev->mode_config.rotation_property, 399 BIT(DRM_ROTATE_0)); 400 } 401 } 402 403 for (i = 0; i < fb_helper->crtc_count; i++) { 404 struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; 405 struct drm_crtc *crtc = mode_set->crtc; 406 int ret; 407 408 if (crtc->funcs->cursor_set2) { 409 ret = crtc->funcs->cursor_set2(crtc, NULL, 0, 0, 0, 0, 0); 410 if (ret) 411 return ret; 412 } else if (crtc->funcs->cursor_set) { 413 ret = crtc->funcs->cursor_set(crtc, NULL, 0, 0, 0); 414 if (ret) 415 return ret; 416 } 417 418 ret = drm_mode_set_config_internal(mode_set); 419 if (ret) 420 return ret; 421 } 422 423 return 0; 424 } 425 426 /** 427 * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration 428 * @fb_helper: fbcon to restore 429 * 430 * This should be called from driver's drm ->lastclose callback 431 * when implementing an fbcon on top of kms using this helper. This ensures that 432 * the user isn't greeted with a black screen when e.g. X dies. 433 * 434 * RETURNS: 435 * Zero if everything went ok, negative error code otherwise. 436 */ 437 int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper) 438 { 439 struct drm_device *dev = fb_helper->dev; 440 bool do_delayed; 441 int ret; 442 443 if (!drm_fbdev_emulation) 444 return -ENODEV; 445 446 drm_modeset_lock_all(dev); 447 ret = restore_fbdev_mode(fb_helper); 448 449 do_delayed = fb_helper->delayed_hotplug; 450 if (do_delayed) 451 fb_helper->delayed_hotplug = false; 452 drm_modeset_unlock_all(dev); 453 454 if (do_delayed) 455 drm_fb_helper_hotplug_event(fb_helper); 456 return ret; 457 } 458 EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode_unlocked); 459 460 static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper) 461 { 462 struct drm_device *dev = fb_helper->dev; 463 struct drm_crtc *crtc; 464 int bound = 0, crtcs_bound = 0; 465 466 /* Sometimes user space wants everything disabled, so don't steal the 467 * display if there's a master. */ 468 if (dev->primary->master) 469 return false; 470 471 drm_for_each_crtc(crtc, dev) { 472 if (crtc->primary->fb) 473 crtcs_bound++; 474 if (crtc->primary->fb == fb_helper->fb) 475 bound++; 476 } 477 478 if (bound < crtcs_bound) 479 return false; 480 481 return true; 482 } 483 484 #ifdef CONFIG_MAGIC_SYSRQ 485 /* 486 * restore fbcon display for all kms driver's using this helper, used for sysrq 487 * and panic handling. 488 */ 489 static bool drm_fb_helper_force_kernel_mode(void) 490 { 491 bool ret, error = false; 492 struct drm_fb_helper *helper; 493 494 if (list_empty(&kernel_fb_helper_list)) 495 return false; 496 497 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 498 struct drm_device *dev = helper->dev; 499 500 if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) 501 continue; 502 503 drm_modeset_lock_all(dev); 504 ret = restore_fbdev_mode(helper); 505 if (ret) 506 error = true; 507 drm_modeset_unlock_all(dev); 508 } 509 return error; 510 } 511 512 static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) 513 { 514 bool ret; 515 ret = drm_fb_helper_force_kernel_mode(); 516 if (ret == true) 517 DRM_ERROR("Failed to restore crtc configuration\n"); 518 } 519 static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn); 520 521 static void drm_fb_helper_sysrq(int dummy1) 522 { 523 schedule_work(&drm_fb_helper_restore_work); 524 } 525 526 static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { 527 .handler = drm_fb_helper_sysrq, 528 .help_msg = "force-fb(V)", 529 .action_msg = "Restore framebuffer console", 530 }; 531 #else 532 static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { }; 533 #endif 534 535 static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) 536 { 537 struct drm_fb_helper *fb_helper = info->par; 538 struct drm_device *dev = fb_helper->dev; 539 struct drm_crtc *crtc; 540 struct drm_connector *connector; 541 int i, j; 542 543 /* 544 * For each CRTC in this fb, turn the connectors on/off. 545 */ 546 drm_modeset_lock_all(dev); 547 if (!drm_fb_helper_is_bound(fb_helper)) { 548 drm_modeset_unlock_all(dev); 549 return; 550 } 551 552 for (i = 0; i < fb_helper->crtc_count; i++) { 553 crtc = fb_helper->crtc_info[i].mode_set.crtc; 554 555 if (!crtc->enabled) 556 continue; 557 558 /* Walk the connectors & encoders on this fb turning them on/off */ 559 for (j = 0; j < fb_helper->connector_count; j++) { 560 connector = fb_helper->connector_info[j]->connector; 561 connector->funcs->dpms(connector, dpms_mode); 562 drm_object_property_set_value(&connector->base, 563 dev->mode_config.dpms_property, dpms_mode); 564 } 565 } 566 drm_modeset_unlock_all(dev); 567 } 568 569 /** 570 * drm_fb_helper_blank - implementation for ->fb_blank 571 * @blank: desired blanking state 572 * @info: fbdev registered by the helper 573 */ 574 int drm_fb_helper_blank(int blank, struct fb_info *info) 575 { 576 if (oops_in_progress) 577 return -EBUSY; 578 579 switch (blank) { 580 /* Display: On; HSync: On, VSync: On */ 581 case FB_BLANK_UNBLANK: 582 drm_fb_helper_dpms(info, DRM_MODE_DPMS_ON); 583 break; 584 /* Display: Off; HSync: On, VSync: On */ 585 case FB_BLANK_NORMAL: 586 drm_fb_helper_dpms(info, DRM_MODE_DPMS_STANDBY); 587 break; 588 /* Display: Off; HSync: Off, VSync: On */ 589 case FB_BLANK_HSYNC_SUSPEND: 590 drm_fb_helper_dpms(info, DRM_MODE_DPMS_STANDBY); 591 break; 592 /* Display: Off; HSync: On, VSync: Off */ 593 case FB_BLANK_VSYNC_SUSPEND: 594 drm_fb_helper_dpms(info, DRM_MODE_DPMS_SUSPEND); 595 break; 596 /* Display: Off; HSync: Off, VSync: Off */ 597 case FB_BLANK_POWERDOWN: 598 drm_fb_helper_dpms(info, DRM_MODE_DPMS_OFF); 599 break; 600 } 601 return 0; 602 } 603 EXPORT_SYMBOL(drm_fb_helper_blank); 604 605 static void drm_fb_helper_crtc_free(struct drm_fb_helper *helper) 606 { 607 int i; 608 609 for (i = 0; i < helper->connector_count; i++) { 610 drm_connector_unreference(helper->connector_info[i]->connector); 611 kfree(helper->connector_info[i]); 612 } 613 kfree(helper->connector_info); 614 for (i = 0; i < helper->crtc_count; i++) { 615 kfree(helper->crtc_info[i].mode_set.connectors); 616 if (helper->crtc_info[i].mode_set.mode) 617 drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); 618 } 619 kfree(helper->crtc_info); 620 } 621 622 static void drm_fb_helper_dirty_work(struct work_struct *work) 623 { 624 struct drm_fb_helper *helper = container_of(work, struct drm_fb_helper, 625 dirty_work); 626 struct drm_clip_rect *clip = &helper->dirty_clip; 627 struct drm_clip_rect clip_copy; 628 unsigned long flags; 629 630 spin_lock_irqsave(&helper->dirty_lock, flags); 631 clip_copy = *clip; 632 clip->x1 = clip->y1 = ~0; 633 clip->x2 = clip->y2 = 0; 634 spin_unlock_irqrestore(&helper->dirty_lock, flags); 635 636 helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, &clip_copy, 1); 637 } 638 639 /** 640 * drm_fb_helper_prepare - setup a drm_fb_helper structure 641 * @dev: DRM device 642 * @helper: driver-allocated fbdev helper structure to set up 643 * @funcs: pointer to structure of functions associate with this helper 644 * 645 * Sets up the bare minimum to make the framebuffer helper usable. This is 646 * useful to implement race-free initialization of the polling helpers. 647 */ 648 void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, 649 const struct drm_fb_helper_funcs *funcs) 650 { 651 INIT_LIST_HEAD(&helper->kernel_fb_list); 652 spin_lock_init(&helper->dirty_lock); 653 INIT_WORK(&helper->dirty_work, drm_fb_helper_dirty_work); 654 helper->dirty_clip.x1 = helper->dirty_clip.y1 = ~0; 655 helper->funcs = funcs; 656 helper->dev = dev; 657 } 658 EXPORT_SYMBOL(drm_fb_helper_prepare); 659 660 /** 661 * drm_fb_helper_init - initialize a drm_fb_helper structure 662 * @dev: drm device 663 * @fb_helper: driver-allocated fbdev helper structure to initialize 664 * @crtc_count: maximum number of crtcs to support in this fbdev emulation 665 * @max_conn_count: max connector count 666 * 667 * This allocates the structures for the fbdev helper with the given limits. 668 * Note that this won't yet touch the hardware (through the driver interfaces) 669 * nor register the fbdev. This is only done in drm_fb_helper_initial_config() 670 * to allow driver writes more control over the exact init sequence. 671 * 672 * Drivers must call drm_fb_helper_prepare() before calling this function. 673 * 674 * RETURNS: 675 * Zero if everything went ok, nonzero otherwise. 676 */ 677 int drm_fb_helper_init(struct drm_device *dev, 678 struct drm_fb_helper *fb_helper, 679 int crtc_count, int max_conn_count) 680 { 681 struct drm_crtc *crtc; 682 int i; 683 684 if (!drm_fbdev_emulation) 685 return 0; 686 687 if (!max_conn_count) 688 return -EINVAL; 689 690 fb_helper->crtc_info = kcalloc(crtc_count, sizeof(struct drm_fb_helper_crtc), GFP_KERNEL); 691 if (!fb_helper->crtc_info) 692 return -ENOMEM; 693 694 fb_helper->crtc_count = crtc_count; 695 fb_helper->connector_info = kcalloc(dev->mode_config.num_connector, sizeof(struct drm_fb_helper_connector *), GFP_KERNEL); 696 if (!fb_helper->connector_info) { 697 kfree(fb_helper->crtc_info); 698 return -ENOMEM; 699 } 700 fb_helper->connector_info_alloc_count = dev->mode_config.num_connector; 701 fb_helper->connector_count = 0; 702 703 for (i = 0; i < crtc_count; i++) { 704 fb_helper->crtc_info[i].mode_set.connectors = 705 kcalloc(max_conn_count, 706 sizeof(struct drm_connector *), 707 GFP_KERNEL); 708 709 if (!fb_helper->crtc_info[i].mode_set.connectors) 710 goto out_free; 711 fb_helper->crtc_info[i].mode_set.num_connectors = 0; 712 } 713 714 i = 0; 715 drm_for_each_crtc(crtc, dev) { 716 fb_helper->crtc_info[i].mode_set.crtc = crtc; 717 i++; 718 } 719 720 fb_helper->atomic = !!drm_core_check_feature(dev, DRIVER_ATOMIC); 721 722 return 0; 723 out_free: 724 drm_fb_helper_crtc_free(fb_helper); 725 return -ENOMEM; 726 } 727 EXPORT_SYMBOL(drm_fb_helper_init); 728 729 /** 730 * drm_fb_helper_alloc_fbi - allocate fb_info and some of its members 731 * @fb_helper: driver-allocated fbdev helper 732 * 733 * A helper to alloc fb_info and the members cmap and apertures. Called 734 * by the driver within the fb_probe fb_helper callback function. 735 * 736 * RETURNS: 737 * fb_info pointer if things went okay, pointer containing error code 738 * otherwise 739 */ 740 struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper) 741 { 742 struct device *dev = fb_helper->dev->dev; 743 struct fb_info *info; 744 int ret; 745 746 info = framebuffer_alloc(0, dev); 747 if (!info) 748 return ERR_PTR(-ENOMEM); 749 750 ret = fb_alloc_cmap(&info->cmap, 256, 0); 751 if (ret) 752 goto err_release; 753 754 info->apertures = alloc_apertures(1); 755 if (!info->apertures) { 756 ret = -ENOMEM; 757 goto err_free_cmap; 758 } 759 760 fb_helper->fbdev = info; 761 762 return info; 763 764 err_free_cmap: 765 fb_dealloc_cmap(&info->cmap); 766 err_release: 767 framebuffer_release(info); 768 return ERR_PTR(ret); 769 } 770 EXPORT_SYMBOL(drm_fb_helper_alloc_fbi); 771 772 /** 773 * drm_fb_helper_unregister_fbi - unregister fb_info framebuffer device 774 * @fb_helper: driver-allocated fbdev helper 775 * 776 * A wrapper around unregister_framebuffer, to release the fb_info 777 * framebuffer device 778 */ 779 void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper) 780 { 781 if (fb_helper && fb_helper->fbdev) 782 unregister_framebuffer(fb_helper->fbdev); 783 } 784 EXPORT_SYMBOL(drm_fb_helper_unregister_fbi); 785 786 /** 787 * drm_fb_helper_release_fbi - dealloc fb_info and its members 788 * @fb_helper: driver-allocated fbdev helper 789 * 790 * A helper to free memory taken by fb_info and the members cmap and 791 * apertures 792 */ 793 void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper) 794 { 795 if (fb_helper) { 796 struct fb_info *info = fb_helper->fbdev; 797 798 if (info) { 799 if (info->cmap.len) 800 fb_dealloc_cmap(&info->cmap); 801 framebuffer_release(info); 802 } 803 804 fb_helper->fbdev = NULL; 805 } 806 } 807 EXPORT_SYMBOL(drm_fb_helper_release_fbi); 808 809 void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) 810 { 811 if (!drm_fbdev_emulation) 812 return; 813 814 if (!list_empty(&fb_helper->kernel_fb_list)) { 815 list_del(&fb_helper->kernel_fb_list); 816 if (list_empty(&kernel_fb_helper_list)) { 817 unregister_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); 818 } 819 } 820 821 drm_fb_helper_crtc_free(fb_helper); 822 823 } 824 EXPORT_SYMBOL(drm_fb_helper_fini); 825 826 /** 827 * drm_fb_helper_unlink_fbi - wrapper around unlink_framebuffer 828 * @fb_helper: driver-allocated fbdev helper 829 * 830 * A wrapper around unlink_framebuffer implemented by fbdev core 831 */ 832 void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper) 833 { 834 if (fb_helper && fb_helper->fbdev) 835 unlink_framebuffer(fb_helper->fbdev); 836 } 837 EXPORT_SYMBOL(drm_fb_helper_unlink_fbi); 838 839 static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y, 840 u32 width, u32 height) 841 { 842 struct drm_fb_helper *helper = info->par; 843 struct drm_clip_rect *clip = &helper->dirty_clip; 844 unsigned long flags; 845 846 if (!helper->fb->funcs->dirty) 847 return; 848 849 spin_lock_irqsave(&helper->dirty_lock, flags); 850 clip->x1 = min_t(u32, clip->x1, x); 851 clip->y1 = min_t(u32, clip->y1, y); 852 clip->x2 = max_t(u32, clip->x2, x + width); 853 clip->y2 = max_t(u32, clip->y2, y + height); 854 spin_unlock_irqrestore(&helper->dirty_lock, flags); 855 856 schedule_work(&helper->dirty_work); 857 } 858 859 /** 860 * drm_fb_helper_deferred_io() - fbdev deferred_io callback function 861 * @info: fb_info struct pointer 862 * @pagelist: list of dirty mmap framebuffer pages 863 * 864 * This function is used as the &fb_deferred_io ->deferred_io 865 * callback function for flushing the fbdev mmap writes. 866 */ 867 void drm_fb_helper_deferred_io(struct fb_info *info, 868 struct list_head *pagelist) 869 { 870 unsigned long start, end, min, max; 871 struct page *page; 872 u32 y1, y2; 873 874 min = ULONG_MAX; 875 max = 0; 876 list_for_each_entry(page, pagelist, lru) { 877 start = page->index << PAGE_SHIFT; 878 end = start + PAGE_SIZE - 1; 879 min = min(min, start); 880 max = max(max, end); 881 } 882 883 if (min < max) { 884 y1 = min / info->fix.line_length; 885 y2 = min_t(u32, DIV_ROUND_UP(max, info->fix.line_length), 886 info->var.yres); 887 drm_fb_helper_dirty(info, 0, y1, info->var.xres, y2 - y1); 888 } 889 } 890 EXPORT_SYMBOL(drm_fb_helper_deferred_io); 891 892 /** 893 * drm_fb_helper_sys_read - wrapper around fb_sys_read 894 * @info: fb_info struct pointer 895 * @buf: userspace buffer to read from framebuffer memory 896 * @count: number of bytes to read from framebuffer memory 897 * @ppos: read offset within framebuffer memory 898 * 899 * A wrapper around fb_sys_read implemented by fbdev core 900 */ 901 ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, 902 size_t count, loff_t *ppos) 903 { 904 return fb_sys_read(info, buf, count, ppos); 905 } 906 EXPORT_SYMBOL(drm_fb_helper_sys_read); 907 908 /** 909 * drm_fb_helper_sys_write - wrapper around fb_sys_write 910 * @info: fb_info struct pointer 911 * @buf: userspace buffer to write to framebuffer memory 912 * @count: number of bytes to write to framebuffer memory 913 * @ppos: write offset within framebuffer memory 914 * 915 * A wrapper around fb_sys_write implemented by fbdev core 916 */ 917 ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf, 918 size_t count, loff_t *ppos) 919 { 920 ssize_t ret; 921 922 ret = fb_sys_write(info, buf, count, ppos); 923 if (ret > 0) 924 drm_fb_helper_dirty(info, 0, 0, info->var.xres, 925 info->var.yres); 926 927 return ret; 928 } 929 EXPORT_SYMBOL(drm_fb_helper_sys_write); 930 931 /** 932 * drm_fb_helper_sys_fillrect - wrapper around sys_fillrect 933 * @info: fbdev registered by the helper 934 * @rect: info about rectangle to fill 935 * 936 * A wrapper around sys_fillrect implemented by fbdev core 937 */ 938 void drm_fb_helper_sys_fillrect(struct fb_info *info, 939 const struct fb_fillrect *rect) 940 { 941 sys_fillrect(info, rect); 942 drm_fb_helper_dirty(info, rect->dx, rect->dy, 943 rect->width, rect->height); 944 } 945 EXPORT_SYMBOL(drm_fb_helper_sys_fillrect); 946 947 /** 948 * drm_fb_helper_sys_copyarea - wrapper around sys_copyarea 949 * @info: fbdev registered by the helper 950 * @area: info about area to copy 951 * 952 * A wrapper around sys_copyarea implemented by fbdev core 953 */ 954 void drm_fb_helper_sys_copyarea(struct fb_info *info, 955 const struct fb_copyarea *area) 956 { 957 sys_copyarea(info, area); 958 drm_fb_helper_dirty(info, area->dx, area->dy, 959 area->width, area->height); 960 } 961 EXPORT_SYMBOL(drm_fb_helper_sys_copyarea); 962 963 /** 964 * drm_fb_helper_sys_imageblit - wrapper around sys_imageblit 965 * @info: fbdev registered by the helper 966 * @image: info about image to blit 967 * 968 * A wrapper around sys_imageblit implemented by fbdev core 969 */ 970 void drm_fb_helper_sys_imageblit(struct fb_info *info, 971 const struct fb_image *image) 972 { 973 sys_imageblit(info, image); 974 drm_fb_helper_dirty(info, image->dx, image->dy, 975 image->width, image->height); 976 } 977 EXPORT_SYMBOL(drm_fb_helper_sys_imageblit); 978 979 /** 980 * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect 981 * @info: fbdev registered by the helper 982 * @rect: info about rectangle to fill 983 * 984 * A wrapper around cfb_imageblit implemented by fbdev core 985 */ 986 void drm_fb_helper_cfb_fillrect(struct fb_info *info, 987 const struct fb_fillrect *rect) 988 { 989 cfb_fillrect(info, rect); 990 drm_fb_helper_dirty(info, rect->dx, rect->dy, 991 rect->width, rect->height); 992 } 993 EXPORT_SYMBOL(drm_fb_helper_cfb_fillrect); 994 995 /** 996 * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea 997 * @info: fbdev registered by the helper 998 * @area: info about area to copy 999 * 1000 * A wrapper around cfb_copyarea implemented by fbdev core 1001 */ 1002 void drm_fb_helper_cfb_copyarea(struct fb_info *info, 1003 const struct fb_copyarea *area) 1004 { 1005 cfb_copyarea(info, area); 1006 drm_fb_helper_dirty(info, area->dx, area->dy, 1007 area->width, area->height); 1008 } 1009 EXPORT_SYMBOL(drm_fb_helper_cfb_copyarea); 1010 1011 /** 1012 * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit 1013 * @info: fbdev registered by the helper 1014 * @image: info about image to blit 1015 * 1016 * A wrapper around cfb_imageblit implemented by fbdev core 1017 */ 1018 void drm_fb_helper_cfb_imageblit(struct fb_info *info, 1019 const struct fb_image *image) 1020 { 1021 cfb_imageblit(info, image); 1022 drm_fb_helper_dirty(info, image->dx, image->dy, 1023 image->width, image->height); 1024 } 1025 EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit); 1026 1027 /** 1028 * drm_fb_helper_set_suspend - wrapper around fb_set_suspend 1029 * @fb_helper: driver-allocated fbdev helper 1030 * @state: desired state, zero to resume, non-zero to suspend 1031 * 1032 * A wrapper around fb_set_suspend implemented by fbdev core 1033 */ 1034 void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state) 1035 { 1036 if (fb_helper && fb_helper->fbdev) 1037 fb_set_suspend(fb_helper->fbdev, state); 1038 } 1039 EXPORT_SYMBOL(drm_fb_helper_set_suspend); 1040 1041 static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, 1042 u16 blue, u16 regno, struct fb_info *info) 1043 { 1044 struct drm_fb_helper *fb_helper = info->par; 1045 struct drm_framebuffer *fb = fb_helper->fb; 1046 int pindex; 1047 1048 if (info->fix.visual == FB_VISUAL_TRUECOLOR) { 1049 u32 *palette; 1050 u32 value; 1051 /* place color in psuedopalette */ 1052 if (regno > 16) 1053 return -EINVAL; 1054 palette = (u32 *)info->pseudo_palette; 1055 red >>= (16 - info->var.red.length); 1056 green >>= (16 - info->var.green.length); 1057 blue >>= (16 - info->var.blue.length); 1058 value = (red << info->var.red.offset) | 1059 (green << info->var.green.offset) | 1060 (blue << info->var.blue.offset); 1061 if (info->var.transp.length > 0) { 1062 u32 mask = (1 << info->var.transp.length) - 1; 1063 mask <<= info->var.transp.offset; 1064 value |= mask; 1065 } 1066 palette[regno] = value; 1067 return 0; 1068 } 1069 1070 /* 1071 * The driver really shouldn't advertise pseudo/directcolor 1072 * visuals if it can't deal with the palette. 1073 */ 1074 if (WARN_ON(!fb_helper->funcs->gamma_set || 1075 !fb_helper->funcs->gamma_get)) 1076 return -EINVAL; 1077 1078 pindex = regno; 1079 1080 if (fb->bits_per_pixel == 16) { 1081 pindex = regno << 3; 1082 1083 if (fb->depth == 16 && regno > 63) 1084 return -EINVAL; 1085 if (fb->depth == 15 && regno > 31) 1086 return -EINVAL; 1087 1088 if (fb->depth == 16) { 1089 u16 r, g, b; 1090 int i; 1091 if (regno < 32) { 1092 for (i = 0; i < 8; i++) 1093 fb_helper->funcs->gamma_set(crtc, red, 1094 green, blue, pindex + i); 1095 } 1096 1097 fb_helper->funcs->gamma_get(crtc, &r, 1098 &g, &b, 1099 pindex >> 1); 1100 1101 for (i = 0; i < 4; i++) 1102 fb_helper->funcs->gamma_set(crtc, r, 1103 green, b, 1104 (pindex >> 1) + i); 1105 } 1106 } 1107 1108 if (fb->depth != 16) 1109 fb_helper->funcs->gamma_set(crtc, red, green, blue, pindex); 1110 return 0; 1111 } 1112 1113 /** 1114 * drm_fb_helper_setcmap - implementation for ->fb_setcmap 1115 * @cmap: cmap to set 1116 * @info: fbdev registered by the helper 1117 */ 1118 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) 1119 { 1120 struct drm_fb_helper *fb_helper = info->par; 1121 struct drm_device *dev = fb_helper->dev; 1122 const struct drm_crtc_helper_funcs *crtc_funcs; 1123 u16 *red, *green, *blue, *transp; 1124 struct drm_crtc *crtc; 1125 int i, j, rc = 0; 1126 int start; 1127 1128 if (oops_in_progress) 1129 return -EBUSY; 1130 1131 drm_modeset_lock_all(dev); 1132 if (!drm_fb_helper_is_bound(fb_helper)) { 1133 drm_modeset_unlock_all(dev); 1134 return -EBUSY; 1135 } 1136 1137 for (i = 0; i < fb_helper->crtc_count; i++) { 1138 crtc = fb_helper->crtc_info[i].mode_set.crtc; 1139 crtc_funcs = crtc->helper_private; 1140 1141 red = cmap->red; 1142 green = cmap->green; 1143 blue = cmap->blue; 1144 transp = cmap->transp; 1145 start = cmap->start; 1146 1147 for (j = 0; j < cmap->len; j++) { 1148 u16 hred, hgreen, hblue, htransp = 0xffff; 1149 1150 hred = *red++; 1151 hgreen = *green++; 1152 hblue = *blue++; 1153 1154 if (transp) 1155 htransp = *transp++; 1156 1157 rc = setcolreg(crtc, hred, hgreen, hblue, start++, info); 1158 if (rc) 1159 goto out; 1160 } 1161 if (crtc_funcs->load_lut) 1162 crtc_funcs->load_lut(crtc); 1163 } 1164 out: 1165 drm_modeset_unlock_all(dev); 1166 return rc; 1167 } 1168 EXPORT_SYMBOL(drm_fb_helper_setcmap); 1169 1170 /** 1171 * drm_fb_helper_check_var - implementation for ->fb_check_var 1172 * @var: screeninfo to check 1173 * @info: fbdev registered by the helper 1174 */ 1175 int drm_fb_helper_check_var(struct fb_var_screeninfo *var, 1176 struct fb_info *info) 1177 { 1178 struct drm_fb_helper *fb_helper = info->par; 1179 struct drm_framebuffer *fb = fb_helper->fb; 1180 int depth; 1181 1182 if (var->pixclock != 0 || in_dbg_master()) 1183 return -EINVAL; 1184 1185 /* Need to resize the fb object !!! */ 1186 if (var->bits_per_pixel > fb->bits_per_pixel || 1187 var->xres > fb->width || var->yres > fb->height || 1188 var->xres_virtual > fb->width || var->yres_virtual > fb->height) { 1189 DRM_DEBUG("fb userspace requested width/height/bpp is greater than current fb " 1190 "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n", 1191 var->xres, var->yres, var->bits_per_pixel, 1192 var->xres_virtual, var->yres_virtual, 1193 fb->width, fb->height, fb->bits_per_pixel); 1194 return -EINVAL; 1195 } 1196 1197 switch (var->bits_per_pixel) { 1198 case 16: 1199 depth = (var->green.length == 6) ? 16 : 15; 1200 break; 1201 case 32: 1202 depth = (var->transp.length > 0) ? 32 : 24; 1203 break; 1204 default: 1205 depth = var->bits_per_pixel; 1206 break; 1207 } 1208 1209 switch (depth) { 1210 case 8: 1211 var->red.offset = 0; 1212 var->green.offset = 0; 1213 var->blue.offset = 0; 1214 var->red.length = 8; 1215 var->green.length = 8; 1216 var->blue.length = 8; 1217 var->transp.length = 0; 1218 var->transp.offset = 0; 1219 break; 1220 case 15: 1221 var->red.offset = 10; 1222 var->green.offset = 5; 1223 var->blue.offset = 0; 1224 var->red.length = 5; 1225 var->green.length = 5; 1226 var->blue.length = 5; 1227 var->transp.length = 1; 1228 var->transp.offset = 15; 1229 break; 1230 case 16: 1231 var->red.offset = 11; 1232 var->green.offset = 5; 1233 var->blue.offset = 0; 1234 var->red.length = 5; 1235 var->green.length = 6; 1236 var->blue.length = 5; 1237 var->transp.length = 0; 1238 var->transp.offset = 0; 1239 break; 1240 case 24: 1241 var->red.offset = 16; 1242 var->green.offset = 8; 1243 var->blue.offset = 0; 1244 var->red.length = 8; 1245 var->green.length = 8; 1246 var->blue.length = 8; 1247 var->transp.length = 0; 1248 var->transp.offset = 0; 1249 break; 1250 case 32: 1251 var->red.offset = 16; 1252 var->green.offset = 8; 1253 var->blue.offset = 0; 1254 var->red.length = 8; 1255 var->green.length = 8; 1256 var->blue.length = 8; 1257 var->transp.length = 8; 1258 var->transp.offset = 24; 1259 break; 1260 default: 1261 return -EINVAL; 1262 } 1263 return 0; 1264 } 1265 EXPORT_SYMBOL(drm_fb_helper_check_var); 1266 1267 /** 1268 * drm_fb_helper_set_par - implementation for ->fb_set_par 1269 * @info: fbdev registered by the helper 1270 * 1271 * This will let fbcon do the mode init and is called at initialization time by 1272 * the fbdev core when registering the driver, and later on through the hotplug 1273 * callback. 1274 */ 1275 int drm_fb_helper_set_par(struct fb_info *info) 1276 { 1277 struct drm_fb_helper *fb_helper = info->par; 1278 struct fb_var_screeninfo *var = &info->var; 1279 1280 if (oops_in_progress) 1281 return -EBUSY; 1282 1283 if (var->pixclock != 0) { 1284 DRM_ERROR("PIXEL CLOCK SET\n"); 1285 return -EINVAL; 1286 } 1287 1288 drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper); 1289 1290 return 0; 1291 } 1292 EXPORT_SYMBOL(drm_fb_helper_set_par); 1293 1294 static int pan_display_atomic(struct fb_var_screeninfo *var, 1295 struct fb_info *info) 1296 { 1297 struct drm_fb_helper *fb_helper = info->par; 1298 struct drm_device *dev = fb_helper->dev; 1299 struct drm_atomic_state *state; 1300 struct drm_plane *plane; 1301 int i, ret; 1302 unsigned plane_mask; 1303 1304 state = drm_atomic_state_alloc(dev); 1305 if (!state) 1306 return -ENOMEM; 1307 1308 state->acquire_ctx = dev->mode_config.acquire_ctx; 1309 retry: 1310 plane_mask = 0; 1311 for(i = 0; i < fb_helper->crtc_count; i++) { 1312 struct drm_mode_set *mode_set; 1313 1314 mode_set = &fb_helper->crtc_info[i].mode_set; 1315 1316 mode_set->x = var->xoffset; 1317 mode_set->y = var->yoffset; 1318 1319 ret = __drm_atomic_helper_set_config(mode_set, state); 1320 if (ret != 0) 1321 goto fail; 1322 1323 plane = mode_set->crtc->primary; 1324 plane_mask |= (1 << drm_plane_index(plane)); 1325 plane->old_fb = plane->fb; 1326 } 1327 1328 ret = drm_atomic_commit(state); 1329 if (ret != 0) 1330 goto fail; 1331 1332 info->var.xoffset = var->xoffset; 1333 info->var.yoffset = var->yoffset; 1334 1335 1336 fail: 1337 drm_atomic_clean_old_fb(dev, plane_mask, ret); 1338 1339 if (ret == -EDEADLK) 1340 goto backoff; 1341 1342 if (ret != 0) 1343 drm_atomic_state_free(state); 1344 1345 return ret; 1346 1347 backoff: 1348 drm_atomic_state_clear(state); 1349 drm_atomic_legacy_backoff(state); 1350 1351 goto retry; 1352 } 1353 1354 /** 1355 * drm_fb_helper_pan_display - implementation for ->fb_pan_display 1356 * @var: updated screen information 1357 * @info: fbdev registered by the helper 1358 */ 1359 int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, 1360 struct fb_info *info) 1361 { 1362 struct drm_fb_helper *fb_helper = info->par; 1363 struct drm_device *dev = fb_helper->dev; 1364 struct drm_mode_set *modeset; 1365 int ret = 0; 1366 int i; 1367 1368 if (oops_in_progress) 1369 return -EBUSY; 1370 1371 drm_modeset_lock_all(dev); 1372 if (!drm_fb_helper_is_bound(fb_helper)) { 1373 drm_modeset_unlock_all(dev); 1374 return -EBUSY; 1375 } 1376 1377 if (fb_helper->atomic) { 1378 ret = pan_display_atomic(var, info); 1379 goto unlock; 1380 } 1381 1382 for (i = 0; i < fb_helper->crtc_count; i++) { 1383 modeset = &fb_helper->crtc_info[i].mode_set; 1384 1385 modeset->x = var->xoffset; 1386 modeset->y = var->yoffset; 1387 1388 if (modeset->num_connectors) { 1389 ret = drm_mode_set_config_internal(modeset); 1390 if (!ret) { 1391 info->var.xoffset = var->xoffset; 1392 info->var.yoffset = var->yoffset; 1393 } 1394 } 1395 } 1396 unlock: 1397 drm_modeset_unlock_all(dev); 1398 return ret; 1399 } 1400 EXPORT_SYMBOL(drm_fb_helper_pan_display); 1401 1402 /* 1403 * Allocates the backing storage and sets up the fbdev info structure through 1404 * the ->fb_probe callback and then registers the fbdev and sets up the panic 1405 * notifier. 1406 */ 1407 static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, 1408 int preferred_bpp) 1409 { 1410 int ret = 0; 1411 int crtc_count = 0; 1412 int i; 1413 struct fb_info *info; 1414 struct drm_fb_helper_surface_size sizes; 1415 int gamma_size = 0; 1416 1417 memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); 1418 sizes.surface_depth = 24; 1419 sizes.surface_bpp = 32; 1420 sizes.fb_width = (unsigned)-1; 1421 sizes.fb_height = (unsigned)-1; 1422 1423 /* if driver picks 8 or 16 by default use that 1424 for both depth/bpp */ 1425 if (preferred_bpp != sizes.surface_bpp) 1426 sizes.surface_depth = sizes.surface_bpp = preferred_bpp; 1427 1428 /* first up get a count of crtcs now in use and new min/maxes width/heights */ 1429 for (i = 0; i < fb_helper->connector_count; i++) { 1430 struct drm_fb_helper_connector *fb_helper_conn = fb_helper->connector_info[i]; 1431 struct drm_cmdline_mode *cmdline_mode; 1432 1433 cmdline_mode = &fb_helper_conn->connector->cmdline_mode; 1434 1435 if (cmdline_mode->bpp_specified) { 1436 switch (cmdline_mode->bpp) { 1437 case 8: 1438 sizes.surface_depth = sizes.surface_bpp = 8; 1439 break; 1440 case 15: 1441 sizes.surface_depth = 15; 1442 sizes.surface_bpp = 16; 1443 break; 1444 case 16: 1445 sizes.surface_depth = sizes.surface_bpp = 16; 1446 break; 1447 case 24: 1448 sizes.surface_depth = sizes.surface_bpp = 24; 1449 break; 1450 case 32: 1451 sizes.surface_depth = 24; 1452 sizes.surface_bpp = 32; 1453 break; 1454 } 1455 break; 1456 } 1457 } 1458 1459 crtc_count = 0; 1460 for (i = 0; i < fb_helper->crtc_count; i++) { 1461 struct drm_display_mode *desired_mode; 1462 struct drm_mode_set *mode_set; 1463 int x, y, j; 1464 /* in case of tile group, are we the last tile vert or horiz? 1465 * If no tile group you are always the last one both vertically 1466 * and horizontally 1467 */ 1468 bool lastv = true, lasth = true; 1469 1470 desired_mode = fb_helper->crtc_info[i].desired_mode; 1471 mode_set = &fb_helper->crtc_info[i].mode_set; 1472 1473 if (!desired_mode) 1474 continue; 1475 1476 crtc_count++; 1477 1478 x = fb_helper->crtc_info[i].x; 1479 y = fb_helper->crtc_info[i].y; 1480 1481 if (gamma_size == 0) 1482 gamma_size = fb_helper->crtc_info[i].mode_set.crtc->gamma_size; 1483 1484 sizes.surface_width = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width); 1485 sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height); 1486 1487 for (j = 0; j < mode_set->num_connectors; j++) { 1488 struct drm_connector *connector = mode_set->connectors[j]; 1489 if (connector->has_tile) { 1490 lasth = (connector->tile_h_loc == (connector->num_h_tile - 1)); 1491 lastv = (connector->tile_v_loc == (connector->num_v_tile - 1)); 1492 /* cloning to multiple tiles is just crazy-talk, so: */ 1493 break; 1494 } 1495 } 1496 1497 if (lasth) 1498 sizes.fb_width = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width); 1499 if (lastv) 1500 sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height); 1501 } 1502 1503 if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) { 1504 /* hmm everyone went away - assume VGA cable just fell out 1505 and will come back later. */ 1506 DRM_INFO("Cannot find any crtc or sizes - going 1024x768\n"); 1507 sizes.fb_width = sizes.surface_width = 1024; 1508 sizes.fb_height = sizes.surface_height = 768; 1509 } 1510 1511 /* push down into drivers */ 1512 ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); 1513 if (ret < 0) 1514 return ret; 1515 1516 info = fb_helper->fbdev; 1517 1518 /* 1519 * Set the fb pointer - usually drm_setup_crtcs does this for hotplug 1520 * events, but at init time drm_setup_crtcs needs to be called before 1521 * the fb is allocated (since we need to figure out the desired size of 1522 * the fb before we can allocate it ...). Hence we need to fix things up 1523 * here again. 1524 */ 1525 for (i = 0; i < fb_helper->crtc_count; i++) 1526 if (fb_helper->crtc_info[i].mode_set.num_connectors) 1527 fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; 1528 1529 1530 info->var.pixclock = 0; 1531 if (register_framebuffer(info) < 0) 1532 return -EINVAL; 1533 1534 dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", 1535 info->node, info->fix.id); 1536 1537 if (list_empty(&kernel_fb_helper_list)) { 1538 register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); 1539 } 1540 1541 list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); 1542 1543 return 0; 1544 } 1545 1546 /** 1547 * drm_fb_helper_fill_fix - initializes fixed fbdev information 1548 * @info: fbdev registered by the helper 1549 * @pitch: desired pitch 1550 * @depth: desired depth 1551 * 1552 * Helper to fill in the fixed fbdev information useful for a non-accelerated 1553 * fbdev emulations. Drivers which support acceleration methods which impose 1554 * additional constraints need to set up their own limits. 1555 * 1556 * Drivers should call this (or their equivalent setup code) from their 1557 * ->fb_probe callback. 1558 */ 1559 void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, 1560 uint32_t depth) 1561 { 1562 info->fix.type = FB_TYPE_PACKED_PIXELS; 1563 info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR : 1564 FB_VISUAL_TRUECOLOR; 1565 info->fix.mmio_start = 0; 1566 info->fix.mmio_len = 0; 1567 info->fix.type_aux = 0; 1568 info->fix.xpanstep = 1; /* doing it in hw */ 1569 info->fix.ypanstep = 1; /* doing it in hw */ 1570 info->fix.ywrapstep = 0; 1571 info->fix.accel = FB_ACCEL_NONE; 1572 1573 info->fix.line_length = pitch; 1574 return; 1575 } 1576 EXPORT_SYMBOL(drm_fb_helper_fill_fix); 1577 1578 /** 1579 * drm_fb_helper_fill_var - initalizes variable fbdev information 1580 * @info: fbdev instance to set up 1581 * @fb_helper: fb helper instance to use as template 1582 * @fb_width: desired fb width 1583 * @fb_height: desired fb height 1584 * 1585 * Sets up the variable fbdev metainformation from the given fb helper instance 1586 * and the drm framebuffer allocated in fb_helper->fb. 1587 * 1588 * Drivers should call this (or their equivalent setup code) from their 1589 * ->fb_probe callback after having allocated the fbdev backing 1590 * storage framebuffer. 1591 */ 1592 void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, 1593 uint32_t fb_width, uint32_t fb_height) 1594 { 1595 struct drm_framebuffer *fb = fb_helper->fb; 1596 info->pseudo_palette = fb_helper->pseudo_palette; 1597 info->var.xres_virtual = fb->width; 1598 info->var.yres_virtual = fb->height; 1599 info->var.bits_per_pixel = fb->bits_per_pixel; 1600 info->var.accel_flags = FB_ACCELF_TEXT; 1601 info->var.xoffset = 0; 1602 info->var.yoffset = 0; 1603 info->var.activate = FB_ACTIVATE_NOW; 1604 info->var.height = -1; 1605 info->var.width = -1; 1606 1607 switch (fb->depth) { 1608 case 8: 1609 info->var.red.offset = 0; 1610 info->var.green.offset = 0; 1611 info->var.blue.offset = 0; 1612 info->var.red.length = 8; /* 8bit DAC */ 1613 info->var.green.length = 8; 1614 info->var.blue.length = 8; 1615 info->var.transp.offset = 0; 1616 info->var.transp.length = 0; 1617 break; 1618 case 15: 1619 info->var.red.offset = 10; 1620 info->var.green.offset = 5; 1621 info->var.blue.offset = 0; 1622 info->var.red.length = 5; 1623 info->var.green.length = 5; 1624 info->var.blue.length = 5; 1625 info->var.transp.offset = 15; 1626 info->var.transp.length = 1; 1627 break; 1628 case 16: 1629 info->var.red.offset = 11; 1630 info->var.green.offset = 5; 1631 info->var.blue.offset = 0; 1632 info->var.red.length = 5; 1633 info->var.green.length = 6; 1634 info->var.blue.length = 5; 1635 info->var.transp.offset = 0; 1636 break; 1637 case 24: 1638 info->var.red.offset = 16; 1639 info->var.green.offset = 8; 1640 info->var.blue.offset = 0; 1641 info->var.red.length = 8; 1642 info->var.green.length = 8; 1643 info->var.blue.length = 8; 1644 info->var.transp.offset = 0; 1645 info->var.transp.length = 0; 1646 break; 1647 case 32: 1648 info->var.red.offset = 16; 1649 info->var.green.offset = 8; 1650 info->var.blue.offset = 0; 1651 info->var.red.length = 8; 1652 info->var.green.length = 8; 1653 info->var.blue.length = 8; 1654 info->var.transp.offset = 24; 1655 info->var.transp.length = 8; 1656 break; 1657 default: 1658 break; 1659 } 1660 1661 info->var.xres = fb_width; 1662 info->var.yres = fb_height; 1663 } 1664 EXPORT_SYMBOL(drm_fb_helper_fill_var); 1665 1666 static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper, 1667 uint32_t maxX, 1668 uint32_t maxY) 1669 { 1670 struct drm_connector *connector; 1671 int count = 0; 1672 int i; 1673 1674 for (i = 0; i < fb_helper->connector_count; i++) { 1675 connector = fb_helper->connector_info[i]->connector; 1676 count += connector->funcs->fill_modes(connector, maxX, maxY); 1677 } 1678 1679 return count; 1680 } 1681 1682 struct drm_display_mode *drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector, int width, int height) 1683 { 1684 struct drm_display_mode *mode; 1685 1686 list_for_each_entry(mode, &fb_connector->connector->modes, head) { 1687 if (mode->hdisplay > width || 1688 mode->vdisplay > height) 1689 continue; 1690 if (mode->type & DRM_MODE_TYPE_PREFERRED) 1691 return mode; 1692 } 1693 return NULL; 1694 } 1695 EXPORT_SYMBOL(drm_has_preferred_mode); 1696 1697 static bool drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector) 1698 { 1699 return fb_connector->connector->cmdline_mode.specified; 1700 } 1701 1702 struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn, 1703 int width, int height) 1704 { 1705 struct drm_cmdline_mode *cmdline_mode; 1706 struct drm_display_mode *mode; 1707 bool prefer_non_interlace; 1708 1709 cmdline_mode = &fb_helper_conn->connector->cmdline_mode; 1710 if (cmdline_mode->specified == false) 1711 return NULL; 1712 1713 /* attempt to find a matching mode in the list of modes 1714 * we have gotten so far, if not add a CVT mode that conforms 1715 */ 1716 if (cmdline_mode->rb || cmdline_mode->margins) 1717 goto create_mode; 1718 1719 prefer_non_interlace = !cmdline_mode->interlace; 1720 again: 1721 list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { 1722 /* check width/height */ 1723 if (mode->hdisplay != cmdline_mode->xres || 1724 mode->vdisplay != cmdline_mode->yres) 1725 continue; 1726 1727 if (cmdline_mode->refresh_specified) { 1728 if (mode->vrefresh != cmdline_mode->refresh) 1729 continue; 1730 } 1731 1732 if (cmdline_mode->interlace) { 1733 if (!(mode->flags & DRM_MODE_FLAG_INTERLACE)) 1734 continue; 1735 } else if (prefer_non_interlace) { 1736 if (mode->flags & DRM_MODE_FLAG_INTERLACE) 1737 continue; 1738 } 1739 return mode; 1740 } 1741 1742 if (prefer_non_interlace) { 1743 prefer_non_interlace = false; 1744 goto again; 1745 } 1746 1747 create_mode: 1748 mode = drm_mode_create_from_cmdline_mode(fb_helper_conn->connector->dev, 1749 cmdline_mode); 1750 list_add(&mode->head, &fb_helper_conn->connector->modes); 1751 return mode; 1752 } 1753 EXPORT_SYMBOL(drm_pick_cmdline_mode); 1754 1755 static bool drm_connector_enabled(struct drm_connector *connector, bool strict) 1756 { 1757 bool enable; 1758 1759 if (strict) 1760 enable = connector->status == connector_status_connected; 1761 else 1762 enable = connector->status != connector_status_disconnected; 1763 1764 return enable; 1765 } 1766 1767 static void drm_enable_connectors(struct drm_fb_helper *fb_helper, 1768 bool *enabled) 1769 { 1770 bool any_enabled = false; 1771 struct drm_connector *connector; 1772 int i = 0; 1773 1774 for (i = 0; i < fb_helper->connector_count; i++) { 1775 connector = fb_helper->connector_info[i]->connector; 1776 enabled[i] = drm_connector_enabled(connector, true); 1777 DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id, 1778 enabled[i] ? "yes" : "no"); 1779 any_enabled |= enabled[i]; 1780 } 1781 1782 if (any_enabled) 1783 return; 1784 1785 for (i = 0; i < fb_helper->connector_count; i++) { 1786 connector = fb_helper->connector_info[i]->connector; 1787 enabled[i] = drm_connector_enabled(connector, false); 1788 } 1789 } 1790 1791 static bool drm_target_cloned(struct drm_fb_helper *fb_helper, 1792 struct drm_display_mode **modes, 1793 struct drm_fb_offset *offsets, 1794 bool *enabled, int width, int height) 1795 { 1796 int count, i, j; 1797 bool can_clone = false; 1798 struct drm_fb_helper_connector *fb_helper_conn; 1799 struct drm_display_mode *dmt_mode, *mode; 1800 1801 /* only contemplate cloning in the single crtc case */ 1802 if (fb_helper->crtc_count > 1) 1803 return false; 1804 1805 count = 0; 1806 for (i = 0; i < fb_helper->connector_count; i++) { 1807 if (enabled[i]) 1808 count++; 1809 } 1810 1811 /* only contemplate cloning if more than one connector is enabled */ 1812 if (count <= 1) 1813 return false; 1814 1815 /* check the command line or if nothing common pick 1024x768 */ 1816 can_clone = true; 1817 for (i = 0; i < fb_helper->connector_count; i++) { 1818 if (!enabled[i]) 1819 continue; 1820 fb_helper_conn = fb_helper->connector_info[i]; 1821 modes[i] = drm_pick_cmdline_mode(fb_helper_conn, width, height); 1822 if (!modes[i]) { 1823 can_clone = false; 1824 break; 1825 } 1826 for (j = 0; j < i; j++) { 1827 if (!enabled[j]) 1828 continue; 1829 if (!drm_mode_equal(modes[j], modes[i])) 1830 can_clone = false; 1831 } 1832 } 1833 1834 if (can_clone) { 1835 DRM_DEBUG_KMS("can clone using command line\n"); 1836 return true; 1837 } 1838 1839 /* try and find a 1024x768 mode on each connector */ 1840 can_clone = true; 1841 dmt_mode = drm_mode_find_dmt(fb_helper->dev, 1024, 768, 60, false); 1842 1843 for (i = 0; i < fb_helper->connector_count; i++) { 1844 1845 if (!enabled[i]) 1846 continue; 1847 1848 fb_helper_conn = fb_helper->connector_info[i]; 1849 list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { 1850 if (drm_mode_equal(mode, dmt_mode)) 1851 modes[i] = mode; 1852 } 1853 if (!modes[i]) 1854 can_clone = false; 1855 } 1856 1857 if (can_clone) { 1858 DRM_DEBUG_KMS("can clone using 1024x768\n"); 1859 return true; 1860 } 1861 DRM_INFO("kms: can't enable cloning when we probably wanted to.\n"); 1862 return false; 1863 } 1864 1865 static int drm_get_tile_offsets(struct drm_fb_helper *fb_helper, 1866 struct drm_display_mode **modes, 1867 struct drm_fb_offset *offsets, 1868 int idx, 1869 int h_idx, int v_idx) 1870 { 1871 struct drm_fb_helper_connector *fb_helper_conn; 1872 int i; 1873 int hoffset = 0, voffset = 0; 1874 1875 for (i = 0; i < fb_helper->connector_count; i++) { 1876 fb_helper_conn = fb_helper->connector_info[i]; 1877 if (!fb_helper_conn->connector->has_tile) 1878 continue; 1879 1880 if (!modes[i] && (h_idx || v_idx)) { 1881 DRM_DEBUG_KMS("no modes for connector tiled %d %d\n", i, 1882 fb_helper_conn->connector->base.id); 1883 continue; 1884 } 1885 if (fb_helper_conn->connector->tile_h_loc < h_idx) 1886 hoffset += modes[i]->hdisplay; 1887 1888 if (fb_helper_conn->connector->tile_v_loc < v_idx) 1889 voffset += modes[i]->vdisplay; 1890 } 1891 offsets[idx].x = hoffset; 1892 offsets[idx].y = voffset; 1893 DRM_DEBUG_KMS("returned %d %d for %d %d\n", hoffset, voffset, h_idx, v_idx); 1894 return 0; 1895 } 1896 1897 static bool drm_target_preferred(struct drm_fb_helper *fb_helper, 1898 struct drm_display_mode **modes, 1899 struct drm_fb_offset *offsets, 1900 bool *enabled, int width, int height) 1901 { 1902 struct drm_fb_helper_connector *fb_helper_conn; 1903 int i; 1904 uint64_t conn_configured = 0, mask; 1905 int tile_pass = 0; 1906 mask = (1 << fb_helper->connector_count) - 1; 1907 retry: 1908 for (i = 0; i < fb_helper->connector_count; i++) { 1909 fb_helper_conn = fb_helper->connector_info[i]; 1910 1911 if (conn_configured & (1 << i)) 1912 continue; 1913 1914 if (enabled[i] == false) { 1915 conn_configured |= (1 << i); 1916 continue; 1917 } 1918 1919 /* first pass over all the untiled connectors */ 1920 if (tile_pass == 0 && fb_helper_conn->connector->has_tile) 1921 continue; 1922 1923 if (tile_pass == 1) { 1924 if (fb_helper_conn->connector->tile_h_loc != 0 || 1925 fb_helper_conn->connector->tile_v_loc != 0) 1926 continue; 1927 1928 } else { 1929 if (fb_helper_conn->connector->tile_h_loc != tile_pass -1 && 1930 fb_helper_conn->connector->tile_v_loc != tile_pass - 1) 1931 /* if this tile_pass doesn't cover any of the tiles - keep going */ 1932 continue; 1933 1934 /* find the tile offsets for this pass - need 1935 to find all tiles left and above */ 1936 drm_get_tile_offsets(fb_helper, modes, offsets, 1937 i, fb_helper_conn->connector->tile_h_loc, fb_helper_conn->connector->tile_v_loc); 1938 } 1939 DRM_DEBUG_KMS("looking for cmdline mode on connector %d\n", 1940 fb_helper_conn->connector->base.id); 1941 1942 /* got for command line mode first */ 1943 modes[i] = drm_pick_cmdline_mode(fb_helper_conn, width, height); 1944 if (!modes[i]) { 1945 DRM_DEBUG_KMS("looking for preferred mode on connector %d %d\n", 1946 fb_helper_conn->connector->base.id, fb_helper_conn->connector->tile_group ? fb_helper_conn->connector->tile_group->id : 0); 1947 modes[i] = drm_has_preferred_mode(fb_helper_conn, width, height); 1948 } 1949 /* No preferred modes, pick one off the list */ 1950 if (!modes[i] && !list_empty(&fb_helper_conn->connector->modes)) { 1951 list_for_each_entry(modes[i], &fb_helper_conn->connector->modes, head) 1952 break; 1953 } 1954 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name : 1955 "none"); 1956 conn_configured |= (1 << i); 1957 } 1958 1959 if ((conn_configured & mask) != mask) { 1960 tile_pass++; 1961 goto retry; 1962 } 1963 return true; 1964 } 1965 1966 static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, 1967 struct drm_fb_helper_crtc **best_crtcs, 1968 struct drm_display_mode **modes, 1969 int n, int width, int height) 1970 { 1971 int c, o; 1972 struct drm_connector *connector; 1973 const struct drm_connector_helper_funcs *connector_funcs; 1974 struct drm_encoder *encoder; 1975 int my_score, best_score, score; 1976 struct drm_fb_helper_crtc **crtcs, *crtc; 1977 struct drm_fb_helper_connector *fb_helper_conn; 1978 1979 if (n == fb_helper->connector_count) 1980 return 0; 1981 1982 fb_helper_conn = fb_helper->connector_info[n]; 1983 connector = fb_helper_conn->connector; 1984 1985 best_crtcs[n] = NULL; 1986 best_score = drm_pick_crtcs(fb_helper, best_crtcs, modes, n+1, width, height); 1987 if (modes[n] == NULL) 1988 return best_score; 1989 1990 crtcs = kzalloc(fb_helper->connector_count * 1991 sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL); 1992 if (!crtcs) 1993 return best_score; 1994 1995 my_score = 1; 1996 if (connector->status == connector_status_connected) 1997 my_score++; 1998 if (drm_has_cmdline_mode(fb_helper_conn)) 1999 my_score++; 2000 if (drm_has_preferred_mode(fb_helper_conn, width, height)) 2001 my_score++; 2002 2003 connector_funcs = connector->helper_private; 2004 encoder = connector_funcs->best_encoder(connector); 2005 if (!encoder) 2006 goto out; 2007 2008 /* select a crtc for this connector and then attempt to configure 2009 remaining connectors */ 2010 for (c = 0; c < fb_helper->crtc_count; c++) { 2011 crtc = &fb_helper->crtc_info[c]; 2012 2013 if ((encoder->possible_crtcs & (1 << c)) == 0) 2014 continue; 2015 2016 for (o = 0; o < n; o++) 2017 if (best_crtcs[o] == crtc) 2018 break; 2019 2020 if (o < n) { 2021 /* ignore cloning unless only a single crtc */ 2022 if (fb_helper->crtc_count > 1) 2023 continue; 2024 2025 if (!drm_mode_equal(modes[o], modes[n])) 2026 continue; 2027 } 2028 2029 crtcs[n] = crtc; 2030 memcpy(crtcs, best_crtcs, n * sizeof(struct drm_fb_helper_crtc *)); 2031 score = my_score + drm_pick_crtcs(fb_helper, crtcs, modes, n + 1, 2032 width, height); 2033 if (score > best_score) { 2034 best_score = score; 2035 memcpy(best_crtcs, crtcs, 2036 fb_helper->connector_count * 2037 sizeof(struct drm_fb_helper_crtc *)); 2038 } 2039 } 2040 out: 2041 kfree(crtcs); 2042 return best_score; 2043 } 2044 2045 static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) 2046 { 2047 struct drm_device *dev = fb_helper->dev; 2048 struct drm_fb_helper_crtc **crtcs; 2049 struct drm_display_mode **modes; 2050 struct drm_fb_offset *offsets; 2051 struct drm_mode_set *modeset; 2052 bool *enabled; 2053 int width, height; 2054 int i; 2055 2056 DRM_DEBUG_KMS("\n"); 2057 2058 width = dev->mode_config.max_width; 2059 height = dev->mode_config.max_height; 2060 2061 crtcs = kcalloc(fb_helper->connector_count, 2062 sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL); 2063 modes = kcalloc(fb_helper->connector_count, 2064 sizeof(struct drm_display_mode *), GFP_KERNEL); 2065 offsets = kcalloc(fb_helper->connector_count, 2066 sizeof(struct drm_fb_offset), GFP_KERNEL); 2067 enabled = kcalloc(fb_helper->connector_count, 2068 sizeof(bool), GFP_KERNEL); 2069 if (!crtcs || !modes || !enabled || !offsets) { 2070 DRM_ERROR("Memory allocation failed\n"); 2071 goto out; 2072 } 2073 2074 2075 drm_enable_connectors(fb_helper, enabled); 2076 2077 if (!(fb_helper->funcs->initial_config && 2078 fb_helper->funcs->initial_config(fb_helper, crtcs, modes, 2079 offsets, 2080 enabled, width, height))) { 2081 memset(modes, 0, fb_helper->connector_count*sizeof(modes[0])); 2082 memset(crtcs, 0, fb_helper->connector_count*sizeof(crtcs[0])); 2083 memset(offsets, 0, fb_helper->connector_count*sizeof(offsets[0])); 2084 2085 if (!drm_target_cloned(fb_helper, modes, offsets, 2086 enabled, width, height) && 2087 !drm_target_preferred(fb_helper, modes, offsets, 2088 enabled, width, height)) 2089 DRM_ERROR("Unable to find initial modes\n"); 2090 2091 DRM_DEBUG_KMS("picking CRTCs for %dx%d config\n", 2092 width, height); 2093 2094 drm_pick_crtcs(fb_helper, crtcs, modes, 0, width, height); 2095 } 2096 2097 /* need to set the modesets up here for use later */ 2098 /* fill out the connector<->crtc mappings into the modesets */ 2099 for (i = 0; i < fb_helper->crtc_count; i++) { 2100 modeset = &fb_helper->crtc_info[i].mode_set; 2101 modeset->num_connectors = 0; 2102 modeset->fb = NULL; 2103 } 2104 2105 for (i = 0; i < fb_helper->connector_count; i++) { 2106 struct drm_display_mode *mode = modes[i]; 2107 struct drm_fb_helper_crtc *fb_crtc = crtcs[i]; 2108 struct drm_fb_offset *offset = &offsets[i]; 2109 modeset = &fb_crtc->mode_set; 2110 2111 if (mode && fb_crtc) { 2112 DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n", 2113 mode->name, fb_crtc->mode_set.crtc->base.id, offset->x, offset->y); 2114 fb_crtc->desired_mode = mode; 2115 fb_crtc->x = offset->x; 2116 fb_crtc->y = offset->y; 2117 if (modeset->mode) 2118 drm_mode_destroy(dev, modeset->mode); 2119 modeset->mode = drm_mode_duplicate(dev, 2120 fb_crtc->desired_mode); 2121 modeset->connectors[modeset->num_connectors++] = fb_helper->connector_info[i]->connector; 2122 modeset->fb = fb_helper->fb; 2123 modeset->x = offset->x; 2124 modeset->y = offset->y; 2125 } 2126 } 2127 2128 /* Clear out any old modes if there are no more connected outputs. */ 2129 for (i = 0; i < fb_helper->crtc_count; i++) { 2130 modeset = &fb_helper->crtc_info[i].mode_set; 2131 if (modeset->num_connectors == 0) { 2132 BUG_ON(modeset->fb); 2133 if (modeset->mode) 2134 drm_mode_destroy(dev, modeset->mode); 2135 modeset->mode = NULL; 2136 } 2137 } 2138 out: 2139 kfree(crtcs); 2140 kfree(modes); 2141 kfree(offsets); 2142 kfree(enabled); 2143 } 2144 2145 /** 2146 * drm_fb_helper_initial_config - setup a sane initial connector configuration 2147 * @fb_helper: fb_helper device struct 2148 * @bpp_sel: bpp value to use for the framebuffer configuration 2149 * 2150 * Scans the CRTCs and connectors and tries to put together an initial setup. 2151 * At the moment, this is a cloned configuration across all heads with 2152 * a new framebuffer object as the backing store. 2153 * 2154 * Note that this also registers the fbdev and so allows userspace to call into 2155 * the driver through the fbdev interfaces. 2156 * 2157 * This function will call down into the ->fb_probe callback to let 2158 * the driver allocate and initialize the fbdev info structure and the drm 2159 * framebuffer used to back the fbdev. drm_fb_helper_fill_var() and 2160 * drm_fb_helper_fill_fix() are provided as helpers to setup simple default 2161 * values for the fbdev info structure. 2162 * 2163 * HANG DEBUGGING: 2164 * 2165 * When you have fbcon support built-in or already loaded, this function will do 2166 * a full modeset to setup the fbdev console. Due to locking misdesign in the 2167 * VT/fbdev subsystem that entire modeset sequence has to be done while holding 2168 * console_lock. Until console_unlock is called no dmesg lines will be sent out 2169 * to consoles, not even serial console. This means when your driver crashes, 2170 * you will see absolutely nothing else but a system stuck in this function, 2171 * with no further output. Any kind of printk() you place within your own driver 2172 * or in the drm core modeset code will also never show up. 2173 * 2174 * Standard debug practice is to run the fbcon setup without taking the 2175 * console_lock as a hack, to be able to see backtraces and crashes on the 2176 * serial line. This can be done by setting the fb.lockless_register_fb=1 kernel 2177 * cmdline option. 2178 * 2179 * The other option is to just disable fbdev emulation since very likely the 2180 * first modeset from userspace will crash in the same way, and is even easier 2181 * to debug. This can be done by setting the drm_kms_helper.fbdev_emulation=0 2182 * kernel cmdline option. 2183 * 2184 * RETURNS: 2185 * Zero if everything went ok, nonzero otherwise. 2186 */ 2187 int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) 2188 { 2189 struct drm_device *dev = fb_helper->dev; 2190 int count = 0; 2191 2192 if (!drm_fbdev_emulation) 2193 return 0; 2194 2195 mutex_lock(&dev->mode_config.mutex); 2196 count = drm_fb_helper_probe_connector_modes(fb_helper, 2197 dev->mode_config.max_width, 2198 dev->mode_config.max_height); 2199 mutex_unlock(&dev->mode_config.mutex); 2200 /* 2201 * we shouldn't end up with no modes here. 2202 */ 2203 if (count == 0) 2204 dev_info(fb_helper->dev->dev, "No connectors reported connected with modes\n"); 2205 2206 drm_setup_crtcs(fb_helper); 2207 2208 return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); 2209 } 2210 EXPORT_SYMBOL(drm_fb_helper_initial_config); 2211 2212 /** 2213 * drm_fb_helper_hotplug_event - respond to a hotplug notification by 2214 * probing all the outputs attached to the fb 2215 * @fb_helper: the drm_fb_helper 2216 * 2217 * Scan the connectors attached to the fb_helper and try to put together a 2218 * setup after *notification of a change in output configuration. 2219 * 2220 * Called at runtime, takes the mode config locks to be able to check/change the 2221 * modeset configuration. Must be run from process context (which usually means 2222 * either the output polling work or a work item launched from the driver's 2223 * hotplug interrupt). 2224 * 2225 * Note that drivers may call this even before calling 2226 * drm_fb_helper_initial_config but only after drm_fb_helper_init. This allows 2227 * for a race-free fbcon setup and will make sure that the fbdev emulation will 2228 * not miss any hotplug events. 2229 * 2230 * RETURNS: 2231 * 0 on success and a non-zero error code otherwise. 2232 */ 2233 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) 2234 { 2235 struct drm_device *dev = fb_helper->dev; 2236 u32 max_width, max_height; 2237 2238 if (!drm_fbdev_emulation) 2239 return 0; 2240 2241 mutex_lock(&fb_helper->dev->mode_config.mutex); 2242 if (!fb_helper->fb || !drm_fb_helper_is_bound(fb_helper)) { 2243 fb_helper->delayed_hotplug = true; 2244 mutex_unlock(&fb_helper->dev->mode_config.mutex); 2245 return 0; 2246 } 2247 DRM_DEBUG_KMS("\n"); 2248 2249 max_width = fb_helper->fb->width; 2250 max_height = fb_helper->fb->height; 2251 2252 drm_fb_helper_probe_connector_modes(fb_helper, max_width, max_height); 2253 mutex_unlock(&fb_helper->dev->mode_config.mutex); 2254 2255 drm_modeset_lock_all(dev); 2256 drm_setup_crtcs(fb_helper); 2257 drm_modeset_unlock_all(dev); 2258 drm_fb_helper_set_par(fb_helper->fbdev); 2259 2260 return 0; 2261 } 2262 EXPORT_SYMBOL(drm_fb_helper_hotplug_event); 2263 2264 /* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) 2265 * but the module doesn't depend on any fb console symbols. At least 2266 * attempt to load fbcon to avoid leaving the system without a usable console. 2267 */ 2268 int __init drm_fb_helper_modinit(void) 2269 { 2270 #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) 2271 const char *name = "fbcon"; 2272 struct module *fbcon; 2273 2274 mutex_lock(&module_mutex); 2275 fbcon = find_module(name); 2276 mutex_unlock(&module_mutex); 2277 2278 if (!fbcon) 2279 request_module_nowait(name); 2280 #endif 2281 return 0; 2282 } 2283 EXPORT_SYMBOL(drm_fb_helper_modinit); 2284 2285 2286 2287 2288 2289 /* LDV_COMMENT_BEGIN_MAIN */ 2290 #ifdef LDV_MAIN9_sequence_infinite_withcheck_stateful 2291 2292 /*###########################################################################*/ 2293 2294 /*############## Driver Environment Generator 0.2 output ####################*/ 2295 2296 /*###########################################################################*/ 2297 2298 2299 2300 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */ 2301 void ldv_check_final_state(void); 2302 2303 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 2304 void ldv_check_return_value(int res); 2305 2306 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 2307 void ldv_check_return_value_probe(int res); 2308 2309 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 2310 void ldv_initialize(void); 2311 2312 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 2313 void ldv_handler_precall(void); 2314 2315 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 2316 int nondet_int(void); 2317 2318 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 2319 int LDV_IN_INTERRUPT; 2320 2321 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 2322 void ldv_main9_sequence_infinite_withcheck_stateful(void) { 2323 2324 2325 2326 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 2327 /*============================= VARIABLE DECLARATION PART =============================*/ 2328 /** STRUCT: struct type: sysrq_key_op, struct name: sysrq_drm_fb_helper_restore_op **/ 2329 /* content: static void drm_fb_helper_sysrq(int dummy1)*/ 2330 /* LDV_COMMENT_BEGIN_PREP */ 2331 #ifdef CONFIG_MAGIC_SYSRQ 2332 /* LDV_COMMENT_END_PREP */ 2333 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "drm_fb_helper_sysrq" */ 2334 int var_drm_fb_helper_sysrq_14_p0; 2335 /* LDV_COMMENT_BEGIN_PREP */ 2336 #else 2337 #endif 2338 #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) 2339 #endif 2340 /* LDV_COMMENT_END_PREP */ 2341 2342 2343 2344 2345 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 2346 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 2347 /*============================= VARIABLE INITIALIZING PART =============================*/ 2348 LDV_IN_INTERRUPT=1; 2349 2350 2351 2352 2353 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 2354 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 2355 /*============================= FUNCTION CALL SECTION =============================*/ 2356 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 2357 ldv_initialize(); 2358 2359 2360 2361 while( nondet_int() 2362 ) { 2363 2364 switch(nondet_int()) { 2365 2366 case 0: { 2367 2368 /** STRUCT: struct type: sysrq_key_op, struct name: sysrq_drm_fb_helper_restore_op **/ 2369 2370 2371 /* content: static void drm_fb_helper_sysrq(int dummy1)*/ 2372 /* LDV_COMMENT_BEGIN_PREP */ 2373 #ifdef CONFIG_MAGIC_SYSRQ 2374 /* LDV_COMMENT_END_PREP */ 2375 /* LDV_COMMENT_FUNCTION_CALL Function from field "handler" from driver structure with callbacks "sysrq_drm_fb_helper_restore_op" */ 2376 ldv_handler_precall(); 2377 drm_fb_helper_sysrq( var_drm_fb_helper_sysrq_14_p0); 2378 /* LDV_COMMENT_BEGIN_PREP */ 2379 #else 2380 #endif 2381 #if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) 2382 #endif 2383 /* LDV_COMMENT_END_PREP */ 2384 2385 2386 2387 2388 } 2389 2390 break; 2391 default: break; 2392 2393 } 2394 2395 } 2396 2397 ldv_module_exit: 2398 2399 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 2400 ldv_final: ldv_check_final_state(); 2401 2402 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 2403 return; 2404 2405 } 2406 #endif 2407 2408 /* LDV_COMMENT_END_MAIN */
1 2 /* 3 * Copyright © 2015 Intel Corporation 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice (including the next 13 * paragraph) shall be included in all copies or substantial portions of the 14 * Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 * IN THE SOFTWARE. 23 * 24 * Authors: 25 * Rafael Antognolli <rafael.antognolli@intel.com> 26 * 27 */ 28 29 #include <drm/drmP.h> 30 #include <drm/drm_fb_helper.h> 31 #include <drm/drm_dp_aux_dev.h> 32 33 MODULE_AUTHOR("David Airlie, Jesse Barnes"); 34 MODULE_DESCRIPTION("DRM KMS helper"); 35 MODULE_LICENSE("GPL and additional rights"); 36 37 static int __init drm_kms_helper_init(void) 38 { 39 int ret; 40 41 /* Call init functions from specific kms helpers here */ 42 ret = drm_fb_helper_modinit(); 43 if (ret < 0) 44 goto out; 45 46 ret = drm_dp_aux_dev_init(); 47 if (ret < 0) 48 goto out; 49 50 out: 51 return ret; 52 } 53 54 static void __exit drm_kms_helper_exit(void) 55 { 56 /* Call exit functions from specific kms helpers here */ 57 drm_dp_aux_dev_exit(); 58 } 59 60 module_init(drm_kms_helper_init); 61 module_exit(drm_kms_helper_exit); 62 63 64 65 66 67 /* LDV_COMMENT_BEGIN_MAIN */ 68 #ifdef LDV_MAIN6_sequence_infinite_withcheck_stateful 69 70 /*###########################################################################*/ 71 72 /*############## Driver Environment Generator 0.2 output ####################*/ 73 74 /*###########################################################################*/ 75 76 77 78 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */ 79 void ldv_check_final_state(void); 80 81 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 82 void ldv_check_return_value(int res); 83 84 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 85 void ldv_check_return_value_probe(int res); 86 87 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 88 void ldv_initialize(void); 89 90 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 91 void ldv_handler_precall(void); 92 93 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 94 int nondet_int(void); 95 96 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 97 int LDV_IN_INTERRUPT; 98 99 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 100 void ldv_main6_sequence_infinite_withcheck_stateful(void) { 101 102 103 104 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 105 /*============================= VARIABLE DECLARATION PART =============================*/ 106 107 108 109 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 110 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 111 /*============================= VARIABLE INITIALIZING PART =============================*/ 112 LDV_IN_INTERRUPT=1; 113 114 115 116 117 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 118 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 119 /*============================= FUNCTION CALL SECTION =============================*/ 120 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 121 ldv_initialize(); 122 123 /** INIT: init_type: ST_MODULE_INIT **/ 124 /* content: static int __init drm_kms_helper_init(void)*/ 125 /* LDV_COMMENT_END_PREP */ 126 /* LDV_COMMENT_FUNCTION_CALL Kernel calls driver init function after driver loading to kernel. This function declared as "MODULE_INIT(function name)". */ 127 ldv_handler_precall(); 128 if(drm_kms_helper_init()) 129 goto ldv_final; 130 131 while( nondet_int() 132 ) { 133 134 switch(nondet_int()) { 135 136 default: break; 137 138 } 139 140 } 141 142 ldv_module_exit: 143 144 /** INIT: init_type: ST_MODULE_EXIT **/ 145 /* content: static void __exit drm_kms_helper_exit(void)*/ 146 /* LDV_COMMENT_END_PREP */ 147 /* LDV_COMMENT_FUNCTION_CALL Kernel calls driver release function before driver will be uploaded from kernel. This function declared as "MODULE_EXIT(function name)". */ 148 ldv_handler_precall(); 149 drm_kms_helper_exit(); 150 151 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 152 ldv_final: ldv_check_final_state(); 153 154 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 155 return; 156 157 } 158 #endif 159 160 /* LDV_COMMENT_END_MAIN */
1 2 3 #include <verifier/rcv.h> 4 #include <kernel-model/ERR.inc> 5 6 // There are 2 possible states of usb gadget class registration. 7 enum 8 { 9 LDV_USB_GADGET_CLASS_ZERO_STATE, // Usb gadget class is not registered. 10 LDV_USB_GADGET_CLASS_REGISTERED // Usb gadget class is registered. 11 }; 12 13 // There are 2 possible states of char device region registration. 14 enum 15 { 16 LDV_USB_GADGET_CHRDEV_ZERO_STATE, // Char device region is not registered for usb gadget. 17 LDV_USB_GADGET_CHRDEV_REGISTERED // Char device region is registered for usb gadget. 18 }; 19 20 // There are 2 possible states of usb gadget registration. 21 enum 22 { 23 LDV_USB_GADGET_ZERO_STATE, // Usb gadget is not registered. 24 LDV_USB_GADGET_REGISTERED // Usb gadget is registered. 25 }; 26 27 /* LDV_COMMENT_CHANGE_STATE Usb gadget class is not registered at the beginning. */ 28 int ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_ZERO_STATE; 29 30 /* LDV_COMMENT_CHANGE_STATE Char device region is not registered at the beginning. */ 31 int ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_ZERO_STATE; 32 33 /* LDV_COMMENT_CHANGE_STATE Usb gadget is not registered at the beginning. */ 34 int ldv_usb_gadget = LDV_USB_GADGET_ZERO_STATE; 35 36 37 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_create_class') Check that usb gadget class was not registered. Then create and register class for it. */ 38 void *ldv_create_class(void) 39 { 40 void *is_got; 41 42 /* LDV_COMMENT_OTHER Get blk request in the nondeterministic way. */ 43 is_got = ldv_undef_ptr(); 44 45 /* LDV_COMMENT_ASSERT Get blk request just in case when an error did not happen. */ 46 if (is_got <= LDV_PTR_MAX) 47 { 48 /* LDV_COMMENT_ASSERT Registring usb gadget class is only allowed if usb gadget is not registered. */ 49 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 50 /* LDV_COMMENT_ASSERT Check that usb gadget class is unregistered. */ 51 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 52 /* LDV_COMMENT_CHANGE_STATE Register class for usb gadget. */ 53 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_REGISTERED; 54 } 55 56 /* LDV_COMMENT_RETURN Return obtained blk request. */ 57 return is_got; 58 } 59 60 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_class') Check that usb gadget class was not registered and register class for it. */ 61 int ldv_register_class(void) 62 { 63 int is_reg; 64 65 /* LDV_COMMENT_OTHER Register gadget class in the nondeterministic way. */ 66 is_reg = ldv_undef_int_nonpositive(); 67 68 /* LDV_COMMENT_ASSERT Get blk request just in case when an error did not happen. */ 69 if (!is_reg) 70 { 71 /* LDV_COMMENT_ASSERT Registering usb gadget class is only allowed if usb gadget is not registered. */ 72 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 73 /* LDV_COMMENT_ASSERT Check that usb gadget class is unregistered. */ 74 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 75 /* LDV_COMMENT_CHANGE_STATE Register class for usb gadget. */ 76 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_REGISTERED; 77 } 78 79 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 80 return is_reg; 81 } 82 83 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_class') Check that usb gadget class was registered and unregister it. */ 84 void ldv_unregister_class(void) 85 { 86 /* LDV_COMMENT_ASSERT Unregistering usb gadget class is only allowed if usb gadget is not registered. */ 87 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 88 /* LDV_COMMENT_ASSERT Check that usb gadget class is registered. */ 89 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_REGISTERED); 90 /* LDV_COMMENT_CHANGE_STATE Unregister class for usb gadget. */ 91 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_ZERO_STATE; 92 } 93 94 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_chrdev') Check that chrdev region was not registered and register it. */ 95 int ldv_register_chrdev(int major) 96 { 97 int is_reg; 98 99 /* LDV_COMMENT_OTHER Register chrdev in the nondeterministic way. */ 100 is_reg = ldv_undef_int_nonpositive(); 101 102 /* LDV_COMMENT_ASSERT Register chrdev just in case when an error did not happen. */ 103 if (!is_reg) 104 { 105 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at this point. */ 106 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 107 /* LDV_COMMENT_ASSERT Check that chrdev region is unregistered. */ 108 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 109 /* LDV_COMMENT_CHANGE_STATE Register chrdev region for usb gadget. */ 110 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_REGISTERED; 111 if (major == 0) 112 { 113 /* LDV_COMMENT_OTHER Function returns allocated major number. */ 114 is_reg = ldv_undef_int(); 115 ldv_assume (is_reg > 0); 116 } 117 } 118 119 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 120 return is_reg; 121 } 122 123 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_chrdev_region') Check that chrdev region was not registered and register it. */ 124 int ldv_register_chrdev_region(void) 125 { 126 int is_reg; 127 128 /* LDV_COMMENT_OTHER Register chrdev in the nondeterministic way. */ 129 is_reg = ldv_undef_int_nonpositive(); 130 131 /* LDV_COMMENT_ASSERT Register chrdev just in case when an error did not happen. */ 132 if (!is_reg) 133 { 134 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at this point. */ 135 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 136 /* LDV_COMMENT_ASSERT Check that chrdev region is unregistered. */ 137 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 138 /* LDV_COMMENT_CHANGE_STATE Register chrdev region for usb gadget. */ 139 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_REGISTERED; 140 } 141 142 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 143 return is_reg; 144 } 145 146 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_chrdev_region') Check that chrdev region was registered and unregister it. */ 147 void ldv_unregister_chrdev_region(void) 148 { 149 /* LDV_COMMENT_ASSERT Usb gadget should not be registered at this point. */ 150 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 151 /* LDV_COMMENT_ASSERT Check that chrdev region is registered. */ 152 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_REGISTERED); 153 /* LDV_COMMENT_CHANGE_STATE Unregister chrdev. */ 154 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_ZERO_STATE; 155 } 156 157 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_usb_gadget') Check that usb gadget was not registered and register it. */ 158 int ldv_register_usb_gadget(void) 159 { 160 int is_reg; 161 162 /* LDV_COMMENT_OTHER Register usb gadget in the nondeterministic way. */ 163 is_reg = ldv_undef_int_nonpositive(); 164 165 /* LDV_COMMENT_ASSERT Register usb gadget just in case when an error did not happen. */ 166 if (!is_reg) 167 { 168 /* LDV_COMMENT_ASSERT Gadget should not be registered at this point. */ 169 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 170 /* LDV_COMMENT_CHANGE_STATE Register usb gadget. */ 171 ldv_usb_gadget = LDV_USB_GADGET_REGISTERED; 172 } 173 174 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 175 return is_reg; 176 } 177 178 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_usb_gadget') Check that usb gadget was registered and unregister it. */ 179 void ldv_unregister_usb_gadget(void) 180 { 181 /* LDV_COMMENT_ASSERT Usb gadget should be registered at this point. */ 182 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_REGISTERED); 183 /* LDV_COMMENT_CHANGE_STATE Unregister usb gadget. */ 184 ldv_usb_gadget = LDV_USB_GADGET_ZERO_STATE; 185 } 186 187 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') Check that usb gadget is fully unregistered at the end. */ 188 void ldv_check_final_state(void) 189 { 190 /* LDV_COMMENT_ASSERT Usb gadget class should be unregistered at the end. */ 191 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 192 /* LDV_COMMENT_ASSERT Chrdev region should be unregistered at the end. */ 193 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 194 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at the end. */ 195 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 196 }
1 #ifndef _LDV_ERR_ 2 #define _LDV_ERR_ 3 4 #include <linux/kernel.h> 5 6 /* LDV_COMMENT_MODEL_FUNCTION_DEFENITION(name='ldv_is_err') This function return result of checking if pointer is impossible. */ 7 bool ldv_is_err(const void *ptr) 8 { 9 /*LDV_COMMENT_RETURN Return value of function ldv_is_err_val().*/ 10 return ((unsigned long)ptr > LDV_PTR_MAX); 11 } 12 13 /* LDV_COMMENT_MODEL_FUNCTION_DEFENITION(name='ldv_err_ptr') This function return pointer. */ 14 void* ldv_err_ptr(long error) 15 { 16 /*LDV_COMMENT_RETURN Return error pointer.*/ 17 return (void *)(LDV_PTR_MAX - error); 18 } 19 20 /* LDV_COMMENT_MODEL_FUNCTION_DEFENITION(name='ldv_ptr_err') This function return error if pointer is impossible. */ 21 long ldv_ptr_err(const void *ptr) 22 { 23 /*LDV_COMMENT_RETURN Return error code.*/ 24 return (long)(LDV_PTR_MAX - (unsigned long)ptr); 25 } 26 27 /* LDV_COMMENT_MODEL_FUNCTION_DEFENITION(name='ldv_is_err_or_null') This function check if pointer is impossible or null. */ 28 bool ldv_is_err_or_null(const void *ptr) 29 { 30 /*LDV_COMMENT_RETURN Return 0 if pointer is possible and not zero, and 1 in other cases*/ 31 return !ptr || ldv_is_err((unsigned long)ptr); 32 } 33 34 #endif /* _LDV_ERR_ */
1 #ifndef _LDV_RCV_H_ 2 #define _LDV_RCV_H_ 3 4 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error 5 label like the standard assert(). */ 6 #define ldv_assert(expr) ((expr) ? 0 : ldv_error()) 7 8 /* The error label wrapper. It is used because of some static verifiers (like 9 BLAST) don't accept multiple error labels through a program. */ 10 static inline void ldv_error(void) 11 { 12 LDV_ERROR: goto LDV_ERROR; 13 } 14 15 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is 16 avoided by verifiers. */ 17 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop()) 18 19 /* Infinite loop, that causes verifiers to skip such paths. */ 20 static inline void ldv_stop(void) { 21 LDV_STOP: goto LDV_STOP; 22 } 23 24 /* Special nondeterministic functions. */ 25 int ldv_undef_int(void); 26 void *ldv_undef_ptr(void); 27 unsigned long ldv_undef_ulong(void); 28 long ldv_undef_long(void); 29 /* Return nondeterministic negative integer number. */ 30 static inline int ldv_undef_int_negative(void) 31 { 32 int ret = ldv_undef_int(); 33 34 ldv_assume(ret < 0); 35 36 return ret; 37 } 38 /* Return nondeterministic nonpositive integer number. */ 39 static inline int ldv_undef_int_nonpositive(void) 40 { 41 int ret = ldv_undef_int(); 42 43 ldv_assume(ret <= 0); 44 45 return ret; 46 } 47 48 /* Add explicit model for __builin_expect GCC function. Without the model a 49 return value will be treated as nondetermined by verifiers. */ 50 static inline long __builtin_expect(long exp, long c) 51 { 52 return exp; 53 } 54 55 /* This function causes the program to exit abnormally. GCC implements this 56 function by using a target-dependent mechanism (such as intentionally executing 57 an illegal instruction) or by calling abort. The mechanism used may vary from 58 release to release so you should not rely on any particular implementation. 59 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ 60 static inline void __builtin_trap(void) 61 { 62 ldv_assert(0); 63 } 64 65 /* The constant is for simulating an error of ldv_undef_ptr() function. */ 66 #define LDV_PTR_MAX 2012 67 68 #endif /* _LDV_RCV_H_ */

Here is an explanation of a rule violation arisen while checking your driver against a corresponding kernel.

Note that it may be false positive, i.e. there isn't a real error indeed. Please analyze a given error trace and related source code to understand whether there is an error in your driver.

Error trace column contains a path on which the given rule is violated. You can expand/collapse some entity classes by clicking on corresponding checkboxes in a main menu or in an advanced Others menu. Also you can expand/collapse each particular entity by clicking on +/-. In hovering on some entities you can see some tips. Also the error trace is bound with related source code. Line numbers may be shown as links on the left. You can click on them to open corresponding lines in source code.

Source code column contains a content of files related with the error trace. There is source code of your driver (note that there are some LDV modifications at the end), kernel headers and rule model. Tabs show a currently opened file and other available files. In hovering on them you can see full file names. On clicking a corresponding file content will be shown.

Kernel Module Rule Verifier Verdict Status Timestamp Bug report
linux-4.7-rc1.tar.xz drivers/gpu/drm/drm_kms_helper.ko 106_1a CPAchecker Bug Fixed 2016-06-30 00:51:47 L0237

Comment

Reported: 30 Jun 2016

[Home]