From owner-freebsd-ppc@FreeBSD.ORG Thu Sep 22 03:48:47 2011 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3439106566C for ; Thu, 22 Sep 2011 03:48:47 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 91BFA8FC0A for ; Thu, 22 Sep 2011 03:48:47 +0000 (UTC) Received: by gyf2 with SMTP id 2so2139208gyf.13 for ; Wed, 21 Sep 2011 20:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=L2r6t+Na9m/NoDtB0jW5bwxPMxq9gTfKrd7jOq3aDQI=; b=P/CSomBRoa99yk0AXSY/qEDzYdQJH1T1W5GR+77APEF1Mc7ShhWOevlvN4BNGp7gtc CGS6tAO4ZzxNp6ljTUgqQFtWbPI/fbYjbCjpzdI6Qoba2SJiOzBWjnKt0RVqvnlc+j+R iksNyhAz8716qMmYyZvkXl2doFIF7OsRToJNI= MIME-Version: 1.0 Received: by 10.68.19.100 with SMTP id d4mr1476802pbe.35.1316663326451; Wed, 21 Sep 2011 20:48:46 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.142.132.17 with HTTP; Wed, 21 Sep 2011 20:48:46 -0700 (PDT) In-Reply-To: <4E7AAA9D.9010503@freebsd.org> References: <91CC14C1-14F2-41B3-81F1-D90B42F038CA@alumni.cwru.edu> <4E7AAA9D.9010503@freebsd.org> Date: Wed, 21 Sep 2011 23:48:46 -0400 X-Google-Sender-Auth: AtH0N4p1iaRxsOpllNYWtWwAHs0 Message-ID: From: Justin Hibbits To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD PowerPC ML Subject: Re: ofw syscons brightness patch X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 03:48:48 -0000 On Wed, Sep 21, 2011 at 11:25 PM, Peter Grehan wrote: > Hi Justin, > > > Attached is a patch that adds brightness control to ofw syscons >> (dev.sc.0.brightness sysctl). Pretty simple. Comments and tests >> requested. Hopefully the listserv doesn't eat the patch. >> > > Is it possible to have the value in the sysctl be 0-100, or 0-10 ? It > might be a bit confusing for the user to have to know that the range is > 0x34-0xff, and have the sysctl code clamp to these. > > Are the MIN_BRIGHTNESS/MAX_BRIGHTNESS values the same for all models ? > > later, > > Peter. > Good points. I took those values from OpenBSD's driver, which hides it in an ioctl (not hidden very well, it still leaks out to userspace), so I'm assuming it's the same for all models. I can apply a simple scale factor, and clamp it at 0-100 (capped below 0xff for even intervals), or 0-17 (perfect increments of 12, capped at 0xff). I also plan to make it check the model for "PowerBook" and similar, so that it's not provided for non-laptop (and iMac?) machines. - Justin