vc4_drv.h 19 KB

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