diff options
author | Peter Boonstoppel <pboonstoppel@nvidia.com> | 2017-05-02 15:09:40 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-17 13:24:20 -0400 |
commit | 39a9e251da0fb4da8512593d3ce4f6eba47d5e0c (patch) | |
tree | 4b0cc5a4c196ba815aff2856034ffbf115cc2fa6 /drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | |
parent | 65de2a2d65a2d7f748580cbc646438a7b4e99d13 (diff) |
gpu: nvgpu: Add czf_bypass sysfs node for gp10b
This change adds a new sysfs node to allow configuring CZF_BYPASS, to
enable platforms with low context-switching latency requirements.
/sys/devices/17000000.gp10b/czf_bypass
Values:
0 - always
1 - lateZ (default)
2 - single pass
3 - never
The specified value will apply only to newly allocated contexts.
Bug 1914014
Change-Id: Ibb9a8e86089acaadaa7260b00eedec5c80762d6f
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/1478567
(cherry picked from commit 3bc022cb385b53f698b04f218db535e8162e8c94)
Reviewed-on: http://git-master/r/1473820
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c index d42afb4c..ee14d00c 100644 --- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c +++ b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GP10B specific sysfs files | 2 | * GP10B specific sysfs files |
3 | * | 3 | * |
4 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 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, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -18,6 +18,8 @@ | |||
18 | #include "gk20a/gk20a.h" | 18 | #include "gk20a/gk20a.h" |
19 | #include "gp10b_sysfs.h" | 19 | #include "gp10b_sysfs.h" |
20 | 20 | ||
21 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> | ||
22 | |||
21 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) | 23 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) |
22 | 24 | ||
23 | static ssize_t ecc_enable_store(struct device *dev, | 25 | static ssize_t ecc_enable_store(struct device *dev, |
@@ -49,12 +51,43 @@ static ssize_t ecc_enable_read(struct device *dev, | |||
49 | 51 | ||
50 | static DEVICE_ATTR(ecc_enable, ROOTRW, ecc_enable_read, ecc_enable_store); | 52 | static DEVICE_ATTR(ecc_enable, ROOTRW, ecc_enable_read, ecc_enable_store); |
51 | 53 | ||
54 | |||
55 | static ssize_t czf_bypass_store(struct device *dev, | ||
56 | struct device_attribute *attr, const char *buf, size_t count) | ||
57 | { | ||
58 | struct gk20a *g = get_gk20a(dev); | ||
59 | unsigned long val; | ||
60 | |||
61 | if (kstrtoul(buf, 10, &val) < 0) | ||
62 | return -EINVAL; | ||
63 | |||
64 | if (val >= 4) | ||
65 | return -EINVAL; | ||
66 | |||
67 | g->gr.czf_bypass = val; | ||
68 | |||
69 | return count; | ||
70 | } | ||
71 | |||
72 | static ssize_t czf_bypass_read(struct device *dev, | ||
73 | struct device_attribute *attr, char *buf) | ||
74 | { | ||
75 | struct gk20a *g = get_gk20a(dev); | ||
76 | |||
77 | return sprintf(buf, "%d\n", g->gr.czf_bypass); | ||
78 | } | ||
79 | |||
80 | static DEVICE_ATTR(czf_bypass, ROOTRW, czf_bypass_read, czf_bypass_store); | ||
81 | |||
52 | void gp10b_create_sysfs(struct device *dev) | 82 | void gp10b_create_sysfs(struct device *dev) |
53 | { | 83 | { |
54 | struct gk20a *g = get_gk20a(dev); | 84 | struct gk20a *g = get_gk20a(dev); |
55 | int error = 0; | 85 | int error = 0; |
56 | 86 | ||
87 | g->gr.czf_bypass = gr_gpc0_prop_debug1_czf_bypass_init_v(); | ||
88 | |||
57 | error |= device_create_file(dev, &dev_attr_ecc_enable); | 89 | error |= device_create_file(dev, &dev_attr_ecc_enable); |
90 | error |= device_create_file(dev, &dev_attr_czf_bypass); | ||
58 | if (error) | 91 | if (error) |
59 | nvgpu_err(g, "Failed to create sysfs attributes!\n"); | 92 | nvgpu_err(g, "Failed to create sysfs attributes!\n"); |
60 | } | 93 | } |
@@ -62,4 +95,5 @@ void gp10b_create_sysfs(struct device *dev) | |||
62 | void gp10b_remove_sysfs(struct device *dev) | 95 | void gp10b_remove_sysfs(struct device *dev) |
63 | { | 96 | { |
64 | device_remove_file(dev, &dev_attr_ecc_enable); | 97 | device_remove_file(dev, &dev_attr_ecc_enable); |
98 | device_remove_file(dev, &dev_attr_czf_bypass); | ||
65 | } | 99 | } |