summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2009-12-22 17:16:00 -0800
committerAaron Plattner <aplattner@nvidia.com>2009-12-22 17:16:00 -0800
commit8787f02b434a05b0986499dcff0fb434e9360927 (patch)
tree4b0583bfc2bc61e728e7888ca643a81627be124e
parent25d9a353334be8c75255f61cff354c11163b0d08 (diff)
195.30195.30
-rw-r--r--samples/nv-control-events.c1
-rw-r--r--src/gtk+-2.x/ctkdisplayconfig-utils.c23
-rw-r--r--src/gtk+-2.x/ctkevent.c6
-rw-r--r--src/gtk+-2.x/ctkgpu.c78
-rw-r--r--src/gtk+-2.x/ctkgpu.h5
-rw-r--r--src/gtk+-2.x/ctkgvi.c61
-rw-r--r--src/gtk+-2.x/ctkgvi.h6
-rw-r--r--src/gtk+-2.x/ctkgvo.c75
-rw-r--r--src/gtk+-2.x/ctkgvo.h2
-rw-r--r--src/gtk+-2.x/ctkutils.c23
-rw-r--r--src/gtk+-2.x/ctkutils.h4
-rw-r--r--src/gtk+-2.x/ctkwindow.c19
-rw-r--r--src/libXNVCtrl/NVCtrl.c44
-rw-r--r--src/libXNVCtrl/NVCtrl.h92
-rw-r--r--src/libXNVCtrl/NVCtrlLib.h18
-rw-r--r--src/libXNVCtrl/nv_control.h13
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributes.c14
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c35
-rw-r--r--src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h7
-rw-r--r--src/parse.c6
-rw-r--r--src/query-assign.c197
21 files changed, 562 insertions, 167 deletions
diff --git a/samples/nv-control-events.c b/samples/nv-control-events.c
index bdb2302..7412e52 100644
--- a/samples/nv-control-events.c
+++ b/samples/nv-control-events.c
@@ -548,5 +548,6 @@ static AttrEntry attr_table[] = {
MAKE_ENTRY(NV_CTRL_OPENGL_AA_LINE_GAMMA_VALUE),
MAKE_ENTRY(NV_CTRL_DISPLAYPORT_LINK_RATE),
MAKE_ENTRY(NV_CTRL_STEREO_EYES_EXCHANGE),
+ MAKE_ENTRY(NV_CTRL_ACCELERATE_TRAPEZOIDS),
{ -1, NULL, NULL }
};
diff --git a/src/gtk+-2.x/ctkdisplayconfig-utils.c b/src/gtk+-2.x/ctkdisplayconfig-utils.c
index 80b1067..fed2001 100644
--- a/src/gtk+-2.x/ctkdisplayconfig-utils.c
+++ b/src/gtk+-2.x/ctkdisplayconfig-utils.c
@@ -1851,6 +1851,7 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu,
if (display->is_sdi && !gpu->gvo_mode_data) {
unsigned int valid1 = 0;
unsigned int valid2 = 0;
+ unsigned int valid3 = 0;
NVCTRLAttributeValidValuesRec valid;
ret = NvCtrlGetValidAttributeValues(gpu->handle,
@@ -1873,9 +1874,20 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu,
valid2 = valid.u.bits.ints;
}
+ ret = NvCtrlGetValidAttributeValues(gpu->handle,
+ NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3,
+ &valid);
+ if ((ret != NvCtrlSuccess) ||
+ (valid.type != ATTRIBUTE_TYPE_INT_BITS)) {
+ valid3 = 0;
+ } else {
+ valid3 = valid.u.bits.ints;
+ }
+
/* Count the number of valid modes there are */
gpu->num_gvo_modes = count_number_of_bits(valid1);
gpu->num_gvo_modes += count_number_of_bits(valid2);
+ gpu->num_gvo_modes += count_number_of_bits(valid3);
if (gpu->num_gvo_modes > 0) {
gpu->gvo_mode_data = (GvoModeData *)calloc(gpu->num_gvo_modes,
sizeof(GvoModeData));
@@ -1903,7 +1915,16 @@ nvDisplayPtr gpu_add_display_from_server(nvGpuPtr gpu,
}
valid2 >>= 1;
id++;
- }
+ }
+ while (valid3) {
+ if (valid3 & 1) {
+ if (gpu_query_gvo_mode_info(gpu, id, idx)) {
+ idx++;
+ }
+ }
+ valid3 >>= 1;
+ id++;
+ }
}
}
diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c
index 7f3c944..80f08c9 100644
--- a/src/gtk+-2.x/ctkevent.c
+++ b/src/gtk+-2.x/ctkevent.c
@@ -295,6 +295,10 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
MAKE_SIGNAL(NV_CTRL_GVI_NUM_CAPTURE_SURFACES);
MAKE_SIGNAL(NV_CTRL_OVERSCAN_COMPENSATION);
MAKE_SIGNAL(NV_CTRL_GPU_PCIE_GENERATION);
+ MAKE_SIGNAL(NV_CTRL_GVI_BOUND_GPU);
+ MAKE_SIGNAL(NV_CTRL_ACCELERATE_TRAPEZOIDS);
+ MAKE_SIGNAL(NV_CTRL_GPU_CORES);
+ MAKE_SIGNAL(NV_CTRL_GPU_MEMORY_BUS_WIDTH);
#undef MAKE_SIGNAL
@@ -305,7 +309,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class)
* knows about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_GENERATION
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_MEMORY_BUS_WIDTH
#warning "There are attributes that do not emit signals!"
#endif
diff --git a/src/gtk+-2.x/ctkgpu.c b/src/gtk+-2.x/ctkgpu.c
index b94adfe..4568159 100644
--- a/src/gtk+-2.x/ctkgpu.c
+++ b/src/gtk+-2.x/ctkgpu.c
@@ -245,12 +245,16 @@ GtkWidget* ctk_gpu_new(
gchar *screens;
gchar *displays;
gchar *tmp_str;
+ gchar *gpu_cores;
+ gchar *memory_interface;
unsigned int display_devices;
int xinerama_enabled;
int *pData;
int len;
int i;
+ int row = 0;
+ int total_rows = 19;
/*
@@ -306,7 +310,25 @@ GtkWidget* ctk_gpu_new(
} else {
video_ram = g_strdup_printf("%d MB", tmp >> 10);
}
+
+ /* NV_CTRL_GPU_CORES */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_CORES, &tmp);
+ if (ret != NvCtrlSuccess) {
+ gpu_cores = NULL;
+ } else {
+ gpu_cores = g_strdup_printf("%d", tmp);
+ }
+
+ /* NV_CTRL_GPU_MEMORY_BUS_WIDTH */
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GPU_MEMORY_BUS_WIDTH, &tmp);
+ if (ret != NvCtrlSuccess) {
+ memory_interface = NULL;
+ } else {
+ memory_interface = g_strdup_printf("%d-bit", tmp);
+ }
+
/* NV_CTRL_IRQ */
ret = NvCtrlGetAttribute(handle, NV_CTRL_IRQ, &tmp);
@@ -387,6 +409,8 @@ GtkWidget* ctk_gpu_new(
/* cache the attribute handle */
ctk_gpu->handle = handle;
+ ctk_gpu->gpu_cores = (gpu_cores != NULL) ? 1 : 0;
+ ctk_gpu->memory_interface = (memory_interface != NULL) ? 1 : 0;
/* set container properties of the object */
@@ -417,44 +441,59 @@ GtkWidget* ctk_gpu_new(
hseparator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5);
- table = gtk_table_new(19, 2, FALSE);
+ table = gtk_table_new(total_rows, 2, FALSE);
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
gtk_table_set_col_spacings(GTK_TABLE(table), 15);
gtk_container_set_border_width(GTK_CONTAINER(table), 5);
- add_table_row(table, 0,
+ add_table_row(table, row++,
0, 0.5, "Graphics Processor:",
0, 0.5, product_name);
- add_table_row(table, 1,
+ if ( ctk_gpu->gpu_cores ) {
+ gtk_table_resize(GTK_TABLE(table), ++total_rows, 2);
+ add_table_row(table, row++,
+ 0, 0.5, "CUDA Cores:",
+ 0, 0.5, gpu_cores);
+ }
+ add_table_row(table, row++,
0, 0.5, "VBIOS Version:",
0, 0.5, vbios_version);
- add_table_row(table, 2,
+ add_table_row(table, row++,
0, 0.5, "Memory:",
0, 0.5, video_ram);
+ if ( ctk_gpu->memory_interface ) {
+ gtk_table_resize(GTK_TABLE(table), ++total_rows, 2);
+ add_table_row(table, row++,
+ 0, 0.5, "Memory Interface:",
+ 0, 0.5, memory_interface);
+ }
/* spacing */
- add_table_row(table, 6,
+ row += 3;
+ add_table_row(table, row++,
0, 0.5, "Bus Type:",
0, 0.5, bus);
- add_table_row(table, 7,
+ add_table_row(table, row++,
0, 0.5, "Bus ID:",
0, 0.5, pci_bus_id);
- add_table_row(table, 8,
+ add_table_row(table, row++,
0, 0.5, "PCI Device ID:",
0, 0.5, pci_device_id);
- add_table_row(table, 9,
+ add_table_row(table, row++,
0, 0.5, "PCI Vendor ID:",
0, 0.5, pci_vendor_id);
- add_table_row(table, 10,
+ add_table_row(table, row++,
0, 0.5, "IRQ:",
0, 0.5, irq);
/* spacing */
- add_table_row(table, 14,
+ row += 3;
+ add_table_row(table, row++,
0, 0, "X Screens:",
0, 0, screens);
/* spacing */
+ row += 3;
ctk_gpu->displays =
- add_table_row(table, 18,
+ add_table_row(table, row,
0, 0, "Display Devices:",
0, 0, displays);
@@ -462,6 +501,8 @@ GtkWidget* ctk_gpu_new(
XFree(vbios_version);
g_free(video_ram);
g_free(bus);
+ g_free(gpu_cores);
+ g_free(memory_interface);
g_free(pci_bus_id);
g_free(irq);
g_free(screens);
@@ -480,7 +521,8 @@ GtkWidget* ctk_gpu_new(
}
-GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table)
+GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table,
+ CtkGpu *ctk_gpu)
{
GtkTextIter i;
GtkTextBuffer *b;
@@ -499,6 +541,12 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table)
ctk_help_heading(b, &i, "Graphics Processor");
ctk_help_para(b, &i, "This is the product name of the GPU.");
+ if (ctk_gpu->gpu_cores) {
+ ctk_help_heading(b, &i, "CUDA Cores");
+ ctk_help_para(b, &i, "This is the number of CUDA cores supported by "
+ "the graphics pipeline.");
+ }
+
ctk_help_heading(b, &i, "VBIOS Version");
ctk_help_para(b, &i, "This is the Video BIOS version.");
@@ -511,6 +559,12 @@ GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *table)
"dedicated system memory set aside by the system "
"BIOS for use by the integrated GPU.");
+ if (ctk_gpu->memory_interface) {
+ ctk_help_heading(b, &i, "Memory Interface");
+ ctk_help_para(b, &i, "This is the bus bandwidth of the GPU's "
+ "memory interface.");
+ }
+
ctk_help_heading(b, &i, "Bus Type");
ctk_help_para(b, &i, "This is the bus type which is "
"used to connect the NVIDIA GPU to the rest of "
diff --git a/src/gtk+-2.x/ctkgpu.h b/src/gtk+-2.x/ctkgpu.h
index 9ccd7a7..d6fe47e 100644
--- a/src/gtk+-2.x/ctkgpu.h
+++ b/src/gtk+-2.x/ctkgpu.h
@@ -62,6 +62,8 @@ struct _CtkGpu
NvCtrlAttributeHandle *handle;
GtkWidget *displays;
+ gint gpu_cores;
+ gint memory_interface;
};
struct _CtkGpuClass
@@ -78,7 +80,8 @@ void get_bus_related_info(NvCtrlAttributeHandle *handle,
gchar **bus,
gchar **pci_bus_id);
-GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *);
+GtkTextBuffer *ctk_gpu_create_help(GtkTextTagTable *,
+ CtkGpu *);
diff --git a/src/gtk+-2.x/ctkgvi.c b/src/gtk+-2.x/ctkgvi.c
index f0e0a07..3356749 100644
--- a/src/gtk+-2.x/ctkgvi.c
+++ b/src/gtk+-2.x/ctkgvi.c
@@ -494,15 +494,40 @@ static void show_detailed_info_button_toggled(GtkWidget *button,
update_sdi_input_info(ctk_gvi);
}
+static gchar* gpu_name_string(gint gpu, CtrlHandles *handle)
+{
+ gchar *gpu_name;
+
+ if ((gpu < 0) || (gpu >= handle->targets[GPU_TARGET].n)) {
+ gpu_name = g_strdup_printf("None");
+ } else {
+ NvCtrlAttributeHandle *gpu_handle = handle->targets[GPU_TARGET].t[gpu].h;
+ gpu_name = create_gpu_name_string(gpu_handle);
+ }
+ return gpu_name;
+}
+
+static void bound_gpu_changed(GtkObject *object, gpointer arg1,
+ gpointer user_data)
+{
+ CtkGvi *ctk_gvi = (CtkGvi *) user_data;
+ CtkEventStruct *event_struct = (CtkEventStruct *) arg1;
+ gchar *gpu_name;
+
+ gpu_name = gpu_name_string(event_struct->value, ctk_gvi->ctk_config->pCtrlHandles);
+
+ gtk_label_set_label(GTK_LABEL(ctk_gvi->gpu_name), gpu_name);
+}
GtkWidget* ctk_gvi_new(NvCtrlAttributeHandle *handle,
- CtkConfig *ctk_config)
+ CtkConfig *ctk_config,
+ CtkEvent *ctk_event)
{
GObject *object;
CtkGvi *ctk_gvi;
GtkWidget *hbox, *vbox, *hsep, *hseparator, *table, *button;
GtkWidget *banner, *label;
- gchar *bus, *pci_bus_id, *irq;
+ gchar *bus, *pci_bus_id, *irq, *gpu_name;
int tmp;
ReturnStatus ret;
gchar *firmware_version;
@@ -537,7 +562,15 @@ GtkWidget* ctk_gvi_new(NvCtrlAttributeHandle *handle,
} else {
irq = g_strdup_printf("%d", tmp);
}
-
+
+ /* NV_CTRL_GVI_BOUND_GPU */
+
+ ret = NvCtrlGetAttribute(handle, NV_CTRL_GVI_BOUND_GPU, &tmp);
+ if (ret != NvCtrlSuccess) {
+ tmp = -1;
+ }
+ gpu_name = gpu_name_string(tmp, ctk_config->pCtrlHandles);
+
/* create the CtkGvi object */
object = g_object_new(CTK_TYPE_GVI, NULL);
@@ -582,7 +615,7 @@ GtkWidget* ctk_gvi_new(NvCtrlAttributeHandle *handle,
hseparator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(hbox), hseparator, TRUE, TRUE, 5);
- table = gtk_table_new(6, 2, FALSE);
+ table = gtk_table_new(8, 2, FALSE);
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
gtk_table_set_col_spacings(GTK_TABLE(table), 15);
@@ -602,10 +635,25 @@ GtkWidget* ctk_gvi_new(NvCtrlAttributeHandle *handle,
add_table_row(table, 5,
0, 0.5, "IRQ:",
0, 0.5, irq);
+
+ label = gtk_label_new("Bound GPU:");
+ gtk_label_set_selectable(GTK_LABEL(label), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_table_attach(GTK_TABLE(table), label, 0, 1, 7, 8,
+ GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+
+ label = gtk_label_new(gpu_name);
+ gtk_label_set_selectable(GTK_LABEL(label), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_table_attach(GTK_TABLE(table), label, 1, 2, 7, 8,
+ GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+ ctk_gvi->gpu_name = label;
+
g_free(firmware_version);
g_free(bus);
g_free(pci_bus_id);
g_free(irq);
+ g_free(gpu_name);
hbox = gtk_hbox_new(FALSE, 0);
@@ -655,6 +703,11 @@ GtkWidget* ctk_gvi_new(NvCtrlAttributeHandle *handle,
G_CALLBACK(show_detailed_info_button_toggled),
GTK_OBJECT(ctk_gvi));
+ g_signal_connect(G_OBJECT(ctk_event),
+ CTK_EVENT_NAME(NV_CTRL_GVI_BOUND_GPU),
+ G_CALLBACK(bound_gpu_changed),
+ (gpointer) ctk_gvi);
+
gtk_widget_show_all(GTK_WIDGET(ctk_gvi));
update_sdi_input_info(ctk_gvi);
diff --git a/src/gtk+-2.x/ctkgvi.h b/src/gtk+-2.x/ctkgvi.h
index 772f2f9..cff6e2e 100644
--- a/src/gtk+-2.x/ctkgvi.h
+++ b/src/gtk+-2.x/ctkgvi.h
@@ -26,6 +26,7 @@
#define __CTK_GVI_H__
#include "NvCtrlAttributes.h"
+#include "ctkevent.h"
#include "ctkconfig.h"
G_BEGIN_DECLS
@@ -61,6 +62,8 @@ struct _CtkGvi
int num_jacks;
int max_channels_per_jack;
+ GtkWidget *gpu_name;
+
GtkWidget *jack_channel_omenu;
GtkWidget *input_info_vbox;
@@ -75,7 +78,8 @@ struct _CtkGviClass
};
GType ctk_gvi_get_type (void) G_GNUC_CONST;
-GtkWidget* ctk_gvi_new (NvCtrlAttributeHandle *, CtkConfig *);
+GtkWidget* ctk_gvi_new (NvCtrlAttributeHandle *, CtkConfig *,
+ CtkEvent *);
GtkTextBuffer* ctk_gvi_create_help (GtkTextTagTable *, CtkGvi *);
void ctk_gvi_start_timer (GtkWidget *);
diff --git a/src/gtk+-2.x/ctkgvo.c b/src/gtk+-2.x/ctkgvo.c
index f8fdd0b..f509b15 100644
--- a/src/gtk+-2.x/ctkgvo.c
+++ b/src/gtk+-2.x/ctkgvo.c
@@ -183,10 +183,32 @@ const GvioFormatName videoFormatNames[] = {
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_SMPTE372, "2048 x 1080p 25.00 Hz (SMPTE372)" },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_SMPTE372, "2048 x 1080p 29.97 Hz (SMPTE372)" },
{ NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_SMPTE372, "2048 x 1080p 30.00 Hz (SMPTE372)" },
- { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 50.00 Hz (SMPTE274) 3G LEVEL A" },
- { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274, "1920 x 1080p 59.94 Hz (SMPTE274) 3G LEVEL A" },
- { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 60.00 Hz (SMPTE274) 3G LEVEL A" },
-
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 50.00 Hz (SMPTE274) 3G Level A" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274, "1920 x 1080p 59.94 Hz (SMPTE274) 3G Level A" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274, "1920 x 1080p 60.00 Hz (SMPTE274) 3G Level A" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_B_SMPTE274, "1920 x 1080p 60.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_60_00_3G_LEVEL_B_SMPTE274, "1920 x 1080i 60.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_60_00_3G_LEVEL_B_SMPTE372, "2048 x 1080i 60.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_B_SMPTE274, "1920 x 1080p 50.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_3G_LEVEL_B_SMPTE274, "1920 x 1080i 50.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_50_00_3G_LEVEL_B_SMPTE372, "2048 x 1080i 50.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_30_00_3G_LEVEL_B_SMPTE274, "1920 x 1080p 30.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_3G_LEVEL_B_SMPTE372, "2048 x 1080p 30.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_25_00_3G_LEVEL_B_SMPTE274, "1920 x 1080p 25.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_3G_LEVEL_B_SMPTE372, "2048 x 1080p 25.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_24_00_3G_LEVEL_B_SMPTE274, "1920 x 1080p 24.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_24_00_3G_LEVEL_B_SMPTE372, "2048 x 1080p 24.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_3G_LEVEL_B_SMPTE274, "1920 x 1080i 48.00 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_3G_LEVEL_B_SMPTE372, "2048 x 1080i 48.00 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_B_SMPTE274, "1920 x 1080p 59.94 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_59_94_3G_LEVEL_B_SMPTE274, "1920 x 1080i 59.94 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_59_94_3G_LEVEL_B_SMPTE372, "2048 x 1080i 59.94 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_29_97_3G_LEVEL_B_SMPTE274, "1920 x 1080p 29.97 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_3G_LEVEL_B_SMPTE372, "2048 x 1080p 29.97 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_23_98_3G_LEVEL_B_SMPTE274, "1920 x 1080p 23.98 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_3G_LEVEL_B_SMPTE372, "2048 x 1080p 23.98 Hz (SMPTE372) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_3G_LEVEL_B_SMPTE274, "1920 x 1080i 47.96 Hz (SMPTE274) 3G Level B" },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_3G_LEVEL_B_SMPTE372, "2048 x 1080i 47.96 Hz (SMPTE372) 3G Level B" },
{ -1, NULL },
};
@@ -233,7 +255,29 @@ static GvioFormatDetails videoFormatDetails[] = {
{ NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
{ NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274, 0, 0, 0 },
-
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_60_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_60_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_50_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_30_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_25_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_24_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_24_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_59_94_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_59_94_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_29_97_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080P_23_98_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_3G_LEVEL_B_SMPTE274, 0, 0, 0 },
+ { NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_3G_LEVEL_B_SMPTE372, 0, 0, 0 },
{ -1, -1, -1, -1 },
};
@@ -377,12 +421,13 @@ guint ctk_gvo_video_format_valid(CtkGvo *ctk_gvo, const gint format)
if ((width > ctk_gvo->screen_width) || (height > ctk_gvo->screen_height)) {
valid &= ~(GVO_VIDEO_FORMAT_RESOLUTION_VALID);
}
-
+
/* Check that format is supported */
- if (((format < 32) &&
- !((1 << format) & ctk_gvo->valid_output_video_format_mask[0])) ||
- ((format >= 32) &&
- !((1 << (format -32)) & ctk_gvo->valid_output_video_format_mask[1]))) {
+ if (((format / 32) >=
+ (sizeof(ctk_gvo->valid_output_video_format_mask)/
+ sizeof(ctk_gvo->valid_output_video_format_mask[0]))) ||
+ !(ctk_gvo->valid_output_video_format_mask[format / 32] &
+ (1 << (format % 32)))) {
valid &= ~(GVO_VIDEO_FORMAT_MODE_VALID);
}
@@ -1222,6 +1267,16 @@ static gboolean query_init_gvo_state(CtkGvo *ctk_gvo)
ctk_gvo->valid_output_video_format_mask[1] = valid.u.bits.ints;
}
+ ret = NvCtrlGetValidAttributeValues(ctk_gvo->handle,
+ NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3,
+ &valid);
+
+ if ((ret != NvCtrlSuccess) || (valid.type != ATTRIBUTE_TYPE_INT_BITS)) {
+ ctk_gvo->valid_output_video_format_mask[2] = 0;
+ } else {
+ ctk_gvo->valid_output_video_format_mask[2] = valid.u.bits.ints;
+ }
+
/* Output data format */
ret = NvCtrlGetAttribute(ctk_gvo->handle, NV_CTRL_GVO_DATA_FORMAT, &val);
diff --git a/src/gtk+-2.x/ctkgvo.h b/src/gtk+-2.x/ctkgvo.h
index 4117d09..17020a2 100644
--- a/src/gtk+-2.x/ctkgvo.h
+++ b/src/gtk+-2.x/ctkgvo.h
@@ -75,7 +75,7 @@ struct _CtkGvo
gint input_video_format;
gint output_video_format;
- guint valid_output_video_format_mask[2];
+ guint valid_output_video_format_mask[3];
gint output_data_format;
diff --git a/src/gtk+-2.x/ctkutils.c b/src/gtk+-2.x/ctkutils.c
index 74867ca..09665f4 100644
--- a/src/gtk+-2.x/ctkutils.c
+++ b/src/gtk+-2.x/ctkutils.c
@@ -23,11 +23,34 @@
*/
#include <gtk/gtk.h>
+#include <NvCtrlAttributes.h>
#include "ctkutils.h"
#include "msg.h"
+gchar* create_gpu_name_string(NvCtrlAttributeHandle *gpu_handle)
+{
+ gchar *gpu_name;
+ gchar *gpu_product_name;
+ ReturnStatus ret;
+
+ ret = NvCtrlGetStringDisplayAttribute(gpu_handle, 0,
+ NV_CTRL_STRING_PRODUCT_NAME,
+ &gpu_product_name);
+ if (ret == NvCtrlSuccess && gpu_product_name) {
+ gpu_name = g_strdup_printf("GPU %d - (%s)",
+ NvCtrlGetTargetId(gpu_handle),
+ gpu_product_name);
+ } else {
+ gpu_name = g_strdup_printf("GPU %d - (Unknown)",
+ NvCtrlGetTargetId(gpu_handle));
+ }
+ g_free(gpu_product_name);
+
+ return gpu_name;
+}
+
GtkWidget *add_table_row(GtkWidget *table,
const gint row,
diff --git a/src/gtk+-2.x/ctkutils.h b/src/gtk+-2.x/ctkutils.h
index 148a0b0..e052abe 100644
--- a/src/gtk+-2.x/ctkutils.h
+++ b/src/gtk+-2.x/ctkutils.h
@@ -26,10 +26,12 @@
#define __CTK_UTILS_H__
#include <gtk/gtk.h>
-
+#include <NvCtrlAttributes.h>
G_BEGIN_DECLS
+gchar* create_gpu_name_string(NvCtrlAttributeHandle *gpu_handle);
+
GtkWidget *add_table_row(GtkWidget *, const gint,
const gfloat, const gfloat, const gchar *,
const gfloat, const gfloat, const gchar *);
diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c
index 2d6f7ea..95d7219 100644
--- a/src/gtk+-2.x/ctkwindow.c
+++ b/src/gtk+-2.x/ctkwindow.c
@@ -42,6 +42,7 @@
#include "ctkgvo-sync.h"
#include "ctkgvo-csc.h"
#include "ctkconfig.h"
+#include "ctkutils.h"
#include "ctkscreen.h"
#include "ctkslimm.h"
@@ -760,10 +761,8 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
for (i = 0; i < h->targets[GPU_TARGET].n; i++) {
- gchar *gpu_product_name;
gchar *gpu_name;
GtkWidget *child;
- ReturnStatus ret;
NvCtrlAttributeHandle *gpu_handle = h->targets[GPU_TARGET].t[i].h;
UpdateDisplaysData *data;
@@ -772,17 +771,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
/* create the gpu entry name */
- ret = NvCtrlGetStringDisplayAttribute(gpu_handle, 0,
- NV_CTRL_STRING_PRODUCT_NAME,
- &gpu_product_name);
- if (ret == NvCtrlSuccess && gpu_product_name) {
- gpu_name = g_strdup_printf("GPU %d - (%s)",
- NvCtrlGetTargetId(gpu_handle),
- gpu_product_name);
- } else {
- gpu_name = g_strdup_printf("GPU %d - (Unknown)",
- NvCtrlGetTargetId(gpu_handle));
- }
+ gpu_name = create_gpu_name_string(gpu_handle);
if (!gpu_name) continue;
/* create the object for receiving NV-CONTROL events */
@@ -800,7 +789,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
CTK_WINDOW_WIDGET_COLUMN, child, -1);
gtk_tree_store_set(ctk_window->tree_store, &iter,
CTK_WINDOW_HELP_COLUMN,
- ctk_gpu_create_help(tag_table), -1);
+ ctk_gpu_create_help(tag_table, CTK_GPU(child)), -1);
gtk_tree_store_set(ctk_window->tree_store, &iter,
CTK_WINDOW_CONFIG_FILE_ATTRIBUTES_FUNC_COLUMN,
NULL, -1);
@@ -949,7 +938,7 @@ GtkWidget *ctk_window_new(ParsedAttribute *p, ConfigProperties *conf,
gtk_tree_store_append(ctk_window->tree_store, &iter, NULL);
gtk_tree_store_set(ctk_window->tree_store, &iter,
CTK_WINDOW_LABEL_COLUMN, gvi_name, -1);
- child = ctk_gvi_new(gvi_handle, ctk_config);
+ child = ctk_gvi_new(gvi_handle, ctk_config, ctk_event);
gtk_object_ref(GTK_OBJECT(child));
gtk_tree_store_set(ctk_window->tree_store, &iter,
CTK_WINDOW_WIDGET_COLUMN, child, -1);
diff --git a/src/libXNVCtrl/NVCtrl.c b/src/libXNVCtrl/NVCtrl.c
index 2372d97..0de10e1 100644
--- a/src/libXNVCtrl/NVCtrl.c
+++ b/src/libXNVCtrl/NVCtrl.c
@@ -577,6 +577,50 @@ static Bool XNVCTRLQueryValidTargetAttributeValues32 (
}
+Bool XNVCTRLQueryValidTargetStringAttributeValues (
+ Display *dpy,
+ int target_type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ NVCTRLAttributeValidValuesRec *values
+){
+ XExtDisplayInfo *info = find_display(dpy);
+ Bool exists;
+ xnvCtrlQueryValidAttributeValuesReply rep;
+ xnvCtrlQueryValidAttributeValuesReq *req;
+
+ if (!values) return False;
+
+ if (!XextHasExtension(info))
+ return False;
+
+ XNVCTRLCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq (nvCtrlQueryValidAttributeValues, req);
+ req->reqType = info->codes->major_opcode;
+ req->nvReqType = X_nvCtrlQueryValidStringAttributeValues;
+ req->target_type = target_type;
+ req->target_id = target_id;
+ req->display_mask = display_mask;
+ req->attribute = attribute;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ exists = rep.flags;
+ if (exists) {
+ values->type = rep.attr_type;
+ values->permissions = rep.perms;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return exists;
+}
+
+
static Bool XNVCTRLQueryValidTargetAttributeValues64 (
Display *dpy,
XExtDisplayInfo *info,
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index 7a4eb80..0fd4211 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -888,9 +888,9 @@
* NV_CTRL_GVO_SDI_SYNC_INPUT_DETECTED to detect what input syncs are
* present.
*
- * (If no analog sync is detected but it is known that a valid
+ * (If no analog sync is detected but it is known that a valid
* bi-level or tri-level sync is connected set
- * NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE appropriately and
+ * NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECT_MODE appropriately and
* retest with NV_CTRL_GVO_COMPOSITE_SYNC_INPUT_DETECTED).
*
* - if syncing to input sync, query the
@@ -989,10 +989,12 @@
* values are reported as bits within a bitmask
* (ATTRIBUTE_TYPE_INT_BITS); unfortunately, there are more valid
* value bits than will fit in a single 32-bit value. To solve this,
- * query the ValidValues for NV_CTRL_GVIO_OUTPUT_VIDEO_FORMAT to check
- * which of the first 31 VIDEO_FORMATS are valid, then query the
- * ValidValues for NV_CTRL_GVIO_OUTPUT_VIDEO_FORMAT2 to check which of
- * the VIDEO_FORMATS with value 32 and higher are valid.
+ * query the ValidValues for NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT to
+ * check which of the first 31 VIDEO_FORMATS are valid, query the
+ * ValidValues for NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2 to check which
+ * of the 32-63 VIDEO_FORMATS are valid, and query the ValidValues of
+ * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3 to check which of the 64-95
+ * VIDEO_FORMATS are valid.
*/
#define NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT 70 /* RW--I */
@@ -1039,6 +1041,29 @@
#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_A_SMPTE274 39
#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_A_SMPTE274 40
#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_A_SMPTE274 41
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_60_00_3G_LEVEL_B_SMPTE274 42
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_60_00_3G_LEVEL_B_SMPTE274 43
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_60_00_3G_LEVEL_B_SMPTE372 44
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_50_00_3G_LEVEL_B_SMPTE274 45
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_50_00_3G_LEVEL_B_SMPTE274 46
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_50_00_3G_LEVEL_B_SMPTE372 47
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_30_00_3G_LEVEL_B_SMPTE274 48
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_30_00_3G_LEVEL_B_SMPTE372 49
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_25_00_3G_LEVEL_B_SMPTE274 50
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_25_00_3G_LEVEL_B_SMPTE372 51
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_24_00_3G_LEVEL_B_SMPTE274 52
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_24_00_3G_LEVEL_B_SMPTE372 53
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_48_00_3G_LEVEL_B_SMPTE274 54
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_48_00_3G_LEVEL_B_SMPTE372 55
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_59_94_3G_LEVEL_B_SMPTE274 56
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_59_94_3G_LEVEL_B_SMPTE274 57
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_59_94_3G_LEVEL_B_SMPTE372 58
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_29_97_3G_LEVEL_B_SMPTE274 59
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_29_97_3G_LEVEL_B_SMPTE372 60
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080P_23_98_3G_LEVEL_B_SMPTE274 61
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048P_23_98_3G_LEVEL_B_SMPTE372 62
+#define NV_CTRL_GVIO_VIDEO_FORMAT_1080I_47_96_3G_LEVEL_B_SMPTE274 63
+#define NV_CTRL_GVIO_VIDEO_FORMAT_2048I_47_96_3G_LEVEL_B_SMPTE372 64
/*
@@ -1260,7 +1285,7 @@
/*
* NV_CTRL_GVO_INPUT_VIDEO_FORMAT_REACQUIRE - must be set for a period
* of about 2 seconds for the new InputVideoFormat to be properly
- * locked to.  In nvidia-settings, we do a reacquire whenever genlock
+ * locked to. In nvidia-settings, we do a reacquire whenever genlock
* or frame lock mode is entered into, when the user clicks the
* "detect" button. This value can be written, but always reads back
* _FALSE.
@@ -1582,10 +1607,10 @@
#define NV_CTRL_XV_SYNC_TO_DISPLAY 226 /* RW- */
/*
- * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2 - this attribute is only intended
- * to be used to query the ValidValues for
- * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT above the first 31 VIDEO_FORMATS.
- * See NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT for details.
+ * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2 - this attribute is only
+ * intended to be used to query the ValidValues for
+ * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT for VIDEO_FORMAT values between
+ * 31 and 63. See NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT for details.
*/
#define NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT2 227 /* ---GI */
@@ -2774,7 +2799,49 @@
#define NV_CTRL_GPU_PCIE_GENERATION1 0x00000001
#define NV_CTRL_GPU_PCIE_GENERATION2 0x00000002
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GPU_PCIE_GENERATION
+/*
+ * NV_CTRL_GVI_BOUND_GPU - Returns the NV_CTRL_TARGET_TYPE_GPU target_id of
+ * the GPU currently bound to the GVI device. Returns -1 if no GPU is
+ * currently bound to the GVI device.
+ */
+#define NV_CTRL_GVI_BOUND_GPU 342 /* R--I */
+
+
+/*
+ * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3 - this attribute is only
+ * intended to be used to query the ValidValues for
+ * NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT for VIDEO_FORMAT values between
+ * 64 and 95. See NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT for details.
+ */
+
+#define NV_CTRL_GVIO_REQUESTED_VIDEO_FORMAT3 343 /* ---GI */
+
+
+/*
+ * NV_CTRL_ACCELERATE_TRAPEZOIDS - Toggles RENDER Trapezoid acceleration
+ */
+
+#define NV_CTRL_ACCELERATE_TRAPEZOIDS 344 /* RW- */
+#define NV_CTRL_ACCELERATE_TRAPEZOIDS_DISABLE 0
+#define NV_CTRL_ACCELERATE_TRAPEZOIDS_ENABLE 1
+
+
+/*
+ * NV_CTRL_GPU_CORES - Returns number of GPU cores supported by the graphics
+ * pipeline.
+ */
+
+#define NV_CTRL_GPU_CORES 345 /* R--G */
+
+
+/*
+ * NV_CTRL_GPU_MEMORY_BUS_WIDTH - Returns memory bus bandwidth on the associated
+ * subdevice.
+ */
+
+#define NV_CTRL_GPU_MEMORY_BUS_WIDTH 346 /* R--G */
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_GPU_MEMORY_BUS_WIDTH
/**************************************************************************/
@@ -3794,6 +3861,7 @@
#define ATTRIBUTE_TYPE_RANGE 4
#define ATTRIBUTE_TYPE_INT_BITS 5
#define ATTRIBUTE_TYPE_64BIT_INTEGER 6
+#define ATTRIBUTE_TYPE_STRING 7
#define ATTRIBUTE_TYPE_READ 0x001
#define ATTRIBUTE_TYPE_WRITE 0x002
diff --git a/src/libXNVCtrl/NVCtrlLib.h b/src/libXNVCtrl/NVCtrlLib.h
index e70b1b8..6636270 100644
--- a/src/libXNVCtrl/NVCtrlLib.h
+++ b/src/libXNVCtrl/NVCtrlLib.h
@@ -399,6 +399,24 @@ Bool XNVCTRLQueryValidTargetAttributeValues (
/*
+ * XNVCTRLQueryValidTargetStringAttributeValues -
+ *
+ * Returns True if the attribute exists. Returns False otherwise. If
+ * XNVCTRLQueryValidTargetStringAttributeValues returns True, values will
+ * indicate the valid values for the specified attribute.
+ */
+
+ Bool XNVCTRLQueryValidTargetStringAttributeValues (
+ Display *dpy,
+ int target_type,
+ int target_id,
+ unsigned int display_mask,
+ unsigned int attribute,
+ NVCTRLAttributeValidValuesRec *values
+);
+
+
+/*
* XNVCTRLSetGvoColorConversion -
*
* Sets the color conversion matrix, offset, and scale that should be
diff --git a/src/libXNVCtrl/nv_control.h b/src/libXNVCtrl/nv_control.h
index ce8b376..2755387 100644
--- a/src/libXNVCtrl/nv_control.h
+++ b/src/libXNVCtrl/nv_control.h
@@ -45,6 +45,8 @@
* SetStringAttribute requests
* 1.20 Added COOLER TargetType
* 1.21 Added initial 64-bit integer attribute support (read-only)
+ * 1.22 Added X_nvCtrlQueryValidStringAttributeValues to check
+ * string attribute permissions.
*/
#ifndef __NVCONTROL_H
@@ -55,7 +57,7 @@
#define NV_CONTROL_NAME "NV-CONTROL"
#define NV_CONTROL_MAJOR 1
-#define NV_CONTROL_MINOR 21
+#define NV_CONTROL_MINOR 22
#define X_nvCtrlQueryExtension 0
#define X_nvCtrlIsNv 1
@@ -85,7 +87,8 @@
#define X_nvCtrlStringOperation 25
#define X_nvCtrlQueryValidAttributeValues64 26
#define X_nvCtrlQueryAttribute64 27
-#define X_nvCtrlLastRequest (X_nvCtrlQueryAttribute64 + 1)
+#define X_nvCtrlQueryValidStringAttributeValues 28
+#define X_nvCtrlLastRequest (X_nvCtrlQueryValidStringAttributeValues + 1)
/* Define 32 bit floats */
@@ -193,7 +196,7 @@ typedef struct {
CARD32 length B32;
CARD32 flags B32;
CARD32 pad3 B32;
- CARD64 value_64;
+ int64_t value_64;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xnvCtrlQueryAttribute64Reply;
@@ -321,8 +324,8 @@ typedef struct {
CARD32 length B32;
CARD32 flags B32;
INT32 attr_type B32;
- CARD64 min_64;
- CARD64 max_64;
+ int64_t min_64;
+ int64_t max_64;
CARD64 bits_64;
CARD32 perms B32;
CARD32 pad1 B32;
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributes.c b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
index 4154807..682ad8f 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributes.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributes.c
@@ -708,15 +708,15 @@ NvCtrlGetValidStringDisplayAttributeValues(NvCtrlAttributeHandle *handle,
NvCtrlAttributePrivateHandle *h;
h = (NvCtrlAttributePrivateHandle *) handle;
- if (val) {
- memset(val, 0, sizeof(NVCTRLAttributeValidValuesRec));
- val->type = ATTRIBUTE_TYPE_UNKNOWN;
- val->permissions = ATTRIBUTE_TYPE_READ | ATTRIBUTE_TYPE_X_SCREEN;
- return NvCtrlSuccess;
- } else {
- return NvCtrlBadArgument;
+ if ((attr >= 0) && (attr <= NV_CTRL_STRING_LAST_ATTRIBUTE)) {
+ if (!h->nv) return NvCtrlMissingExtension;
+ return NvCtrlNvControlGetValidStringDisplayAttributeValues(h,
+ display_mask,
+ attr, val);
}
+ return NvCtrlBadArgument;
+
} /* NvCtrlGetValidStringDisplayAttributeValues() */
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
index 596552f..0733163 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesNvControl.c
@@ -270,6 +270,41 @@ ReturnStatus NvCtrlNvControlGetValidAttributeValues
ReturnStatus
+NvCtrlNvControlGetValidStringDisplayAttributeValues
+ (NvCtrlAttributePrivateHandle *h,
+ unsigned int display_mask,
+ int attr, NVCTRLAttributeValidValuesRec *val)
+{
+ if (attr <= NV_CTRL_STRING_LAST_ATTRIBUTE) {
+ if ((h->nv->major_version > 1) ||
+ ((h->nv->major_version == 1) && (h->nv->minor_version >= 22))) {
+ if (XNVCTRLQueryValidTargetStringAttributeValues (h->dpy,
+ h->target_type,
+ h->target_id,
+ display_mask,
+ attr, val)) {
+ return NvCtrlSuccess;
+ } else {
+ return NvCtrlAttributeNotAvailable;
+ }
+ } else {
+ if (val) {
+ memset(val, 0, sizeof(NVCTRLAttributeValidValuesRec));
+ val->type = ATTRIBUTE_TYPE_STRING;
+ val->permissions = ATTRIBUTE_TYPE_READ | ATTRIBUTE_TYPE_X_SCREEN;
+ return NvCtrlSuccess;
+ } else {
+ return NvCtrlBadArgument;
+ }
+ }
+ }
+
+ return NvCtrlNoAttribute;
+
+} /* NvCtrlNvControlGetValidStringDisplayAttributeValues() */
+
+
+ReturnStatus
NvCtrlNvControlGetStringAttribute (NvCtrlAttributePrivateHandle *h,
unsigned int display_mask,
int attr, char **ptr)
diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
index 70b104f..f82089e 100644
--- a/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
+++ b/src/libXNVCtrlAttributes/NvCtrlAttributesPrivate.h
@@ -266,6 +266,13 @@ ReturnStatus
NvCtrlNvControlGetValidAttributeValues (NvCtrlAttributePrivateHandle *,
unsigned int, int,
NVCTRLAttributeValidValuesRec *);
+
+ReturnStatus
+NvCtrlNvControlGetValidStringDisplayAttributeValues
+ (NvCtrlAttributePrivateHandle *,
+ unsigned int, int,
+ NVCTRLAttributeValidValuesRec *);
+
ReturnStatus
NvCtrlNvControlGetStringAttribute (NvCtrlAttributePrivateHandle *,
unsigned int, int, char **);
diff --git a/src/parse.c b/src/parse.c
index dc63d90..724ff3f 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -110,6 +110,7 @@ AttributeTableEntry attributeTable[] = {
{ "XServerUniqueId", NV_CTRL_X_SERVER_UNIQUE_ID, N, "Returns a pseudo-unique identification number for the X server." },
{ "PixmapCache", NV_CTRL_PIXMAP_CACHE, N, "Controls whether pixmaps are allocated in a cache." },
{ "PixmapCacheRoundSizeKB", NV_CTRL_PIXMAP_CACHE_ROUNDING_SIZE_KB, N, "Controls the number of kilobytes to add to the pixmap cache when there is not enough room." },
+ { "AccelerateTrapezoids", NV_CTRL_ACCELERATE_TRAPEZOIDS, N, "Enable or disable GPU acceleration of RENDER Trapezoids." },
/* OpenGL */
{ "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, 0, "Enables sync to vertical blanking for OpenGL clients. This setting only takes effect on OpenGL clients started after it is set." },
@@ -136,6 +137,8 @@ AttributeTableEntry attributeTable[] = {
{ "BusType", NV_CTRL_BUS_TYPE, 0, "Returns the type of bus connecting the specified device to the computer. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
{ "VideoRam", NV_CTRL_VIDEO_RAM, 0, "Returns the total amount of memory available to the specified GPU (or the GPU driving the specified X screen). Note: if the GPU supports TurboCache(TM), the value reported may exceed the amount of video memory installed on the GPU. The value reported for integrated GPUs may likewise exceed the amount of dedicated system memory set aside by the system BIOS for use by the integrated GPU." },
{ "Irq", NV_CTRL_IRQ, 0, "Returns the interrupt request line used by the specified device. If the target is an X screen, then it uses the GPU driving the X screen as the device." },
+ { "CUDACores", NV_CTRL_GPU_CORES, N, "Returns number of CUDA cores supported by the graphics pipeline." },
+ { "GPUMemoryInterface", NV_CTRL_GPU_MEMORY_BUS_WIDTH, N, "Returns bus bandwidth of the GPU's memory interface." },
{ "GPUCoreTemp", NV_CTRL_GPU_CORE_TEMPERATURE, N, "Reports the current core temperature in Celsius of the GPU driving the X screen." },
{ "GPUAmbientTemp", NV_CTRL_AMBIENT_TEMPERATURE, N, "Reports the current temperature in Celsius of the immediate neighborhood of the GPU driving the X screen." },
{ "GPUOverclockingState", NV_CTRL_GPU_OVERCLOCKING_STATE, N, "The current overclocking state; the value of this attribute controls the availability of additional overclocking attributes. Note that this attribute is unavailable unless overclocking support has been enabled by the system administrator." },
@@ -246,6 +249,7 @@ AttributeTableEntry attributeTable[] = {
{ "GviMaxChannelsPerJack", NV_CTRL_GVI_MAX_CHANNELS_PER_JACK, I|N, "Returns the maximum supported number of channels per single jack on a GVI device." },
{ "GviMaxStreams", NV_CTRL_GVI_MAX_STREAMS, I|N, "Returns the maximum supported number of streams that can be configured on a GVI device." },
{ "GviNumCaptureSurfaces", NV_CTRL_GVI_NUM_CAPTURE_SURFACES, I|N, "Controls the number of capture buffers for storing incoming video from the GVI device." },
+ { "GviBoundGpu", NV_CTRL_GVI_BOUND_GPU, I|N, "Returns the target index of the GPU currently attached to the GVI device." },
/* Display */
{ "Brightness", BRIGHTNESS_VALUE|ALL_CHANNELS, N|C|G, "Controls the overall brightness of the display." },
@@ -322,7 +326,7 @@ AttributeTableEntry attributeTable[] = {
* about.
*/
-#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_PCIE_GENERATION
+#if NV_CTRL_LAST_ATTRIBUTE != NV_CTRL_GPU_MEMORY_BUS_WIDTH
#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 53f98a9..31cc01c 100644
--- a/src/query-assign.c
+++ b/src/query-assign.c
@@ -667,6 +667,10 @@ static void print_valid_values(char *name, int attr, uint32 flags,
#define INDENT " "
switch (valid.type) {
+ case ATTRIBUTE_TYPE_STRING:
+ nv_msg(INDENT, "'%s' is a string attribute.", name);
+ break;
+
case ATTRIBUTE_TYPE_INTEGER:
if (flags & NV_PARSER_TYPE_PACKED_ATTRIBUTE) {
nv_msg(INDENT, "'%s' is a packed integer attribute.", name);
@@ -919,9 +923,9 @@ static void print_additional_info(const char *name,
/*
- * 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
+ * query_all() - loop through all target types, and query all attributes
+ * for those targets. The current attribute values for all display
+ * devices on all targets are printed, along with the valid values for
* each attribute.
*
* If an error occurs, an error message is printed and NV_FALSE is
@@ -930,7 +934,8 @@ static void print_additional_info(const char *name,
static int query_all(const char *display_name)
{
- int bit, entry, screen, val;
+ int bit, entry, target_id, val;
+ int target_type;
uint32 mask;
ReturnStatus status;
AttributeTableEntry *a;
@@ -943,129 +948,131 @@ static int query_all(const char *display_name)
#define INDENT " "
/*
- * For now, we only loop over X screen targets; we could loop over
- * other target types, too, but that would likely be redundant
- * with X screens.
+ * Loop through all target types.
*/
- for (screen = 0; screen < h->targets[X_SCREEN_TARGET].n; screen++) {
+ for (target_type = 0; target_type < MAX_TARGET_TYPES; target_type++) {
+
+ for (target_id = 0; target_id < h->targets[target_type].n; target_id++) {
- t = &h->targets[X_SCREEN_TARGET].t[screen];
+ t = &h->targets[target_type].t[target_id];
- if (!t->h) continue;
+ if (!t->h) continue;
- nv_msg(NULL, "Attributes for %s:", t->name);
+ nv_msg(NULL, "Attributes queryable via %s:", t->name);
- if (!__terse) nv_msg(NULL, "");
+ if (!__terse) nv_msg(NULL, "");
- for (entry = 0; attributeTable[entry].name; entry++) {
+ for (entry = 0; attributeTable[entry].name; entry++) {
- a = &attributeTable[entry];
-
- /* skip the color attributes */
+ a = &attributeTable[entry];
- if (a->flags & NV_PARSER_TYPE_COLOR_ATTRIBUTE) continue;
+ /* skip the color attributes */
- /* skip attributes that shouldn't be queried here */
+ if (a->flags & NV_PARSER_TYPE_COLOR_ATTRIBUTE) continue;
- if (a->flags & NV_PARSER_TYPE_NO_QUERY_ALL) continue;
+ /* skip attributes that shouldn't be queried here */
- for (bit = 0; bit < 24; bit++) {
- mask = 1 << bit;
+ if (a->flags & NV_PARSER_TYPE_NO_QUERY_ALL) continue;
- /*
- * if this bit is not present in the screens's enabled
- * display device mask (and the X screen has enabled
- * display devices), skip to the next bit
- */
+ for (bit = 0; bit < 24; bit++) {
+ mask = 1 << bit;
- if (((t->d & mask) == 0x0) && (t->d)) continue;
-
- if (a->flags & NV_PARSER_TYPE_STRING_ATTRIBUTE) {
- char *tmp_str = NULL;
+ /*
+ * if this bit is not present in the screens's enabled
+ * display device mask (and the X screen has enabled
+ * display devices), skip to the next bit
+ */
- status = NvCtrlGetValidStringDisplayAttributeValues(t->h, mask,
- a->attr, &valid);
+ if (((t->d & mask) == 0x0) && (t->d)) continue;
- if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
+ if (a->flags & NV_PARSER_TYPE_STRING_ATTRIBUTE) {
+ char *tmp_str = NULL;
- if (status != NvCtrlSuccess) {
- nv_error_msg("Error while querying valid values for "
- "attribute '%s' on %s (%s).",
- a->name, t->name,
- NvCtrlAttributesStrError(status));
- goto exit_bit_loop;
- }
+ status = NvCtrlGetValidStringDisplayAttributeValues(t->h, mask,
+ a->attr, &valid);
+ if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
- status = NvCtrlGetStringDisplayAttribute(t->h, mask, a->attr, &tmp_str);
+ if (status != NvCtrlSuccess) {
+ nv_error_msg("Error while querying valid values for "
+ "attribute '%s' on %s (%s).",
+ a->name, t->name,
+ NvCtrlAttributesStrError(status));
+ goto exit_bit_loop;
+ }
+
+ status = NvCtrlGetStringDisplayAttribute(t->h, mask, a->attr, &tmp_str);
- if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
+ if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
- if (status != NvCtrlSuccess) {
- nv_error_msg("Error while querying attribute '%s' "
- "on %s (%s).", a->name, t->name,
- NvCtrlAttributesStrError(status));
- goto exit_bit_loop;
- }
+ if (status != NvCtrlSuccess) {
+ nv_error_msg("Error while querying attribute '%s' "
+ "on %s (%s).", a->name, t->name,
+ NvCtrlAttributesStrError(status));
+ goto exit_bit_loop;
+ }
+
+ if (__terse) {
+ nv_msg(" ", "%s: %s", a->name, tmp_str);
+ } else {
+ nv_msg(" ", "Attribute '%s' (%s%s): %s ",
+ a->name, t->name, "", tmp_str);
+ }
+ free(tmp_str);
+ tmp_str = NULL;
- if (__terse) {
- nv_msg(" ", "%s: %s", a->name, tmp_str);
} else {
- nv_msg(" ", "Attribute '%s' (%s%s): %s ",
- a->name, t->name, "", tmp_str);
+
+ status = NvCtrlGetValidDisplayAttributeValues(t->h, mask, a->attr, &valid);
+
+ if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
+
+ if (status != NvCtrlSuccess) {
+ nv_error_msg("Error while querying valid values for "
+ "attribute '%s' on %s (%s).",
+ a->name, t->name,
+ NvCtrlAttributesStrError(status));
+ goto exit_bit_loop;
+ }
+
+ status = NvCtrlGetDisplayAttribute(t->h, mask, a->attr, &val);
+
+ if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
+
+ if (status != NvCtrlSuccess) {
+ nv_error_msg("Error while querying attribute '%s' "
+ "on %s (%s).", a->name, t->name,
+ NvCtrlAttributesStrError(status));
+ goto exit_bit_loop;
+ }
+
+ print_queried_value(t, &valid, val, a->flags, a->name,
+ mask, INDENT, __terse ?
+ VerboseLevelAbbreviated :
+ VerboseLevelVerbose);
+
}
- free(tmp_str);
- tmp_str = NULL;
+ print_valid_values(a->name, a->attr, a->flags, valid);
- } else {
- status = NvCtrlGetValidDisplayAttributeValues(t->h, mask, a->attr, &valid);
+ if (!__terse) nv_msg(NULL,"");
- if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
-
- if (status != NvCtrlSuccess) {
- nv_error_msg("Error while querying valid values for "
- "attribute '%s' on %s (%s).",
- a->name, t->name,
- NvCtrlAttributesStrError(status));
- goto exit_bit_loop;
+ if (valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
+ continue;
}
- status = NvCtrlGetDisplayAttribute(t->h, mask, a->attr, &val);
+ /* fall through to exit_bit_loop */
- if (status == NvCtrlAttributeNotAvailable) goto exit_bit_loop;
+exit_bit_loop:
- if (status != NvCtrlSuccess) {
- nv_error_msg("Error while querying attribute '%s' "
- "on %s (%s).", a->name, t->name,
- NvCtrlAttributesStrError(status));
- goto exit_bit_loop;
- }
+ bit = 25; /* XXX force us out of the display device loop */
- print_queried_value(t, &valid, val, a->flags, a->name,
- mask, INDENT, __terse ?
- VerboseLevelAbbreviated :
- VerboseLevelVerbose);
+ } /* bit */
- print_valid_values(a->name, a->attr, a->flags, valid);
- }
-
- if (!__terse) nv_msg(NULL,"");
-
- if (valid.permissions & ATTRIBUTE_TYPE_DISPLAY) {
- continue;
- }
-
- /* fall through to exit_bit_loop */
-
- exit_bit_loop:
+ } /* entry */
- bit = 25; /* XXX force us out of the display device loop */
-
- } /* bit */
-
- } /* entry */
-
- } /* screen */
+ } /* target_id */
+
+ } /* target_type */
#undef INDENT