diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2014-12-09 03:04:05 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 18:06:45 -0400 |
commit | 5df3d09e16c9d2f413cea53d16bc8ca42ae42d6e (patch) | |
tree | 0ed55cf8bdf0d265742d396c160f8dd0f1ac9d85 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |
parent | 4ccb162da7a2414c344aecc9cdf85bee9c284caf (diff) |
gpu: nvgpu: gm20b: Enable CTA preemption
CTA preemption needs to be enabled by setting a value in context. Set
it for gm20b.
Bug 200063473
Bug 1517461
Change-Id: I080cd71b348d08f834fd23ebbe7443dba79224db
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/661299
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 4f6c885c..37cccba3 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -67,7 +67,8 @@ static void gr_gk20a_unmap_global_ctx_buffers(struct channel_gk20a *c); | |||
67 | 67 | ||
68 | /* channel gr ctx buffer */ | 68 | /* channel gr ctx buffer */ |
69 | static int gr_gk20a_alloc_channel_gr_ctx(struct gk20a *g, | 69 | static int gr_gk20a_alloc_channel_gr_ctx(struct gk20a *g, |
70 | struct channel_gk20a *c, u32 padding); | 70 | struct channel_gk20a *c, |
71 | u32 class, u32 padding); | ||
71 | static void gr_gk20a_free_channel_gr_ctx(struct channel_gk20a *c); | 72 | static void gr_gk20a_free_channel_gr_ctx(struct channel_gk20a *c); |
72 | 73 | ||
73 | /* channel patch ctx buffer */ | 74 | /* channel patch ctx buffer */ |
@@ -2486,6 +2487,7 @@ static void gr_gk20a_unmap_global_ctx_buffers(struct channel_gk20a *c) | |||
2486 | 2487 | ||
2487 | int gr_gk20a_alloc_gr_ctx(struct gk20a *g, | 2488 | int gr_gk20a_alloc_gr_ctx(struct gk20a *g, |
2488 | struct gr_ctx_desc **__gr_ctx, struct vm_gk20a *vm, | 2489 | struct gr_ctx_desc **__gr_ctx, struct vm_gk20a *vm, |
2490 | u32 class, | ||
2489 | u32 padding) | 2491 | u32 padding) |
2490 | { | 2492 | { |
2491 | struct gr_ctx_desc *gr_ctx = NULL; | 2493 | struct gr_ctx_desc *gr_ctx = NULL; |
@@ -2551,7 +2553,7 @@ int gr_gk20a_alloc_gr_ctx(struct gk20a *g, | |||
2551 | } | 2553 | } |
2552 | 2554 | ||
2553 | static int gr_gk20a_alloc_tsg_gr_ctx(struct gk20a *g, | 2555 | static int gr_gk20a_alloc_tsg_gr_ctx(struct gk20a *g, |
2554 | struct tsg_gk20a *tsg, u32 padding) | 2556 | struct tsg_gk20a *tsg, u32 class, u32 padding) |
2555 | { | 2557 | { |
2556 | struct gr_ctx_desc **gr_ctx = &tsg->tsg_gr_ctx; | 2558 | struct gr_ctx_desc **gr_ctx = &tsg->tsg_gr_ctx; |
2557 | int err; | 2559 | int err; |
@@ -2561,7 +2563,7 @@ static int gr_gk20a_alloc_tsg_gr_ctx(struct gk20a *g, | |||
2561 | return -ENOMEM; | 2563 | return -ENOMEM; |
2562 | } | 2564 | } |
2563 | 2565 | ||
2564 | err = g->ops.gr.alloc_gr_ctx(g, gr_ctx, tsg->vm, padding); | 2566 | err = g->ops.gr.alloc_gr_ctx(g, gr_ctx, tsg->vm, class, padding); |
2565 | if (err) | 2567 | if (err) |
2566 | return err; | 2568 | return err; |
2567 | 2569 | ||
@@ -2570,10 +2572,11 @@ static int gr_gk20a_alloc_tsg_gr_ctx(struct gk20a *g, | |||
2570 | 2572 | ||
2571 | static int gr_gk20a_alloc_channel_gr_ctx(struct gk20a *g, | 2573 | static int gr_gk20a_alloc_channel_gr_ctx(struct gk20a *g, |
2572 | struct channel_gk20a *c, | 2574 | struct channel_gk20a *c, |
2575 | u32 class, | ||
2573 | u32 padding) | 2576 | u32 padding) |
2574 | { | 2577 | { |
2575 | struct gr_ctx_desc **gr_ctx = &c->ch_ctx.gr_ctx; | 2578 | struct gr_ctx_desc **gr_ctx = &c->ch_ctx.gr_ctx; |
2576 | int err = g->ops.gr.alloc_gr_ctx(g, gr_ctx, c->vm, padding); | 2579 | int err = g->ops.gr.alloc_gr_ctx(g, gr_ctx, c->vm, class, padding); |
2577 | if (err) | 2580 | if (err) |
2578 | return err; | 2581 | return err; |
2579 | 2582 | ||
@@ -2767,6 +2770,7 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, | |||
2767 | if (!tsg) { | 2770 | if (!tsg) { |
2768 | if (!ch_ctx->gr_ctx) { | 2771 | if (!ch_ctx->gr_ctx) { |
2769 | err = gr_gk20a_alloc_channel_gr_ctx(g, c, | 2772 | err = gr_gk20a_alloc_channel_gr_ctx(g, c, |
2773 | args->class_num, | ||
2770 | args->padding); | 2774 | args->padding); |
2771 | if (err) { | 2775 | if (err) { |
2772 | gk20a_err(dev_from_gk20a(g), | 2776 | gk20a_err(dev_from_gk20a(g), |
@@ -2786,7 +2790,9 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, | |||
2786 | if (!tsg->tsg_gr_ctx) { | 2790 | if (!tsg->tsg_gr_ctx) { |
2787 | tsg->vm = c->vm; | 2791 | tsg->vm = c->vm; |
2788 | gk20a_vm_get(tsg->vm); | 2792 | gk20a_vm_get(tsg->vm); |
2789 | err = gr_gk20a_alloc_tsg_gr_ctx(g, tsg, args->padding); | 2793 | err = gr_gk20a_alloc_tsg_gr_ctx(g, tsg, |
2794 | args->class_num, | ||
2795 | args->padding); | ||
2790 | if (err) { | 2796 | if (err) { |
2791 | gk20a_err(dev_from_gk20a(g), | 2797 | gk20a_err(dev_from_gk20a(g), |
2792 | "fail to allocate TSG gr ctx buffer"); | 2798 | "fail to allocate TSG gr ctx buffer"); |