vc4_drv.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * Copyright (C) 2015 Broadcom
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/reservation.h>
  9. #include <drm/drmP.h>
  10. #include <drm/drm_encoder.h>
  11. #include <drm/drm_gem_cma_helper.h>
  12. /* Don't forget to update vc4_bo.c: bo_type_names[] when adding to
  13. * this.
  14. */
  15. enum vc4_kernel_bo_type {
  16. /* Any kernel allocation (gem_create_object hook) before it
  17. * gets another type set.
  18. */
  19. VC4_BO_TYPE_KERNEL,
  20. VC4_BO_TYPE_V3D,
  21. VC4_BO_TYPE_V3D_SHADER,
  22. VC4_BO_TYPE_DUMB,
  23. VC4_BO_TYPE_BIN,
  24. VC4_BO_TYPE_RCL,
  25. VC4_BO_TYPE_BCL,
  26. VC4_BO_TYPE_KERNEL_CACHE,
  27. VC4_BO_TYPE_COUNT
  28. };
  29. struct vc4_dev {
  30. struct drm_device *dev;
  31. struct vc4_hdmi *hdmi;
  32. struct vc4_hvs *hvs;
  33. struct vc4_v3d *v3d;
  34. struct vc4_dpi *dpi;
  35. struct vc4_dsi *dsi1;
  36. struct vc4_vec *vec;
  37. struct vc4_hang_state *hang_state;
  38. /* The kernel-space BO cache. Tracks buffers that have been
  39. * unreferenced by all other users (refcounts of 0!) but not
  40. * yet freed, so we can do cheap allocations.
  41. */
  42. struct vc4_bo_cache {
  43. /* Array of list heads for entries in the BO cache,
  44. * based on number of pages, so we can do O(1) lookups
  45. * in the cache when allocating.
  46. */
  47. struct list_head *size_list;
  48. uint32_t size_list_size;
  49. /* List of all BOs in the cache, ordered by age, so we
  50. * can do O(1) lookups when trying to free old
  51. * buffers.
  52. */
  53. struct list_head time_list;
  54. struct work_struct time_work;
  55. struct timer_list time_timer;
  56. } bo_cache;
  57. u32 num_labels;
  58. struct vc4_label {
  59. const char *name;
  60. u32 num_allocated;
  61. u32 size_allocated;
  62. } *bo_labels;
  63. /* Protects bo_cache and bo_labels. */
  64. struct mutex bo_lock;
  65. /* Purgeable BO pool. All BOs in this pool can have their memory
  66. * reclaimed if the driver is unable to allocate new BOs. We also
  67. * keep stats related to the purge mechanism here.
  68. */
  69. struct {
  70. struct list_head list;
  71. unsigned int num;
  72. size_t size;
  73. unsigned int purged_num;
  74. size_t purged_size;
  75. struct mutex lock;
  76. } purgeable;
  77. uint64_t dma_fence_context;
  78. /* Sequence number for the last job queued in bin_job_list.
  79. * Starts at 0 (no jobs emitted).
  80. */
  81. uint64_t emit_seqno;
  82. /* Sequence number for the last completed job on the GPU.
  83. * Starts at 0 (no jobs completed).
  84. */
  85. uint64_t finished_seqno;
  86. /* List of all struct vc4_exec_info for jobs to be executed in
  87. * the binner. The first job in the list is the one currently
  88. * programmed into ct0ca for execution.
  89. */
  90. struct list_head bin_job_list;
  91. /* List of all struct vc4_exec_info for jobs that have
  92. * completed binning and are ready for rendering. The first
  93. * job in the list is the one currently programmed into ct1ca
  94. * for execution.
  95. */
  96. struct list_head render_job_list;
  97. /* List of the finished vc4_exec_infos waiting to be freed by
  98. * job_done_work.
  99. */
  100. struct list_head job_done_list;
  101. /* Spinlock used to synchronize the job_list and seqno
  102. * accesses between the IRQ handler and GEM ioctls.
  103. */
  104. spinlock_t job_lock;
  105. wait_queue_head_t job_wait_queue;
  106. struct work_struct job_done_work;
  107. /* List of struct vc4_seqno_cb for callbacks to be made from a
  108. * workqueue when the given seqno is passed.
  109. */
  110. struct list_head seqno_cb_list;
  111. /* The memory used for storing binner tile alloc, tile state,
  112. * and overflow memory allocations. This is freed when V3D
  113. * powers down.
  114. */
  115. struct vc4_bo *bin_bo;
  116. /* Size of blocks allocated within bin_bo. */
  117. uint32_t bin_alloc_size;
  118. /* Bitmask of the bin_alloc_size chunks in bin_bo that are
  119. * used.
  120. */
  121. uint32_t bin_alloc_used;
  122. /* Bitmask of the current bin_alloc used for overflow memory. */
  123. uint32_t bin_alloc_overflow;
  124. struct work_struct overflow_mem_work;
  125. int power_refcount;
  126. /* Mutex controlling the power refcount. */
  127. struct mutex power_lock;
  128. struct {
  129. struct timer_list timer;
  130. struct work_struct reset_work;
  131. } hangcheck;
  132. struct semaphore async_modeset;
  133. };
  134. static inline struct vc4_dev *
  135. to_vc4_dev(struct drm_device *dev)
  136. {
  137. return (struct vc4_dev *)dev->dev_private;
  138. }
  139. struct vc4_bo {
  140. struct drm_gem_cma_object base;
  141. /* seqno of the last job to render using this BO. */
  142. uint64_t seqno;
  143. /* seqno of the last job to use the RCL to write to this BO.
  144. *
  145. * Note that this doesn't include binner overflow memory
  146. * writes.
  147. */
  148. uint64_t write_seqno;
  149. bool t_format;
  150. /* List entry for the BO's position in either
  151. * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list
  152. */
  153. struct list_head unref_head;
  154. /* Time in jiffies when the BO was put in vc4->bo_cache. */
  155. unsigned long free_time;
  156. /* List entry for the BO's position in vc4_dev->bo_cache.size_list */
  157. struct list_head size_head;
  158. /* Struct for shader validation state, if created by
  159. * DRM_IOCTL_VC4_CREATE_SHADER_BO.
  160. */
  161. struct vc4_validated_shader_info *validated_shader;
  162. /* normally (resv == &_resv) except for imported bo's */
  163. struct reservation_object *resv;
  164. struct reservation_object _resv;
  165. /* One of enum vc4_kernel_bo_type, or VC4_BO_TYPE_COUNT + i
  166. * for user-allocated labels.
  167. */
  168. int label;
  169. /* Count the number of active users. This is needed to determine
  170. * whether we can move the BO to the purgeable list or not (when the BO
  171. * is used by the GPU or the display engine we can't purge it).
  172. */
  173. refcount_t usecnt;
  174. /* Store purgeable/purged state here */
  175. u32 madv;
  176. struct mutex madv_lock;
  177. };
  178. static inline struct vc4_bo *
  179. to_vc4_bo(struct drm_gem_object *bo)
  180. {
  181. return (struct vc4_bo *)bo;
  182. }
  183. struct vc4_fence {
  184. struct dma_fence base;
  185. struct drm_device *dev;
  186. /* vc4 seqno for signaled() test */
  187. uint64_t seqno;
  188. };
  189. static inline struct vc4_fence *
  190. to_vc4_fence(struct dma_fence *fence)
  191. {
  192. return (struct vc4_fence *)fence;
  193. }
  194. struct vc4_seqno_cb {
  195. struct work_struct work;
  196. uint64_t seqno;
  197. void (*func)(struct vc4_seqno_cb *cb);
  198. };
  199. struct vc4_v3d {
  200. struct vc4_dev *vc4;
  201. struct platform_device *pdev;
  202. void __iomem *regs;
  203. struct clk *clk;
  204. };
  205. struct vc4_hvs {
  206. struct platform_device *pdev;
  207. void __iomem *regs;
  208. u32 __iomem *dlist;
  209. /* Memory manager for CRTCs to allocate space in the display
  210. * list. Units are dwords.
  211. */
  212. struct drm_mm dlist_mm;
  213. /* Memory manager for the LBM memory used by HVS scaling. */
  214. struct drm_mm lbm_mm;
  215. spinlock_t mm_lock;
  216. struct drm_mm_node mitchell_netravali_filter;
  217. };
  218. struct vc4_plane {
  219. struct drm_plane base;
  220. };
  221. static inline struct vc4_plane *
  222. to_vc4_plane(struct drm_plane *plane)
  223. {
  224. return (struct vc4_plane *)plane;
  225. }
  226. enum vc4_encoder_type {
  227. VC4_ENCODER_TYPE_NONE,
  228. VC4_ENCODER_TYPE_HDMI,
  229. VC4_ENCODER_TYPE_VEC,
  230. VC4_ENCODER_TYPE_DSI0,
  231. VC4_ENCODER_TYPE_DSI1,
  232. VC4_ENCODER_TYPE_SMI,
  233. VC4_ENCODER_TYPE_DPI,
  234. };
  235. struct vc4_encoder {
  236. struct drm_encoder base;
  237. enum vc4_encoder_type type;
  238. u32 clock_select;
  239. };
  240. static inline struct vc4_encoder *
  241. to_vc4_encoder(struct drm_encoder *encoder)
  242. {
  243. return container_of(encoder, struct vc4_encoder, base);
  244. }
  245. #define V3D_READ(offset) readl(vc4->v3d->regs + offset)
  246. #define V3D_WRITE(offset, val) writel(val, vc4->v3d->regs + offset)
  247. #define HVS_READ(offset) readl(vc4->hvs->regs + offset)
  248. #define HVS_WRITE(offset, val) writel(val, vc4->hvs->regs + offset)
  249. struct vc4_exec_info {
  250. /* Sequence number for this bin/render job. */
  251. uint64_t seqno;
  252. /* Latest write_seqno of any BO that binning depends on. */
  253. uint64_t bin_dep_seqno;
  254. struct dma_fence *fence;
  255. /* Last current addresses the hardware was processing when the
  256. * hangcheck timer checked on us.
  257. */
  258. uint32_t last_ct0ca, last_ct1ca;
  259. /* Kernel-space copy of the ioctl arguments */
  260. struct drm_vc4_submit_cl *args;
  261. /* This is the array of BOs that were looked up at the start of exec.
  262. * Command validation will use indices into this array.
  263. */
  264. struct drm_gem_cma_object **bo;
  265. uint32_t bo_count;
  266. /* List of BOs that are being written by the RCL. Other than
  267. * the binner temporary storage, this is all the BOs written
  268. * by the job.
  269. */
  270. struct drm_gem_cma_object *rcl_write_bo[4];
  271. uint32_t rcl_write_bo_count;
  272. /* Pointers for our position in vc4->job_list */
  273. struct list_head head;
  274. /* List of other BOs used in the job that need to be released
  275. * once the job is complete.
  276. */
  277. struct list_head unref_list;
  278. /* Current unvalidated indices into @bo loaded by the non-hardware
  279. * VC4_PACKET_GEM_HANDLES.
  280. */
  281. uint32_t bo_index[2];
  282. /* This is the BO where we store the validated command lists, shader
  283. * records, and uniforms.
  284. */
  285. struct drm_gem_cma_object *exec_bo;
  286. /**
  287. * This tracks the per-shader-record state (packet 64) that
  288. * determines the length of the shader record and the offset
  289. * it's expected to be found at. It gets read in from the
  290. * command lists.
  291. */
  292. struct vc4_shader_state {
  293. uint32_t addr;
  294. /* Maximum vertex index referenced by any primitive using this
  295. * shader state.
  296. */
  297. uint32_t max_index;
  298. } *shader_state;
  299. /** How many shader states the user declared they were using. */
  300. uint32_t shader_state_size;
  301. /** How many shader state records the validator has seen. */
  302. uint32_t shader_state_count;
  303. bool found_tile_binning_mode_config_packet;
  304. bool found_start_tile_binning_packet;
  305. bool found_increment_semaphore_packet;
  306. bool found_flush;
  307. uint8_t bin_tiles_x, bin_tiles_y;
  308. /* Physical address of the start of the tile alloc array
  309. * (where each tile's binned CL will start)
  310. */
  311. uint32_t tile_alloc_offset;
  312. /* Bitmask of which binner slots are freed when this job completes. */
  313. uint32_t bin_slots;
  314. /**
  315. * Computed addresses pointing into exec_bo where we start the
  316. * bin thread (ct0) and render thread (ct1).
  317. */
  318. uint32_t ct0ca, ct0ea;
  319. uint32_t ct1ca, ct1ea;
  320. /* Pointer to the unvalidated bin CL (if present). */
  321. void *bin_u;
  322. /* Pointers to the shader recs. These paddr gets incremented as CL
  323. * packets are relocated in validate_gl_shader_state, and the vaddrs
  324. * (u and v) get incremented and size decremented as the shader recs
  325. * themselves are validated.
  326. */
  327. void *shader_rec_u;
  328. void *shader_rec_v;
  329. uint32_t shader_rec_p;
  330. uint32_t shader_rec_size;
  331. /* Pointers to the uniform data. These pointers are incremented, and
  332. * size decremented, as each batch of uniforms is uploaded.
  333. */
  334. void *uniforms_u;
  335. void *uniforms_v;
  336. uint32_t uniforms_p;
  337. uint32_t uniforms_size;
  338. };
  339. static inline struct vc4_exec_info *
  340. vc4_first_bin_job(struct vc4_dev *vc4)
  341. {
  342. return list_first_entry_or_null(&vc4->bin_job_list,
  343. struct vc4_exec_info, head);
  344. }
  345. static inline struct vc4_exec_info *
  346. vc4_first_render_job(struct vc4_dev *vc4)
  347. {
  348. return list_first_entry_or_null(&vc4->render_job_list,
  349. struct vc4_exec_info, head);
  350. }
  351. static inline struct vc4_exec_info *
  352. vc4_last_render_job(struct vc4_dev *vc4)
  353. {
  354. if (list_empty(&vc4->render_job_list))
  355. return NULL;
  356. return list_last_entry(&vc4->render_job_list,
  357. struct vc4_exec_info, head);
  358. }
  359. /**
  360. * struct vc4_texture_sample_info - saves the offsets into the UBO for texture
  361. * setup parameters.
  362. *
  363. * This will be used at draw time to relocate the reference to the texture
  364. * contents in p0, and validate that the offset combined with
  365. * width/height/stride/etc. from p1 and p2/p3 doesn't sample outside the BO.
  366. * Note that the hardware treats unprovided config parameters as 0, so not all
  367. * of them need to be set up for every texure sample, and we'll store ~0 as
  368. * the offset to mark the unused ones.
  369. *
  370. * See the VC4 3D architecture guide page 41 ("Texture and Memory Lookup Unit
  371. * Setup") for definitions of the texture parameters.
  372. */
  373. struct vc4_texture_sample_info {
  374. bool is_direct;
  375. uint32_t p_offset[4];
  376. };
  377. /**
  378. * struct vc4_validated_shader_info - information about validated shaders that
  379. * needs to be used from command list validation.
  380. *
  381. * For a given shader, each time a shader state record references it, we need
  382. * to verify that the shader doesn't read more uniforms than the shader state
  383. * record's uniform BO pointer can provide, and we need to apply relocations
  384. * and validate the shader state record's uniforms that define the texture
  385. * samples.
  386. */
  387. struct vc4_validated_shader_info {
  388. uint32_t uniforms_size;
  389. uint32_t uniforms_src_size;
  390. uint32_t num_texture_samples;
  391. struct vc4_texture_sample_info *texture_samples;
  392. uint32_t num_uniform_addr_offsets;
  393. uint32_t *uniform_addr_offsets;
  394. bool is_threaded;
  395. };
  396. /**
  397. * _wait_for - magic (register) wait macro
  398. *
  399. * Does the right thing for modeset paths when run under kdgb or similar atomic
  400. * contexts. Note that it's important that we check the condition again after
  401. * having timed out, since the timeout could be due to preemption or similar and
  402. * we've never had a chance to check the condition before the timeout.
  403. */
  404. #define _wait_for(COND, MS, W) ({ \
  405. unsigned long timeout__ = jiffies + msecs_to_jiffies(MS) + 1; \
  406. int ret__ = 0; \
  407. while (!(COND)) { \
  408. if (time_after(jiffies, timeout__)) { \
  409. if (!(COND)) \
  410. ret__ = -ETIMEDOUT; \
  411. break; \
  412. } \
  413. if (W && drm_can_sleep()) { \
  414. msleep(W); \
  415. } else { \
  416. cpu_relax(); \
  417. } \
  418. } \
  419. ret__; \
  420. })
  421. #define wait_for(COND, MS) _wait_for(COND, MS, 1)
  422. /* vc4_bo.c */
  423. struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size);
  424. void vc4_free_object(struct drm_gem_object *gem_obj);
  425. struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t size,
  426. bool from_cache, enum vc4_kernel_bo_type type);
  427. int vc4_dumb_create(struct drm_file *file_priv,
  428. struct drm_device *dev,
  429. struct drm_mode_create_dumb *args);
  430. struct dma_buf *vc4_prime_export(struct drm_device *dev,
  431. struct drm_gem_object *obj, int flags);
  432. int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
  433. struct drm_file *file_priv);
  434. int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
  435. struct drm_file *file_priv);
  436. int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
  437. struct drm_file *file_priv);
  438. int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
  439. struct drm_file *file_priv);
  440. int vc4_get_tiling_ioctl(struct drm_device *dev, void *data,
  441. struct drm_file *file_priv);
  442. int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data,
  443. struct drm_file *file_priv);
  444. int vc4_label_bo_ioctl(struct drm_device *dev, void *data,
  445. struct drm_file *file_priv);
  446. int vc4_fault(struct vm_fault *vmf);
  447. int vc4_mmap(struct file *filp, struct vm_area_struct *vma);
  448. struct reservation_object *vc4_prime_res_obj(struct drm_gem_object *obj);
  449. int vc4_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
  450. struct drm_gem_object *vc4_prime_import_sg_table(struct drm_device *dev,
  451. struct dma_buf_attachment *attach,
  452. struct sg_table *sgt);
  453. void *vc4_prime_vmap(struct drm_gem_object *obj);
  454. int vc4_bo_cache_init(struct drm_device *dev);
  455. void vc4_bo_cache_destroy(struct drm_device *dev);
  456. int vc4_bo_stats_debugfs(struct seq_file *m, void *arg);
  457. int vc4_bo_inc_usecnt(struct vc4_bo *bo);
  458. void vc4_bo_dec_usecnt(struct vc4_bo *bo);
  459. void vc4_bo_add_to_purgeable_pool(struct vc4_bo *bo);
  460. void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo);
  461. /* vc4_crtc.c */
  462. extern struct platform_driver vc4_crtc_driver;
  463. int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg);
  464. bool vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
  465. bool in_vblank_irq, int *vpos, int *hpos,
  466. ktime_t *stime, ktime_t *etime,
  467. const struct drm_display_mode *mode);
  468. /* vc4_debugfs.c */
  469. int vc4_debugfs_init(struct drm_minor *minor);
  470. /* vc4_drv.c */
  471. void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
  472. /* vc4_dpi.c */
  473. extern struct platform_driver vc4_dpi_driver;
  474. int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused);
  475. /* vc4_dsi.c */
  476. extern struct platform_driver vc4_dsi_driver;
  477. int vc4_dsi_debugfs_regs(struct seq_file *m, void *unused);
  478. /* vc4_fence.c */
  479. extern const struct dma_fence_ops vc4_fence_ops;
  480. /* vc4_gem.c */
  481. void vc4_gem_init(struct drm_device *dev);
  482. void vc4_gem_destroy(struct drm_device *dev);
  483. int vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
  484. struct drm_file *file_priv);
  485. int vc4_wait_seqno_ioctl(struct drm_device *dev, void *data,
  486. struct drm_file *file_priv);
  487. int vc4_wait_bo_ioctl(struct drm_device *dev, void *data,
  488. struct drm_file *file_priv);
  489. void vc4_submit_next_bin_job(struct drm_device *dev);
  490. void vc4_submit_next_render_job(struct drm_device *dev);
  491. void vc4_move_job_to_render(struct drm_device *dev, struct vc4_exec_info *exec);
  492. int vc4_wait_for_seqno(struct drm_device *dev, uint64_t seqno,
  493. uint64_t timeout_ns, bool interruptible);
  494. void vc4_job_handle_completed(struct vc4_dev *vc4);
  495. int vc4_queue_seqno_cb(struct drm_device *dev,
  496. struct vc4_seqno_cb *cb, uint64_t seqno,
  497. void (*func)(struct vc4_seqno_cb *cb));
  498. int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data,
  499. struct drm_file *file_priv);
  500. /* vc4_hdmi.c */
  501. extern struct platform_driver vc4_hdmi_driver;
  502. int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused);
  503. /* vc4_vec.c */
  504. extern struct platform_driver vc4_vec_driver;
  505. int vc4_vec_debugfs_regs(struct seq_file *m, void *unused);
  506. /* vc4_irq.c */
  507. irqreturn_t vc4_irq(int irq, void *arg);
  508. void vc4_irq_preinstall(struct drm_device *dev);
  509. int vc4_irq_postinstall(struct drm_device *dev);
  510. void vc4_irq_uninstall(struct drm_device *dev);
  511. void vc4_irq_reset(struct drm_device *dev);
  512. /* vc4_hvs.c */
  513. extern struct platform_driver vc4_hvs_driver;
  514. void vc4_hvs_dump_state(struct drm_device *dev);
  515. int vc4_hvs_debugfs_regs(struct seq_file *m, void *unused);
  516. /* vc4_kms.c */
  517. int vc4_kms_load(struct drm_device *dev);
  518. /* vc4_plane.c */
  519. struct drm_plane *vc4_plane_init(struct drm_device *dev,
  520. enum drm_plane_type type);
  521. u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist);
  522. u32 vc4_plane_dlist_size(const struct drm_plane_state *state);
  523. void vc4_plane_async_set_fb(struct drm_plane *plane,
  524. struct drm_framebuffer *fb);
  525. /* vc4_v3d.c */
  526. extern struct platform_driver vc4_v3d_driver;
  527. int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused);
  528. int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused);
  529. int vc4_v3d_get_bin_slot(struct vc4_dev *vc4);
  530. /* vc4_validate.c */
  531. int
  532. vc4_validate_bin_cl(struct drm_device *dev,
  533. void *validated,
  534. void *unvalidated,
  535. struct vc4_exec_info *exec);
  536. int
  537. vc4_validate_shader_recs(struct drm_device *dev, struct vc4_exec_info *exec);
  538. struct drm_gem_cma_object *vc4_use_bo(struct vc4_exec_info *exec,
  539. uint32_t hindex);
  540. int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec);
  541. bool vc4_check_tex_size(struct vc4_exec_info *exec,
  542. struct drm_gem_cma_object *fbo,
  543. uint32_t offset, uint8_t tiling_format,
  544. uint32_t width, uint32_t height, uint8_t cpp);
  545. /* vc4_validate_shader.c */
  546. struct vc4_validated_shader_info *
  547. vc4_validate_shader(struct drm_gem_cma_object *shader_obj);