summaryrefslogtreecommitdiff
path: root/src/libXNVCtrlAttributes
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:00 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-12 21:29:00 -0800
commitf513358f729cc7c91a0a441ed8e8cf247bfb9a7d (patch)
tree42bf7728fb2b949e3a5fd0dd1bcb00cf651d6dd3 /src/libXNVCtrlAttributes
parented6a95f84006ba62cdec15b8aa22a5ab2d46f2e4 (diff)
100.14.19100.14.19
Diffstat (limited to 'src/libXNVCtrlAttributes')
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.h9
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h2
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesXv.c24
3 files changed, 27 insertions, 8 deletions
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.h b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
index 372a956..0cd3edd 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
@@ -101,9 +101,12 @@ typedef void NvCtrlAttributeHandle;
#define NV_CTRL_ATTR_XV_OVERLAY_HUE (NV_CTRL_ATTR_XV_BASE + 3)
#define NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 4)
#define NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 5)
-#define NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 6)
-#define NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 7)
-#define NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 8)
+#define NV_CTRL_ATTR_XV_TEXTURE_CONTRAST (NV_CTRL_ATTR_XV_BASE + 6)
+#define NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS (NV_CTRL_ATTR_XV_BASE + 7)
+#define NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 8)
+#define NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK (NV_CTRL_ATTR_XV_BASE + 9)
+#define NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS (NV_CTRL_ATTR_XV_BASE + 10)
+
#define NV_CTRL_ATTR_XV_LAST_ATTRIBUTE \
(NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS)
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
index b7ba4cc..8072833 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
@@ -122,6 +122,8 @@ struct __NvCtrlXvOverlayAttributes {
struct __NvCtrlXvTextureAttributes {
unsigned int port;
NvCtrlXvAttribute *sync_to_vblank;
+ NvCtrlXvAttribute *contrast;
+ NvCtrlXvAttribute *brightness;
NvCtrlXvAttribute *defaults;
};
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
index 1833038..c43b3e6 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c
@@ -272,7 +272,7 @@ NvCtrlXvAttributes * NvCtrlInitXvAttributes(NvCtrlAttributePrivateHandle *h)
if (strcmp(ainfo[i].name, "NV17 Video Texture") == 0) {
NvCtrlXvTextureAttributes *attrs;
-
+
attrs = (NvCtrlXvTextureAttributes *)
malloc(sizeof(NvCtrlXvTextureAttributes));
if ( !attrs ) {
@@ -283,6 +283,10 @@ NvCtrlXvAttributes * NvCtrlInitXvAttributes(NvCtrlAttributePrivateHandle *h)
attrs->port = ainfo[i].base_id;
attrs->sync_to_vblank = getXvAttribute(h, attrs->port,
"XV_SYNC_TO_VBLANK");
+ attrs->contrast = getXvAttribute(h, attrs->port,
+ "XV_CONTRAST");
+ attrs->brightness = getXvAttribute(h, attrs->port,
+ "XV_BRIGHTNESS");
attrs->defaults = getXvAttribute(h, attrs->port,
"XV_SET_DEFAULTS");
if (!attrs->sync_to_vblank ||
@@ -551,21 +555,23 @@ static NvCtrlXvAttribute *getXvAttribute(NvCtrlAttributePrivateHandle *h,
static Bool checkAdaptor(NvCtrlAttributePrivateHandle *h,
unsigned int attribute)
{
+
switch(attribute) {
case NV_CTRL_ATTR_XV_OVERLAY_SATURATION:
case NV_CTRL_ATTR_XV_OVERLAY_CONTRAST:
case NV_CTRL_ATTR_XV_OVERLAY_BRIGHTNESS:
case NV_CTRL_ATTR_XV_OVERLAY_HUE:
- case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
+ case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
if (h && h->xv && h->xv->overlay) return True;
else return False;
-
+
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
if (h && h->xv && h->xv->texture) return True;
else return False;
-
case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
case NV_CTRL_ATTR_XV_BLITTER_SET_DEFAULTS:
if (h && h->xv && h->xv->blitter) return True;
@@ -598,6 +604,8 @@ static unsigned int getXvPort(NvCtrlAttributePrivateHandle *h,
return h->xv->overlay->port;
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
return h->xv->texture->port;
@@ -639,12 +647,18 @@ static NvCtrlXvAttribute *getXvAttributePtr(NvCtrlAttributePrivateHandle *h,
case NV_CTRL_ATTR_XV_TEXTURE_SYNC_TO_VBLANK:
return h->xv->texture->sync_to_vblank;
+ case NV_CTRL_ATTR_XV_TEXTURE_CONTRAST:
+ return h->xv->texture->contrast;
+
+ case NV_CTRL_ATTR_XV_TEXTURE_BRIGHTNESS:
+ return h->xv->texture->brightness;
+
case NV_CTRL_ATTR_XV_BLITTER_SYNC_TO_VBLANK:
return h->xv->blitter->sync_to_vblank;
case NV_CTRL_ATTR_XV_OVERLAY_SET_DEFAULTS:
return h->xv->overlay->defaults;
-
+
case NV_CTRL_ATTR_XV_TEXTURE_SET_DEFAULTS:
return h->xv->texture->defaults;