diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2012-03-22 11:32:57 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2012-03-22 11:32:57 -0700 |
commit | 6b333953abd714430148c8141579a48c310dbcc2 (patch) | |
tree | 1e466c869c56738751f3a2e4e86d924aa5d1dc4e | |
parent | b5a380e1f99cfd386a29d0b91ee63972c6d774b4 (diff) |
295.33295.33
-rw-r--r-- | src/gtk+-2.x/ctkdisplaydevice-dfp.c | 129 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkdisplaydevice-dfp.h | 1 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkevent.c | 15 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkevent.h | 2 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkimagesliders.c | 25 | ||||
-rw-r--r-- | src/libXNVCtrl/NVCtrl.h | 8 | ||||
-rw-r--r-- | version.mk | 2 |
7 files changed, 103 insertions, 79 deletions
diff --git a/src/gtk+-2.x/ctkdisplaydevice-dfp.c b/src/gtk+-2.x/ctkdisplaydevice-dfp.c index ddf559f..cd20c87 100644 --- a/src/gtk+-2.x/ctkdisplaydevice-dfp.c +++ b/src/gtk+-2.x/ctkdisplaydevice-dfp.c @@ -1022,6 +1022,73 @@ GtkTextBuffer *ctk_display_device_dfp_create_help(GtkTextTagTable *table, } /* ctk_display_device_dfp_create_help() */ +static void update_link(CtkDisplayDeviceDfp *ctk_display_device_dfp) +{ + ReturnStatus ret; + gint val, signal_type = ctk_display_device_dfp->signal_type; + const char *link = "Unknown"; + char tmp[32]; + + ret = + NvCtrlGetDisplayAttribute(ctk_display_device_dfp->handle, + ctk_display_device_dfp->display_device_mask, + NV_CTRL_FLATPANEL_LINK, &val); + if (ret == NvCtrlSuccess) { + if (signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) { + int lanes; + + lanes = val + 1; + + ret = + NvCtrlGetDisplayAttribute(ctk_display_device_dfp->handle, + ctk_display_device_dfp->display_device_mask, + NV_CTRL_DISPLAYPORT_LINK_RATE, &val); + if (ret == NvCtrlSuccess && val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED) { + link = "Disabled"; + } else { + const char *bw = "unknown bandwidth"; + + if (ret == NvCtrlSuccess) { + switch (val) { + case NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS: + bw = "1.62 Gbps"; + break; + case NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS: + bw = "2.70 Gbps"; + break; + } + } + + snprintf(tmp, 32, "%d lane%s @ %s", lanes, lanes == 1 ? "" : "s", + bw); + link = tmp; + } + } else { + // LVDS or TMDS + switch(val) { + case NV_CTRL_FLATPANEL_LINK_SINGLE: + link = "Single"; + break; + case NV_CTRL_FLATPANEL_LINK_DUAL: + link = "Dual"; + break; + } + } + } + + gtk_label_set_text + (GTK_LABEL(ctk_display_device_dfp->txt_link), link); +} + + +static void callback_link_changed(GtkObject *object, gpointer arg1, + gpointer user_data) +{ + CtkDisplayDeviceDfp *ctk_display_device_dfp = + CTK_DISPLAY_DEVICE_DFP(user_data); + + update_link(ctk_display_device_dfp); +} /* * dfp_info_setup() - @@ -1031,10 +1098,10 @@ GtkTextBuffer *ctk_display_device_dfp_create_help(GtkTextTagTable *table, static void dfp_info_setup(CtkDisplayDeviceDfp *ctk_display_device_dfp) { ReturnStatus ret; - gint val, signal_type, gpu_scaling, dfp_scaling; + gint val, gpu_scaling, dfp_scaling; char *chip_location, *link, *signal; char *scaling; - char tmp[32]; + CtkEvent *ctk_event = ctk_display_device_dfp->ctk_event; chip_location = link = signal = "Unknown"; scaling = "Unknown"; @@ -1079,59 +1146,21 @@ static void dfp_info_setup(CtkDisplayDeviceDfp *ctk_display_device_dfp) } gtk_label_set_text (GTK_LABEL(ctk_display_device_dfp->txt_signal), signal); - signal_type = val; + ctk_display_device_dfp->signal_type = val; /* Link */ - ret = - NvCtrlGetDisplayAttribute(ctk_display_device_dfp->handle, - ctk_display_device_dfp->display_device_mask, - NV_CTRL_FLATPANEL_LINK, &val); - if (ret == NvCtrlSuccess) { - if (signal_type == NV_CTRL_FLATPANEL_SIGNAL_DISPLAYPORT) { - int lanes; - - lanes = val + 1; - - ret = - NvCtrlGetDisplayAttribute(ctk_display_device_dfp->handle, - ctk_display_device_dfp->display_device_mask, - NV_CTRL_DISPLAYPORT_LINK_RATE, &val); - if (ret == NvCtrlSuccess && val == NV_CTRL_DISPLAYPORT_LINK_RATE_DISABLED) { - link = "Disabled"; - } else { - char *bw = "unknown bandwidth"; - - if (ret == NvCtrlSuccess) { - switch (val) { - case NV_CTRL_DISPLAYPORT_LINK_RATE_1_62GBPS: - bw = "1.62 Gbps"; - break; - case NV_CTRL_DISPLAYPORT_LINK_RATE_2_70GBPS: - bw = "2.70 Gbps"; - break; - } - } + g_signal_connect(G_OBJECT(ctk_event), + CTK_EVENT_NAME(NV_CTRL_FLATPANEL_LINK), + G_CALLBACK(callback_link_changed), + (gpointer) ctk_display_device_dfp); - snprintf(tmp, 32, "%d lane%s @ %s", lanes, lanes == 1 ? "" : "s", - bw); - link = tmp; - } - } else { - // LVDS or TMDS - switch(val) { - case NV_CTRL_FLATPANEL_LINK_SINGLE: - link = "Single"; - break; - case NV_CTRL_FLATPANEL_LINK_DUAL: - link = "Dual"; - break; - } - } - } - gtk_label_set_text - (GTK_LABEL(ctk_display_device_dfp->txt_link), link); + g_signal_connect(G_OBJECT(ctk_event), + CTK_EVENT_NAME(NV_CTRL_DISPLAYPORT_LINK_RATE), + G_CALLBACK(callback_link_changed), + (gpointer) ctk_display_device_dfp); + update_link(ctk_display_device_dfp); /* Native Resolution */ diff --git a/src/gtk+-2.x/ctkdisplaydevice-dfp.h b/src/gtk+-2.x/ctkdisplaydevice-dfp.h index 7ccd108..7286a95 100644 --- a/src/gtk+-2.x/ctkdisplaydevice-dfp.h +++ b/src/gtk+-2.x/ctkdisplaydevice-dfp.h @@ -85,6 +85,7 @@ struct _CtkDisplayDeviceDfp char *name; gint default_scaling_target; gint default_scaling_method; + gint signal_type; }; struct _CtkDisplayDeviceDfpClass diff --git a/src/gtk+-2.x/ctkevent.c b/src/gtk+-2.x/ctkevent.c index e174d46..296d07b 100644 --- a/src/gtk+-2.x/ctkevent.c +++ b/src/gtk+-2.x/ctkevent.c @@ -28,6 +28,8 @@ * NV-CONTROL -> event -> glib -> CtkEvent -> signal -> GUI */ +#include <string.h> + #include <gtk/gtk.h> #include <X11/Xlib.h> /* Xrandr */ @@ -205,6 +207,7 @@ static void ctk_event_class_init(CtkEventClass *ctk_event_class) MAKE_SIGNAL(NV_CTRL_GPU_3D_CLOCK_FREQS); MAKE_SIGNAL(NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS); MAKE_SIGNAL(NV_CTRL_GPU_OPTIMAL_CLOCK_FREQS_DETECTION_STATE); + MAKE_SIGNAL(NV_CTRL_FLATPANEL_LINK); MAKE_SIGNAL(NV_CTRL_USE_HOUSE_SYNC); MAKE_SIGNAL(NV_CTRL_IMAGE_SETTINGS); MAKE_SIGNAL(NV_CTRL_XINERAMA_STEREO); @@ -611,6 +614,8 @@ static gboolean ctk_event_dispatch(GSource *source, CtkEventSource *event_source = (CtkEventSource *) source; CtkEventStruct event_struct; + memset(&event_struct, 0, sizeof(event_struct)); + /* * if ctk_event_dispatch() is called, then either * ctk_event_prepare() or ctk_event_check() returned TRUE, so we @@ -638,7 +643,6 @@ static gboolean ctk_event_dispatch(GSource *source, event_struct.attribute = nvctrlevent->attribute; event_struct.value = nvctrlevent->value; event_struct.display_mask = nvctrlevent->display_mask; - event_struct.availability = TRUE; /* * XXX Is emitting a signal with g_signal_emit() really @@ -672,8 +676,7 @@ static gboolean ctk_event_dispatch(GSource *source, event_struct.attribute = nvctrlevent->attribute; event_struct.value = nvctrlevent->value; event_struct.display_mask = nvctrlevent->display_mask; - event_struct.availability = TRUE; - + /* * XXX Is emitting a signal with g_signal_emit() really * the "correct" way of dispatching the event? @@ -707,8 +710,8 @@ static gboolean ctk_event_dispatch(GSource *source, event_struct.attribute = nvctrlevent->attribute; event_struct.value = nvctrlevent->value; event_struct.display_mask = nvctrlevent->display_mask; - event_struct.availability = nvctrlevent->availability; - + event_struct.is_availability_changed = TRUE; + /* * XXX Is emitting a signal with g_signal_emit() really * the "correct" way of dispatching the event? @@ -739,7 +742,6 @@ static gboolean ctk_event_dispatch(GSource *source, event_struct.attribute = nvctrlevent->attribute; event_struct.value = 0; event_struct.display_mask = nvctrlevent->display_mask; - event_struct.availability = TRUE; /* * XXX Is emitting a signal with g_signal_emit() really * the "correct" way of dispatching the event @@ -769,7 +771,6 @@ static gboolean ctk_event_dispatch(GSource *source, event_struct.attribute = nvctrlevent->attribute; event_struct.value = 0; event_struct.display_mask = nvctrlevent->display_mask; - event_struct.availability = TRUE; /* * XXX Is emitting a signal with g_signal_emit() really * the "correct" way of dispatching the event diff --git a/src/gtk+-2.x/ctkevent.h b/src/gtk+-2.x/ctkevent.h index 2f4232b..61ecdca 100644 --- a/src/gtk+-2.x/ctkevent.h +++ b/src/gtk+-2.x/ctkevent.h @@ -64,7 +64,7 @@ struct _CtkEventStruct gint attribute; gint value; guint display_mask; - gboolean availability; + gboolean is_availability_changed; }; GType ctk_event_get_type (void) G_GNUC_CONST; diff --git a/src/gtk+-2.x/ctkimagesliders.c b/src/gtk+-2.x/ctkimagesliders.c index afb2a7f..fb6a190 100644 --- a/src/gtk+-2.x/ctkimagesliders.c +++ b/src/gtk+-2.x/ctkimagesliders.c @@ -398,30 +398,15 @@ static void scale_value_received(GtkObject *object, gpointer arg1, break; case NV_CTRL_IMAGE_SHARPENING: scale = ctk_image_sliders->image_sharpening; - if (event_struct->availability == FALSE) { - gtk_widget_set_sensitive(scale, FALSE); - g_object_set_data(G_OBJECT(CTK_SCALE(scale)->gtk_adjustment), - "attribute active", - GINT_TO_POINTER(0)); - } else if (event_struct->availability == TRUE) { - setup_scale(ctk_image_sliders, NV_CTRL_IMAGE_SHARPENING, - ctk_image_sliders->image_sharpening); - gtk_widget_set_sensitive(scale, TRUE); - g_object_set_data(G_OBJECT(CTK_SCALE(scale)->gtk_adjustment), - "attribute active", - GINT_TO_POINTER(1)); - /* In case of image sharpening slider here we are syncing to the - * recent image sharpening value, so updating status bar message */ - post_scale_value_changed(CTK_SCALE(scale)->gtk_adjustment, - ctk_image_sliders, - gtk_adjustment_get_value( - CTK_SCALE(scale)->gtk_adjustment)); - } break; default: return; } - + + if (event_struct->is_availability_changed) { + setup_scale(ctk_image_sliders, event_struct->attribute, scale); + } + adj = CTK_SCALE(scale)->gtk_adjustment; val = gtk_adjustment_get_value(GTK_ADJUSTMENT(adj)); diff --git a/src/libXNVCtrl/NVCtrl.h b/src/libXNVCtrl/NVCtrl.h index 1c848d9..b04a21d 100644 --- a/src/libXNVCtrl/NVCtrl.h +++ b/src/libXNVCtrl/NVCtrl.h @@ -1230,6 +1230,10 @@ * attribute. When NV_CTRL_GVO_DISPLAY_X_SCREEN is enabled, * the GVO device will be locked by NV_CTRL_GVO_LOCK_OWNER_CLONE. * see NV_CTRL_GVO_LOCK_OWNER for detais. + * + * NOTE: This attribute is deprecated and will be removed in a future release. + * To display an X screen over GVO, it is recommended to instead + * configure GVO via MetaModes. */ #define NV_CTRL_GVO_DISPLAY_X_SCREEN 73 /* RW- */ @@ -1385,6 +1389,10 @@ * GVO output is enabled, or before enabling GVO output. The pan * values will be clamped so that GVO output is not panned beyond the * end of the X screen. + * + * NOTE: These attributes are deprecated and will be removed in a future + * release. To display an X screen over GVO, it is recommended to + * instead configure GVO via MetaModes. */ #define NV_CTRL_GVO_X_SCREEN_PAN_X 86 /* RW- */ @@ -1 +1 @@ -NVIDIA_VERSION = 295.20 +NVIDIA_VERSION = 295.33 |