From patchwork Tue May 10 03:29:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Chang X-Patchwork-Id: 772622 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4A3rng7001282 for ; Tue, 10 May 2011 03:54:14 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4F779E856 for ; Mon, 9 May 2011 20:53:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vw0-f49.google.com (mail-vw0-f49.google.com [209.85.212.49]) by gabe.freedesktop.org (Postfix) with ESMTP id D07219E7EB for ; Mon, 9 May 2011 20:29:05 -0700 (PDT) Received: by vws8 with SMTP id 8so308380vws.36 for ; Mon, 09 May 2011 20:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=biofaKaccZcm2NagQYLA3FfZZTK4VDJpfDrCx5mo2ek=; b=WOiNn8/vwwJG4hVHX78Q6VjEQDMKSM0oiTwFYV3snPpxUIRbgtgatJPDSiQUu2lAgl /eCFmOEYVoFBPx7+tePovs1N1l0e4sPHXEWTpRjEcYodUE2OmpKz4PhUojwwW7De8Fa0 2/5FLnP67A87vIeLMVUyHDgyi1er7Bv4LqoQ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=mWLCgbDD4puj02XNMM681C1fGWV8Ppn5/IlemjlWFbBuHCe6D2g5BpdW4TP72JVlon I6zeQkTEc8g/pVJ0HjxfLTK28PklCjYZbkjEbE/8xNdmt0r4C3wSAbVh0XW76o5YPba/ b/IIM/oE2HThDWjgbeblU4C1Y+Wx6W7Nf1Pe0= MIME-Version: 1.0 Received: by 10.52.75.37 with SMTP id z5mr640635vdv.240.1304998145023; Mon, 09 May 2011 20:29:05 -0700 (PDT) Received: by 10.220.118.7 with HTTP; Mon, 9 May 2011 20:29:04 -0700 (PDT) In-Reply-To: References: <201105081605.46617@rk-nord.at> <4DC8378A020000230002C5A8@novprvlin0050.provo.novell.com> <201105091208.10379@rk-nord.at> Date: Tue, 10 May 2011 11:29:04 +0800 X-Google-Sender-Auth: 3xrVqzlyX6PBGvhfA23-YexE-AE Message-ID: Subject: Re: i915/kms/backlight-combo mode problem From: Michael Chang To: Melchior FRANZ X-Mailman-Approved-At: Mon, 09 May 2011 20:53:36 -0700 Cc: Joey Lee , tiwai@suse.de, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 10 May 2011 03:54:14 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter1.kernel.org id p4A3rng7001282 Melchior, Could you please try this patch and get the log ? We wonder why is_backlight_combination_mode () returns false. We all knew that it returns true during booting (and takashi's fix works to fix the blackscreen for you) and it's unlikely to become false afterward. Perhaps it was changed wrongly .. I speculate that if it returns true matters because it would touch the LPBC register and your problem might get fixed. Thanks in advance. :) 2011/5/9 Michael Chang : > > From the log, it looks like is_backlight_combination_mode is evaluated false > which contradicts with the topic we are discussed. Regardless of the > combination_mode, the log seems to work ..  weird. > > 2011/5/9 Melchior FRANZ >> >> * Joey Lee -- Monday 09 May 2011: >> > The following is debug patch, and please add kernel parameter >> > drm.debug=0x02 : >> >> The result is with acpi_osi=Linux: >> >> >> boot phase: >> [    3.310274] [drm:intel_panel_get_backlight], get backlight val = 2890 >> [    3.310280] [drm:intel_panel_get_backlight], get backlight PWM = 2890 >> [    3.310615] [drm:intel_panel_get_backlight], get backlight val = 2890 >> [    3.310617] [drm:intel_panel_get_backlight], get backlight PWM = 2890 >> [    3.310619] [drm:intel_panel_set_backlight], set backlight PWM = 0 >> [    3.310622] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401930 >> [    3.310624] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [    3.310626] [drm:intel_panel_set_backlight], set backlight level = 0 >> >> [    3.641522] [drm:intel_panel_set_backlight], set backlight PWM = 2890 >> [    3.641525] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399040 >> [    3.641527] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [    3.641529] [drm:intel_panel_set_backlight], set backlight level = 2890 >> >> [   11.410563] video LNXVIDEO:01: Restoring backlight state >> >> >> >> brightness up: >>   [no output] >> >> >> >> brightness down: >> [  152.697127] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  152.697136] [drm:intel_panel_set_backlight], set backlight PWM = 283 >> [  152.697141] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401930 >> [  152.697146] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  152.697150] [drm:intel_panel_set_backlight], set backlight level = 283 >> >> [  166.720631] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  166.720640] [drm:intel_panel_set_backlight], set backlight PWM = 578 >> [  166.720645] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399323 >> [  166.720649] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  166.720654] [drm:intel_panel_set_backlight], set backlight level = 578 >> >> [  178.091776] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  178.091784] [drm:intel_panel_set_backlight], set backlight PWM = 861 >> [  178.091789] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399618 >> [  178.091793] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  178.091797] [drm:intel_panel_set_backlight], set backlight level = 861 >> >> [  188.888370] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  188.888379] [drm:intel_panel_set_backlight], set backlight PWM = 1156 >> [  188.888383] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399901 >> [  188.888388] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  188.888392] [drm:intel_panel_set_backlight], set backlight level = 1156 >> >> [  196.411657] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  196.411665] [drm:intel_panel_set_backlight], set backlight PWM = 1439 >> [  196.411670] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400196 >> [  196.411674] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  196.411678] [drm:intel_panel_set_backlight], set backlight level = 1439 >> >> [  201.256229] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  201.256238] [drm:intel_panel_set_backlight], set backlight PWM = 1734 >> [  201.256243] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400479 >> [  201.256247] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  201.256252] [drm:intel_panel_set_backlight], set backlight level = 1734 >> >> [  206.939838] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  206.939846] [drm:intel_panel_set_backlight], set backlight PWM = 2017 >> [  206.939851] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400774 >> [  206.939856] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  206.939860] [drm:intel_panel_set_backlight], set backlight level = 2017 >> >> [  213.779732] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  213.779740] [drm:intel_panel_set_backlight], set backlight PWM = 2312 >> [  213.779744] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401057 >> [  213.779749] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  213.779753] [drm:intel_panel_set_backlight], set backlight level = 2312 >> >> [  222.583806] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  222.583814] [drm:intel_panel_set_backlight], set backlight PWM = 2595 >> [  222.583819] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401352 >> [  222.583824] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  222.583828] [drm:intel_panel_set_backlight], set backlight level = 2595 >> >> [  229.345860] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  229.345870] [drm:intel_panel_set_backlight], set backlight PWM = 2595 >> [  229.345874] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401635 >> [  229.345879] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  229.345883] [drm:intel_panel_set_backlight], set backlight level = 2595 >> >> >> >> brightness up: >> [  240.594464] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  240.594474] [drm:intel_panel_set_backlight], set backlight PWM = 2312 >> [  240.594479] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401635 >> [  240.594483] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  240.594487] [drm:intel_panel_set_backlight], set backlight level = 2312 >> >> [  240.816722] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  240.816730] [drm:intel_panel_set_backlight], set backlight PWM = 2017 >> [  240.816734] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401352 >> [  240.816739] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  240.816743] [drm:intel_panel_set_backlight], set backlight level = 2017 >> >> [  240.999973] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  240.999981] [drm:intel_panel_set_backlight], set backlight PWM = 1734 >> [  240.999985] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189401057 >> [  240.999990] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  240.999994] [drm:intel_panel_set_backlight], set backlight level = 1734 >> >> [  241.212456] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  241.212464] [drm:intel_panel_set_backlight], set backlight PWM = 1439 >> [  241.212469] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400774 >> [  241.212473] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  241.212478] [drm:intel_panel_set_backlight], set backlight level = 1439 >> >> [  241.395611] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  241.395619] [drm:intel_panel_set_backlight], set backlight PWM = 1156 >> [  241.395624] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400479 >> [  241.395628] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  241.395633] [drm:intel_panel_set_backlight], set backlight level = 1156 >> >> [  242.039460] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  242.039470] [drm:intel_panel_set_backlight], set backlight PWM = 283 >> [  242.039475] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189400196 >> [  242.039479] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  242.039484] [drm:intel_panel_set_backlight], set backlight level = 283 >> >> [  242.044495] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  242.044502] [drm:intel_panel_set_backlight], set backlight PWM = 283 >> [  242.044507] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399323 >> [  242.044511] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  242.044515] [drm:intel_panel_set_backlight], set backlight level = 283 >> >> [  242.077032] [drm:intel_panel_get_max_backlight], max backlight PWM = >> 2890 >> [  242.077038] [drm:intel_panel_set_backlight], set backlight PWM = 0 >> [  242.077043] [drm:intel_panel_set_backlight], set backlight tmp(1) = >> 189399323 >> [  242.077047] [drm:intel_panel_set_backlight], set backlight tmp(2) = >> 189399040 >> [  242.077052] [drm:intel_panel_set_backlight], set backlight level = 0 >> >> m. > > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a06ff07..8f14bfa 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -116,12 +116,21 @@ static int Melchior(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - if (INTEL_INFO(dev)->gen >= 4) - return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; + if (INTEL_INFO(dev)->gen >= 4) { - if (IS_GEN2(dev)) - return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; + int ret = I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; + DRM_DEBUG_DRIVER("BLM_COMBINATION_MODE = %d\n", ret); + return ret; + } + + if (IS_GEN2(dev)) { + int ret = I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; + DRM_DEBUG_DRIVER("BLM_LEGACY_MODE = %d\n", ret); + return ret; + } + + DRM_DEBUG_DRIVER("Do nothing, return false\n"); return 0; }