From patchwork Tue Jul 16 05:08:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 2827878 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EAA319F967 for ; Tue, 16 Jul 2013 05:07:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 083B320172 for ; Tue, 16 Jul 2013 05:07:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D98832017D for ; Tue, 16 Jul 2013 05:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930Ab3GPFH3 (ORCPT ); Tue, 16 Jul 2013 01:07:29 -0400 Received: from mga03.intel.com ([143.182.124.21]:58625 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915Ab3GPFH3 (ORCPT ); Tue, 16 Jul 2013 01:07:29 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 15 Jul 2013 22:07:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,674,1367996400"; d="scan'208";a="268813715" Received: from aaronlu.sh.intel.com ([10.239.36.102]) by AZSMGA002.ch.intel.com with ESMTP; 15 Jul 2013 22:07:26 -0700 Message-ID: <51E4D535.10009@intel.com> Date: Tue, 16 Jul 2013 13:08:05 +0800 From: Aaron Lu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: Matthew Garrett , Len Brown , ACPI Devel Mailing List , Zhang Rui , Micael Dias , Dan Garton , Bob Ziuchkovski Subject: Re: [PATCH] acpi: video: no automatic brightness changes by firmware References: <51B98CFD.7090409@intel.com> <51BE5FD6.6070405@intel.com> <20130617224040.GB14793@srcf.ucam.org> <51BFA628.8000804@intel.com> <51D61E3B.2000205@intel.com> In-Reply-To: <51D61E3B.2000205@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Starting from win8, MS backlight control driver will set bit 2 of the parameter of control method _DOS, to inform firmware it should not perform any automatic brightness changes. This mostly affects hotkey notification deliver - if we do not set this bit, on hotkey press, firmware may choose to adjust brightness level instead of sending out notification and doing nothing. So this patch sets bit 2 when calling _DOS so that GUIs can show the notification window on hotkey press. This behavior change is only necessary for win8 systems. The MS document on win8 backlight control is here: http://msdn.microsoft.com/en-US/library/windows/hardware/jj159305 Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=52951 Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=56711 Reported-by: Micael Dias Reported-by: Dan Garton Reported-by: Bob Ziuchkovski Signed-off-by: Aaron Lu --- Apply on top of: https://patchwork.kernel.org/patch/2812951/ (expose OSI version) https://patchwork.kernel.org/patch/2827793/ (win8 video quirk) Micael, Dan and Bob, Please give the patch a test if possible, thanks. v2: Make the behavior change only for win8 systems; use the newly added function acpi_video_backlight_quirks as the condition check for win8. drivers/acpi/video.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 1.8.3.2.10.g43d11f4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 01b1a25..bc2954b 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -1534,14 +1534,20 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) /* acpi_video interface */ +/* + * Win8 requires setting bit2 of _DOS to let firmware know it shouldn't + * preform any automatic brightness change on receiving a notification. + */ static int acpi_video_bus_start_devices(struct acpi_video_bus *video) { - return acpi_video_bus_DOS(video, 0, 0); + return acpi_video_bus_DOS(video, 0, + acpi_video_backlight_quirks() ? 1 : 0); } static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) { - return acpi_video_bus_DOS(video, 0, 1); + return acpi_video_bus_DOS(video, 0, + acpi_video_backlight_quirks() ? 0 : 1); } static void acpi_video_bus_notify(struct acpi_device *device, u32 event)