Lines Matching refs:vc4file
88 struct vc4_perfmon *vc4_perfmon_find(struct vc4_file *vc4file, int id) in vc4_perfmon_find() argument
90 struct vc4_dev *vc4 = vc4file->dev; in vc4_perfmon_find()
96 mutex_lock(&vc4file->perfmon.lock); in vc4_perfmon_find()
97 perfmon = idr_find(&vc4file->perfmon.idr, id); in vc4_perfmon_find()
99 mutex_unlock(&vc4file->perfmon.lock); in vc4_perfmon_find()
104 void vc4_perfmon_open_file(struct vc4_file *vc4file) in vc4_perfmon_open_file() argument
106 struct vc4_dev *vc4 = vc4file->dev; in vc4_perfmon_open_file()
111 mutex_init(&vc4file->perfmon.lock); in vc4_perfmon_open_file()
112 idr_init_base(&vc4file->perfmon.idr, VC4_PERFMONID_MIN); in vc4_perfmon_open_file()
113 vc4file->dev = vc4; in vc4_perfmon_open_file()
130 void vc4_perfmon_close_file(struct vc4_file *vc4file) in vc4_perfmon_close_file() argument
132 struct vc4_dev *vc4 = vc4file->dev; in vc4_perfmon_close_file()
137 mutex_lock(&vc4file->perfmon.lock); in vc4_perfmon_close_file()
138 idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, vc4); in vc4_perfmon_close_file()
139 idr_destroy(&vc4file->perfmon.idr); in vc4_perfmon_close_file()
140 mutex_unlock(&vc4file->perfmon.lock); in vc4_perfmon_close_file()
141 mutex_destroy(&vc4file->perfmon.lock); in vc4_perfmon_close_file()
148 struct vc4_file *vc4file = file_priv->driver_priv; in vc4_perfmon_create_ioctl() local
186 mutex_lock(&vc4file->perfmon.lock); in vc4_perfmon_create_ioctl()
187 ret = idr_alloc(&vc4file->perfmon.idr, perfmon, VC4_PERFMONID_MIN, in vc4_perfmon_create_ioctl()
189 mutex_unlock(&vc4file->perfmon.lock); in vc4_perfmon_create_ioctl()
204 struct vc4_file *vc4file = file_priv->driver_priv; in vc4_perfmon_destroy_ioctl() local
216 mutex_lock(&vc4file->perfmon.lock); in vc4_perfmon_destroy_ioctl()
217 perfmon = idr_remove(&vc4file->perfmon.idr, req->id); in vc4_perfmon_destroy_ioctl()
218 mutex_unlock(&vc4file->perfmon.lock); in vc4_perfmon_destroy_ioctl()
231 struct vc4_file *vc4file = file_priv->driver_priv; in vc4_perfmon_get_values_ioctl() local
244 mutex_lock(&vc4file->perfmon.lock); in vc4_perfmon_get_values_ioctl()
245 perfmon = idr_find(&vc4file->perfmon.idr, req->id); in vc4_perfmon_get_values_ioctl()
247 mutex_unlock(&vc4file->perfmon.lock); in vc4_perfmon_get_values_ioctl()