nouveau_chan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. /*
  2. * Copyright 2012 Red Hat Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: Ben Skeggs
  23. */
  24. #include <nvif/push006c.h>
  25. #include <nvif/class.h>
  26. #include <nvif/cl0002.h>
  27. #include <nvif/cl006b.h>
  28. #include <nvif/cl506f.h>
  29. #include <nvif/cl906f.h>
  30. #include <nvif/cla06f.h>
  31. #include <nvif/clc36f.h>
  32. #include <nvif/ioctl.h>
  33. #include "nouveau_drv.h"
  34. #include "nouveau_dma.h"
  35. #include "nouveau_bo.h"
  36. #include "nouveau_chan.h"
  37. #include "nouveau_fence.h"
  38. #include "nouveau_abi16.h"
  39. #include "nouveau_vmm.h"
  40. #include "nouveau_svm.h"
  41. MODULE_PARM_DESC(vram_pushbuf, "Create DMA push buffers in VRAM");
  42. int nouveau_vram_pushbuf;
  43. module_param_named(vram_pushbuf, nouveau_vram_pushbuf, int, 0400);
  44. static int
  45. nouveau_channel_killed(struct nvif_notify *ntfy)
  46. {
  47. struct nouveau_channel *chan = container_of(ntfy, typeof(*chan), kill);
  48. struct nouveau_cli *cli = (void *)chan->user.client;
  49. NV_PRINTK(warn, cli, "channel %d killed!\n", chan->chid);
  50. atomic_set(&chan->killed, 1);
  51. if (chan->fence)
  52. nouveau_fence_context_kill(chan->fence, -ENODEV);
  53. return NVIF_NOTIFY_DROP;
  54. }
  55. int
  56. nouveau_channel_idle(struct nouveau_channel *chan)
  57. {
  58. if (likely(chan && chan->fence && !atomic_read(&chan->killed))) {
  59. struct nouveau_cli *cli = (void *)chan->user.client;
  60. struct nouveau_fence *fence = NULL;
  61. int ret;
  62. ret = nouveau_fence_new(chan, false, &fence);
  63. if (!ret) {
  64. ret = nouveau_fence_wait(fence, false, false);
  65. nouveau_fence_unref(&fence);
  66. }
  67. if (ret) {
  68. NV_PRINTK(err, cli, "failed to idle channel %d [%s]\n",
  69. chan->chid, nvxx_client(&cli->base)->name);
  70. return ret;
  71. }
  72. }
  73. return 0;
  74. }
  75. void
  76. nouveau_channel_del(struct nouveau_channel **pchan)
  77. {
  78. struct nouveau_channel *chan = *pchan;
  79. if (chan) {
  80. struct nouveau_cli *cli = (void *)chan->user.client;
  81. if (chan->fence)
  82. nouveau_fence(chan->drm)->context_del(chan);
  83. if (cli)
  84. nouveau_svmm_part(chan->vmm->svmm, chan->inst);
  85. nvif_object_dtor(&chan->nvsw);
  86. nvif_object_dtor(&chan->gart);
  87. nvif_object_dtor(&chan->vram);
  88. nvif_notify_dtor(&chan->kill);
  89. nvif_object_dtor(&chan->user);
  90. nvif_object_dtor(&chan->push.ctxdma);
  91. nouveau_vma_del(&chan->push.vma);
  92. nouveau_bo_unmap(chan->push.buffer);
  93. if (chan->push.buffer && chan->push.buffer->bo.pin_count)
  94. nouveau_bo_unpin(chan->push.buffer);
  95. nouveau_bo_ref(NULL, &chan->push.buffer);
  96. kfree(chan);
  97. }
  98. *pchan = NULL;
  99. }
  100. static void
  101. nouveau_channel_kick(struct nvif_push *push)
  102. {
  103. struct nouveau_channel *chan = container_of(push, typeof(*chan), chan._push);
  104. chan->dma.cur = chan->dma.cur + (chan->chan._push.cur - chan->chan._push.bgn);
  105. FIRE_RING(chan);
  106. chan->chan._push.bgn = chan->chan._push.cur;
  107. }
  108. static int
  109. nouveau_channel_wait(struct nvif_push *push, u32 size)
  110. {
  111. struct nouveau_channel *chan = container_of(push, typeof(*chan), chan._push);
  112. int ret;
  113. chan->dma.cur = chan->dma.cur + (chan->chan._push.cur - chan->chan._push.bgn);
  114. ret = RING_SPACE(chan, size);
  115. if (ret == 0) {
  116. chan->chan._push.bgn = chan->chan._push.mem.object.map.ptr;
  117. chan->chan._push.bgn = chan->chan._push.bgn + chan->dma.cur;
  118. chan->chan._push.cur = chan->chan._push.bgn;
  119. chan->chan._push.end = chan->chan._push.bgn + size;
  120. }
  121. return ret;
  122. }
  123. static int
  124. nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device,
  125. u32 size, struct nouveau_channel **pchan)
  126. {
  127. struct nouveau_cli *cli = (void *)device->object.client;
  128. struct nv_dma_v0 args = {};
  129. struct nouveau_channel *chan;
  130. u32 target;
  131. int ret;
  132. chan = *pchan = kzalloc(sizeof(*chan), GFP_KERNEL);
  133. if (!chan)
  134. return -ENOMEM;
  135. chan->device = device;
  136. chan->drm = drm;
  137. chan->vmm = cli->svm.cli ? &cli->svm : &cli->vmm;
  138. atomic_set(&chan->killed, 0);
  139. /* allocate memory for dma push buffer */
  140. target = NOUVEAU_GEM_DOMAIN_GART | NOUVEAU_GEM_DOMAIN_COHERENT;
  141. if (nouveau_vram_pushbuf)
  142. target = NOUVEAU_GEM_DOMAIN_VRAM;
  143. ret = nouveau_bo_new(cli, size, 0, target, 0, 0, NULL, NULL,
  144. &chan->push.buffer);
  145. if (ret == 0) {
  146. ret = nouveau_bo_pin(chan->push.buffer, target, false);
  147. if (ret == 0)
  148. ret = nouveau_bo_map(chan->push.buffer);
  149. }
  150. if (ret) {
  151. nouveau_channel_del(pchan);
  152. return ret;
  153. }
  154. chan->chan._push.mem.object.parent = cli->base.object.parent;
  155. chan->chan._push.mem.object.client = &cli->base;
  156. chan->chan._push.mem.object.name = "chanPush";
  157. chan->chan._push.mem.object.map.ptr = chan->push.buffer->kmap.virtual;
  158. chan->chan._push.wait = nouveau_channel_wait;
  159. chan->chan._push.kick = nouveau_channel_kick;
  160. chan->chan.push = &chan->chan._push;
  161. /* create dma object covering the *entire* memory space that the
  162. * pushbuf lives in, this is because the GEM code requires that
  163. * we be able to call out to other (indirect) push buffers
  164. */
  165. chan->push.addr = chan->push.buffer->offset;
  166. if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
  167. ret = nouveau_vma_new(chan->push.buffer, chan->vmm,
  168. &chan->push.vma);
  169. if (ret) {
  170. nouveau_channel_del(pchan);
  171. return ret;
  172. }
  173. chan->push.addr = chan->push.vma->addr;
  174. if (device->info.family >= NV_DEVICE_INFO_V0_FERMI)
  175. return 0;
  176. args.target = NV_DMA_V0_TARGET_VM;
  177. args.access = NV_DMA_V0_ACCESS_VM;
  178. args.start = 0;
  179. args.limit = chan->vmm->vmm.limit - 1;
  180. } else
  181. if (chan->push.buffer->bo.resource->mem_type == TTM_PL_VRAM) {
  182. if (device->info.family == NV_DEVICE_INFO_V0_TNT) {
  183. /* nv04 vram pushbuf hack, retarget to its location in
  184. * the framebuffer bar rather than direct vram access..
  185. * nfi why this exists, it came from the -nv ddx.
  186. */
  187. args.target = NV_DMA_V0_TARGET_PCI;
  188. args.access = NV_DMA_V0_ACCESS_RDWR;
  189. args.start = nvxx_device(device)->func->
  190. resource_addr(nvxx_device(device), 1);
  191. args.limit = args.start + device->info.ram_user - 1;
  192. } else {
  193. args.target = NV_DMA_V0_TARGET_VRAM;
  194. args.access = NV_DMA_V0_ACCESS_RDWR;
  195. args.start = 0;
  196. args.limit = device->info.ram_user - 1;
  197. }
  198. } else {
  199. if (chan->drm->agp.bridge) {
  200. args.target = NV_DMA_V0_TARGET_AGP;
  201. args.access = NV_DMA_V0_ACCESS_RDWR;
  202. args.start = chan->drm->agp.base;
  203. args.limit = chan->drm->agp.base +
  204. chan->drm->agp.size - 1;
  205. } else {
  206. args.target = NV_DMA_V0_TARGET_VM;
  207. args.access = NV_DMA_V0_ACCESS_RDWR;
  208. args.start = 0;
  209. args.limit = chan->vmm->vmm.limit - 1;
  210. }
  211. }
  212. ret = nvif_object_ctor(&device->object, "abi16PushCtxDma", 0,
  213. NV_DMA_FROM_MEMORY, &args, sizeof(args),
  214. &chan->push.ctxdma);
  215. if (ret) {
  216. nouveau_channel_del(pchan);
  217. return ret;
  218. }
  219. return 0;
  220. }
  221. static int
  222. nouveau_channel_ind(struct nouveau_drm *drm, struct nvif_device *device,
  223. u64 runlist, bool priv, struct nouveau_channel **pchan)
  224. {
  225. static const u16 oclasses[] = { AMPERE_CHANNEL_GPFIFO_B,
  226. TURING_CHANNEL_GPFIFO_A,
  227. VOLTA_CHANNEL_GPFIFO_A,
  228. PASCAL_CHANNEL_GPFIFO_A,
  229. MAXWELL_CHANNEL_GPFIFO_A,
  230. KEPLER_CHANNEL_GPFIFO_B,
  231. KEPLER_CHANNEL_GPFIFO_A,
  232. FERMI_CHANNEL_GPFIFO,
  233. G82_CHANNEL_GPFIFO,
  234. NV50_CHANNEL_GPFIFO,
  235. 0 };
  236. const u16 *oclass = oclasses;
  237. union {
  238. struct nv50_channel_gpfifo_v0 nv50;
  239. struct fermi_channel_gpfifo_v0 fermi;
  240. struct kepler_channel_gpfifo_a_v0 kepler;
  241. struct volta_channel_gpfifo_a_v0 volta;
  242. } args;
  243. struct nouveau_channel *chan;
  244. u32 size;
  245. int ret;
  246. /* allocate dma push buffer */
  247. ret = nouveau_channel_prep(drm, device, 0x12000, &chan);
  248. *pchan = chan;
  249. if (ret)
  250. return ret;
  251. /* create channel object */
  252. do {
  253. if (oclass[0] >= VOLTA_CHANNEL_GPFIFO_A) {
  254. args.volta.version = 0;
  255. args.volta.ilength = 0x02000;
  256. args.volta.ioffset = 0x10000 + chan->push.addr;
  257. args.volta.runlist = runlist;
  258. args.volta.vmm = nvif_handle(&chan->vmm->vmm.object);
  259. args.volta.priv = priv;
  260. size = sizeof(args.volta);
  261. } else
  262. if (oclass[0] >= KEPLER_CHANNEL_GPFIFO_A) {
  263. args.kepler.version = 0;
  264. args.kepler.ilength = 0x02000;
  265. args.kepler.ioffset = 0x10000 + chan->push.addr;
  266. args.kepler.runlist = runlist;
  267. args.kepler.vmm = nvif_handle(&chan->vmm->vmm.object);
  268. args.kepler.priv = priv;
  269. size = sizeof(args.kepler);
  270. } else
  271. if (oclass[0] >= FERMI_CHANNEL_GPFIFO) {
  272. args.fermi.version = 0;
  273. args.fermi.ilength = 0x02000;
  274. args.fermi.ioffset = 0x10000 + chan->push.addr;
  275. args.fermi.vmm = nvif_handle(&chan->vmm->vmm.object);
  276. size = sizeof(args.fermi);
  277. } else {
  278. args.nv50.version = 0;
  279. args.nv50.ilength = 0x02000;
  280. args.nv50.ioffset = 0x10000 + chan->push.addr;
  281. args.nv50.pushbuf = nvif_handle(&chan->push.ctxdma);
  282. args.nv50.vmm = nvif_handle(&chan->vmm->vmm.object);
  283. size = sizeof(args.nv50);
  284. }
  285. ret = nvif_object_ctor(&device->object, "abi16ChanUser", 0,
  286. *oclass++, &args, size, &chan->user);
  287. if (ret == 0) {
  288. if (chan->user.oclass >= VOLTA_CHANNEL_GPFIFO_A) {
  289. chan->chid = args.volta.chid;
  290. chan->inst = args.volta.inst;
  291. chan->token = args.volta.token;
  292. } else
  293. if (chan->user.oclass >= KEPLER_CHANNEL_GPFIFO_A) {
  294. chan->chid = args.kepler.chid;
  295. chan->inst = args.kepler.inst;
  296. } else
  297. if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) {
  298. chan->chid = args.fermi.chid;
  299. } else {
  300. chan->chid = args.nv50.chid;
  301. }
  302. return ret;
  303. }
  304. } while (*oclass);
  305. nouveau_channel_del(pchan);
  306. return ret;
  307. }
  308. static int
  309. nouveau_channel_dma(struct nouveau_drm *drm, struct nvif_device *device,
  310. struct nouveau_channel **pchan)
  311. {
  312. static const u16 oclasses[] = { NV40_CHANNEL_DMA,
  313. NV17_CHANNEL_DMA,
  314. NV10_CHANNEL_DMA,
  315. NV03_CHANNEL_DMA,
  316. 0 };
  317. const u16 *oclass = oclasses;
  318. struct nv03_channel_dma_v0 args;
  319. struct nouveau_channel *chan;
  320. int ret;
  321. /* allocate dma push buffer */
  322. ret = nouveau_channel_prep(drm, device, 0x10000, &chan);
  323. *pchan = chan;
  324. if (ret)
  325. return ret;
  326. /* create channel object */
  327. args.version = 0;
  328. args.pushbuf = nvif_handle(&chan->push.ctxdma);
  329. args.offset = chan->push.addr;
  330. do {
  331. ret = nvif_object_ctor(&device->object, "abi16ChanUser", 0,
  332. *oclass++, &args, sizeof(args),
  333. &chan->user);
  334. if (ret == 0) {
  335. chan->chid = args.chid;
  336. return ret;
  337. }
  338. } while (ret && *oclass);
  339. nouveau_channel_del(pchan);
  340. return ret;
  341. }
  342. static int
  343. nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
  344. {
  345. struct nvif_device *device = chan->device;
  346. struct nouveau_drm *drm = chan->drm;
  347. struct nv_dma_v0 args = {};
  348. int ret, i;
  349. ret = nvif_object_map(&chan->user, NULL, 0);
  350. if (ret)
  351. return ret;
  352. if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO &&
  353. chan->user.oclass < AMPERE_CHANNEL_GPFIFO_B) {
  354. ret = nvif_notify_ctor(&chan->user, "abi16ChanKilled",
  355. nouveau_channel_killed,
  356. true, NV906F_V0_NTFY_KILLED,
  357. NULL, 0, 0, &chan->kill);
  358. if (ret == 0)
  359. ret = nvif_notify_get(&chan->kill);
  360. if (ret) {
  361. NV_ERROR(drm, "Failed to request channel kill "
  362. "notification: %d\n", ret);
  363. return ret;
  364. }
  365. }
  366. /* allocate dma objects to cover all allowed vram, and gart */
  367. if (device->info.family < NV_DEVICE_INFO_V0_FERMI) {
  368. if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
  369. args.target = NV_DMA_V0_TARGET_VM;
  370. args.access = NV_DMA_V0_ACCESS_VM;
  371. args.start = 0;
  372. args.limit = chan->vmm->vmm.limit - 1;
  373. } else {
  374. args.target = NV_DMA_V0_TARGET_VRAM;
  375. args.access = NV_DMA_V0_ACCESS_RDWR;
  376. args.start = 0;
  377. args.limit = device->info.ram_user - 1;
  378. }
  379. ret = nvif_object_ctor(&chan->user, "abi16ChanVramCtxDma", vram,
  380. NV_DMA_IN_MEMORY, &args, sizeof(args),
  381. &chan->vram);
  382. if (ret)
  383. return ret;
  384. if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
  385. args.target = NV_DMA_V0_TARGET_VM;
  386. args.access = NV_DMA_V0_ACCESS_VM;
  387. args.start = 0;
  388. args.limit = chan->vmm->vmm.limit - 1;
  389. } else
  390. if (chan->drm->agp.bridge) {
  391. args.target = NV_DMA_V0_TARGET_AGP;
  392. args.access = NV_DMA_V0_ACCESS_RDWR;
  393. args.start = chan->drm->agp.base;
  394. args.limit = chan->drm->agp.base +
  395. chan->drm->agp.size - 1;
  396. } else {
  397. args.target = NV_DMA_V0_TARGET_VM;
  398. args.access = NV_DMA_V0_ACCESS_RDWR;
  399. args.start = 0;
  400. args.limit = chan->vmm->vmm.limit - 1;
  401. }
  402. ret = nvif_object_ctor(&chan->user, "abi16ChanGartCtxDma", gart,
  403. NV_DMA_IN_MEMORY, &args, sizeof(args),
  404. &chan->gart);
  405. if (ret)
  406. return ret;
  407. }
  408. /* initialise dma tracking parameters */
  409. switch (chan->user.oclass & 0x00ff) {
  410. case 0x006b:
  411. case 0x006e:
  412. chan->user_put = 0x40;
  413. chan->user_get = 0x44;
  414. chan->dma.max = (0x10000 / 4) - 2;
  415. break;
  416. default:
  417. chan->user_put = 0x40;
  418. chan->user_get = 0x44;
  419. chan->user_get_hi = 0x60;
  420. chan->dma.ib_base = 0x10000 / 4;
  421. chan->dma.ib_max = (0x02000 / 8) - 1;
  422. chan->dma.ib_put = 0;
  423. chan->dma.ib_free = chan->dma.ib_max - chan->dma.ib_put;
  424. chan->dma.max = chan->dma.ib_base;
  425. break;
  426. }
  427. chan->dma.put = 0;
  428. chan->dma.cur = chan->dma.put;
  429. chan->dma.free = chan->dma.max - chan->dma.cur;
  430. ret = PUSH_WAIT(chan->chan.push, NOUVEAU_DMA_SKIPS);
  431. if (ret)
  432. return ret;
  433. for (i = 0; i < NOUVEAU_DMA_SKIPS; i++)
  434. PUSH_DATA(chan->chan.push, 0x00000000);
  435. /* allocate software object class (used for fences on <= nv05) */
  436. if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) {
  437. ret = nvif_object_ctor(&chan->user, "abi16NvswFence", 0x006e,
  438. NVIF_CLASS_SW_NV04,
  439. NULL, 0, &chan->nvsw);
  440. if (ret)
  441. return ret;
  442. ret = PUSH_WAIT(chan->chan.push, 2);
  443. if (ret)
  444. return ret;
  445. PUSH_NVSQ(chan->chan.push, NV_SW, 0x0000, chan->nvsw.handle);
  446. PUSH_KICK(chan->chan.push);
  447. }
  448. /* initialise synchronisation */
  449. return nouveau_fence(chan->drm)->context_new(chan);
  450. }
  451. int
  452. nouveau_channel_new(struct nouveau_drm *drm, struct nvif_device *device,
  453. u32 arg0, u32 arg1, bool priv,
  454. struct nouveau_channel **pchan)
  455. {
  456. struct nouveau_cli *cli = (void *)device->object.client;
  457. int ret;
  458. /* hack until fencenv50 is fixed, and agp access relaxed */
  459. ret = nouveau_channel_ind(drm, device, arg0, priv, pchan);
  460. if (ret) {
  461. NV_PRINTK(dbg, cli, "ib channel create, %d\n", ret);
  462. ret = nouveau_channel_dma(drm, device, pchan);
  463. if (ret) {
  464. NV_PRINTK(dbg, cli, "dma channel create, %d\n", ret);
  465. return ret;
  466. }
  467. }
  468. ret = nouveau_channel_init(*pchan, arg0, arg1);
  469. if (ret) {
  470. NV_PRINTK(err, cli, "channel failed to initialise, %d\n", ret);
  471. nouveau_channel_del(pchan);
  472. return ret;
  473. }
  474. ret = nouveau_svmm_join((*pchan)->vmm->svmm, (*pchan)->inst);
  475. if (ret)
  476. nouveau_channel_del(pchan);
  477. return ret;
  478. }
  479. int
  480. nouveau_channels_init(struct nouveau_drm *drm)
  481. {
  482. struct {
  483. struct nv_device_info_v1 m;
  484. struct {
  485. struct nv_device_info_v1_data channels;
  486. } v;
  487. } args = {
  488. .m.version = 1,
  489. .m.count = sizeof(args.v) / sizeof(args.v.channels),
  490. .v.channels.mthd = NV_DEVICE_HOST_CHANNELS,
  491. };
  492. struct nvif_object *device = &drm->client.device.object;
  493. int ret;
  494. ret = nvif_object_mthd(device, NV_DEVICE_V0_INFO, &args, sizeof(args));
  495. if (ret || args.v.channels.mthd == NV_DEVICE_INFO_INVALID)
  496. return -ENODEV;
  497. drm->chan.nr = args.v.channels.data;
  498. drm->chan.context_base = dma_fence_context_alloc(drm->chan.nr);
  499. return 0;
  500. }