From a69f45fc3dc7847ca600bfb1873ec2995fce13a6 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Mon, 18 May 2009 12:43:08 -0700 Subject: 185.18.10 --- doc/NV-CONTROL-API.txt | 4 ++-- src/gtk+-2.x/ctkdisplayconfig.c | 1 + src/gtk+-2.x/ctkgvo.c | 25 ++++++++++++++--------- src/gtk+-2.x/ctkwindow.c | 5 ++++- src/libXNVCtrl/nv_control.h | 24 +++++++++++++++++++++- src/parse.c | 12 +++++++---- src/parse.h | 10 ++++++++++ src/query-assign.c | 44 ++++++++++++++++++++++++++++++++--------- 8 files changed, 99 insertions(+), 26 deletions(-) diff --git a/doc/NV-CONTROL-API.txt b/doc/NV-CONTROL-API.txt index f8f43af..79f76b4 100644 --- a/doc/NV-CONTROL-API.txt +++ b/doc/NV-CONTROL-API.txt @@ -380,6 +380,6 @@ 8. NV-CONTROL EXTENSION HISTORY - 1.0 - 1.5 NVIDIA Internal development versions - 1.6 Initial public version + Please see the NV-CONTROL Protocol Version History comment at the + top of nv_control.h. diff --git a/src/gtk+-2.x/ctkdisplayconfig.c b/src/gtk+-2.x/ctkdisplayconfig.c index 3409bea..744de7d 100644 --- a/src/gtk+-2.x/ctkdisplayconfig.c +++ b/src/gtk+-2.x/ctkdisplayconfig.c @@ -2439,6 +2439,7 @@ static void setup_display_resolution_dropdown(CtkDisplayConfig *ctk_object) gtk_option_menu_set_history (GTK_OPTION_MENU(ctk_object->mnu_display_resolution), cur_idx); + ctk_object->last_resolution_idx = cur_idx; /* If dropdown has only one item, disable menu selection */ if (ctk_object->resolution_table_len > 1) { diff --git a/src/gtk+-2.x/ctkgvo.c b/src/gtk+-2.x/ctkgvo.c index 64910e3..8e31f40 100644 --- a/src/gtk+-2.x/ctkgvo.c +++ b/src/gtk+-2.x/ctkgvo.c @@ -1455,17 +1455,24 @@ static void clone_mode_button_ui_toggled(GtkWidget *button, gpointer user_data) if (enabled) val = NV_CTRL_GVO_DISPLAY_X_SCREEN_ENABLE; else val = NV_CTRL_GVO_DISPLAY_X_SCREEN_DISABLE; - NvCtrlSetAttribute(ctk_gvo->handle, NV_CTRL_GVO_DISPLAY_X_SCREEN, val); - /* - * XXX NV_CTRL_GVO_DISPLAY_X_SCREEN can silently fail if GLX - * locked GVO output for use by pbuffer(s). Check that the - * setting actually stuck. - */ + ret = NvCtrlSetDisplayAttributeWithReply(ctk_gvo->handle, + 0, /* display_mask */ + NV_CTRL_GVO_DISPLAY_X_SCREEN, + val); - ret = NvCtrlGetAttribute(ctk_gvo->handle, - NV_CTRL_GVO_LOCK_OWNER, - &ctk_gvo->lock_owner); + if (ret == NvCtrlSuccess) { + + /* + * XXX NV_CTRL_GVO_DISPLAY_X_SCREEN can silently fail if GLX + * locked GVO output for use by pbuffer(s). Check that the + * setting actually stuck. + */ + + ret = NvCtrlGetAttribute(ctk_gvo->handle, + NV_CTRL_GVO_LOCK_OWNER, + &ctk_gvo->lock_owner); + } if ((ret != NvCtrlSuccess) || (enabled && diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c index 1043b79..29addf0 100644 --- a/src/gtk+-2.x/ctkwindow.c +++ b/src/gtk+-2.x/ctkwindow.c @@ -398,6 +398,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf, CtkConfig *ctk_config; gint column_offset, i; + gboolean slimm_page_added; /* XXX Kludge to only show one SLIMM page */ /* create the new object */ @@ -597,6 +598,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf, /* add the per-screen entries into the tree model */ + slimm_page_added = FALSE; for (i = 0; i < h->targets[X_SCREEN_TARGET].n; i++) { gchar *screen_name; @@ -633,11 +635,12 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf, CTK_WINDOW_CONFIG_FILE_ATTRIBUTES_FUNC_COLUMN, NULL, -1); - if (h->targets[VCS_TARGET].n) { + if (h->targets[VCS_TARGET].n && !slimm_page_added) { /* SLI Mosaic Mode information */ child = ctk_slimm_new(screen_handle, ctk_event, ctk_config); if (child) { + slimm_page_added = TRUE; help = ctk_slimm_create_help(tag_table, "SLI Mosaic Mode Settings"); add_page(child, help, ctk_window, &iter, NULL, "SLI Mosaic Mode Settings", NULL, NULL, NULL); diff --git a/src/libXNVCtrl/nv_control.h b/src/libXNVCtrl/nv_control.h index b424724..795823f 100644 --- a/src/libXNVCtrl/nv_control.h +++ b/src/libXNVCtrl/nv_control.h @@ -19,6 +19,28 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * + * NV-CONTROL Protocol Version History + * + * 1.0 - 1.5 NVIDIA Internal development versions + * 1.6 Initial public version + * 1.7 Added QueryBinaryData request + * 1.8 Added TargetTypes + * 1.9 Added QueryTargetCount request + * 1.10 Fixed target type/id byte ordering for compatibility with + * pre-1.8 NV-CONTROL clients + * 1.11 NVIDIA Internal development version + * 1.12 Added StringOperation request + * 1.13 NVIDIA Internal development version + * 1.14 Fixed an NV_CTRL_BINARY_DATA_MODELINES double scan modeline + * reporting bug (vsyncstart, vsyncend, and vtotal were incorrectly + * doubled) + * 1.15 Added AVAILABILITY_TARGET_ATTRIBUTE_CHANGED_EVENT + * 1.16 Added TARGET_STRING_ATTRIBUTE_CHANGED_EVENT + * 1.17 Added TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT + * 1.18 Updated QueryTargetCount to return a count of 0, rather than + * BadMatch, if an unknown TargetType is specified */ #ifndef __NVCONTROL_H @@ -29,7 +51,7 @@ #define NV_CONTROL_NAME "NV-CONTROL" #define NV_CONTROL_MAJOR 1 -#define NV_CONTROL_MINOR 17 +#define NV_CONTROL_MINOR 18 #define X_nvCtrlQueryExtension 0 #define X_nvCtrlIsNv 1 diff --git a/src/parse.c b/src/parse.c index 5a4476e..1fb3cb6 100644 --- a/src/parse.c +++ b/src/parse.c @@ -307,28 +307,32 @@ TargetTypeEntry targetTypeTable[] = { X_SCREEN_TARGET, /* target_index */ NV_CTRL_TARGET_TYPE_X_SCREEN, /* nvctrl */ ATTRIBUTE_TYPE_X_SCREEN, /* permission_bit */ - NV_TRUE }, /* uses_display_devices */ + NV_TRUE, /* uses_display_devices */ + 1, 6 }, /* required major,minor protocol rev */ { "GPU", /* name */ "gpu", /* parsed_name */ GPU_TARGET, /* target_index */ NV_CTRL_TARGET_TYPE_GPU, /* nvctrl */ ATTRIBUTE_TYPE_GPU, /* permission_bit */ - NV_TRUE }, /* uses_display_devices */ + NV_TRUE, /* uses_display_devices */ + 1, 10 }, /* required major,minor protocol rev */ { "Frame Lock Device", /* name */ "framelock", /* parsed_name */ FRAMELOCK_TARGET, /* target_index */ NV_CTRL_TARGET_TYPE_FRAMELOCK, /* nvctrl */ ATTRIBUTE_TYPE_FRAMELOCK, /* permission_bit */ - NV_FALSE }, /* uses_display_devices */ + NV_FALSE, /* uses_display_devices */ + 1, 10 }, /* required major,minor protocol rev */ { "VCS", /* name */ "vcs", /* parsed_name */ VCS_TARGET, /* target_index */ NV_CTRL_TARGET_TYPE_VCSC, /* nvctrl */ ATTRIBUTE_TYPE_VCSC, /* permission_bit */ - NV_FALSE }, /* uses_display_devices */ + NV_FALSE, /* uses_display_devices */ + 1, 12 }, /* required major,minor protocol rev */ { NULL, NULL, 0, 0, 0 }, }; diff --git a/src/parse.h b/src/parse.h index 326531e..0b99541 100644 --- a/src/parse.h +++ b/src/parse.h @@ -167,6 +167,16 @@ typedef struct { /* whether this target type is aware of display devices */ int uses_display_devices; + /* + * the minimum NV-CONTROL Protocol version required to use this target + * type; note that all future target types should be able to use 1.18, + * since that version and later allows NV-CONTROL clients to query the + * count of TargetTypes not recognized by the X server + */ + + int major; + int minor; + } TargetTypeEntry; diff --git a/src/query-assign.c b/src/query-assign.c index ad6d36a..87a8878 100644 --- a/src/query-assign.c +++ b/src/query-assign.c @@ -154,8 +154,33 @@ CtrlHandles *nv_alloc_ctrl_handles(const char *display) */ if (pQueryHandle) { - status = NvCtrlQueryTargetCount - (pQueryHandle, targetTypeTable[j].nvctrl, &val); + + /* + * check that the NV-CONTROL protocol is new enough to + * recognize this target type + */ + + ReturnStatus ret1, ret2; + int major, minor; + + ret1 = NvCtrlGetAttribute(pQueryHandle, + NV_CTRL_ATTR_NV_MAJOR_VERSION, + &major); + ret2 = NvCtrlGetAttribute(pQueryHandle, + NV_CTRL_ATTR_NV_MINOR_VERSION, + &minor); + + if ((ret1 == NvCtrlSuccess) && (ret2 == NvCtrlSuccess) && + ((major > targetTypeTable[j].major) || + ((major == targetTypeTable[j].major) && + (minor >= targetTypeTable[j].minor)))) { + + status = NvCtrlQueryTargetCount + (pQueryHandle, targetTypeTable[j].nvctrl, + &val); + } else { + status = NvCtrlMissingExtension; + } } else { status = NvCtrlMissingExtension; } @@ -839,20 +864,21 @@ static void print_additional_fsaa_info(const char *name, { int bit; -#define MORE_INDENT " " - - nv_msg(indent, "\nNames for valid '%s' values:\n", name); + nv_msg(indent, "\n"); + nv_msg(indent, "Note to assign 'FSAA' on the commandline, you may also " + "need to assign\n"); + nv_msg(indent, "'FSAAAppControlled' and 'FSAAAppEnhanced' to 0.\n"); + nv_msg(indent, "\n"); + nv_msg(indent, "Valid '%s' Values\n", name); + nv_msg(indent, " value - description\n"); 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", + nv_msg(indent, " %2u - %s\n", bit, NvCtrlGetMultisampleModeName(bit)); } } - -#undef MORE_INDENT - } -- cgit v1.2.3