From owner-freebsd-current@FreeBSD.ORG Tue Mar 31 13:02:31 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D46D1B67 for ; Tue, 31 Mar 2015 13:02:31 +0000 (UTC) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (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 97F0CF46 for ; Tue, 31 Mar 2015 13:02:31 +0000 (UTC) Received: by ierf6 with SMTP id f6so14716431ier.2 for ; Tue, 31 Mar 2015 06:02:31 -0700 (PDT) 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=ku8lQ8F6EFfOrpuZEcjGp2SKsyhlvCesR6/Fizli6D4=; b=gMt+6msCbKr8ts9EM/usQWS8AxXSr6/2MJU/W5ePs3RNwktG10wFFahEKDMTpcq/Yh YzHXZIGu2DzlI/wCwtMB9GUrf+SLe9AdpK+DWqWcCmapySpz2QtwiNRRPsycuzWxW8j8 bBi0mqQsnNB6NdyuzjRTc3y+RC5Qjk4z3J1ZRNdDr9QtJddqUJXLJhSquyUm88bCQCTM 9nz7hFsY3mNzl7Ybmz3zi9ip/UyCDrdWc0fZwlhdupnfHDbq1h5dck/p3L4IuS9Mom1u 9DYRFZqskh/Ugx+5x17cK3gMhIeH/xKKrWkn+iWwtW2i1oAt84MP6jmgg7UoAF33sC83 Payw== MIME-Version: 1.0 X-Received: by 10.50.40.7 with SMTP id t7mr4097321igk.48.1427806951089; Tue, 31 Mar 2015 06:02:31 -0700 (PDT) Received: by 10.36.61.65 with HTTP; Tue, 31 Mar 2015 06:02:31 -0700 (PDT) In-Reply-To: <55157D0C.2040808@selasky.org> References: <55157D0C.2040808@selasky.org> Date: Tue, 31 Mar 2015 15:02:31 +0200 Message-ID: Subject: Re: [PATCH] Adding backlight support for the i915 driver. From: "Ranjan1018 ." <214748mv@gmail.com> To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: 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: Tue, 31 Mar 2015 13:02:31 -0000 2015-03-27 16:53 GMT+01:00 Hans Petter Selasky : > On 03/27/15 16:01, Ranjan1018 . wrote: > >> This patch exposes the backlight support via a sysctl: >> >> set the backlight to 10%: >> >> # sysctl hw.dri.0.i915_backlight=3D10 >> >> hw.dri.0.i915_backlight: 25 -> 10 >> >> set the backlight to 50%: >> >> # sysctl hw.dri.0.i915_backlight=3D50 >> >> hw.dri.0.i915_backlight: 10 -> 50 >> >> decrease the current backlight value: >> >> # sysctl hw.dri.0.i915_backlight=3D-1000 >> >> hw.dri.0.i915_backlight: 50 -> 43 >> >> increment the current backlight value: >> >> # sysctl hw.dri.0.i915_backlight=3D1000 >> >> hw.dri.0.i915_backlight: 43 -> 51 >> >> # sysctl hw.dri.0.i915_backlight=3D1000 >> >> hw.dri.0.i915_backlight: 51 -> 60 >> >> I am running this path on for about a week without issue. >> >> This path can be found at: >> https://github.com/maurizio-emmex/i915_backlight_freebsd >> >> I thank Elizabeth Myers, elizabeth at interlinked dot me, for the idea o= f >> adding the backlight support for the i915 driver and for the original >> patch. >> >> Regards, >> Maurizio >> > > Maybe you want to use "CTLFLAG_RWTUN" so that it also can be set from > /boot/loader.conf ? > > --HPS > The ability to set the backlight at startup may be useful. With this new patch I expose two ways to do this: - with the tunable "drm.i915.init_backlight" in /boot/loader.conf, just after the driver initialization (eg. drm.i915.init_backlight=3D20) - with the OID "hw.dri.0.i915_backlight" in /etc/sysctl.conf as suggested by Hans I don=E2=80=99t know if setting the backlight with the tunable "drm.i915.init_backlight" is useful, but I have already written the code and is simple to remove it. The patch file is i915_backlight.patch at https://github.com/maurizio-emmex/i915_backlight_freebsd Regards, Maurizio