diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/channel.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/channel.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c index ad127606..db85f66a 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.c +++ b/drivers/gpu/nvgpu/common/linux/channel.c | |||
@@ -328,12 +328,12 @@ void nvgpu_remove_channel_support_linux(struct nvgpu_os_linux *l) | |||
328 | 328 | ||
329 | u32 nvgpu_get_gpfifo_entry_size(void) | 329 | u32 nvgpu_get_gpfifo_entry_size(void) |
330 | { | 330 | { |
331 | return sizeof(struct nvgpu_gpfifo); | 331 | return sizeof(struct nvgpu_gpfifo_entry); |
332 | } | 332 | } |
333 | 333 | ||
334 | #ifdef CONFIG_DEBUG_FS | 334 | #ifdef CONFIG_DEBUG_FS |
335 | static void trace_write_pushbuffer(struct channel_gk20a *c, | 335 | static void trace_write_pushbuffer(struct channel_gk20a *c, |
336 | struct nvgpu_gpfifo *g) | 336 | struct nvgpu_gpfifo_entry *g) |
337 | { | 337 | { |
338 | void *mem = NULL; | 338 | void *mem = NULL; |
339 | unsigned int words; | 339 | unsigned int words; |
@@ -371,15 +371,15 @@ static void trace_write_pushbuffer(struct channel_gk20a *c, | |||
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | static void trace_write_pushbuffer_range(struct channel_gk20a *c, | 373 | static void trace_write_pushbuffer_range(struct channel_gk20a *c, |
374 | struct nvgpu_gpfifo *g, | 374 | struct nvgpu_gpfifo_entry *g, |
375 | struct nvgpu_gpfifo __user *user_gpfifo, | 375 | struct nvgpu_gpfifo_entry __user *user_gpfifo, |
376 | int offset, | 376 | int offset, |
377 | int count) | 377 | int count) |
378 | { | 378 | { |
379 | #ifdef CONFIG_DEBUG_FS | 379 | #ifdef CONFIG_DEBUG_FS |
380 | u32 size; | 380 | u32 size; |
381 | int i; | 381 | int i; |
382 | struct nvgpu_gpfifo *gp; | 382 | struct nvgpu_gpfifo_entry *gp; |
383 | bool gpfifo_allocated = false; | 383 | bool gpfifo_allocated = false; |
384 | 384 | ||
385 | if (!gk20a_debug_trace_cmdbuf) | 385 | if (!gk20a_debug_trace_cmdbuf) |
@@ -389,7 +389,7 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c, | |||
389 | return; | 389 | return; |
390 | 390 | ||
391 | if (!g) { | 391 | if (!g) { |
392 | size = count * sizeof(struct nvgpu_gpfifo); | 392 | size = count * sizeof(struct nvgpu_gpfifo_entry); |
393 | if (size) { | 393 | if (size) { |
394 | g = nvgpu_big_malloc(c->g, size); | 394 | g = nvgpu_big_malloc(c->g, size); |
395 | if (!g) | 395 | if (!g) |
@@ -553,7 +553,7 @@ static void gk20a_submit_append_priv_cmdbuf(struct channel_gk20a *c, | |||
553 | { | 553 | { |
554 | struct gk20a *g = c->g; | 554 | struct gk20a *g = c->g; |
555 | struct nvgpu_mem *gpfifo_mem = &c->gpfifo.mem; | 555 | struct nvgpu_mem *gpfifo_mem = &c->gpfifo.mem; |
556 | struct nvgpu_gpfifo x = { | 556 | struct nvgpu_gpfifo_entry x = { |
557 | .entry0 = u64_lo32(cmd->gva), | 557 | .entry0 = u64_lo32(cmd->gva), |
558 | .entry1 = u64_hi32(cmd->gva) | | 558 | .entry1 = u64_hi32(cmd->gva) | |
559 | pbdma_gp_entry1_length_f(cmd->size) | 559 | pbdma_gp_entry1_length_f(cmd->size) |
@@ -574,17 +574,18 @@ static void gk20a_submit_append_priv_cmdbuf(struct channel_gk20a *c, | |||
574 | * splitting into two memcpys to handle wrap-around. | 574 | * splitting into two memcpys to handle wrap-around. |
575 | */ | 575 | */ |
576 | static int gk20a_submit_append_gpfifo(struct channel_gk20a *c, | 576 | static int gk20a_submit_append_gpfifo(struct channel_gk20a *c, |
577 | struct nvgpu_gpfifo *kern_gpfifo, | 577 | struct nvgpu_gpfifo_entry *kern_gpfifo, |
578 | struct nvgpu_gpfifo __user *user_gpfifo, | 578 | struct nvgpu_gpfifo_entry __user *user_gpfifo, |
579 | u32 num_entries) | 579 | u32 num_entries) |
580 | { | 580 | { |
581 | /* byte offsets */ | 581 | /* byte offsets */ |
582 | u32 gpfifo_size = c->gpfifo.entry_num * sizeof(struct nvgpu_gpfifo); | 582 | u32 gpfifo_size = |
583 | u32 len = num_entries * sizeof(struct nvgpu_gpfifo); | 583 | c->gpfifo.entry_num * sizeof(struct nvgpu_gpfifo_entry); |
584 | u32 start = c->gpfifo.put * sizeof(struct nvgpu_gpfifo); | 584 | u32 len = num_entries * sizeof(struct nvgpu_gpfifo_entry); |
585 | u32 start = c->gpfifo.put * sizeof(struct nvgpu_gpfifo_entry); | ||
585 | u32 end = start + len; /* exclusive */ | 586 | u32 end = start + len; /* exclusive */ |
586 | struct nvgpu_mem *gpfifo_mem = &c->gpfifo.mem; | 587 | struct nvgpu_mem *gpfifo_mem = &c->gpfifo.mem; |
587 | struct nvgpu_gpfifo *cpu_src; | 588 | struct nvgpu_gpfifo_entry *cpu_src; |
588 | int err; | 589 | int err; |
589 | 590 | ||
590 | if (user_gpfifo && !c->gpfifo.pipe) { | 591 | if (user_gpfifo && !c->gpfifo.pipe) { |
@@ -659,7 +660,7 @@ out: | |||
659 | } | 660 | } |
660 | 661 | ||
661 | int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | 662 | int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, |
662 | struct nvgpu_gpfifo *gpfifo, | 663 | struct nvgpu_gpfifo_entry *gpfifo, |
663 | struct nvgpu_submit_gpfifo_args *args, | 664 | struct nvgpu_submit_gpfifo_args *args, |
664 | u32 num_entries, | 665 | u32 num_entries, |
665 | u32 flags, | 666 | u32 flags, |
@@ -681,8 +682,8 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
681 | int err = 0; | 682 | int err = 0; |
682 | bool need_job_tracking; | 683 | bool need_job_tracking; |
683 | bool need_deferred_cleanup = false; | 684 | bool need_deferred_cleanup = false; |
684 | struct nvgpu_gpfifo __user *user_gpfifo = args ? | 685 | struct nvgpu_gpfifo_entry __user *user_gpfifo = args ? |
685 | (struct nvgpu_gpfifo __user *)(uintptr_t)args->gpfifo : NULL; | 686 | (struct nvgpu_gpfifo_entry __user *)(uintptr_t)args->gpfifo : NULL; |
686 | 687 | ||
687 | if (nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) | 688 | if (nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) |
688 | return -ENODEV; | 689 | return -ENODEV; |