summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-09-19 15:53:53 -0700
committerAaron Plattner <aplattner@nvidia.com>2008-09-19 15:53:53 -0700
commit504dad3f8f2977a1f79d8f552583c9e166c82b20 (patch)
treefe4962d98e7ef7e711eab86cdc38fd273d484dc7
parent4bef4cc0c837bb8649cb7b7c13ef5c4aefd4e7fe (diff)
-rw-r--r--src/gtk+-2.x/ctkevent.c2
-rw-r--r--src/gtk+-2.x/ctkmultisample.c104
-rw-r--r--src/libXNVCtrl/NVCtrl.h17
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.c35
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.h2
-rw-r--r--src/parse.c3
-rw-r--r--src/query-assign.c73
7 files changed, 157 insertions, 79 deletions
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 1e056a7..08f5adb 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -270,7 +270,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_CSC_CHANGED_EVENT
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_SYNC_TO_DISPLAY
#warning "There are attributes that do not emit signals!"
#endif
diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c
index 9bb4b16..d8b65c1 100644
--- a/src/gtk+-2.x/ctkmultisample.c
+++ b/src/gtk+-2.x/ctkmultisample.c
@@ -46,8 +46,6 @@ static int map_nv_ctrl_fsaa_value_to_slider(CtkMultisample *ctk_multisample,
static gchar *format_fsaa_value(GtkScale *scale, gdouble arg1,
gpointer user_data);
-static const gchar *get_multisample_mode_name(gint multisample_mode);
-
static GtkWidget *create_fsaa_setting_menu(CtkMultisample *ctk_multisample,
CtkEvent *ctk_event,
gboolean override,
@@ -615,49 +613,13 @@ static gchar *format_fsaa_value(GtkScale *scale, gdouble arg1,
if (val < 0) val = 0;
val = ctk_multisample->fsaa_translation_table[val];
- return g_strdup(get_multisample_mode_name(val));
+ return g_strdup(NvCtrlGetMultisampleModeName(val));
} /* format_fsaa_value() */
/*
- * get_multisample_mode_name() - lookup a string desribing the
- * NV-CONTROL constant.
- */
-
-static const gchar *get_multisample_mode_name(gint multisample_mode)
-{
- static const gchar *mode_names[] = {
-
- "Off", /* FSAA_MODE_NONE */
- "2x Bilinear", /* FSAA_MODE_2x */
- "2x Quincunx", /* FSAA_MODE_2x_5t */
- "1.5 x 1.5", /* FSAA_MODE_15x15 */
- "2 x 2 Supersampling", /* FSAA_MODE_2x2 */
- "4x Bilinear", /* FSAA_MODE_4x */
- "4x, 9-tap Gaussian", /* FSAA_MODE_4x_9t */
- "8x", /* FSAA_MODE_8x */
- "16x", /* FSAA_MODE_16x */
- "8xS", /* FSAA_MODE_8xS */
- "8xQ", /* FSAA_MODE_8xQ */
- "16xS", /* FSAA_MODE_16xS */
- "16xQ", /* FSAA_MODE_16xQ */
- "32xS" /* FSAA_MODE_32xS */
- };
-
- if ((multisample_mode < NV_CTRL_FSAA_MODE_NONE) ||
- (multisample_mode > NV_CTRL_FSAA_MODE_MAX)) {
- return "Unknown Multisampling";
- }
-
- return mode_names[multisample_mode];
-
-} /* get_multisample_mode_name() */
-
-
-
-/*
* create_fsaa_setting_menu() - Helper function that creates the
* FSAA application control dropdown menu.
*/
@@ -942,7 +904,7 @@ static void post_fsaa_value_changed(CtkMultisample *ctk_multisample, gint val)
{
ctk_config_statusbar_message(ctk_multisample->ctk_config,
"Antialiasing set to %s.",
- get_multisample_mode_name(val));
+ NvCtrlGetMultisampleModeName(val));
} /* post_fsaa_value_changed() */
@@ -1352,8 +1314,8 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
}
if (ctk_multisample->active_attributes & __FSAA_2x) {
- ctk_help_term(b, &i, "2x Bilinear");
- ctk_help_para(b, &i, "This enables antialiasing using the 2x "
+ ctk_help_term(b, &i, "2x (2xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 2x (2xMS)"
"Bilinear mode. This mode offers improved image "
"quality and high performance in OpenGL "
"applications.");
@@ -1385,8 +1347,8 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
}
if (ctk_multisample->active_attributes & __FSAA_4x) {
- ctk_help_term(b, &i, "4x Bilinear");
- ctk_help_para(b, &i, "This enables antialiasing using the 4x "
+ ctk_help_term(b, &i, "4x (4xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 4x (4xMS)"
"Bilinearmode. This mode offers higher image "
"quality at the expense of some performance in "
"OpenGL applications.");
@@ -1401,53 +1363,53 @@ GtkTextBuffer *ctk_multisample_create_help(GtkTextTagTable *table,
}
if (ctk_multisample->active_attributes & __FSAA_8x) {
- ctk_help_term(b, &i, "8x");
+ ctk_help_term(b, &i, "8x (4xMS, 4xCS)");
ctk_help_para(b, &i, "This enables antialiasing using the 8x "
- "mode. This mode offers better image quality than "
- "the 4x mode.");
+ "(4xMS, 4xCS) mode. This mode offers better image "
+ "quality than the 4x mode.");
}
if (ctk_multisample->active_attributes & __FSAA_8xS) {
- ctk_help_term(b, &i, "8xS");
- ctk_help_para(b, &i, "This enables antialiasing using the 8xS "
- "mode. This mode offers better image quality than "
- "the 4x mode; 8xS is only available on Geforce "
- "(non-Quadro) FX or better GPUs.");
+ ctk_help_term(b, &i, "8x (4xSS, 2xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 8x "
+ "(4xSS, 2xMS) mode. This mode offers better image "
+ "quality than the 4x mode; 8xS is only available on "
+ "Geforce (non-Quadro) FX or better GPUs.");
}
if (ctk_multisample->active_attributes & __FSAA_16x) {
- ctk_help_term(b, &i, "16x");
+ ctk_help_term(b, &i, "16x (4xMS, 12xCS)");
ctk_help_para(b, &i, "This enables antialiasing using the 16x "
- "mode. This mode offers better image quality than "
- "the 8x mode.");
+ "(4xMS, 12xCS) mode. This mode offers better image "
+ "quality than the 8x mode.");
}
if (ctk_multisample->active_attributes & __FSAA_8xQ) {
- ctk_help_term(b, &i, "8xQ");
- ctk_help_para(b, &i, "This enables antialiasing using the 8xQ "
- "mode. This mode offers better image quality than "
- "the 8x mode.");
+ ctk_help_term(b, &i, "8x (8xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 8x (8xMS) "
+ "mode. This mode offers better image "
+ "quality than the 8x mode.");
}
if (ctk_multisample->active_attributes & __FSAA_16xS) {
- ctk_help_term(b, &i, "16xS");
- ctk_help_para(b, &i, "This enables antialiasing using the 16xS "
- "mode. This mode offers better image quality than "
- "the 16x mode.");
+ ctk_help_term(b, &i, "16x (4xSS, 4xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 16x "
+ "(4xSS, 4xMS) mode. This mode offers better image "
+ "quality than the 16x mode.");
}
if (ctk_multisample->active_attributes & __FSAA_16xQ) {
- ctk_help_term(b, &i, "16xQ");
- ctk_help_para(b, &i, "This enables antialiasing using the 16xQ "
- "mode. This mode offers better image quality than "
- "the 16x mode.");
+ ctk_help_term(b, &i, "16x (8xMS, 8xCS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 16x "
+ "(8xMS, 8xCS) mode. This mode offers better image "
+ "quality than the 16x mode.");
}
if (ctk_multisample->active_attributes & __FSAA_32xS) {
- ctk_help_term(b, &i, "32xS");
- ctk_help_para(b, &i, "This enables antialiasing using the 32xS "
- "mode. This mode offers better image quality than "
- "the 16x mode.");
+ ctk_help_term(b, &i, "32x (4xSS, 8xMS)");
+ ctk_help_para(b, &i, "This enables antialiasing using the 32x "
+ "(4xSS, 8xMS) mode. This mode offers better image "
+ "quality than the 16x mode.");
}
}
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index 5e79a88..4a106c3 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -2827,6 +2827,8 @@
* initially, but allows them to migrate to video memory.
* NV_CTRL_INITIAL_PIXMAP_PLACEMENT_VIDMEM creates pixmaps in video memory
* when enough resources are available.
+ * NV_CTRL_INITIAL_PIXMAP_PLACEMENT_RESERVED is currently reserved for future
+ * use. Behavior is undefined.
* NV_CTRL_INITIAL_PIXMAP_PLACEMENT_GPU_SYSMEM creates pixmaps in GPU accessible
* system memory when enough resources are available.
*/
@@ -2835,6 +2837,7 @@
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_FORCE_SYSMEM 0
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_SYSMEM 1
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_VIDMEM 2
+#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_RESERVED 3
#define NV_CTRL_INITIAL_PIXMAP_PLACEMENT_GPU_SYSMEM 4
@@ -3377,7 +3380,19 @@
#define NV_CTRL_GVO_CSC_CHANGED_EVENT 294 /* --- */
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GVO_CSC_CHANGED_EVENT
+/*
+ * NV_CTRL_GVO_SYNC_TO_DISPLAY This attribute controls whether or not
+ * the non-SDI display device will be sync'ed to the SDI display device
+ * (when configured in TwinView, Clone Mode or when using the SDI device
+ * with OpenGL).
+ */
+
+#define NV_CTRL_GVO_SYNC_TO_DISPLAY 296 /* --- */
+#define NV_CTRL_GVO_SYNC_TO_DISPLAY_DISABLE 0
+#define NV_CTRL_GVO_SYNC_TO_DISPLAY_ENABLE 1
+
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GVO_SYNC_TO_DISPLAY
/**************************************************************************/
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
index 64a57ec..0d5256e 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
@@ -866,3 +866,38 @@ NvCtrlXrandrGetScreenMode (NvCtrlAttributeHandle *handle,
return NvCtrlXrandrGetScreenMagicMode
((NvCtrlAttributePrivateHandle *)handle, width, height, refresh);
} /* NvCtrlXrandrGetScreenMode() */
+
+
+/*
+ * NvCtrlGetMultisampleModeName() - lookup a string desribing the
+ * NV-CONTROL constant.
+*/
+
+const char *NvCtrlGetMultisampleModeName(int multisample_mode)
+{
+ static const char *mode_names[] = {
+
+ "Off", /* FSAA_MODE_NONE */
+ "2x (2xMS)", /* FSAA_MODE_2x */
+ "2x Quincunx", /* FSAA_MODE_2x_5t */
+ "1.5 x 1.5", /* FSAA_MODE_15x15 */
+ "2 x 2 Supersampling", /* FSAA_MODE_2x2 */
+ "4x (4xMS)", /* FSAA_MODE_4x */
+ "4x, 9-tap Gaussian", /* FSAA_MODE_4x_9t */
+ "8x (4xMS, 4xCS)", /* FSAA_MODE_8x */
+ "16x (4xMS, 12xCS)", /* FSAA_MODE_16x */
+ "8x (4xSS, 2xMS)", /* FSAA_MODE_8xS */
+ "8x (8xMS)", /* FSAA_MODE_8xQ */
+ "16x (4xSS, 4xMS)", /* FSAA_MODE_16xS */
+ "16x (8xMS, 8xCS)", /* FSAA_MODE_16xQ */
+ "32x (4xSS, 8xMS)" /* FSAA_MODE_32xS */
+ };
+
+ if ((multisample_mode < NV_CTRL_FSAA_MODE_NONE) ||
+ (multisample_mode > NV_CTRL_FSAA_MODE_MAX)) {
+ return "Unknown Multisampling";
+ }
+
+ return mode_names[multisample_mode];
+
+} /* NvCtrlGetMultisampleModeName */
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.h b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
index c3d404c..ab3b502 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.h
@@ -496,6 +496,8 @@ NvCtrlGetGvoColorConversion(NvCtrlAttributeHandle *handle,
float colorOffset[3],
float colorScale[3]);
+const char *NvCtrlGetMultisampleModeName(int multisample_mode);
+
char *NvCtrlAttributesStrError (ReturnStatus status);
void NvCtrlAttributeClose(NvCtrlAttributeHandle *handle);
diff --git a/src/parse.c b/src/parse.c
index ec19f0b..9a0aa87 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -182,6 +182,7 @@ AttributeTableEntry attributeTable[] = {
{ "GvoComposite", NV_CTRL_GVO_COMPOSITE, I },
{ "GvoCompositeAlphaKey", NV_CTRL_GVO_COMPOSITE_ALPHA_KEY, I },
{ "GvoCompositeNumKeyRanges", NV_CTRL_GVO_COMPOSITE_NUM_KEY_RANGES, I|N },
+ { "GvoSyncToDisplay", NV_CTRL_GVO_SYNC_TO_DISPLAY, I|N },
{ "Brightness", BRIGHTNESS_VALUE|ALL_CHANNELS, N|C|G },
{ "RedBrightness", BRIGHTNESS_VALUE|RED_CHANNEL, C|G },
@@ -263,7 +264,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_CSC_CHANGED_EVENT
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GVO_SYNC_TO_DISPLAY
#warning "Have you forgotten to add a new integer attribute to attributeTable?"
#endif
diff --git a/src/query-assign.c b/src/query-assign.c
index 2920762..f1d5d42 100644
--- a/src/query-assign.c
+++ b/src/query-assign.c
@@ -50,7 +50,12 @@ static int process_attribute_assignments(int, char**, const char *);
static int query_all(const char *);
static int query_all_targets(const char *display_name, const int target_index);
-static void print_valid_values(char *, uint32, NVCTRLAttributeValidValuesRec);
+static void print_valid_values(char *, int, uint32, NVCTRLAttributeValidValuesRec);
+
+static void print_additional_info(const char *name,
+ int attr,
+ NVCTRLAttributeValidValuesRec valid,
+ const char *indent);
static int validate_value(CtrlHandleTarget *t, ParsedAttribute *a, uint32 d,
int target_type, char *whence);
@@ -597,7 +602,7 @@ static int validate_value(CtrlHandleTarget *t, ParsedAttribute *a, uint32 d,
a->val, a->name, t->name,
d_str, whence);
}
- print_valid_values(a->name, a->flags, valid);
+ print_valid_values(a->name, a->attr, a->flags, valid);
return NV_FALSE;
}
return NV_TRUE;
@@ -611,7 +616,7 @@ static int validate_value(CtrlHandleTarget *t, ParsedAttribute *a, uint32 d,
* attribute.
*/
-static void print_valid_values(char *name, uint32 flags,
+static void print_valid_values(char *name, int attr, uint32 flags,
NVCTRLAttributeValidValuesRec valid)
{
int bit, print_bit, last, last2, i, n;
@@ -735,6 +740,9 @@ static void print_valid_values(char *name, uint32 flags,
nv_msg(INDENT, "'%s' can use the following target types: %s.",
name, str);
+ if (__verbosity >= VERBOSITY_ALL)
+ print_additional_info(name, attr, valid, INDENT);
+
#undef INDENT
} /* print_valid_values() */
@@ -821,6 +829,61 @@ static void print_queried_value(CtrlHandleTarget *t,
/*
+ * print_additional_fsaa_info() - print the currently available fsaa
+ * modes with their corresponding names
+ */
+
+static void print_additional_fsaa_info(const char *name,
+ unsigned int valid_fsaa_modes,
+ const char *indent)
+{
+ int bit;
+
+#define MORE_INDENT " "
+
+ nv_msg(indent, "\nNames for valid '%s' values:\n", name);
+
+ for (bit = 0; bit < 32; bit++) {
+ /* FSAA is not a packed attribute */
+ if (valid_fsaa_modes & (1 << bit)) {
+ nv_msg(MORE_INDENT, "%2u - %s\n",
+ bit, NvCtrlGetMultisampleModeName(bit));
+ }
+ }
+
+#undef MORE_INDENT
+
+}
+
+
+
+/*
+ * print_additional_info() - after printing the main information about
+ * a queried attribute, we may want to add some more when in verbose mode.
+ * This function is designed to handle this. Add a new 'case' here when
+ * you want to print this additional information for a specific attr.
+ */
+
+static void print_additional_info(const char *name,
+ int attr,
+ NVCTRLAttributeValidValuesRec valid,
+ const char *indent)
+{
+ switch (attr) {
+
+ case NV_CTRL_FSAA_MODE:
+ print_additional_fsaa_info(name, valid.u.bits.ints, indent);
+ break;
+
+ // add more here
+
+ }
+
+}
+
+
+
+/*
* query_all() - loop through all screens, and query all attributes
* for those screens. The current attribute values for all display
* devices on all screens are printed, along with the valid values for
@@ -942,7 +1005,7 @@ static int query_all(const char *display_name)
VerboseLevelAbbreviated :
VerboseLevelVerbose);
- print_valid_values(a->name, a->flags, valid);
+ print_valid_values(a->name, a->attr, a->flags, valid);
}
if (!__terse) nv_msg(NULL,"");
@@ -1414,7 +1477,7 @@ static int process_parsed_attribute_internal(CtrlHandleTarget *t,
print_queried_value(t, &valid, a->val, a->flags, a->name, d,
" ", __terse ?
VerboseLevelTerse : VerboseLevelVerbose);
- print_valid_values(a->name, a->flags, valid);
+ print_valid_values(a->name, a->attr, a->flags, valid);
}
}
} /* query */