summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-12 21:28:56 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-12 21:28:56 -0800
commit23b4d0c3275907d31f15292232286cafcaea6b7b (patch)
treef1a61b9b833974030c333ec5b14abb1dea378358 /src
parent9cec52adf6e908620eeb819927b7395734e47f09 (diff)
1.0-87621.0-8762
Diffstat (limited to 'src')
-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
6 files changed, 213 insertions, 62 deletions
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;