summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-11-13 07:55:51 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:02 -0500
commit1f11c7ffe745571753903fdca7024d4428bd99bd (patch)
tree84fc8853243a93f76591121416285da8564b795a /drivers/gpu/nvgpu/gp10b/fb_gp10b.c
parenta83e5281af81bbf56b6d5ce4c7acc8a28beda00a (diff)
gpu: nvgpu: gp10b: Add new supported kind
Bug 1567274 Change-Id: I38c3ffd6129893b02f6bef878a579925cf2bfa1e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/606931 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/fb_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/fb_gp10b.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
new file mode 100644
index 00000000..df35c5b0
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
@@ -0,0 +1,96 @@
1/*
2 * GP10B FB
3 *
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
5*
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include <linux/types.h>
17
18#include "gk20a/gk20a.h"
19#include "gm20b/fb_gm20b.h"
20#include "gk20a/kind_gk20a.h"
21
22#include "hw_gmmu_gp10b.h"
23
24static void gp10b_init_uncompressed_kind_map(void)
25{
26 gm20b_init_uncompressed_kind_map();
27
28 gk20a_uc_kind_map[gmmu_pte_kind_z16_2cz_v()] =
29 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms2_2cz_v()] =
30 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms4_2cz_v()] =
31 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms8_2cz_v()] =
32 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms16_2cz_v()] =
33 gmmu_pte_kind_z16_v();
34
35 gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_4cbra_v()] =
36 gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_4cbra_v()] =
37 gmmu_pte_kind_generic_16bx2_v();
38}
39
40static bool gp10b_kind_supported(u8 k)
41{
42 return (k >= gmmu_pte_kind_z16_2cz_v() &&
43 k <= gmmu_pte_kind_z16_ms8_2cz_v())
44 || k == gmmu_pte_kind_z16_ms16_2cz_v()
45 || k == gmmu_pte_kind_c32_ms4_4cbra_v()
46 || k == gmmu_pte_kind_c64_ms4_4cbra_v();
47}
48
49static bool gp10b_kind_z(u8 k)
50{
51 return (k >= gmmu_pte_kind_z16_2cz_v() &&
52 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
53 k == gmmu_pte_kind_z16_ms16_2cz_v();
54}
55
56static bool gp10b_kind_compressible(u8 k)
57{
58 return (k >= gmmu_pte_kind_z16_2cz_v() &&
59 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
60 k == gmmu_pte_kind_z16_ms16_2cz_v() ||
61 (k >= gmmu_pte_kind_z16_4cz_v() &&
62 k <= gmmu_pte_kind_z16_ms16_4cz_v());
63}
64
65static bool gp10b_kind_zbc(u8 k)
66{
67 return (k >= gmmu_pte_kind_z16_2cz_v() &&
68 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
69 k == gmmu_pte_kind_z16_ms16_2cz_v();
70}
71
72static void gp10b_init_kind_attr(void)
73{
74 u16 k;
75
76 gm20b_init_kind_attr();
77
78 for (k = 0; k < 256; k++) {
79 if (gp10b_kind_supported((u8)k))
80 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_SUPPORTED;
81 if (gp10b_kind_compressible((u8)k))
82 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_COMPRESSIBLE;
83 if (gp10b_kind_z((u8)k))
84 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_Z;
85 if (gp10b_kind_zbc((u8)k))
86 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_ZBC;
87 }
88}
89
90void gp10b_init_fb(struct gpu_ops *gops)
91{
92 gm20b_init_fb(gops);
93
94 gp10b_init_uncompressed_kind_map();
95 gp10b_init_kind_attr();
96}