summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/FRAMELOCK.txt101
-rw-r--r--samples/nv-control-targets.c2
-rw-r--r--src/gtk+-2.x/ctkframelock.c134
-rw-r--r--src/gtk+-2.x/ctkgvo.c2
-rw-r--r--src/libXNVCtrl/NVCtrl.c46
-rw-r--r--src/libXNVCtrl/NVCtrl.h68
-rw-r--r--src/libXNVCtrl/libXNVCtrl.abin15984 -> 16256 bytes
-rw-r--r--src/libXNVCtrl/nv_control.h25
8 files changed, 310 insertions, 68 deletions
diff --git a/doc/FRAMELOCK.txt b/doc/FRAMELOCK.txt
index 3e309e6..45db220 100644
--- a/doc/FRAMELOCK.txt
+++ b/doc/FRAMELOCK.txt
@@ -1,11 +1,16 @@
This is a (very) brief summary of some of things that need to be
-done to write a FrameLock NV-CONTROL client.
+done to write a Frame Lock NV-CONTROL client.
+
+
+-------------------------------------------------------------------------------
+Section 1 - Writing a Frame Lock client for NV-CONTROL 1.8 (and earlier)
+
Please see the sample NV-CONTROL clients in the "samples" directory
for basic examples of how to set integer attributes. See the
file ctkframelock.c for a much more involved example of how the
-nvidia-settings utility programs the FrameLock attributes.
+nvidia-settings utility programs the Frame Lock attributes.
The constants referenced below are defined in NVCtrl.h. Please see the
comments in that file for an explanation of each attribute. It may
@@ -15,10 +20,10 @@ is used.
Basic steps:
- Open a Display connection to each X Screen you want to control
- in your FrameLock cluster. Please make sure you have
+ in your Frame Lock cluster. Please make sure you have
priviledges to establish the X connection.
- - Query the NV_CTRL_FRAMELOCK attribute to determine if FrameLock
+ - Query the NV_CTRL_FRAMELOCK attribute to determine if Frame Lock
is supported on each X screen.
- Set NV_CTRL_FRAMELOCK_MASTER to NV_CTRL_FRAMELOCK_MASTER_TRUE on
@@ -44,7 +49,7 @@ Basic steps:
glXQueryFrameCountNV()).
- When you are done, set NV_CTRL_FRAMELOCK_SYNC to
- NV_CTRL_FRAMELOCK_SYNC_DISABLE on each X screen to disable FrameLock.
+ NV_CTRL_FRAMELOCK_SYNC_DISABLE on each X screen to disable Frame Lock.
During operation, you can also query any of these on each X screen:
@@ -60,3 +65,89 @@ During operation, you can also query any of these on each X screen:
(nvidia-settings registers a gtk+ timeout function and queries the
state of these on each X screen every few seconds).
+
+
+-------------------------------------------------------------------------------
+Section 2 - Writing a Frame Lock client for NV-CONTROL 1.9 (and later)
+
+Configuration of Frame Lock has changed in NV-CONTROL 1.9. There are two
+major differences:
+
+ - Display Devices (instead of X Screens) are now selected as the clients &
+ slaves of a Frame Lock group.
+
+ - Frame Lock attributes should now be set/queried on GPUs
+ (NV_CTRL_TARGET_TYPE_GPU) and G-Sync (Frame Lock) devices
+ (NV_CTRL_TARGET_TYPE_FRAMELOCK) using the new NV-CONTROL targeting API.
+
+Please see the sample NV-CONTROL clients in the "samples" directory
+for basic examples of how to use the new targeting API (nv-control-targets.c),
+and a basic Frame Lock client (nv-control-framelock.c). See the file
+ctkframelock.c for a much more involved example of how the nvidia-settings
+utility programs the Frame Lock attributes.
+
+The constants referenced below are defined in NVCtrl.h. Please see the
+comments in that file for an explanation of each attribute. It may
+also be instructive to grep ctkframelock.c to see how each attribute
+is used.
+
+Querying frame lock capabilities of a system:
+
+ - Query the number of G-Sync devices on the system by passing
+ NV_CTRL_TARGET_TYPE_FRAMELOCK to XNVCTRLQueryTargetCount()
+
+ - Query the GPUs attached to each g-sync device by querying the
+ NV_CTRL_GPUS_USING_FRAMELOCK attribute for each g-sync device.
+
+ - Query the enabled (available) display devices on each GPU through
+ the NV_CTRL_ENABLED_DISPLAYS attribute.
+
+Configuring the Frame Lock group (This must be done while Frame Lock Sync is
+disabled on the GPU/G-Sync Device):
+
+ - Set the Frame Lock Master Display Device on one of the GPUs through the
+ NV_CTRL_FRAMELOCK_MASTER attribute.
+
+ - Set the rest of the display devices as slaves through the
+ NV_CTRL_FRAMELOCK_SLAVES attribute.
+
+ - Set NV_CTRL_USE_HOUSE_SYNC to NV_CTRL_USE_HOUSE_SYNC_TRUE or
+ NV_CTRL_USE_HOUSE_SYNC_FALSE on the master g-sync device (this is the
+ g-sync device that is attached to the GPU that contains the display
+ device currently set as the frame lock master.) Depending on whether
+ or not you will be using a House Sync signal.
+
+ - Set NV_CTRL_FRAMELOCK_POLARITY for each slave G-Sync device in the
+ cluster; most likely you want NV_CTRL_FRAMELOCK_POLARITY_RISING_EDGE.
+
+ - Set NV_CTRL_FRAMELOCK_SYNC_DELAY as appropriate for each G-Sync device.
+ Most likely you want 0.
+
+ - Set NV_CTRL_FRAMELOCK_SYNC_INTERVAL as appropriate if you
+ are using house sync. Most likely, you just want 0.
+
+Enabling/Disabling Frame Lock:
+
+ - Enable Frame Lock on each GPU by setting NV_CTRL_FRAMELOCK_SYNC
+ to NV_CTRL_FRAMELOCK_SYNC_ENABLE.
+
+ - (optional) set NV_CTRL_FRAMELOCK_TEST_SIGNAL to
+ NV_CTRL_FRAMELOCK_TEST_SIGNAL_ENABLE followed immediately by
+ NV_CTRL_FRAMELOCK_TEST_SIGNAL_DISABLE (on the GPU that contains the
+ master Frame Lock display device.) This guarantees accuracy of the
+ Universal Frame Count (as returned by glXQueryFrameCountNV()).
+
+ - When you are done, set NV_CTRL_FRAMELOCK_SYNC to
+ NV_CTRL_FRAMELOCK_SYNC_DISABLE on each GPU to disable Frame Lock.
+
+During operation, you can also query any of these on each GPU or Frame Lock
+device:
+
+ NV_CTRL_FRAMELOCK_PORT0_STATUS
+ NV_CTRL_FRAMELOCK_PORT1_STATUS
+ NV_CTRL_FRAMELOCK_HOUSE_STATUS
+ NV_CTRL_FRAMELOCK_SYNC_READY
+ NV_CTRL_FRAMELOCK_STEREO_SYNC
+ NV_CTRL_FRAMELOCK_ETHERNET_DETECTED
+ NV_CTRL_FRAMELOCK_SYNC_RATE
+ NV_CTRL_FRAMELOCK_TIMING
diff --git a/samples/nv-control-targets.c b/samples/nv-control-targets.c
index fd7377a..4d97c58 100644
--- a/samples/nv-control-targets.c
+++ b/samples/nv-control-targets.c
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
/* Enabled Display Devices on GPU */
ret = XNVCTRLQueryTargetAttribute(dpy,
- NV_CTRL_TARGET_TYPE_X_SCREEN,
+ NV_CTRL_TARGET_TYPE_GPU,
gpu, // target_id
0, // display_mask
NV_CTRL_ENABLED_DISPLAYS,
diff --git a/src/gtk+-2.x/ctkframelock.c b/src/gtk+-2.x/ctkframelock.c
index f820a19..4f013d7 100644
--- a/src/gtk+-2.x/ctkframelock.c
+++ b/src/gtk+-2.x/ctkframelock.c
@@ -69,6 +69,39 @@ enum
ENTRY_DATA_DISPLAY
};
+/*
+ * These signals get hooked up (to the gpu_state_received() function)
+ * for all frame lock devices that are included in the list. When the
+ * frame lock device entry is removed, these signals also get removed for
+ * that entry.
+ */
+
+#define NUM_GPU_SIGNALS 4
+
+const char *__GPUSignals[NUM_GPU_SIGNALS] =
+ {
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_MASTER),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SLAVES),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SYNC),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_TEST_SIGNAL)
+ };
+
+/*
+ * These signals get hooked up (to the framelock_state_received() function)
+ * for all frame lock devices that are included in the list. When the
+ * frame lock device entry is removed, these signals also get removed for
+ * that entry.
+ */
+
+#define NUM_FRAMELOCK_SIGNALS 4
+
+const char *__FrameLockSignals[NUM_FRAMELOCK_SIGNALS] =
+ {
+ CTK_EVENT_NAME(NV_CTRL_USE_HOUSE_SYNC),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SYNC_INTERVAL),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_POLARITY),
+ CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_VIDEO_MODE)
+ };
typedef struct _nvListTreeRec nvListTreeRec, *nvListTreePtr;
typedef struct _nvListEntryRec nvListEntryRec, *nvListEntryPtr;
@@ -154,6 +187,9 @@ struct _nvGPUDataRec {
guint clients_mask;
gboolean enabled; /* Sync enabled */
+ /* Signal Handler IDs */
+ gulong signal_ids[NUM_GPU_SIGNALS];
+
GtkWidget *label;
};
@@ -161,6 +197,9 @@ struct _nvFrameLockDataRec {
gpointer handle; /* NV-CONTROL Frame Lock Target */
+ /* Signal Handler IDs */
+ gulong signal_ids[NUM_FRAMELOCK_SIGNALS];
+
GtkWidget *label;
GtkWidget *receiving_label;
@@ -1566,6 +1605,9 @@ static nvListEntryPtr list_entry_new(void)
*/
static void list_entry_free(nvListEntryPtr entry)
{
+ int i;
+
+
if (!entry) {
return;
}
@@ -1577,6 +1619,34 @@ static void list_entry_free(nvListEntryPtr entry)
gtk_widget_destroy(entry->vp);
*/
+ /* Remove signal callbacks */
+ if (entry->data_type == ENTRY_DATA_GPU) {
+
+ nvGPUDataPtr data = (nvGPUDataPtr) entry->data;
+
+ for (i = 0; i < NUM_GPU_SIGNALS; i++) {
+ if (g_signal_handler_is_connected(G_OBJECT(entry->ctk_event),
+ data->signal_ids[i])) {
+ g_signal_handler_disconnect(G_OBJECT(entry->ctk_event),
+ data->signal_ids[i]);
+ }
+ }
+
+ } else if (entry->data_type == ENTRY_DATA_FRAMELOCK) {
+
+ nvFrameLockDataPtr data = (nvFrameLockDataPtr) entry->data;
+
+ for (i = 0; i < NUM_FRAMELOCK_SIGNALS; i++) {
+ if (g_signal_handler_is_connected(G_OBJECT(entry->ctk_event),
+ data->signal_ids[i])) {
+ g_signal_handler_disconnect(G_OBJECT(entry->ctk_event),
+ data->signal_ids[i]);
+ }
+ }
+ }
+
+ /* XXX We should probably free/destroy the ctk_event objects here */
+
free(entry);
}
@@ -1670,7 +1740,7 @@ static void list_entry_associate(nvListEntryPtr entry, nvListTreePtr tree)
}
/* Remove references to the entry from the old tree */
- if (entry->tree && entry->tree != tree) {
+ if (entry->tree && (entry->tree != tree)) {
/* Unselect ourself */
if (entry == entry->tree->selected_entry) {
@@ -1683,10 +1753,13 @@ static void list_entry_associate(nvListEntryPtr entry, nvListTreePtr tree)
}
}
- /* Associate entry's children to the new tree */
+ /* Associate entry to the new tree */
entry->tree = tree;
+
+ /* Associate entry's children to the new tree */
child = entry->children;
while ( child ) {
+
list_entry_associate(child, tree);
child = child->next_sibling;
}
@@ -3270,7 +3343,6 @@ static void gpu_state_received(GtkObject *object,
gboolean sensitive;
gboolean checked;
-
switch (event->attribute) {
case NV_CTRL_FRAMELOCK_MASTER:
@@ -4473,6 +4545,8 @@ static unsigned int add_gpu_devices(CtkFramelock *ctk_framelock,
/* Add Displays tied to this GPU */
displays_added = add_display_devices(ctk_framelock, entry);
if (displays_added) {
+ int i;
+
list_entry_add_child(framelock_entry, entry);
/* Check to see if we should reflect in the GUI that
@@ -4486,26 +4560,14 @@ static unsigned int add_gpu_devices(CtkFramelock *ctk_framelock,
}
entry->ctk_event = CTK_EVENT(ctk_event_new(gpu_data->handle));
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_MASTER),
- G_CALLBACK(gpu_state_received),
- (gpointer) entry);
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SLAVES),
- G_CALLBACK(gpu_state_received),
- (gpointer) entry);
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SYNC),
- G_CALLBACK(gpu_state_received),
- (gpointer) entry);
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_TEST_SIGNAL),
- G_CALLBACK(gpu_state_received),
- (gpointer) entry);
+ for (i = 0; i < NUM_GPU_SIGNALS; i++) {
+ gpu_data->signal_ids[i] =
+ g_signal_connect(G_OBJECT(entry->ctk_event),
+ __GPUSignals[i],
+ G_CALLBACK(gpu_state_received),
+ (gpointer) entry);
+ }
gpus_added++;
} else {
@@ -4627,31 +4689,21 @@ static unsigned int add_framelock_devices(CtkFramelock *ctk_framelock,
/* Add GPUs tied to this G-Sync */
gpus_added = add_gpu_devices(ctk_framelock, entry);
if (gpus_added) {
+ int i;
+
list_tree_add_entry((nvListTreePtr)(ctk_framelock->tree),
entry);
entry->ctk_event =
CTK_EVENT(ctk_event_new(framelock_data->handle));
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_USE_HOUSE_SYNC),
- G_CALLBACK(framelock_state_received),
- (gpointer) entry);
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_SYNC_INTERVAL),
- G_CALLBACK(framelock_state_received),
- (gpointer) entry);
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_POLARITY),
- G_CALLBACK(framelock_state_received),
- (gpointer) entry);
-
- g_signal_connect(G_OBJECT(entry->ctk_event),
- CTK_EVENT_NAME(NV_CTRL_FRAMELOCK_VIDEO_MODE),
- G_CALLBACK(framelock_state_received),
- (gpointer) entry);
+ for (i = 0; i < NUM_FRAMELOCK_SIGNALS; i++) {
+ framelock_data->signal_ids[i] =
+ g_signal_connect(G_OBJECT(entry->ctk_event),
+ __FrameLockSignals[i],
+ G_CALLBACK(framelock_state_received),
+ (gpointer) entry);
+ }
framelocks_added++;
} else {
diff --git a/src/gtk+-2.x/ctkgvo.c b/src/gtk+-2.x/ctkgvo.c
index 697307e..93f624c 100644
--- a/src/gtk+-2.x/ctkgvo.c
+++ b/src/gtk+-2.x/ctkgvo.c
@@ -286,7 +286,7 @@ static FormatDetails videoFormatDetails[] = {
static const FormatName dataFormatNames[] = {
{ NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_YCRCB444, "RGB -> YCrCb (4:4:4)" },
{ NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_YCRCB422, "RGB -> YCrCb (4:2:2)" },
- { NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_RGB444, "RGB (4:4:4)" },
+ { NV_CTRL_GVO_DATA_FORMAT_X8X8X8_444_PASSTHRU,"RGB (4:4:4)" },
{ -1, NULL },
};
diff --git a/src/libXNVCtrl/NVCtrl.c b/src/libXNVCtrl/NVCtrl.c
index 38fa737..78fe373 100644
--- a/src/libXNVCtrl/NVCtrl.c
+++ b/src/libXNVCtrl/NVCtrl.c
@@ -18,6 +18,9 @@
#include "NVCtrlLib.h"
#include "nv_control.h"
+#define NVCTRL_EXT_NEED_CHECK (XPointer)(~0)
+#define NVCTRL_EXT_NEED_NOTHING (XPointer)(0)
+#define NVCTRL_EXT_NEED_TARGET_SWAP (XPointer)(1)
static XExtensionInfo _nvctrl_ext_info_data;
static XExtensionInfo *nvctrl_ext_info = &_nvctrl_ext_info_data;
@@ -47,10 +50,46 @@ static /* const */ XExtensionHooks nvctrl_extension_hooks = {
static XEXT_GENERATE_FIND_DISPLAY (find_display, nvctrl_ext_info,
nvctrl_extension_name,
&nvctrl_extension_hooks,
- NV_CONTROL_EVENTS, NULL)
+ NV_CONTROL_EVENTS, NVCTRL_EXT_NEED_CHECK)
static XEXT_GENERATE_CLOSE_DISPLAY (close_display, nvctrl_ext_info)
+/*
+ * NV-CONTROL versions 1.8 and 1.9 pack the target_type and target_id
+ * fields in reversed order. In order to talk to one of these servers,
+ * we need to swap these fields.
+ */
+static void XNVCTRLCheckTargetData(Display *dpy, XExtDisplayInfo *info,
+ int *target_type, int *target_id)
+{
+ /* Find out what the server's NV-CONTROL version is and
+ * setup for swapping if we need to.
+ */
+ if (info->data == NVCTRL_EXT_NEED_CHECK) {
+ int major, minor;
+
+ if (XNVCTRLQueryVersion(dpy, &major, &minor)) {
+ if (major == 1 &&
+ (minor == 8 || minor == 9)) {
+ info->data = NVCTRL_EXT_NEED_TARGET_SWAP;
+ } else {
+ info->data = NVCTRL_EXT_NEED_NOTHING;
+ }
+ } else {
+ info->data = NVCTRL_EXT_NEED_NOTHING;
+ }
+ }
+
+ /* We need to swap the target_type and target_id */
+ if (info->data == NVCTRL_EXT_NEED_TARGET_SWAP) {
+ int tmp;
+ tmp = *target_type;
+ *target_type = *target_id;
+ *target_id = tmp;
+ }
+}
+
+
Bool XNVCTRLQueryExtension (
Display *dpy,
int *event_basep,
@@ -173,6 +212,7 @@ void XNVCTRLSetTargetAttribute (
xnvCtrlSetAttributeReq *req;
XNVCTRLSimpleCheckExtension (dpy, info);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlSetAttribute, req);
@@ -255,6 +295,7 @@ Bool XNVCTRLQueryTargetAttribute (
return False;
XNVCTRLCheckExtension (dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlQueryAttribute, req);
@@ -308,6 +349,7 @@ Bool XNVCTRLQueryTargetStringAttribute (
return False;
XNVCTRLCheckExtension (dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlQueryStringAttribute, req);
@@ -417,6 +459,7 @@ Bool XNVCTRLQueryValidTargetAttributeValues (
return False;
XNVCTRLCheckExtension (dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlQueryValidAttributeValues, req);
@@ -1108,6 +1151,7 @@ Bool XNVCTRLQueryTargetBinaryData (
return False;
XNVCTRLCheckExtension (dpy, info, False);
+ XNVCTRLCheckTargetData(dpy, info, &target_type, &target_id);
LockDisplay (dpy);
GetReq (nvCtrlQueryBinaryData, req);
diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h
index 716673b..86a819c 100644
--- a/src/libXNVCtrl/NVCtrl.h
+++ b/src/libXNVCtrl/NVCtrl.h
@@ -976,6 +976,13 @@
* NV_CTRL_GVO_DATA_FORMAT - This controls how the data in the source
* (either the X screen or the GLX pbuffer) is interpretted and
* displayed.
+ *
+ * Note: some of the below DATA_FORMATS have been renamed. For
+ * example, R8G8B8_TO_RGB444 has been renamed to X8X8X8_444_PASSTHRU.
+ * This is to more accurately reflect DATA_FORMATS where the
+ * per-channel data could be either RGB or YCrCb -- the point is that
+ * the driver and GVO hardware do not perform any implicit color space
+ * conversion on the data; it is passed through to the SDI out.
*/
#define NV_CTRL_GVO_DATA_FORMAT 72 /* RW- */
@@ -985,20 +992,37 @@
#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_YCRCB422 3
#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_YCRCBA4224 4
#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_YCRCBZ4224 5
-#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_RGB444 6
-#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_RGBA4444 7
-#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_RGBZ4444 8
-#define NV_CTRL_GVO_DATA_FORMAT_Y10CR10CB10_TO_YCRCB444 9
-#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8_TO_YCRCB444 10
-#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8A10_TO_YCRCBA4444 11
-#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8Z10_TO_YCRCBZ4444 12
+#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8_TO_RGB444 6 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8_444_PASSTHRU 6
+#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8A8_TO_RGBA4444 7 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8A8_4444_PASSTHRU 7
+#define NV_CTRL_GVO_DATA_FORMAT_R8G8B8Z10_TO_RGBZ4444 8 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8Z8_4444_PASSTHRU 8
+#define NV_CTRL_GVO_DATA_FORMAT_Y10CR10CB10_TO_YCRCB444 9 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X10X10X10_444_PASSTHRU 9
+#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8_TO_YCRCB444 10 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8_444_PASSTHRU 10
+#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8A10_TO_YCRCBA4444 11 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8A10_4444_PASSTHRU 11
+#define NV_CTRL_GVO_DATA_FORMAT_Y10CR8CB8Z10_TO_YCRCBZ4444 12 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8Z10_4444_PASSTHRU 12
#define NV_CTRL_GVO_DATA_FORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422 13
-#define NV_CTRL_GVO_DATA_FORMAT_DUAL_Y8CR8CB8_TO_DUAL_YCRCB422 14
+#define NV_CTRL_GVO_DATA_FORMAT_DUAL_Y8CR8CB8_TO_DUAL_YCRCB422 14 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU 14
#define NV_CTRL_GVO_DATA_FORMAT_R10G10B10_TO_YCRCB422 15
#define NV_CTRL_GVO_DATA_FORMAT_R10G10B10_TO_YCRCB444 16
-#define NV_CTRL_GVO_DATA_FORMAT_Y12CR12CB12_TO_YCRCB444 17
+#define NV_CTRL_GVO_DATA_FORMAT_Y12CR12CB12_TO_YCRCB444 17 // renamed
+#define NV_CTRL_GVO_DATA_FORMAT_X12X12X12_444_PASSTHRU 17
#define NV_CTRL_GVO_DATA_FORMAT_R12G12B12_TO_YCRCB444 18
-
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8_422_PASSTHRU 19
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8A8_4224_PASSTHRU 20
+#define NV_CTRL_GVO_DATA_FORMAT_X8X8X8Z8_4224_PASSTHRU 21
+#define NV_CTRL_GVO_DATA_FORMAT_X10X10X10_422_PASSTHRU 22
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8_422_PASSTHRU 23
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8A10_4224_PASSTHRU 24
+#define NV_CTRL_GVO_DATA_FORMAT_X10X8X8Z10_4224_PASSTHRU 25
+#define NV_CTRL_GVO_DATA_FORMAT_X12X12X12_422_PASSTHRU 26
+#define NV_CTRL_GVO_DATA_FORMAT_R12G12B12_TO_YCRCB422 27
/*
* NV_CTRL_GVO_DISPLAY_X_SCREEN - enable/disable GVO output of the X
@@ -2696,7 +2720,29 @@
#define NV_CTRL_REFRESH_RATE 235 /* R-DG */
-#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_REFRESH_RATE
+
+/*
+ * NV_CTRL_GVO_FLIP_QUEUE_SIZE - The Graphics to Video Out interface
+ * exposed through NV-CONTROL and the GLX_NV_video_out extension uses
+ * an internal flip queue when pbuffers are sent to the video device
+ * (via glXSendPbufferToVideoNV()). The NV_CTRL_GVO_FLIP_QUEUE_SIZE
+ * can be used to query and assign the flip queue size. This
+ * attribute is applied to GLX when glXGetVideoDeviceNV() is called by
+ * the application.
+ */
+
+#define NV_CTRL_GVO_FLIP_QUEUE_SIZE 236 /* RW- */
+
+
+/*
+ * NV_CTRL_CURRENT_SCANLINE - query the current scanline for the
+ * specified display device.
+ */
+
+#define NV_CTRL_CURRENT_SCANLINE 237 /* R-D */
+
+
+#define NV_CTRL_LAST_ATTRIBUTE NV_CTRL_CURRENT_SCANLINE
/**************************************************************************/
diff --git a/src/libXNVCtrl/libXNVCtrl.a b/src/libXNVCtrl/libXNVCtrl.a
index 65f789f..3c0a6fb 100644
--- a/src/libXNVCtrl/libXNVCtrl.a
+++ b/src/libXNVCtrl/libXNVCtrl.a
Binary files differ
diff --git a/src/libXNVCtrl/nv_control.h b/src/libXNVCtrl/nv_control.h
index 0ee7ee0..e595918 100644
--- a/src/libXNVCtrl/nv_control.h
+++ b/src/libXNVCtrl/nv_control.h
@@ -6,7 +6,7 @@
#define NV_CONTROL_NAME "NV-CONTROL"
#define NV_CONTROL_MAJOR 1
-#define NV_CONTROL_MINOR 9
+#define NV_CONTROL_MINOR 10
#define X_nvCtrlQueryExtension 0
#define X_nvCtrlIsNv 1
@@ -113,8 +113,8 @@ typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16; /* X screen or GPU */
CARD16 target_id B16; /* X screen number or GPU number */
+ CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryAttributeReq;
@@ -138,8 +138,8 @@ typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16;
CARD16 target_id B16;
+ CARD16 target_type B16;
CARD32 display_mask B32;
CARD32 attribute B32;
INT32 value B32;
@@ -175,8 +175,8 @@ typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16; /* X screen or GPU */
CARD16 target_id B16; /* X screen number or GPU number */
+ CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryStringAttributeReq;
@@ -226,8 +226,8 @@ typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16; /* X screen or GPU */
CARD16 target_id B16; /* X screen number or GPU number */
+ CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryValidAttributeValuesReq;
@@ -576,8 +576,8 @@ typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16; /* X screen or GPU */
CARD16 target_id B16; /* X screen number or GPU number */
+ CARD16 target_type B16; /* X screen or GPU */
CARD32 display_mask B32;
CARD32 attribute B32;
} xnvCtrlQueryBinaryDataReq;
@@ -631,11 +631,20 @@ typedef struct {
} xnvctrlEvent;
+/*
+ * Leave target_type before target_id for the
+ * xnvCtrlSelectTargetNotifyReq and xnvctrlEventTarget
+ * structures, even though other request protocol structures
+ * store target_id in the bottom 16-bits of the second DWORD of the
+ * structures. The event-related structures were added in version
+ * 1.8, and so there is no prior version with which to maintain
+ * compatibility.
+ */
typedef struct {
CARD8 reqType;
CARD8 nvReqType;
CARD16 length B16;
- CARD16 target_type B16;
+ CARD16 target_type B16; /* Don't swap these */
CARD16 target_id B16;
CARD16 notifyType B16;
CARD16 onoff B16;
@@ -654,7 +663,7 @@ typedef struct {
BYTE detail;
CARD16 sequenceNumber B16;
CARD32 time B32;
- CARD16 target_type B16;
+ CARD16 target_type B16; /* Don't swap these */
CARD16 target_id B16;
CARD32 display_mask B32;
CARD32 attribute B32;