1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 /* Copyright 2017-2019 Qiang Yu <yuq825@gmail.com> */ 3 4 #ifndef __LIMA_DRV_H__ 5 #define __LIMA_DRV_H__ 6 7 #include <drm/drm_file.h> 8 9 #include "lima_ctx.h" 10 #include "lima_device.h" 11 12 extern int lima_sched_timeout_ms; 13 extern uint lima_heap_init_nr_pages; 14 extern uint lima_max_error_tasks; 15 extern uint lima_job_hang_limit; 16 17 struct lima_vm; 18 struct lima_bo; 19 struct lima_sched_task; 20 21 struct drm_lima_gem_submit_bo; 22 23 struct lima_drm_priv { 24 struct lima_vm *vm; 25 struct lima_ctx_mgr ctx_mgr; 26 }; 27 28 struct lima_submit { 29 struct lima_ctx *ctx; 30 int pipe; 31 u32 flags; 32 33 struct drm_lima_gem_submit_bo *bos; 34 struct lima_bo **lbos; 35 u32 nr_bos; 36 37 u32 in_sync[2]; 38 u32 out_sync; 39 40 struct lima_sched_task *task; 41 }; 42 43 struct lima_compatible { 44 enum lima_gpu_id id; 45 }; 46 47 static inline struct lima_drm_priv * to_lima_drm_priv(struct drm_file * file)48to_lima_drm_priv(struct drm_file *file) 49 { 50 return file->driver_priv; 51 } 52 53 #endif 54