From owner-freebsd-current@FreeBSD.ORG Sun Feb 1 20:52:49 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D636242; Sun, 1 Feb 2015 20:52:49 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C5D27E; Sun, 1 Feb 2015 20:52:48 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id bs8so12865837wib.3; Sun, 01 Feb 2015 12:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=x10NE3sP+Jheh8gW/A2BFTdD21ezekrJO3UcGq451Gw=; b=ITOW+dna9xoQJqBAIoubsX3SMbONFUR3Bj1Ke6VvEaC/9ojEvhG/60yeI8oDT5arjq yta3SiYZsNsPFppZ4PnbRgf2iidbYNZHOAGA2sfjcnzKr8E5pqtUTk4F6m71wvyw9mDK vBZh9WinqsLkEOqCNH4cuXiDddPeP2qsg+LOUBsjcoTPjDxHLnGlFEq5wpHvJMQAHjRc JoVufvuRc9QhTEg/ZoL1J7OwCDEXCi+yKaGoTIYLXCnNVG3+IDOJdCsJVWn78ky8jQOb KJOYMCbCLC+O7CZ0eqaiqGlSFQNDZ0VA1Iu8K3jLYp0NQRJ672TXtRH/rN87ZAVgspGV dPQQ== MIME-Version: 1.0 X-Received: by 10.194.61.145 with SMTP id p17mr36223880wjr.35.1422823967354; Sun, 01 Feb 2015 12:52:47 -0800 (PST) Received: by 10.217.64.10 with HTTP; Sun, 1 Feb 2015 12:52:47 -0800 (PST) In-Reply-To: <54CC5311.9070604@interlinked.me> References: <54C883E7.4000300@interlinked.me> <54CBA0A4.30708@FreeBSD.org> <54CC0999.90500@interlinked.me> <3595567.zVLW9tlg0N@ralph.baldwin.cx> <54CC2981.3040909@interlinked.me> <54CC5311.9070604@interlinked.me> Date: Sun, 1 Feb 2015 21:52:47 +0100 Message-ID: Subject: Re: Questions on adding backlight support for the i915 driver From: "Ranjan1018 ." <214748mv@gmail.com> To: Elizabeth Myers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Adrian Chadd , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2015 20:52:49 -0000 > I have a sort of "rough draft" of this. I've tested all the percentages > (Ivy Bridge) and they do seem to correlate linearly (and to the > intel_backlight userland program used by a lot of people). I haven't > been able to test on any other hardware as I don't have it, and I don't > know what chipsets require the value to be inverted, so I've not > implemented that. > > If anyone else would like to help test, it'd be nice. > > Thank you Elizabeth for the patch. It works on my Samsung Ativ Book 2 with Ivy Bridge. I have modified the patch for 11-CURRENT and corrected these little bugs: 1) is possible to specify a percentage greater than 100% eg. with the command: =E2=80=98sysctl hw.dri.0.i915_backlight=3D111=E2=80= =99 is possible to set the hardware register above the maximum allowed. 2) the percentage values are truncated instead of rounded: if I set 10% with the intel_backlight program is reported as 9% with the command =E2=80=98sysctl hw.dri.0.i915_backlight=E2=80=99: # intel_backlight 10 current backlight value: 20% (976/4882) set backlight to 10% (488/4882) # sysctl hw.dri.0.i915_backlight hw.dri.0.i915_backlight: 9 but 488/4882 is more near to 10% than 9% I have tested the patch with: # uname -a FreeBSD ativ 11.0-CURRENT FreeBSD 11.0-CURRENT #10 r277961: Sat Jan 31 06:03:15 CET 2015 root@ativ:/usr/obj/usr/src/sys/GENERIC amd64 The patch is available at: http://pastebin.com/vKK7026H Regards, Maurizio