job.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /*
  2. * Tegra host1x Job
  3. *
  4. * Copyright (c) 2010-2015, NVIDIA Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include <linux/dma-mapping.h>
  19. #include <linux/err.h>
  20. #include <linux/host1x.h>
  21. #include <linux/kref.h>
  22. #include <linux/module.h>
  23. #include <linux/scatterlist.h>
  24. #include <linux/slab.h>
  25. #include <linux/vmalloc.h>
  26. #include <trace/events/host1x.h>
  27. #include "channel.h"
  28. #include "dev.h"
  29. #include "job.h"
  30. #include "syncpt.h"
  31. #define HOST1X_WAIT_SYNCPT_OFFSET 0x8
  32. struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
  33. u32 num_cmdbufs, u32 num_relocs,
  34. u32 num_waitchks)
  35. {
  36. struct host1x_job *job = NULL;
  37. unsigned int num_unpins = num_cmdbufs + num_relocs;
  38. u64 total;
  39. void *mem;
  40. /* Check that we're not going to overflow */
  41. total = sizeof(struct host1x_job) +
  42. (u64)num_relocs * sizeof(struct host1x_reloc) +
  43. (u64)num_unpins * sizeof(struct host1x_job_unpin_data) +
  44. (u64)num_waitchks * sizeof(struct host1x_waitchk) +
  45. (u64)num_cmdbufs * sizeof(struct host1x_job_gather) +
  46. (u64)num_unpins * sizeof(dma_addr_t) +
  47. (u64)num_unpins * sizeof(u32 *);
  48. if (total > ULONG_MAX)
  49. return NULL;
  50. mem = job = kzalloc(total, GFP_KERNEL);
  51. if (!job)
  52. return NULL;
  53. kref_init(&job->ref);
  54. job->channel = ch;
  55. /* Redistribute memory to the structs */
  56. mem += sizeof(struct host1x_job);
  57. job->relocarray = num_relocs ? mem : NULL;
  58. mem += num_relocs * sizeof(struct host1x_reloc);
  59. job->unpins = num_unpins ? mem : NULL;
  60. mem += num_unpins * sizeof(struct host1x_job_unpin_data);
  61. job->waitchk = num_waitchks ? mem : NULL;
  62. mem += num_waitchks * sizeof(struct host1x_waitchk);
  63. job->gathers = num_cmdbufs ? mem : NULL;
  64. mem += num_cmdbufs * sizeof(struct host1x_job_gather);
  65. job->addr_phys = num_unpins ? mem : NULL;
  66. job->reloc_addr_phys = job->addr_phys;
  67. job->gather_addr_phys = &job->addr_phys[num_relocs];
  68. return job;
  69. }
  70. EXPORT_SYMBOL(host1x_job_alloc);
  71. struct host1x_job *host1x_job_get(struct host1x_job *job)
  72. {
  73. kref_get(&job->ref);
  74. return job;
  75. }
  76. EXPORT_SYMBOL(host1x_job_get);
  77. static void job_free(struct kref *ref)
  78. {
  79. struct host1x_job *job = container_of(ref, struct host1x_job, ref);
  80. kfree(job);
  81. }
  82. void host1x_job_put(struct host1x_job *job)
  83. {
  84. kref_put(&job->ref, job_free);
  85. }
  86. EXPORT_SYMBOL(host1x_job_put);
  87. void host1x_job_add_gather(struct host1x_job *job, struct host1x_bo *bo,
  88. u32 words, u32 offset)
  89. {
  90. struct host1x_job_gather *cur_gather = &job->gathers[job->num_gathers];
  91. cur_gather->words = words;
  92. cur_gather->bo = bo;
  93. cur_gather->offset = offset;
  94. job->num_gathers++;
  95. }
  96. EXPORT_SYMBOL(host1x_job_add_gather);
  97. /*
  98. * NULL an already satisfied WAIT_SYNCPT host method, by patching its
  99. * args in the command stream. The method data is changed to reference
  100. * a reserved (never given out or incr) HOST1X_SYNCPT_RESERVED syncpt
  101. * with a matching threshold value of 0, so is guaranteed to be popped
  102. * by the host HW.
  103. */
  104. static void host1x_syncpt_patch_offset(struct host1x_syncpt *sp,
  105. struct host1x_bo *h, u32 offset)
  106. {
  107. void *patch_addr = NULL;
  108. /* patch the wait */
  109. patch_addr = host1x_bo_kmap(h, offset >> PAGE_SHIFT);
  110. if (patch_addr) {
  111. host1x_syncpt_patch_wait(sp,
  112. patch_addr + (offset & ~PAGE_MASK));
  113. host1x_bo_kunmap(h, offset >> PAGE_SHIFT, patch_addr);
  114. } else
  115. pr_err("Could not map cmdbuf for wait check\n");
  116. }
  117. /*
  118. * Check driver supplied waitchk structs for syncpt thresholds
  119. * that have already been satisfied and NULL the comparison (to
  120. * avoid a wrap condition in the HW).
  121. */
  122. static int do_waitchks(struct host1x_job *job, struct host1x *host,
  123. struct host1x_job_gather *g)
  124. {
  125. struct host1x_bo *patch = g->bo;
  126. int i;
  127. /* compare syncpt vs wait threshold */
  128. for (i = 0; i < job->num_waitchk; i++) {
  129. struct host1x_waitchk *wait = &job->waitchk[i];
  130. struct host1x_syncpt *sp =
  131. host1x_syncpt_get(host, wait->syncpt_id);
  132. /* validate syncpt id */
  133. if (wait->syncpt_id > host1x_syncpt_nb_pts(host))
  134. continue;
  135. /* skip all other gathers */
  136. if (patch != wait->bo)
  137. continue;
  138. trace_host1x_syncpt_wait_check(wait->bo, wait->offset,
  139. wait->syncpt_id, wait->thresh,
  140. host1x_syncpt_read_min(sp));
  141. if (host1x_syncpt_is_expired(sp, wait->thresh)) {
  142. dev_dbg(host->dev,
  143. "drop WAIT id %u (%s) thresh 0x%x, min 0x%x\n",
  144. wait->syncpt_id, sp->name, wait->thresh,
  145. host1x_syncpt_read_min(sp));
  146. host1x_syncpt_patch_offset(sp, patch,
  147. g->offset + wait->offset);
  148. }
  149. wait->bo = NULL;
  150. }
  151. return 0;
  152. }
  153. static unsigned int pin_job(struct host1x *host, struct host1x_job *job)
  154. {
  155. unsigned int i;
  156. int err;
  157. job->num_unpins = 0;
  158. for (i = 0; i < job->num_relocs; i++) {
  159. struct host1x_reloc *reloc = &job->relocarray[i];
  160. struct sg_table *sgt;
  161. dma_addr_t phys_addr;
  162. reloc->target.bo = host1x_bo_get(reloc->target.bo);
  163. if (!reloc->target.bo) {
  164. err = -EINVAL;
  165. goto unpin;
  166. }
  167. phys_addr = host1x_bo_pin(reloc->target.bo, &sgt);
  168. job->addr_phys[job->num_unpins] = phys_addr;
  169. job->unpins[job->num_unpins].bo = reloc->target.bo;
  170. job->unpins[job->num_unpins].sgt = sgt;
  171. job->num_unpins++;
  172. }
  173. for (i = 0; i < job->num_gathers; i++) {
  174. struct host1x_job_gather *g = &job->gathers[i];
  175. size_t gather_size = 0;
  176. struct scatterlist *sg;
  177. struct sg_table *sgt;
  178. dma_addr_t phys_addr;
  179. unsigned long shift;
  180. struct iova *alloc;
  181. unsigned int j;
  182. g->bo = host1x_bo_get(g->bo);
  183. if (!g->bo) {
  184. err = -EINVAL;
  185. goto unpin;
  186. }
  187. phys_addr = host1x_bo_pin(g->bo, &sgt);
  188. if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && host->domain) {
  189. for_each_sg(sgt->sgl, sg, sgt->nents, j)
  190. gather_size += sg->length;
  191. gather_size = iova_align(&host->iova, gather_size);
  192. shift = iova_shift(&host->iova);
  193. alloc = alloc_iova(&host->iova, gather_size >> shift,
  194. host->iova_end >> shift, true);
  195. if (!alloc) {
  196. err = -ENOMEM;
  197. goto unpin;
  198. }
  199. err = iommu_map_sg(host->domain,
  200. iova_dma_addr(&host->iova, alloc),
  201. sgt->sgl, sgt->nents, IOMMU_READ);
  202. if (err == 0) {
  203. __free_iova(&host->iova, alloc);
  204. err = -EINVAL;
  205. goto unpin;
  206. }
  207. job->addr_phys[job->num_unpins] =
  208. iova_dma_addr(&host->iova, alloc);
  209. job->unpins[job->num_unpins].size = gather_size;
  210. } else {
  211. job->addr_phys[job->num_unpins] = phys_addr;
  212. }
  213. job->gather_addr_phys[i] = job->addr_phys[job->num_unpins];
  214. job->unpins[job->num_unpins].bo = g->bo;
  215. job->unpins[job->num_unpins].sgt = sgt;
  216. job->num_unpins++;
  217. }
  218. return 0;
  219. unpin:
  220. host1x_job_unpin(job);
  221. return err;
  222. }
  223. static int do_relocs(struct host1x_job *job, struct host1x_job_gather *g)
  224. {
  225. int i = 0;
  226. u32 last_page = ~0;
  227. void *cmdbuf_page_addr = NULL;
  228. struct host1x_bo *cmdbuf = g->bo;
  229. /* pin & patch the relocs for one gather */
  230. for (i = 0; i < job->num_relocs; i++) {
  231. struct host1x_reloc *reloc = &job->relocarray[i];
  232. u32 reloc_addr = (job->reloc_addr_phys[i] +
  233. reloc->target.offset) >> reloc->shift;
  234. u32 *target;
  235. /* skip all other gathers */
  236. if (cmdbuf != reloc->cmdbuf.bo)
  237. continue;
  238. if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) {
  239. target = (u32 *)job->gather_copy_mapped +
  240. reloc->cmdbuf.offset / sizeof(u32) +
  241. g->offset / sizeof(u32);
  242. goto patch_reloc;
  243. }
  244. if (last_page != reloc->cmdbuf.offset >> PAGE_SHIFT) {
  245. if (cmdbuf_page_addr)
  246. host1x_bo_kunmap(cmdbuf, last_page,
  247. cmdbuf_page_addr);
  248. cmdbuf_page_addr = host1x_bo_kmap(cmdbuf,
  249. reloc->cmdbuf.offset >> PAGE_SHIFT);
  250. last_page = reloc->cmdbuf.offset >> PAGE_SHIFT;
  251. if (unlikely(!cmdbuf_page_addr)) {
  252. pr_err("Could not map cmdbuf for relocation\n");
  253. return -ENOMEM;
  254. }
  255. }
  256. target = cmdbuf_page_addr + (reloc->cmdbuf.offset & ~PAGE_MASK);
  257. patch_reloc:
  258. *target = reloc_addr;
  259. }
  260. if (cmdbuf_page_addr)
  261. host1x_bo_kunmap(cmdbuf, last_page, cmdbuf_page_addr);
  262. return 0;
  263. }
  264. static bool check_reloc(struct host1x_reloc *reloc, struct host1x_bo *cmdbuf,
  265. unsigned int offset)
  266. {
  267. offset *= sizeof(u32);
  268. if (reloc->cmdbuf.bo != cmdbuf || reloc->cmdbuf.offset != offset)
  269. return false;
  270. /* relocation shift value validation isn't implemented yet */
  271. if (reloc->shift)
  272. return false;
  273. return true;
  274. }
  275. static bool check_wait(struct host1x_waitchk *wait, struct host1x_bo *cmdbuf,
  276. unsigned int offset)
  277. {
  278. offset *= sizeof(u32);
  279. if (wait->bo != cmdbuf || wait->offset != offset)
  280. return false;
  281. return true;
  282. }
  283. struct host1x_firewall {
  284. struct host1x_job *job;
  285. struct device *dev;
  286. unsigned int num_relocs;
  287. struct host1x_reloc *reloc;
  288. unsigned int num_waitchks;
  289. struct host1x_waitchk *waitchk;
  290. struct host1x_bo *cmdbuf;
  291. unsigned int offset;
  292. u32 words;
  293. u32 class;
  294. u32 reg;
  295. u32 mask;
  296. u32 count;
  297. };
  298. static int check_register(struct host1x_firewall *fw, unsigned long offset)
  299. {
  300. if (!fw->job->is_addr_reg)
  301. return 0;
  302. if (fw->job->is_addr_reg(fw->dev, fw->class, offset)) {
  303. if (!fw->num_relocs)
  304. return -EINVAL;
  305. if (!check_reloc(fw->reloc, fw->cmdbuf, fw->offset))
  306. return -EINVAL;
  307. fw->num_relocs--;
  308. fw->reloc++;
  309. }
  310. if (offset == HOST1X_WAIT_SYNCPT_OFFSET) {
  311. if (fw->class != HOST1X_CLASS_HOST1X)
  312. return -EINVAL;
  313. if (!fw->num_waitchks)
  314. return -EINVAL;
  315. if (!check_wait(fw->waitchk, fw->cmdbuf, fw->offset))
  316. return -EINVAL;
  317. fw->num_waitchks--;
  318. fw->waitchk++;
  319. }
  320. return 0;
  321. }
  322. static int check_class(struct host1x_firewall *fw, u32 class)
  323. {
  324. if (!fw->job->is_valid_class) {
  325. if (fw->class != class)
  326. return -EINVAL;
  327. } else {
  328. if (!fw->job->is_valid_class(fw->class))
  329. return -EINVAL;
  330. }
  331. return 0;
  332. }
  333. static int check_mask(struct host1x_firewall *fw)
  334. {
  335. u32 mask = fw->mask;
  336. u32 reg = fw->reg;
  337. int ret;
  338. while (mask) {
  339. if (fw->words == 0)
  340. return -EINVAL;
  341. if (mask & 1) {
  342. ret = check_register(fw, reg);
  343. if (ret < 0)
  344. return ret;
  345. fw->words--;
  346. fw->offset++;
  347. }
  348. mask >>= 1;
  349. reg++;
  350. }
  351. return 0;
  352. }
  353. static int check_incr(struct host1x_firewall *fw)
  354. {
  355. u32 count = fw->count;
  356. u32 reg = fw->reg;
  357. int ret;
  358. while (count) {
  359. if (fw->words == 0)
  360. return -EINVAL;
  361. ret = check_register(fw, reg);
  362. if (ret < 0)
  363. return ret;
  364. reg++;
  365. fw->words--;
  366. fw->offset++;
  367. count--;
  368. }
  369. return 0;
  370. }
  371. static int check_nonincr(struct host1x_firewall *fw)
  372. {
  373. u32 count = fw->count;
  374. int ret;
  375. while (count) {
  376. if (fw->words == 0)
  377. return -EINVAL;
  378. ret = check_register(fw, fw->reg);
  379. if (ret < 0)
  380. return ret;
  381. fw->words--;
  382. fw->offset++;
  383. count--;
  384. }
  385. return 0;
  386. }
  387. static int validate(struct host1x_firewall *fw, struct host1x_job_gather *g)
  388. {
  389. u32 *cmdbuf_base = (u32 *)fw->job->gather_copy_mapped +
  390. (g->offset / sizeof(u32));
  391. u32 job_class = fw->class;
  392. int err = 0;
  393. fw->words = g->words;
  394. fw->cmdbuf = g->bo;
  395. fw->offset = 0;
  396. while (fw->words && !err) {
  397. u32 word = cmdbuf_base[fw->offset];
  398. u32 opcode = (word & 0xf0000000) >> 28;
  399. fw->mask = 0;
  400. fw->reg = 0;
  401. fw->count = 0;
  402. fw->words--;
  403. fw->offset++;
  404. switch (opcode) {
  405. case 0:
  406. fw->class = word >> 6 & 0x3ff;
  407. fw->mask = word & 0x3f;
  408. fw->reg = word >> 16 & 0xfff;
  409. err = check_class(fw, job_class);
  410. if (!err)
  411. err = check_mask(fw);
  412. if (err)
  413. goto out;
  414. break;
  415. case 1:
  416. fw->reg = word >> 16 & 0xfff;
  417. fw->count = word & 0xffff;
  418. err = check_incr(fw);
  419. if (err)
  420. goto out;
  421. break;
  422. case 2:
  423. fw->reg = word >> 16 & 0xfff;
  424. fw->count = word & 0xffff;
  425. err = check_nonincr(fw);
  426. if (err)
  427. goto out;
  428. break;
  429. case 3:
  430. fw->mask = word & 0xffff;
  431. fw->reg = word >> 16 & 0xfff;
  432. err = check_mask(fw);
  433. if (err)
  434. goto out;
  435. break;
  436. case 4:
  437. case 14:
  438. break;
  439. default:
  440. err = -EINVAL;
  441. break;
  442. }
  443. }
  444. out:
  445. return err;
  446. }
  447. static inline int copy_gathers(struct host1x_job *job, struct device *dev)
  448. {
  449. struct host1x_firewall fw;
  450. size_t size = 0;
  451. size_t offset = 0;
  452. int i;
  453. fw.job = job;
  454. fw.dev = dev;
  455. fw.reloc = job->relocarray;
  456. fw.num_relocs = job->num_relocs;
  457. fw.waitchk = job->waitchk;
  458. fw.num_waitchks = job->num_waitchk;
  459. fw.class = job->class;
  460. for (i = 0; i < job->num_gathers; i++) {
  461. struct host1x_job_gather *g = &job->gathers[i];
  462. size += g->words * sizeof(u32);
  463. }
  464. /*
  465. * Try a non-blocking allocation from a higher priority pools first,
  466. * as awaiting for the allocation here is a major performance hit.
  467. */
  468. job->gather_copy_mapped = dma_alloc_wc(dev, size, &job->gather_copy,
  469. GFP_NOWAIT);
  470. /* the higher priority allocation failed, try the generic-blocking */
  471. if (!job->gather_copy_mapped)
  472. job->gather_copy_mapped = dma_alloc_wc(dev, size,
  473. &job->gather_copy,
  474. GFP_KERNEL);
  475. if (!job->gather_copy_mapped)
  476. return -ENOMEM;
  477. job->gather_copy_size = size;
  478. for (i = 0; i < job->num_gathers; i++) {
  479. struct host1x_job_gather *g = &job->gathers[i];
  480. void *gather;
  481. /* Copy the gather */
  482. gather = host1x_bo_mmap(g->bo);
  483. memcpy(job->gather_copy_mapped + offset, gather + g->offset,
  484. g->words * sizeof(u32));
  485. host1x_bo_munmap(g->bo, gather);
  486. /* Store the location in the buffer */
  487. g->base = job->gather_copy;
  488. g->offset = offset;
  489. /* Validate the job */
  490. if (validate(&fw, g))
  491. return -EINVAL;
  492. offset += g->words * sizeof(u32);
  493. }
  494. /* No relocs and waitchks should remain at this point */
  495. if (fw.num_relocs || fw.num_waitchks)
  496. return -EINVAL;
  497. return 0;
  498. }
  499. int host1x_job_pin(struct host1x_job *job, struct device *dev)
  500. {
  501. int err;
  502. unsigned int i, j;
  503. struct host1x *host = dev_get_drvdata(dev->parent);
  504. DECLARE_BITMAP(waitchk_mask, host1x_syncpt_nb_pts(host));
  505. bitmap_zero(waitchk_mask, host1x_syncpt_nb_pts(host));
  506. for (i = 0; i < job->num_waitchk; i++) {
  507. u32 syncpt_id = job->waitchk[i].syncpt_id;
  508. if (syncpt_id < host1x_syncpt_nb_pts(host))
  509. set_bit(syncpt_id, waitchk_mask);
  510. }
  511. /* get current syncpt values for waitchk */
  512. for_each_set_bit(i, waitchk_mask, host1x_syncpt_nb_pts(host))
  513. host1x_syncpt_load(host->syncpt + i);
  514. /* pin memory */
  515. err = pin_job(host, job);
  516. if (err)
  517. goto out;
  518. if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) {
  519. err = copy_gathers(job, dev);
  520. if (err)
  521. goto out;
  522. }
  523. /* patch gathers */
  524. for (i = 0; i < job->num_gathers; i++) {
  525. struct host1x_job_gather *g = &job->gathers[i];
  526. /* process each gather mem only once */
  527. if (g->handled)
  528. continue;
  529. /* copy_gathers() sets gathers base if firewall is enabled */
  530. if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL))
  531. g->base = job->gather_addr_phys[i];
  532. for (j = i + 1; j < job->num_gathers; j++) {
  533. if (job->gathers[j].bo == g->bo) {
  534. job->gathers[j].handled = true;
  535. job->gathers[j].base = g->base;
  536. }
  537. }
  538. err = do_relocs(job, g);
  539. if (err)
  540. break;
  541. err = do_waitchks(job, host, g);
  542. if (err)
  543. break;
  544. }
  545. out:
  546. if (err)
  547. host1x_job_unpin(job);
  548. wmb();
  549. return err;
  550. }
  551. EXPORT_SYMBOL(host1x_job_pin);
  552. void host1x_job_unpin(struct host1x_job *job)
  553. {
  554. struct host1x *host = dev_get_drvdata(job->channel->dev->parent);
  555. unsigned int i;
  556. for (i = 0; i < job->num_unpins; i++) {
  557. struct host1x_job_unpin_data *unpin = &job->unpins[i];
  558. if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && host->domain) {
  559. iommu_unmap(host->domain, job->addr_phys[i],
  560. unpin->size);
  561. free_iova(&host->iova,
  562. iova_pfn(&host->iova, job->addr_phys[i]));
  563. }
  564. host1x_bo_unpin(unpin->bo, unpin->sgt);
  565. host1x_bo_put(unpin->bo);
  566. }
  567. job->num_unpins = 0;
  568. if (job->gather_copy_size)
  569. dma_free_wc(job->channel->dev, job->gather_copy_size,
  570. job->gather_copy_mapped, job->gather_copy);
  571. }
  572. EXPORT_SYMBOL(host1x_job_unpin);
  573. /*
  574. * Debug routine used to dump job entries
  575. */
  576. void host1x_job_dump(struct device *dev, struct host1x_job *job)
  577. {
  578. dev_dbg(dev, " SYNCPT_ID %d\n", job->syncpt_id);
  579. dev_dbg(dev, " SYNCPT_VAL %d\n", job->syncpt_end);
  580. dev_dbg(dev, " FIRST_GET 0x%x\n", job->first_get);
  581. dev_dbg(dev, " TIMEOUT %d\n", job->timeout);
  582. dev_dbg(dev, " NUM_SLOTS %d\n", job->num_slots);
  583. dev_dbg(dev, " NUM_HANDLES %d\n", job->num_unpins);
  584. }