summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2018-01-09 17:33:51 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-10 11:47:07 -0500
commite9de95d7e0629c40b5ceb56c07de319bedd3339f (patch)
treed48300e7b5191f732eaa5105049c9e4bfc81f2e9 /drivers/gpu/nvgpu/gp10b
parent0ac3ba2a99b745f577c752ebf9a6b4291730a36d (diff)
gpu: nvgpu: use chip specific zbc_c/z format reg
Use chip specific gpcs_swdx_dss_zbc_c_format_reg and gpcs_swdx_dss_zbc_z_format_reg. These registers are different for gv11b/gv100 from gp10b/gp106. Change-Id: I9e209c878a11edc986ba4304ff60fcccbb5087aa Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1635091 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/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c22
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.h4
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c6
3 files changed, 26 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 9a7f4f97..68d18aa1 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -507,11 +507,18 @@ void gr_gp10b_commit_global_pagepool(struct gk20a *g,
507 gr_gpcs_gcc_pagepool_total_pages_f(size), patch); 507 gr_gpcs_gcc_pagepool_total_pages_f(size), patch);
508} 508}
509 509
510u32 gr_gp10b_get_gpcs_swdx_dss_zbc_c_format_reg(struct gk20a *g)
511{
512 return gr_gpcs_swdx_dss_zbc_c_01_to_04_format_r();
513}
514
510int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, 515int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr,
511 struct zbc_entry *color_val, u32 index) 516 struct zbc_entry *color_val, u32 index)
512{ 517{
513 u32 i; 518 u32 i;
514 u32 zbc_c; 519 u32 zbc_c;
520 u32 zbc_c_format_reg =
521 g->ops.gr.get_gpcs_swdx_dss_zbc_c_format_reg(g);
515 522
516 /* update l2 table */ 523 /* update l2 table */
517 g->ops.ltc.set_zbc_color_entry(g, color_val, index); 524 g->ops.ltc.set_zbc_color_entry(g, color_val, index);
@@ -554,18 +561,25 @@ int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr,
554 color_val->color_ds[2]); 561 color_val->color_ds[2]);
555 gk20a_writel_check(g, gr_gpcs_swdx_dss_zbc_color_a_r(index), 562 gk20a_writel_check(g, gr_gpcs_swdx_dss_zbc_color_a_r(index),
556 color_val->color_ds[3]); 563 color_val->color_ds[3]);
557 zbc_c = gk20a_readl(g, gr_gpcs_swdx_dss_zbc_c_01_to_04_format_r() + (index & ~3)); 564 zbc_c = gk20a_readl(g, zbc_c_format_reg + (index & ~3));
558 zbc_c &= ~(0x7f << ((index % 4) * 7)); 565 zbc_c &= ~(0x7f << ((index % 4) * 7));
559 zbc_c |= color_val->format << ((index % 4) * 7); 566 zbc_c |= color_val->format << ((index % 4) * 7);
560 gk20a_writel_check(g, gr_gpcs_swdx_dss_zbc_c_01_to_04_format_r() + (index & ~3), zbc_c); 567 gk20a_writel_check(g, zbc_c_format_reg + (index & ~3), zbc_c);
561 568
562 return 0; 569 return 0;
563} 570}
564 571
572u32 gr_gp10b_get_gpcs_swdx_dss_zbc_z_format_reg(struct gk20a *g)
573{
574 return gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r();
575}
576
565int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, 577int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr,
566 struct zbc_entry *depth_val, u32 index) 578 struct zbc_entry *depth_val, u32 index)
567{ 579{
568 u32 zbc_z; 580 u32 zbc_z;
581 u32 zbc_z_format_reg =
582 g->ops.gr.get_gpcs_swdx_dss_zbc_z_format_reg(g);
569 583
570 /* update l2 table */ 584 /* update l2 table */
571 g->ops.ltc.set_zbc_depth_entry(g, depth_val, index); 585 g->ops.ltc.set_zbc_depth_entry(g, depth_val, index);
@@ -592,10 +606,10 @@ int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr,
592 gr->zbc_dep_tbl[index].ref_cnt++; 606 gr->zbc_dep_tbl[index].ref_cnt++;
593 607
594 gk20a_writel(g, gr_gpcs_swdx_dss_zbc_z_r(index), depth_val->depth); 608 gk20a_writel(g, gr_gpcs_swdx_dss_zbc_z_r(index), depth_val->depth);
595 zbc_z = gk20a_readl(g, gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r() + (index & ~3)); 609 zbc_z = gk20a_readl(g, zbc_z_format_reg + (index & ~3));
596 zbc_z &= ~(0x7f << (index % 4) * 7); 610 zbc_z &= ~(0x7f << (index % 4) * 7);
597 zbc_z |= depth_val->format << (index % 4) * 7; 611 zbc_z |= depth_val->format << (index % 4) * 7;
598 gk20a_writel(g, gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r() + (index & ~3), zbc_z); 612 gk20a_writel(g, zbc_z_format_reg + (index & ~3), zbc_z);
599 613
600 return 0; 614 return 0;
601} 615}
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
index 3b0f0f2e..1d39a38b 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B GPU GR 2 * GP10B GPU GR
3 * 3 *
4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2015-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"),
@@ -77,6 +77,8 @@ int gr_gp10b_commit_global_cb_manager(struct gk20a *g,
77void gr_gp10b_commit_global_pagepool(struct gk20a *g, 77void gr_gp10b_commit_global_pagepool(struct gk20a *g,
78 struct channel_ctx_gk20a *ch_ctx, 78 struct channel_ctx_gk20a *ch_ctx,
79 u64 addr, u32 size, bool patch); 79 u64 addr, u32 size, bool patch);
80u32 gr_gp10b_get_gpcs_swdx_dss_zbc_c_format_reg(struct gk20a *g);
81u32 gr_gp10b_get_gpcs_swdx_dss_zbc_z_format_reg(struct gk20a *g);
80int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, 82int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr,
81 struct zbc_entry *color_val, u32 index); 83 struct zbc_entry *color_val, u32 index);
82int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, 84int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr,
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 5e8e7acc..cfba7d65 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GP10B Tegra HAL interface 2 * GP10B Tegra HAL interface
3 * 3 *
4 * Copyright (c) 2014-2017, 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,6 +245,10 @@ static const struct gpu_ops gp10b_ops = {
245 .detect_sm_arch = gr_gm20b_detect_sm_arch, 245 .detect_sm_arch = gr_gm20b_detect_sm_arch,
246 .add_zbc_color = gr_gp10b_add_zbc_color, 246 .add_zbc_color = gr_gp10b_add_zbc_color,
247 .add_zbc_depth = gr_gp10b_add_zbc_depth, 247 .add_zbc_depth = gr_gp10b_add_zbc_depth,
248 .get_gpcs_swdx_dss_zbc_c_format_reg =
249 gr_gp10b_get_gpcs_swdx_dss_zbc_c_format_reg,
250 .get_gpcs_swdx_dss_zbc_z_format_reg =
251 gr_gp10b_get_gpcs_swdx_dss_zbc_z_format_reg,
248 .zbc_set_table = gk20a_gr_zbc_set_table, 252 .zbc_set_table = gk20a_gr_zbc_set_table,
249 .zbc_query_table = gr_gk20a_query_zbc, 253 .zbc_query_table = gr_gk20a_query_zbc,
250 .pmu_save_zbc = gk20a_pmu_save_zbc, 254 .pmu_save_zbc = gk20a_pmu_save_zbc,