From owner-freebsd-current@FreeBSD.ORG Sat Jan 31 01:31:04 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 7B0FEF66; Sat, 31 Jan 2015 01:31:04 +0000 (UTC) Received: from mail-ie0-x229.google.com (mail-ie0-x229.google.com [IPv6:2607:f8b0:4001:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4141337B; Sat, 31 Jan 2015 01:31:04 +0000 (UTC) Received: by mail-ie0-f169.google.com with SMTP id rl12so7367623iec.0; Fri, 30 Jan 2015 17:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=JMihAEy8JctqAtzKGE3pbknAFU04WNjhW58WIiX8ta8=; b=tvF3oYDDlHLAIF6AzjhrpLjWMJhT9z/xbLkN0LDAb74lSqlciQj3QoCvolSBCskgpV 3je9hybdGMxCVsrlSpvy7duOaIFD8nv0U0XQ73A9EqqwWldqBfxmR2rFWpCKhFKIWP2k Q4jMHHcsfCfiA1SvQqfkwpa7rxmcnDQqYAF4q7Dt9EB60S/Xeyooylp5H3t9t40PDxiC 1VA0lWp147j7mGOp64YlWVn2UhT8s/tYIskb5INbdeVGfFpvYSmWQwF5doOxPizkHxoC mdUUqJ7x/qsvHaaJ0P0jOCMZlNTvETSJ5jN7sAfRdfXVoWpqsmYF4PqpmwRbbNlUA9RX PxHA== MIME-Version: 1.0 X-Received: by 10.50.79.135 with SMTP id j7mr83080igx.32.1422667863512; Fri, 30 Jan 2015 17:31:03 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Fri, 30 Jan 2015 17:31:03 -0800 (PST) In-Reply-To: <54CC2981.3040909@interlinked.me> References: <54C883E7.4000300@interlinked.me> <54CBA0A4.30708@FreeBSD.org> <54CC0999.90500@interlinked.me> <3595567.zVLW9tlg0N@ralph.baldwin.cx> <54CC2981.3040909@interlinked.me> Date: Fri, 30 Jan 2015 17:31:03 -0800 X-Google-Sender-Auth: 78LlTAlZnNBH6yDDNGajDP8PTWg Message-ID: Subject: Re: Questions on adding backlight support for the i915 driver From: Adrian Chadd To: Elizabeth Myers Content-Type: text/plain; charset=UTF-8 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: Sat, 31 Jan 2015 01:31:04 -0000 On 30 January 2015 at 17:01, Elizabeth Myers wrote: > On 01/30/15 17:45, John Baldwin wrote: >> On Friday, January 30, 2015 04:45:45 PM Elizabeth Myers wrote: >>> On 01/30/15 09:17, John Baldwin wrote: >>>> Humm. If the code is going to live in the drm driver, then I would >>>> start with hanging a sysctl off of the drm device itself. (Each new-bus >>>> device_t has a sysctl ctx you can get to hang new nodes off of the >>>> device's node.) >>> I'm wondering if that's the correct place for it to live. So far it's >>> the only real place it *can* live that makes logical sense imho, unless >>> anyone has better ideas. >>> >>> This is awesome. As for upower, it should probably be patched to know >>> about other types of brightness sysctls if/when this is implemented. >> For now I think hanging it off of the device_t is fine. It can be moved >> later if there is an urgent need. However, I suspect that tools like upower >> will need updating regardless of where it ends up living. >> > > Now a more interesting question... the raw PCM backlight value used by > the hardware means that one can set the backlight to anything between 0 > and a specific number. On my system, it's 4882, and yes, there is a > subtle difference between the values. Is it best to expose this as a > percentage, or just have a read-only sysctl for max values? So, this is one of the discussions that popped up in the linux side of things, that we will end up eventually pulling into freebsd when the i915 code is updated. The raw value is (a) different per setup, and (b) may be inverted to work correctly. I also don't know if linear values along that spectrum map to linear brightness levels. So yeah, my suggestion we expose an ACPI/acpi_video like list of valid percentages, and let the user set them from 0-100%. That way the details of how the actual backlight values get derived are hidden from userland. -adrian