projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed case of pre-allocated files (reported size of the file might be greater than...
[psensor.git]
/
src
/
lib
/
nvidia.c
diff --git
a/src/lib/nvidia.c
b/src/lib/nvidia.c
index
d3bbb58
..
685f97d
100644
(file)
--- a/
src/lib/nvidia.c
+++ b/
src/lib/nvidia.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
4
jeanfi@gmail.com
+ * Copyright (C) 2010-201
6
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-256,7
+256,8
@@
static char *i2str(int i)
size_t n;
/* second +1 to avoid issue about the conversion of a double
size_t n;
/* second +1 to avoid issue about the conversion of a double
- * to a lower int */
+ * to a lower int
+ */
n = 1 + (ceil(log10(INT_MAX)) + 1) + 1;
str = malloc(n);
n = 1 + (ceil(log10(INT_MAX)) + 1) + 1;
str = malloc(n);
@@
-272,6
+273,7
@@
static struct psensor *create_nvidia_sensor(int id, int subtype, int value_len)
int type;
size_t n;
struct psensor *s;
int type;
size_t n;
struct psensor *s;
+ double v;
type = SENSOR_TYPE_NVCTRL | subtype;
type = SENSOR_TYPE_NVCTRL | subtype;
@@
-293,6
+295,13
@@
static struct psensor *create_nvidia_sensor(int id, int subtype, int value_len)
s->provider_data = malloc(sizeof(int));
set_nvidia_id(s, id);
s->provider_data = malloc(sizeof(int));
set_nvidia_id(s, id);
+ if ((type & SENSOR_TYPE_GPU) && (type & SENSOR_TYPE_TEMP)) {
+ v = get_att(NV_CTRL_TARGET_TYPE_GPU,
+ id,
+ NV_CTRL_GPU_CORE_THRESHOLD);
+ s->max = v;
+ }
+
free(strnid);
return s;
free(strnid);
return s;