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 11 extern int lima_sched_timeout_ms; 12 extern uint lima_heap_init_nr_pages; 13 extern uint lima_max_error_tasks; 14 15 struct lima_vm; 16 struct lima_bo; 17 struct lima_sched_task; 18 19 struct drm_lima_gem_submit_bo; 20 21 struct lima_drm_priv { 22 struct lima_vm *vm; 23 struct lima_ctx_mgr ctx_mgr; 24 }; 25 26 struct lima_submit { 27 struct lima_ctx *ctx; 28 int pipe; 29 u32 flags; 30 31 struct drm_lima_gem_submit_bo *bos; 32 struct lima_bo **lbos; 33 u32 nr_bos; 34 35 u32 in_sync[2]; 36 u32 out_sync; 37 38 struct lima_sched_task *task; 39 }; 40 41 static inline struct lima_drm_priv * 42 to_lima_drm_priv(struct drm_file *file) 43 { 44 return file->driver_priv; 45 } 46 47 #endif 48