vc4_drv.h 18 KB

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