diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2008-02-12 21:08:13 -0800 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2008-02-12 21:08:13 -0800 |
commit | 6cd67d6641a91e0a1d680f8821c28188c0491fc4 (patch) | |
tree | 1f723a1e4d6ddf733e13f92cb7581339baa0575a | |
parent | 014e25b8ac7d68d70cb9110c59cdad0508879b82 (diff) |
1.0-71821.0-7182
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | samples/Makefile | 9 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkglx.c | 24 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkhelp.c | 9 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkhelp.h | 7 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkmultisample.c | 30 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkwindow.c | 24 | ||||
-rw-r--r-- | src/gtk+-2.x/ctkwindow.h | 3 | ||||
-rw-r--r-- | src/image_data/crt.h | 21 | ||||
-rw-r--r-- | src/image_data/image.c | 2 | ||||
-rw-r--r-- | src/image_data/image.h | 2 | ||||
-rw-r--r-- | src/libXNVCtrl/libXNVCtrl.a | bin | 6624 -> 6624 bytes | |||
-rw-r--r-- | src/libXNVCtrl/nv_control.h | 2 | ||||
-rw-r--r-- | src/libXNVCtrlAttributes/NvCtrlAttributesXv.c | 3 | ||||
-rw-r--r-- | src/parse.c | 15 | ||||
-rw-r--r-- | src/query-assign.c | 7 |
16 files changed, 101 insertions, 66 deletions
@@ -39,6 +39,7 @@ SHELL = /bin/sh INSTALL = install -m 755 BUILD_OS := $(shell uname) +BUILD_ARCH := $(shell uname -m) ifndef CC CC = gcc @@ -53,7 +54,11 @@ ifndef PKG_CONFIG endif ifndef X11R6_LIB_DIR - X11R6_LIB_DIR = /usr/X11R6/lib + ifeq ($(BUILD_OS)-$(BUILD_ARCH),Linux-x86_64) + X11R6_LIB_DIR = /usr/X11R6/lib64 + else + X11R6_LIB_DIR = /usr/X11R6/lib + endif endif ifndef X11R6_INC_DIR @@ -173,7 +178,7 @@ default: all all: $(NVIDIA_SETTINGS) install: $(NVIDIA_SETTINGS) - $(STRIP) $< + $(STRIP) $(NVIDIA_SETTINGS) $(INSTALL) $< $(bindir)/$< $(OBJS_DIR)/%.o: %.c diff --git a/samples/Makefile b/samples/Makefile index 0c3d0e1..a5a9cc7 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -34,6 +34,9 @@ # X11R6_INC_DIR = /usr/X11R6/include # X11R6_LIB_DIR = /usr/X11R6/lib/ +BUILD_OS := $(shell uname) +BUILD_ARCH := $(shell uname -m) + ifndef CC CC = gcc endif @@ -51,7 +54,11 @@ ifndef X11R6_INC_DIR endif ifndef X11R6_LIB_DIR - X11R6_LIB_DIR = /usr/X11R6/lib/ + ifeq ($(BUILD_OS)-$(BUILD_ARCH),Linux-x86_64) + X11R6_LIB_DIR = /usr/X11R6/lib64 + else + X11R6_LIB_DIR = /usr/X11R6/lib + endif endif LIBXNVCTRL_DIR = ../src/libXNVCtrl diff --git a/src/gtk+-2.x/ctkglx.c b/src/gtk+-2.x/ctkglx.c index ebd2754..8cab000 100644 --- a/src/gtk+-2.x/ctkglx.c +++ b/src/gtk+-2.x/ctkglx.c @@ -73,16 +73,16 @@ static const char * __st_help = "st (Stereo buffer) - 'y' if the configuration has left and right color " "buffers that are rendered to in stereo. '-' if this is not supported"; static const char * __rs_help = - "rs (Red size) - Number of bits used for ammount of red per color. " + "rs (Red size) - Number of bits per color used for red. " "(Undefined for configurations that use color indexing.)"; static const char * __gs_help = - "gs (Green size - Number of bits used for ammount of green per color. " + "gs (Green size - Number of bits per color used for green. " "(Undefined for configurations that use color indexing.)"; static const char * __bs_help = - "bs (Blue size - Number of bits used for ammount of blue per color. " + "bs (Blue size - Number of bits per color used for blue. " "(Undefined for configurations that use color indexing.)"; static const char * __as_help = - "as (Alpha size - Number of bits used for ammount of alpha per color. " + "as (Alpha size - Number of bits per color used for alpha. " "(Undefined for configurations that use color indexing.)"; static const char * __aux_help = "aux (Auxillary buffers) - Number of available auxiliary color butters."; @@ -91,17 +91,17 @@ static const char * __dpt_help = static const char * __stn_help = "stn (Stencil size) - Number of bits per element in the stencil buffer."; static const char * __acr_help = - "acr (Accumulator red size) - Number of bits used for ammount of red per " - "color in the accumulator buffer."; + "acr (Accumulator red size) - Number of bits per color used for red " + "in the accumulator buffer."; static const char * __acg_help = - "acg (Accumulator green size) - Number of bits used for ammount of green " - "per color in the accumulator buffer."; + "acg (Accumulator green size) - Number of bits per color used for green " + "in the accumulator buffer."; static const char * __acb_help = - "acb (Accumulator blue size) - Number of bits used for ammount of blue per " - "color in the accumulator buffer."; + "acb (Accumulator blue size) - Number of bits per color used for blue " + "in the accumulator buffer."; static const char * __aca_help = - "aca (Accumulator alpha size) - Number of bits used for ammount of alpha " - "per color in the accumulator buffer."; + "aca (Accumulator alpha size) - Number of bits per color used for alpha " + "in the accumulator buffer."; static const char * __ms_help = "ms (Multisample samples) - Number of samples per multisample."; static const char * __mb_help = diff --git a/src/gtk+-2.x/ctkhelp.c b/src/gtk+-2.x/ctkhelp.c index 042f67b..5df77ca 100644 --- a/src/gtk+-2.x/ctkhelp.c +++ b/src/gtk+-2.x/ctkhelp.c @@ -32,7 +32,6 @@ #include <stdlib.h> -static GtkTextTagTable *create_tag_table(void); static GtkTextBuffer *create_default_help(CtkHelp *ctk_help); static void close_button_clicked(GtkButton *button, gpointer user_data); static gboolean window_destroy(GtkWidget *widget, GdkEvent *event, @@ -66,7 +65,7 @@ GType ctk_help_get_type( return ctk_help_type; } -GtkWidget* ctk_help_new(GtkWidget *toggle_button) +GtkWidget* ctk_help_new(GtkWidget *toggle_button, GtkTextTagTable *tag_table) { GObject *object; CtkHelp *ctk_help; @@ -145,9 +144,9 @@ GtkWidget* ctk_help_new(GtkWidget *toggle_button) g_object_set(G_OBJECT(ctk_help->text_viewer), "pixels-inside-wrap", 10, NULL); - /* create the tag table */ + /* save the tag table */ - ctk_help->tag_table = create_tag_table(); + ctk_help->tag_table = tag_table; /* create the default help text */ @@ -247,7 +246,7 @@ static GtkTextBuffer *create_default_help(CtkHelp *ctk_help) } -static GtkTextTagTable *create_tag_table(void) +GtkTextTagTable *ctk_help_create_tag_table(void) { GtkTextTagTable *table; GtkTextTag *tag; diff --git a/src/gtk+-2.x/ctkhelp.h b/src/gtk+-2.x/ctkhelp.h index 53eb719..090adc8 100644 --- a/src/gtk+-2.x/ctkhelp.h +++ b/src/gtk+-2.x/ctkhelp.h @@ -67,9 +67,10 @@ struct _CtkHelpClass GtkWindowClass parent_class; }; -GType ctk_help_get_type (void) G_GNUC_CONST; -GtkWidget *ctk_help_new (GtkWidget *); -void ctk_help_set_page (CtkHelp *, GtkTextBuffer *); +GType ctk_help_get_type (void) G_GNUC_CONST; +GtkWidget *ctk_help_new (GtkWidget *, GtkTextTagTable *); +void ctk_help_set_page (CtkHelp *, GtkTextBuffer *); +GtkTextTagTable *ctk_help_create_tag_table (void); void ctk_help_title (GtkTextBuffer *, GtkTextIter *, const gchar *, ...); void ctk_help_para (GtkTextBuffer *, GtkTextIter *, const gchar *, ...); diff --git a/src/gtk+-2.x/ctkmultisample.c b/src/gtk+-2.x/ctkmultisample.c index 1d749af..89f37e1 100644 --- a/src/gtk+-2.x/ctkmultisample.c +++ b/src/gtk+-2.x/ctkmultisample.c @@ -653,12 +653,27 @@ static void post_fsaa_app_override_toggled(CtkMultisample *ctk_multisample, static void fsaa_app_override_toggled(GtkWidget *widget, gpointer user_data) { CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data); + GtkRange *range = GTK_RANGE(ctk_multisample->fsaa_scale); gboolean override; override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_FSAA_APPLICATION_CONTROLLED, !override); + if (!override) { + NvCtrlSetAttribute(ctk_multisample->handle, + NV_CTRL_FSAA_MODE, NV_CTRL_FSAA_MODE_NONE); + + g_signal_handlers_block_by_func(G_OBJECT(range), + G_CALLBACK(fsaa_value_changed), + (gpointer) ctk_multisample); + + gtk_range_set_value(range, NV_CTRL_FSAA_MODE_NONE); + + g_signal_handlers_unblock_by_func(G_OBJECT(range), + G_CALLBACK(fsaa_value_changed), + (gpointer) ctk_multisample); + } post_fsaa_app_override_toggled(ctk_multisample, override); @@ -809,12 +824,27 @@ static void log_aniso_app_override_toggled(GtkWidget *widget, gpointer user_data) { CtkMultisample *ctk_multisample = CTK_MULTISAMPLE(user_data); + GtkRange *range = GTK_RANGE(ctk_multisample->log_aniso_scale); gboolean override; override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); NvCtrlSetAttribute(ctk_multisample->handle, NV_CTRL_LOG_ANISO_APPLICATION_CONTROLLED, !override); + if (!override) { + NvCtrlSetAttribute(ctk_multisample->handle, + NV_CTRL_LOG_ANISO, 0 /* default(?) */); + + g_signal_handlers_block_by_func(G_OBJECT(range), + G_CALLBACK(log_aniso_value_changed), + (gpointer) ctk_multisample); + + gtk_range_set_value(range, 0); + + g_signal_handlers_unblock_by_func(G_OBJECT(range), + G_CALLBACK(log_aniso_value_changed), + (gpointer) ctk_multisample); + } post_log_aniso_app_override_toggled(ctk_multisample, override); diff --git a/src/gtk+-2.x/ctkwindow.c b/src/gtk+-2.x/ctkwindow.c index badeddc..e0e45b2 100644 --- a/src/gtk+-2.x/ctkwindow.c +++ b/src/gtk+-2.x/ctkwindow.c @@ -198,8 +198,17 @@ static void help_button_toggled(GtkToggleButton *button, gpointer user_data) enabled = gtk_toggle_button_get_active(button); - if (enabled) gtk_widget_show_all(ctk_window->ctk_help); - else gtk_widget_hide_all(ctk_window->ctk_help); + if (enabled) { + if (ctk_window->ctk_help == NULL) { + ctk_window->ctk_help = ctk_help_new(GTK_WIDGET(button), + ctk_window->help_tag_table); + ctk_help_set_page(CTK_HELP(ctk_window->ctk_help), + ctk_window->help_text_buffer); + } + gtk_widget_show_all(ctk_window->ctk_help); + } else { + gtk_widget_hide_all(ctk_window->ctk_help); + } } /* help_button_toggled() */ @@ -246,7 +255,9 @@ static void tree_selection_changed(GtkTreeSelection *selection, /* update the help page */ - ctk_help_set_page(CTK_HELP(ctk_window->ctk_help), help); + if (ctk_window->ctk_help != NULL) + ctk_help_set_page(CTK_HELP(ctk_window->ctk_help), help); + ctk_window->help_text_buffer = help; } /* tree_selection_changed() */ @@ -382,9 +393,10 @@ GtkWidget *ctk_window_new(NvCtrlAttributeHandle **handles, gint num_handles, g_signal_connect(G_OBJECT(toggle_button), "toggled", G_CALLBACK(help_button_toggled), (gpointer) ctk_window); - - ctk_window->ctk_help = ctk_help_new(toggle_button); - tag_table = CTK_HELP(ctk_window->ctk_help)->tag_table; + + ctk_window->ctk_help = NULL; + tag_table = ctk_help_create_tag_table(); + ctk_window->help_tag_table = tag_table; ctk_config_set_tooltip(ctk_config, toggle_button, "The Help button " "toggles the display of a help window which " diff --git a/src/gtk+-2.x/ctkwindow.h b/src/gtk+-2.x/ctkwindow.h index a8c118f..3d9237c 100644 --- a/src/gtk+-2.x/ctkwindow.h +++ b/src/gtk+-2.x/ctkwindow.h @@ -75,6 +75,9 @@ struct _CtkWindow GtkWidget *quit_dialog; ParsedAttribute *attribute_list; + + GtkTextTagTable *help_tag_table; + GtkTextBuffer *help_text_buffer; }; struct _CtkWindowClass diff --git a/src/image_data/crt.h b/src/image_data/crt.h index d286082..83bce95 100644 --- a/src/image_data/crt.h +++ b/src/image_data/crt.h @@ -2,27 +2,6 @@ #include "image.h" -#define GIMP_IMAGE_WIDTH (100) -#define GIMP_IMAGE_HEIGHT (100) -#define GIMP_IMAGE_BYTES_PER_PIXEL (4) /* 3:RGB, 4:RGBA */ -#define GIMP_IMAGE_RLE_PIXEL_DATA ((unsigned char*) GIMP_IMAGE_rle_pixel_data) -#define GIMP_IMAGE_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) do \ -{ unsigned int __bpp; unsigned char *__ip; const unsigned char *__il, *__rd; \ - __bpp = (bpp); __ip = (image_buf); __il = __ip + (size) * __bpp; \ - __rd = (rle_data); if (__bpp > 3) { /* RGBA */ \ - while (__ip < __il) { unsigned int __l = *(__rd++); \ - if (__l & 128) { __l = __l - 128; \ - do { memcpy (__ip, __rd, 4); __ip += 4; } while (--__l); __rd += 4; \ - } else { __l *= 4; memcpy (__ip, __rd, __l); \ - __ip += __l; __rd += __l; } } \ - } else { /* RGB */ \ - while (__ip < __il) { unsigned int __l = *(__rd++); \ - if (__l & 128) { __l = __l - 128; \ - do { memcpy (__ip, __rd, 3); __ip += 3; } while (--__l); __rd += 3; \ - } else { __l *= 3; memcpy (__ip, __rd, __l); \ - __ip += __l; __rd += __l; } } \ - } } while (0) - static const nv_image_t crt_image = { 100, 100, 4, "\377\377\0\377\0\377\377\0\377\0\225\377\0\377\0\25\336\336\337\377\333\333" diff --git a/src/image_data/image.c b/src/image_data/image.c index 6b36e33..22ca190 100644 --- a/src/image_data/image.c +++ b/src/image_data/image.c @@ -42,7 +42,7 @@ do { \ __bpp = (bpp); \ __ip = (image_buf); \ __il = __ip + (size) * __bpp; \ - __rd = (rle_data); \ + __rd = (unsigned char *)(rle_data); \ \ if (__bpp > 3) { /* RGBA */ \ while (__ip < __il) { \ diff --git a/src/image_data/image.h b/src/image_data/image.h index 3bbce6c..be21329 100644 --- a/src/image_data/image.h +++ b/src/image_data/image.h @@ -29,7 +29,7 @@ typedef struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - unsigned char *rle_pixel_data; + char *rle_pixel_data; } nv_image_t; unsigned char *decompress_image_data(const nv_image_t *img); diff --git a/src/libXNVCtrl/libXNVCtrl.a b/src/libXNVCtrl/libXNVCtrl.a Binary files differindex 67db008..4177301 100644 --- a/src/libXNVCtrl/libXNVCtrl.a +++ b/src/libXNVCtrl/libXNVCtrl.a diff --git a/src/libXNVCtrl/nv_control.h b/src/libXNVCtrl/nv_control.h index e82b0f4..5dcfc0e 100644 --- a/src/libXNVCtrl/nv_control.h +++ b/src/libXNVCtrl/nv_control.h @@ -224,7 +224,7 @@ typedef struct { BYTE type; BYTE detail; CARD16 sequenceNumber B16; - Time time B32; + CARD32 time B32; CARD32 screen B32; CARD32 display_mask B32; CARD32 attribute B32; diff --git a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c index 1c0bb50..ee8fe12 100644 --- a/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c +++ b/src/libXNVCtrlAttributes/NvCtrlAttributesXv.c @@ -283,8 +283,7 @@ static NvCtrlXvAttribute *getXvAttribute(Display *dpy, XvPortID port, { NvCtrlXvAttribute *attr = NULL; XvAttribute *attributes = NULL; - unsigned int n; - int i; + int i, n; attributes = XvQueryPortAttributes(dpy, port, &n); diff --git a/src/parse.c b/src/parse.c index b162a27..a5fcc07 100644 --- a/src/parse.c +++ b/src/parse.c @@ -61,12 +61,13 @@ AttributeTableEntry attributeTable[] = { { "FlatpanelScaling", NV_CTRL_FLATPANEL_SCALING, 0 }, { "FlatpanelDithering", NV_CTRL_FLATPANEL_DITHERING, 0 }, { "DigitalVibrance", NV_CTRL_DIGITAL_VIBRANCE, 0 }, - { "ImageSharpening", NV_CTRL_IMAGE_SHARPENING, 0, }, + { "ImageSharpening", NV_CTRL_IMAGE_SHARPENING, 0 }, { "BusType", NV_CTRL_BUS_TYPE, 0 }, { "VideoRam", NV_CTRL_VIDEO_RAM, 0 }, { "Irq", NV_CTRL_IRQ, 0 }, { "OperatingSystem", NV_CTRL_OPERATING_SYSTEM, 0 }, { "SyncToVBlank", NV_CTRL_SYNC_TO_VBLANK, 0 }, + { "AllowFlipping", NV_CTRL_FLIPPING_ALLOWED, 0 }, { "LogAniso", NV_CTRL_LOG_ANISO, 0 }, { "FSAA", NV_CTRL_FSAA_MODE, 0 }, { "TextureSharpen", NV_CTRL_TEXTURE_SHARPEN, 0 }, @@ -105,12 +106,12 @@ AttributeTableEntry attributeTable[] = { { "RedGamma", GAMMA_VALUE|RED_CHANNEL, C|G }, { "GreenGamma", GAMMA_VALUE|GREEN_CHANNEL, C|G }, { "BlueGamma", GAMMA_VALUE|BLUE_CHANNEL, C|G }, - { "TVOverScan", NV_CTRL_TV_OVERSCAN, 0, }, - { "TVFlickerFilter", NV_CTRL_TV_FLICKER_FILTER, 0, }, - { "TVBrightness", NV_CTRL_TV_BRIGHTNESS, 0, }, - { "TVHue", NV_CTRL_TV_HUE, 0, }, - { "TVContrast", NV_CTRL_TV_CONTRAST, 0, }, - { "TVSaturation", NV_CTRL_TV_SATURATION, 0, }, + { "TVOverScan", NV_CTRL_TV_OVERSCAN, 0 }, + { "TVFlickerFilter", NV_CTRL_TV_FLICKER_FILTER, 0 }, + { "TVBrightness", NV_CTRL_TV_BRIGHTNESS, 0 }, + { "TVHue", NV_CTRL_TV_HUE, 0 }, + { "TVContrast", NV_CTRL_TV_CONTRAST, 0 }, + { "TVSaturation", NV_CTRL_TV_SATURATION, 0 }, { "GPUCoreTemp", NV_CTRL_GPU_CORE_TEMPERATURE, N }, { "GPUAmbientTemp", NV_CTRL_AMBIENT_TEMPERATURE, N }, diff --git a/src/query-assign.c b/src/query-assign.c index f8637b1..ae0e7ce 100644 --- a/src/query-assign.c +++ b/src/query-assign.c @@ -96,10 +96,9 @@ int nv_process_assignments_and_queries(Options *op) uint32 *nv_get_enabled_display_devices(int n, NvCtrlAttributeHandle **h) { ReturnStatus status; - uint32 *d; - int screen; + int *d, screen; - d = malloc(sizeof(uint32) * n); + d = malloc(sizeof(int) * n); for (screen = 0; screen < n; screen++) { if (!h[screen]) { @@ -118,7 +117,7 @@ uint32 *nv_get_enabled_display_devices(int n, NvCtrlAttributeHandle **h) } } - return d; + return (uint32 *)d; } /* nv_get_enabled_display_devices() */ |