From owner-freebsd-current@FreeBSD.ORG Fri Jan 30 23:16:32 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 563852BA for ; Fri, 30 Jan 2015 23:16:32 +0000 (UTC) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (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 1C37F6C8 for ; Fri, 30 Jan 2015 23:16:32 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id b16so6968531igk.1 for ; Fri, 30 Jan 2015 15:16:31 -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=DXLdP2wkxhaQ9oUHGtEPuEuuhWIpM0ak6Ya19GTvXiM=; b=SnI/Y49Q5n8z59iwBRHKSjHHGQJQOaeYeG3g6oUzeDJEL3HEYIJdDxh3xItDAfgPlV s3NwtoSkOFOy2vwoitxDHY/shnmrftZ6/ZnoyUhypBTYc84aSesjx7WUiG9uy6f3S4+R TlDNUdkMra2ekBDq6l8Ukjb5Ohgf68QQMaBvCGlgkUaa+CFMxSO3YfGFMjrSbkG/GXBP UBzdVCVegSPho8wNQJSIudO1DKMkeGx3BD11Mm2qYIHwC4xk8nUH0iV334RhVEyNQAWu 3i1PoF6ZCI4SlWX1SaZaedf8zPQYZWzc1yrIVtonmoNcgP+7kJn7Vzrt9Ru3CE722wMF jTkA== MIME-Version: 1.0 X-Received: by 10.50.79.135 with SMTP id j7mr1549069igx.32.1422659791324; Fri, 30 Jan 2015 15:16:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Fri, 30 Jan 2015 15:16:31 -0800 (PST) In-Reply-To: <54C883E7.4000300@interlinked.me> References: <54C883E7.4000300@interlinked.me> Date: Fri, 30 Jan 2015 15:16:31 -0800 X-Google-Sender-Auth: miWApG5OxWizyZ3Vw0Iyfw0ef5c 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: Fri, 30 Jan 2015 23:16:32 -0000 Hi, Which chipset is it? Loading acpi_video causes a handful of interconnected pieces to shift (as IIRC at that point acpi_video also states that it wishes to take control of video setting, not just leave it all up to ACPI to drive itself.) There's a bunch of discussion / code churn in the linux dri2/i915 code (/past/ the point in 2012 that our code is currently synced to) about how to manage backlights. A lot of it seems due to ridiculously large variations in how backlights are actually managed. So, if we're going to do this, I think we should actually have a generic backlight thing that figures out if the right thing to do is talk to the underlying device/panel, rather than hang backlight controls off of each driver. It may not always be off of drm. :( There's also stuff surrounding locking and state changes, as well as restoring backlight values after a suspend/resume cycle. That kind of weird crap. But I'd start with which chipset it is, which version of FreeBSD it is, and whether the ACPI stuff would work for you with a code update. But for a more general future thing, I'd rather we had a sysctl tree of actual display devices, each one mapping to the underlying "thing" it's controlling, so it's a generic API for both getting and setting values for the various displays that are hooked into things. -adrian On 27 January 2015 at 22:38, Elizabeth Myers wrote: > Hello, > > I want to add backlight support to the i915 driver in FreeBSD. It seems > that two magic addresses are read and wrote from to change the backlight > itself. It supports rather fine-level granularity all the way down to > zero. Right now I use a hacked-up userland program that reads > from/writes to these addresses, which is far from an ideal solution. > > I am interested in this because the acpi_video(4) driver does not > support my backlight on my Dell Inspiron 15 3521 (not terribly > suprising, on Linux I needed a special Dell-specific driver, and I'm not > sure even that really used ACPI, I never really checked). > > My questions are really twofold: > > 1) How can this be exposed appropriately? I would prefer this be exposed > generally so upower could grok it. As far as I can tell upower uses > hw.acpi.video.lcd0 to control backlight. I am not sure that upower is > doing the "right" thing here, though. > 2) Where would the code go for this? The dri2 driver seems the most > "logical" place, but maybe it belongs in X and exposed via a program? Or > something else entirely that I'm not thinking of? > > I have experience developing PCI drivers and doing other PCI related > doodads, and some kernel development experience, as well as general C > experience, but I'm not by any means an expert on the matter. > > Cheers, > Elizabeth Myers > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"