diff options
author | sujeet baranwal <sbaranwal@nvidia.com> | 2015-09-22 11:56:13 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-09-24 10:53:43 -0400 |
commit | 6ceef08d52daabdf4911f28086e082b1dd2559f1 (patch) | |
tree | abe98d12cf6d0b94a8f5af8d4d267d8eea7c7cc4 /drivers/gpu | |
parent | 977acd877b68b51eb2f48a999077939378968c66 (diff) |
gpu: nvgpu: Add CDE bits in FECS header
In case of CDE channel, T1 (Tex) unit needs to be promoted to 128B
aligned, otherwise causes a HW deadlock. Gpu driver makes changes in
FECS header which FECS uses to configure the T1 promotions to aligned
128B accesses.
Bug 200096226
Change-Id: Ic006b2c7035bbeabe1081aeed968a6c6d11f9995
Signed-off-by: sujeet baranwal <sbaranwal@nvidia.com>
Reviewed-on: http://git-master/r/802327
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hw_ctxsw_prog_gm20b.h | 12 |
4 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 84b39b2d..f148c65a 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -487,6 +487,9 @@ static int gk20a_init_cde_required_class(struct gk20a_cde_ctx *cde_ctx, | |||
487 | alloc_obj_ctx.class_num = required_class; | 487 | alloc_obj_ctx.class_num = required_class; |
488 | alloc_obj_ctx.flags = 0; | 488 | alloc_obj_ctx.flags = 0; |
489 | 489 | ||
490 | /* CDE enabled */ | ||
491 | cde_ctx->ch->cde = true; | ||
492 | |||
490 | err = gk20a_alloc_obj_ctx(cde_ctx->ch, &alloc_obj_ctx); | 493 | err = gk20a_alloc_obj_ctx(cde_ctx->ch, &alloc_obj_ctx); |
491 | if (err) { | 494 | if (err) { |
492 | gk20a_warn(&cde_ctx->pdev->dev, "cde: failed to allocate ctx. err=%d", | 495 | gk20a_warn(&cde_ctx->pdev->dev, "cde: failed to allocate ctx. err=%d", |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 2ea5b4be..219a7786 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -91,6 +91,7 @@ struct channel_gk20a { | |||
91 | bool bound; | 91 | bool bound; |
92 | bool first_init; | 92 | bool first_init; |
93 | bool vpr; | 93 | bool vpr; |
94 | bool cde; | ||
94 | pid_t pid; | 95 | pid_t pid; |
95 | struct mutex ioctl_lock; | 96 | struct mutex ioctl_lock; |
96 | 97 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 0ae44c6f..24ee8876 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -1612,7 +1612,7 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g, | |||
1612 | struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx; | 1612 | struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx; |
1613 | u32 virt_addr_lo; | 1613 | u32 virt_addr_lo; |
1614 | u32 virt_addr_hi; | 1614 | u32 virt_addr_hi; |
1615 | u32 i, v, data; | 1615 | u32 i, v, data, cde_v; |
1616 | int ret = 0; | 1616 | int ret = 0; |
1617 | void *ctx_ptr = NULL; | 1617 | void *ctx_ptr = NULL; |
1618 | 1618 | ||
@@ -1631,6 +1631,15 @@ int gr_gk20a_load_golden_ctx_image(struct gk20a *g, | |||
1631 | if (!ctx_ptr) | 1631 | if (!ctx_ptr) |
1632 | return -ENOMEM; | 1632 | return -ENOMEM; |
1633 | 1633 | ||
1634 | /* Enable CDE in FECS header. Default cde = 0, is disabled, | ||
1635 | * so no need to do anything in else {} | ||
1636 | */ | ||
1637 | if (c->cde) { | ||
1638 | cde_v = gk20a_mem_rd32(ctx_ptr + ctxsw_prog_main_image_ctl_o(), 0); | ||
1639 | cde_v |= ctxsw_prog_main_image_ctl_cde_enabled_f(); | ||
1640 | gk20a_mem_wr32(ctx_ptr + ctxsw_prog_main_image_ctl_o(), 0, cde_v); | ||
1641 | } | ||
1642 | |||
1634 | for (i = 0; i < gr->ctx_vars.golden_image_size / 4; i++) | 1643 | for (i = 0; i < gr->ctx_vars.golden_image_size / 4; i++) |
1635 | gk20a_mem_wr32(ctx_ptr, i, gr->ctx_vars.local_golden_image[i]); | 1644 | gk20a_mem_wr32(ctx_ptr, i, gr->ctx_vars.local_golden_image[i]); |
1636 | 1645 | ||
diff --git a/drivers/gpu/nvgpu/gm20b/hw_ctxsw_prog_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_ctxsw_prog_gm20b.h index cefd91e1..34f8a6a4 100644 --- a/drivers/gpu/nvgpu/gm20b/hw_ctxsw_prog_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/hw_ctxsw_prog_gm20b.h | |||
@@ -58,6 +58,18 @@ static inline u32 ctxsw_prog_main_image_num_gpcs_o(void) | |||
58 | { | 58 | { |
59 | return 0x00000008; | 59 | return 0x00000008; |
60 | } | 60 | } |
61 | static inline u32 ctxsw_prog_main_image_ctl_o(void) | ||
62 | { | ||
63 | return 0x0000000c; | ||
64 | } | ||
65 | static inline u32 ctxsw_prog_main_image_ctl_cde_enabled_f(void) | ||
66 | { | ||
67 | return 0x400; | ||
68 | } | ||
69 | static inline u32 ctxsw_prog_main_image_ctl_cde_disabled_f(void) | ||
70 | { | ||
71 | return 0x0; | ||
72 | } | ||
61 | static inline u32 ctxsw_prog_main_image_patch_count_o(void) | 73 | static inline u32 ctxsw_prog_main_image_patch_count_o(void) |
62 | { | 74 | { |
63 | return 0x00000010; | 75 | return 0x00000010; |