summaryrefslogtreecommitdiff
path: root/src/libXNVCtrlAttributes
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:01 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:01 -0800
commit9d2899dd01e78209d5a6f0428bd52c22a9245b48 (patch)
treeb3e7b68731fc01e723c2c102391e19e36fc09680 /src/libXNVCtrlAttributes
parentf984a7a8a1e090275f54c8c5ba33d30950a0c1f6 (diff)
169.07169.07
Diffstat (limited to 'src/libXNVCtrlAttributes')
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.c4
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.h11
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c17
3 files changed, 29 insertions, 3 deletions
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
index 5894520..ac873a1 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
@@ -550,7 +550,9 @@ NvCtrlGetDisplayAttribute(NvCtrlAttributeHandle *handle,
return NvCtrlSuccess;
}
- if ((attr >= 0) && (attr <= NV_CTRL_LAST_ATTRIBUTE)) {
+ if (((attr >= 0) && (attr <= NV_CTRL_LAST_ATTRIBUTE)) ||
+ ((attr >= NV_CTRL_ATTR_NV_BASE) &&
+ (attr <= NV_CTRL_ATTR_NV_LAST_ATTRIBUTE))) {
if (!h->nv) return NvCtrlMissingExtension;
return NvCtrlNvControlGetAttribute(h, display_mask, attr, val);
}
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.h b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
index 0cd3edd..ebd206a 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
@@ -92,9 +92,18 @@ typedef void NvCtrlAttributeHandle;
#define NV_CTRL_ATTR_EXT_LAST_ATTRIBUTE \
(NV_CTRL_ATTR_EXT_XV_BLITTER_PRESENT)
-#define NV_CTRL_ATTR_XV_BASE \
+#define NV_CTRL_ATTR_NV_BASE \
(NV_CTRL_ATTR_EXT_LAST_ATTRIBUTE + 1)
+#define NV_CTRL_ATTR_NV_MAJOR_VERSION (NV_CTRL_ATTR_NV_BASE + 0)
+#define NV_CTRL_ATTR_NV_MINOR_VERSION (NV_CTRL_ATTR_NV_BASE + 1)
+
+#define NV_CTRL_ATTR_NV_LAST_ATTRIBUTE \
+ (NV_CTRL_ATTR_NV_MINOR_VERSION)
+
+#define NV_CTRL_ATTR_XV_BASE \
+ (NV_CTRL_ATTR_NV_LAST_ATTRIBUTE + 1)
+
#define NV_CTRL_ATTR_XV_OVERLAY_SATURATION (NV_CTRL_ATTR_XV_BASE + 0)
#define NV_CTRL_ATTR_XV_OVERLAY_CONTRAST (NV_CTRL_ATTR_XV_BASE + 1)
#define NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS (NV_CTRL_ATTR_XV_BASE + 2)
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
index 46c2c80..20a165e 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
@@ -116,7 +116,22 @@ ReturnStatus NvCtrlNvControlGetAttribute (NvCtrlAttributePrivateHandle *h,
return NvCtrlAttributeNotAvailable;
}
}
-
+
+ if ((attr >= NV_CTRL_ATTR_NV_BASE) &&
+ (attr <= NV_CTRL_ATTR_NV_LAST_ATTRIBUTE)) {
+
+ if (!h->nv) return NvCtrlMissingExtension;
+
+ switch (attr) {
+ case NV_CTRL_ATTR_NV_MAJOR_VERSION:
+ *val = h->nv->major_version;
+ return NvCtrlSuccess;
+ case NV_CTRL_ATTR_NV_MINOR_VERSION:
+ *val = h->nv->minor_version;
+ return NvCtrlSuccess;
+ }
+ }
+
return NvCtrlNoAttribute;
} /* NvCtrlNvControlGetAttribute() */