From patchwork Sun Jul 29 03:51:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: joeyli X-Patchwork-Id: 1253331 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 965493FD2A for ; Mon, 30 Jul 2012 05:02:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FC3E9F5EC for ; Sun, 29 Jul 2012 22:02:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C20F9E738 for ; Sat, 28 Jul 2012 20:54:30 -0700 (PDT) Received: from [192.168.1.22] (124-11-22-254.static.tfn.net.tw [124.11.22.254]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Sun, 29 Jul 2012 05:54:26 +0200 Subject: Re: [PATCH] drm/radeon: add new AMD ACPI header and update relevant code From: joeyli To: Luca Tettamanti In-Reply-To: <20120728145626.GA6304@growl> References: <1343237889-5220-1-git-send-email-alexdeucher@gmail.com> <20120726125838.GA28853@growl> <20120726193346.GA11288@growl> <20120728145626.GA6304@growl> Date: Sun, 29 Jul 2012 11:51:48 +0800 Message-ID: <1343533908.6341.6.camel@linux-s257.site> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 X-Mailman-Approved-At: Sun, 29 Jul 2012 21:56:08 -0700 Cc: Alex Deucher , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Hi Luca, ? ??2012-07-28 ? 16:56 +0200?Luca Tettamanti ??? > On Thu, Jul 26, 2012 at 03:42:26PM -0400, Alex Deucher wrote: > > On Thu, Jul 26, 2012 at 3:33 PM, Luca Tettamanti wrote: > > > On Thu, Jul 26, 2012 at 11:35:25AM -0400, Alex Deucher wrote: > > >> On Thu, Jul 26, 2012 at 8:58 AM, Luca Tettamanti wrote: > > >> > The other missing bit is how to actually change the brightness... Alex, > > >> > do you know what registers to poke? > > >> > > >> You need to check if the GPU controls the backlight or the system > > >> does. I think the attached patches should point you in the right > > >> direction. > > > > > > Yep :) > > > > > > 0050: ATOM_FIRMWARE_CAPABILITY_ACCESS usFirmwareCapability : > > > 0050: (union) ATOM_FIRMWARE_CAPABILITY sbfAccess : > > > USHORT GPUControlsBL:1 = 0x0001 (1) > > > > > > The panel is using the INTERNAL_UNIPHY encoder, and I see the > > > UNIPHYTransmitterControl command table. > > > > > > Interaction with video.ko is still a bit messy... > > > > > > Do you already have code for handling the notifications? I'll work on it > > > in the weekend otherwise ;) > > > > I don't have patches for that. Please feel free to work on it :) > > I just found the first problem (probably a BIOS bug): > ATIF_FUNCTION_GET_SYSTEM_PARAMETERS is implemented in the DSDT, but the > corresponding bit ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED is not set :( > I intended to use the method to set up the notification handler but now > my BIOS says that it's not there even if it is... > Can I assume some default values (e.g. notifications are enabled and will > use 0x81 unless ATIF_FUNCTION_GET_SYSTEM_PARAMETERS says something > different)? > > thanks, > Luca > Did you check your DSDT for there have some "Notify (VGA, 0x81)" statement in AFN0..AFN15? If YES, I think that means your machine in case the 0x81 is for ATI used by default. On the other hand, I am also trying to write patch for avoid my AC-power problem. Like your idea, I think just add radeon-acpi to acpi notifier chain then acpi/video feed event to chain before issue KEY code like Matthew's code for ACPI_VIDEO_NOTIFY_SWITCH with intel_opregion on 0x80. The following code for reference: Thanks a lot! Joey Lee diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 1e0a9e1..fc138fd 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -91,6 +91,8 @@ static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device, int type); static void acpi_video_bus_notify(struct acpi_device *device, u32 event); +static u16 video_notify_block_map; + static const struct acpi_device_id video_device_ids[] = { {ACPI_VIDEO_HID, 0}, {"", 0}, @@ -1457,7 +1459,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) acpi_video_device_enumerate(video); acpi_video_device_rebind(video); acpi_bus_generate_proc_event(device, event, 0); - keycode = KEY_SWITCHVIDEOMODE; + if (!acpi_notifier_call_chain(device, event, 0)) + keycode = KEY_SWITCHVIDEOMODE; break; case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ @@ -1479,7 +1482,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) break; } - if (event != ACPI_VIDEO_NOTIFY_SWITCH) + if (event != ACPI_VIDEO_NOTIFY_SWITCH || + event != ACPI_VIDEO_NOTIFY_PROBE) acpi_notifier_call_chain(device, event, 0); if (keycode) {