diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-04-06 08:56:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-10 14:23:03 -0400 |
commit | 4314771142e0b68810b8fa86ec45b6f6b4e24651 (patch) | |
tree | 32c1916385ecdb63073400e07e85266df5f8d412 /drivers/gpu/nvgpu/gk20a | |
parent | e1200259ba3ad4ae416990b2f2abccb94565430f (diff) |
gpu: nvgpu: add broadcast address decode support for volta
With Volta we have more number of broadcast registers than previous chips
and we don't decode them right now in gr_gk20a_decode_priv_addr()
Add a new GR HAL decode_priv_addr() and set gr_gk20a_decode_priv_addr() for all
previous chips
Add and use gr_gv11b_decode_priv_addr() for Volta
gr_gv11b_decode_priv_addr() will decode all the broadcast registers and set
the broadcast flags apporiately
Define below new broadcast types
PRI_BROADCAST_FLAGS_PMMGPC
PRI_BROADCAST_FLAGS_PMM_GPCS
PRI_BROADCAST_FLAGS_PMM_GPCGS_GPCTPCA
PRI_BROADCAST_FLAGS_PMM_GPCGS_GPCTPCB
PRI_BROADCAST_FLAGS_PMMFBP
PRI_BROADCAST_FLAGS_PMM_FBPS
PRI_BROADCAST_FLAGS_PMM_FBPGS_LTC
PRI_BROADCAST_FLAGS_PMM_FBPGS_ROP
Bug 200398811
Jira NVGPU-556
Change-Id: Ic673b357a75b6af3d24a4c16bb5b6bc15974d5b7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1690026
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h | 32 |
4 files changed, 33 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index efb425c2..164668cb 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -461,6 +461,11 @@ struct gpu_ops { | |||
461 | struct aiv_list_gk20a *regs, | 461 | struct aiv_list_gk20a *regs, |
462 | u32 *count, u32 *offset, | 462 | u32 *count, u32 *offset, |
463 | u32 max_cnt, u32 base, u32 mask); | 463 | u32 max_cnt, u32 base, u32 mask); |
464 | int (*decode_priv_addr)(struct gk20a *g, u32 addr, | ||
465 | int *addr_type, | ||
466 | u32 *gpc_num, u32 *tpc_num, | ||
467 | u32 *ppc_num, u32 *be_num, | ||
468 | u32 *broadcast_flags); | ||
464 | } gr; | 469 | } gr; |
465 | struct { | 470 | struct { |
466 | void (*init_hw)(struct gk20a *g); | 471 | void (*init_hw)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 65144cc5..3912a1df 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -6247,7 +6247,7 @@ static int gr_gk20a_find_priv_offset_in_pm_buffer(struct gk20a *g, | |||
6247 | u32 *priv_offset); | 6247 | u32 *priv_offset); |
6248 | 6248 | ||
6249 | /* This function will decode a priv address and return the partition type and numbers. */ | 6249 | /* This function will decode a priv address and return the partition type and numbers. */ |
6250 | static int gr_gk20a_decode_priv_addr(struct gk20a *g, u32 addr, | 6250 | int gr_gk20a_decode_priv_addr(struct gk20a *g, u32 addr, |
6251 | int *addr_type, /* enum ctxsw_addr_type */ | 6251 | int *addr_type, /* enum ctxsw_addr_type */ |
6252 | u32 *gpc_num, u32 *tpc_num, u32 *ppc_num, u32 *be_num, | 6252 | u32 *gpc_num, u32 *tpc_num, u32 *ppc_num, u32 *be_num, |
6253 | u32 *broadcast_flags) | 6253 | u32 *broadcast_flags) |
@@ -6365,7 +6365,7 @@ static int gr_gk20a_create_priv_addr_table(struct gk20a *g, | |||
6365 | 6365 | ||
6366 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "addr=0x%x", addr); | 6366 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "addr=0x%x", addr); |
6367 | 6367 | ||
6368 | err = gr_gk20a_decode_priv_addr(g, addr, &addr_type, | 6368 | err = g->ops.gr.decode_priv_addr(g, addr, &addr_type, |
6369 | &gpc_num, &tpc_num, &ppc_num, &be_num, | 6369 | &gpc_num, &tpc_num, &ppc_num, &be_num, |
6370 | &broadcast_flags); | 6370 | &broadcast_flags); |
6371 | gk20a_dbg(gpu_dbg_gpu_dbg, "addr_type = %d", addr_type); | 6371 | gk20a_dbg(gpu_dbg_gpu_dbg, "addr_type = %d", addr_type); |
@@ -7211,7 +7211,7 @@ static int gr_gk20a_find_priv_offset_in_buffer(struct gk20a *g, | |||
7211 | 7211 | ||
7212 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "addr=0x%x", addr); | 7212 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "addr=0x%x", addr); |
7213 | 7213 | ||
7214 | err = gr_gk20a_decode_priv_addr(g, addr, &addr_type, | 7214 | err = g->ops.gr.decode_priv_addr(g, addr, &addr_type, |
7215 | &gpc_num, &tpc_num, &ppc_num, &be_num, | 7215 | &gpc_num, &tpc_num, &ppc_num, &be_num, |
7216 | &broadcast_flags); | 7216 | &broadcast_flags); |
7217 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, | 7217 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index a80116b7..ee76148a 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -821,4 +821,8 @@ int gr_gk20a_add_ctxsw_reg_perf_pma(struct ctxsw_buf_offset_map_entry *map, | |||
821 | struct aiv_list_gk20a *regs, | 821 | struct aiv_list_gk20a *regs, |
822 | u32 *count, u32 *offset, | 822 | u32 *count, u32 *offset, |
823 | u32 max_cnt, u32 base, u32 mask); | 823 | u32 max_cnt, u32 base, u32 mask); |
824 | int gr_gk20a_decode_priv_addr(struct gk20a *g, u32 addr, | ||
825 | int *addr_type, | ||
826 | u32 *gpc_num, u32 *tpc_num, u32 *ppc_num, u32 *be_num, | ||
827 | u32 *broadcast_flags); | ||
824 | #endif /*__GR_GK20A_H__*/ | 828 | #endif /*__GR_GK20A_H__*/ |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h index d0b6df47..af390833 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_pri_gk20a.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GK20A Graphics Context Pri Register Addressing | 2 | * GK20A Graphics Context Pri Register Addressing |
3 | * | 3 | * |
4 | * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -245,17 +245,27 @@ enum ctxsw_addr_type { | |||
245 | CTXSW_ADDR_TYPE_FBPA = 6, | 245 | CTXSW_ADDR_TYPE_FBPA = 6, |
246 | CTXSW_ADDR_TYPE_EGPC = 7, | 246 | CTXSW_ADDR_TYPE_EGPC = 7, |
247 | CTXSW_ADDR_TYPE_ETPC = 8, | 247 | CTXSW_ADDR_TYPE_ETPC = 8, |
248 | CTXSW_ADDR_TYPE_ROP = 9, | ||
249 | CTXSW_ADDR_TYPE_FBP = 10, | ||
248 | }; | 250 | }; |
249 | 251 | ||
250 | #define PRI_BROADCAST_FLAGS_NONE 0 | 252 | #define PRI_BROADCAST_FLAGS_NONE 0 |
251 | #define PRI_BROADCAST_FLAGS_GPC BIT(0) | 253 | #define PRI_BROADCAST_FLAGS_GPC BIT(0) |
252 | #define PRI_BROADCAST_FLAGS_TPC BIT(1) | 254 | #define PRI_BROADCAST_FLAGS_TPC BIT(1) |
253 | #define PRI_BROADCAST_FLAGS_BE BIT(2) | 255 | #define PRI_BROADCAST_FLAGS_BE BIT(2) |
254 | #define PRI_BROADCAST_FLAGS_PPC BIT(3) | 256 | #define PRI_BROADCAST_FLAGS_PPC BIT(3) |
255 | #define PRI_BROADCAST_FLAGS_LTCS BIT(4) | 257 | #define PRI_BROADCAST_FLAGS_LTCS BIT(4) |
256 | #define PRI_BROADCAST_FLAGS_LTSS BIT(5) | 258 | #define PRI_BROADCAST_FLAGS_LTSS BIT(5) |
257 | #define PRI_BROADCAST_FLAGS_FBPA BIT(6) | 259 | #define PRI_BROADCAST_FLAGS_FBPA BIT(6) |
258 | #define PRI_BROADCAST_FLAGS_EGPC BIT(7) | 260 | #define PRI_BROADCAST_FLAGS_EGPC BIT(7) |
259 | #define PRI_BROADCAST_FLAGS_ETPC BIT(8) | 261 | #define PRI_BROADCAST_FLAGS_ETPC BIT(8) |
262 | #define PRI_BROADCAST_FLAGS_PMMGPC BIT(9) | ||
263 | #define PRI_BROADCAST_FLAGS_PMM_GPCS BIT(10) | ||
264 | #define PRI_BROADCAST_FLAGS_PMM_GPCGS_GPCTPCA BIT(11) | ||
265 | #define PRI_BROADCAST_FLAGS_PMM_GPCGS_GPCTPCB BIT(12) | ||
266 | #define PRI_BROADCAST_FLAGS_PMMFBP BIT(13) | ||
267 | #define PRI_BROADCAST_FLAGS_PMM_FBPS BIT(14) | ||
268 | #define PRI_BROADCAST_FLAGS_PMM_FBPGS_LTC BIT(15) | ||
269 | #define PRI_BROADCAST_FLAGS_PMM_FBPGS_ROP BIT(16) | ||
260 | 270 | ||
261 | #endif /* GR_PRI_GK20A_H */ | 271 | #endif /* GR_PRI_GK20A_H */ |