Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 176831 Details for
Bug 204428
media-video/nvclock-0.8_beta4 64bit support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds options to smoothly fade on brightness change
nvclock-9999_smartdimmer-fade.patch (text/plain), 5.67 KB, created by
Peter Fern
on 2008-12-30 05:17:15 UTC
(
hide
)
Description:
Adds options to smoothly fade on brightness change
Filename:
MIME Type:
Creator:
Peter Fern
Created:
2008-12-30 05:17:15 UTC
Size:
5.67 KB
patch
obsolete
>diff -ur nvclock/src/backend/nv40.c nvclock/src/backend/nv40.c >--- nvclock/src/backend/nv40.c 2008-12-13 07:52:54.000000000 +1100 >+++ nvclock/src/backend/nv40.c 2008-12-30 13:58:18.818085500 +1100 >@@ -430,6 +430,29 @@ > nv_card->PMC[0x15f0/4] = (level << 16) | (nv_card->PMC[0x15f0/4] & 0xffe0ffff); > } > >+/* Fade backpanel brightness on laptops */ >+void nv44_mobile_fade_smartdimmer(int end, unsigned long delay) >+{ >+ int i, start = nv_card->get_smartdimmer(); >+ >+ if (end < 15) >+ end = 15; >+ if (end > 100) >+ end = 100; >+ >+ if (end >= start) { >+ for (i = start + 1; i <= end; i++) { >+ nv_card->set_smartdimmer(i); >+ usleep(delay); >+ } >+ } else { >+ for (i = start - 1; i >= end; i--) { >+ nv_card->set_smartdimmer(i); >+ usleep(delay); >+ } >+ } >+} >+ > static int CalcSpeed_nv40(int base_freq, int m1, int m2, int n1, int n2, int p) > { > return (int)((float)(n1*n2)/(m1*m2) * base_freq) >> p; >@@ -1022,6 +1045,7 @@ > nv_card->caps |= SMARTDIMMER; > nv_card->get_smartdimmer = nv44_mobile_get_smartdimmer; > nv_card->set_smartdimmer = nv44_mobile_set_smartdimmer; >+ nv_card->fade_smartdimmer = nv44_mobile_fade_smartdimmer; > } > > /* Temperature monitoring; all cards after the NV40 feature an internal temperature sensor. >diff -ur nvclock/src/backend/nv50.c nvclock/src/backend/nv50.c >--- nvclock/src/backend/nv50.c 2008-12-29 21:30:05.000000000 +1100 >+++ nvclock/src/backend/nv50.c 2008-12-30 13:59:26.123672572 +1100 >@@ -253,6 +253,28 @@ > nv_card->PDISPLAY[NV_PDISPLAY_SOR0_REGS_BRIGHTNESS/4] = val; > } > >+/* Fade backpanel brightness on laptops */ >+void nv50_mobile_fade_smartdimmer(int end, unsigned long delay) { >+ int i, start = nv_card->get_smartdimmer(); >+ >+ if (end < 15) >+ end = 15; >+ if (end > 100) >+ end = 100; >+ >+ if (end >= start) { >+ for (i = start + 1; i <= end; i++) { >+ nv_card->set_smartdimmer(i); >+ usleep(delay); >+ } >+ } else { >+ for (i = start - 1; i >= end; i--) { >+ nv_card->set_smartdimmer(i); >+ usleep(delay); >+ } >+ } >+} >+ > static int CalcSpeed_nv50(int base_freq, int m1, int m2, int n1, int n2, int p) > { > return (int)((float)(n1*n2)/(m1*m2) * base_freq) >> p; >@@ -414,6 +436,7 @@ > nv_card->caps |= SMARTDIMMER; > nv_card->get_smartdimmer = nv50_mobile_get_smartdimmer; > nv_card->set_smartdimmer = nv50_mobile_set_smartdimmer; >+ nv_card->fade_smartdimmer = nv50_mobile_fade_smartdimmer; > } > > /* Temperature monitoring; all NV50 cards feature an internal temperature sensor >diff -ur nvclock/src/backend/nvclock.h nvclock/src/backend/nvclock.h >--- nvclock/src/backend/nvclock.h 2008-12-29 04:56:13.000000000 +1100 >+++ nvclock/src/backend/nvclock.h 2008-12-30 13:31:32.608727690 +1100 >@@ -280,6 +280,7 @@ > /* Smartdimmer (adjustment of the brigthenss of the backlight on Laptops) */ > int (*get_smartdimmer)(); > void (*set_smartdimmer)(int level); >+ void (*fade_smartdimmer)(int level, unsigned long delay); > > /* Overclocking */ > volatile unsigned int mpll; /* default memory speed */ >diff -ur nvclock/src/smartdimmer.c nvclock/src/smartdimmer.c >--- nvclock/src/smartdimmer.c 2008-12-17 08:38:26.000000000 +1100 >+++ nvclock/src/smartdimmer.c 2008-12-30 14:08:30.725681893 +1100 >@@ -45,10 +45,14 @@ > #define GET_BIT 2 > #define INC_BIT 4 > #define DEC_BIT 8 >+#define FAD_BIT 16 >+#define DEL_BIT 32 > > static struct option long_opts[] = { > { "get" , no_argument , 0, 'g' }, > { "set" , required_argument, 0, 's' }, >+ { "fade" , required_argument, 0, 'f' }, >+ { "delay" , required_argument, 0, 'e' }, > { "increase", no_argument , 0, 'i' }, > { "decrease", no_argument , 0, 'd' }, > { "help" , no_argument , 0, 'h' }, >@@ -62,6 +66,8 @@ > printf("Options:\n"); > printf("\t-g --get\t\tQuery brightness level.\n"); > printf("\t-s --set <level>\tSet brightness level (15-100)\n"); >+ printf("\t-f --fade <level>\tFade in/out to brightness level (15-100)\n"); >+ printf("\t-e --delay <level>\tFade cycle delay (usecs)\n"); > printf("\t-i --increase\t\tIncrease brightness with one level.\n"); > printf("\t-d --decrease\t\tDecrease brightness with one level.\n"); > printf("\t-h --help\t\tPrints this help text.\n\n"); >@@ -83,6 +89,7 @@ > { > int optind = 0, options = 0, setvalue = 0; > int c; >+ unsigned long delay = 7000; > > if (argc < 2) > { >@@ -90,7 +97,7 @@ > return 0; > } > >- while ((c = getopt_long(argc, argv, "gs:idh", long_opts, &optind)) != -1) >+ while ((c = getopt_long(argc, argv, "gs:f:e:idh", long_opts, &optind)) != -1) > { > switch (c) > { >@@ -113,6 +120,26 @@ > return 1; > } > break; >+ case 'f': >+ if (isdigit(*optarg)) { >+ setvalue = atoi(optarg); >+ options |= FAD_BIT; >+ } else { >+ fprintf(stderr, "Illegal option value (-f): " >+ "Value has to be a non-negative number.\n"); >+ return 1; >+ } >+ break; >+ case 'e': >+ if (isdigit(*optarg)) { >+ delay = atoi(optarg); >+ options |= DEL_BIT; >+ } else { >+ fprintf(stderr, "Illegal option value (-d): " >+ "Value has to be a non-negative number.\n"); >+ return 1; >+ } >+ break; > case 'i': > options |= INC_BIT; > break; >@@ -154,6 +181,9 @@ > if (options & SET_BIT) > nv_card->set_smartdimmer(setvalue); > >+ if (options & FAD_BIT) >+ nv_card->fade_smartdimmer(setvalue, delay); >+ > if (options & GET_BIT) > printf("SmartDimmer level: %d\n", nv_card->get_smartdimmer()); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204428
:
140252
|
140645
|
140646
|
166391
|
166392
|
166393
|
176820
|
176822
| 176831 |
176832
|
178510