Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 2003 16:02:59 +0100 (CET)
From:      "Daan Vreeken [PA4DAN]" <Danovitsch@Vitsch.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/59289: [PATH] ioctl METEORGBRIG in bktr_core.c forgets to add 128 to value
Message-ID:  <200311131502.hADF2x3a089396@Danovitsch.dnsq.org>
Resent-Message-ID: <200311141510.hAEFACcV047763@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59289
>Category:       kern
>Synopsis:       [PATH] ioctl METEORGBRIG in bktr_core.c forgets to add 128 to value
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 14 07:10:12 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Daan Vreeken [PA4DAN]
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD RaceBeest.Danovitsch.LAN 5.1-RELEASE FreeBSD 5.1-RELEASE #20: Mon Sep 1 16:39:56 CEST 2003 root@RaceBeest.Danovitsch.LAN:/home/src/sys/i386/compile/RaceBeest i386

>Description:
In bktr_core.c the ioctl METEORSBRIG substracts 128 from the given value
before storing it in the right brightness register, but METEORGBRIG doesn't
add 128 to the value it gets out of the register.

>How-To-Repeat:
wantedvalue=129;
ioctl(bktr,METEORSBRIG,&wantedvalue);
ioctl(bktr,METEORGBRIG,&returnedvalue);

if (returnedvalue!=wantedvalue)
        printf("EEK!\n");

>Fix:
The following patch is agains -CURRENT and simply adds +128 to the value
that's read from the register.

--- diff begins here ---
diff -ur sys-org/dev/bktr/bktr_core.c sys/dev/bktr/bktr_core.c
--- sys-org/dev/bktr/bktr_core.c	Sun Nov  9 10:17:21 2003
+++ sys/dev/bktr/bktr_core.c	Thu Nov 13 15:38:57 2003
@@ -1511,7 +1511,7 @@
 		break;
 
 	case METEORGBRIG:	/* get brightness */
-		*(u_char *)arg = INB(bktr, BKTR_BRIGHT);
+		*(u_char *)arg = INB(bktr, BKTR_BRIGHT) + 128;
 		break;
 
 	case METEORSCSAT:	/* set chroma saturation */
--- diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311131502.hADF2x3a089396>