* How to work around zero-initialized BLC_PWM_PCH_CTL2? @ 2013-08-29 8:29 Takashi Iwai 2013-08-29 11:58 ` Jani Nikula 0 siblings, 1 reply; 3+ messages in thread From: Takashi Iwai @ 2013-08-29 8:29 UTC (permalink / raw) To: intel-gfx Hi, a new laptop model we've been struggling has some strange hardware configuration. BIOS turns off backlight and skips its initialization when the machine is booted with the lid closed. This leaves BLC_PWM_PCH_CTL2 and other registers uninitialized. Because a proper max brightness value can't be obtained from this register, i915 driver doesn't create the own backlight control any more. It results in the permanent blank screen even after the lid is opened. Actually, the only missing piece is the initial BLC_PWM_PCH_CTL2 value. If I overwrite it via intel_reg_write before loading i915 module, everything works fine. Now I wonder whether we can get this max brightness value from somewhere else. Is it defined in VBT or anywhere else persistent? thanks, Takashi ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to work around zero-initialized BLC_PWM_PCH_CTL2? 2013-08-29 8:29 How to work around zero-initialized BLC_PWM_PCH_CTL2? Takashi Iwai @ 2013-08-29 11:58 ` Jani Nikula 2013-08-30 10:05 ` Takashi Iwai 0 siblings, 1 reply; 3+ messages in thread From: Jani Nikula @ 2013-08-29 11:58 UTC (permalink / raw) To: Takashi Iwai, intel-gfx Hi Takashi - On Thu, 29 Aug 2013, Takashi Iwai <tiwai@suse.de> wrote: > a new laptop model we've been struggling has some strange hardware > configuration. BIOS turns off backlight and skips its initialization > when the machine is booted with the lid closed. This leaves > BLC_PWM_PCH_CTL2 and other registers uninitialized. Because a proper > max brightness value can't be obtained from this register, i915 driver > doesn't create the own backlight control any more. It results in the > permanent blank screen even after the lid is opened. > > Actually, the only missing piece is the initial BLC_PWM_PCH_CTL2 > value. If I overwrite it via intel_reg_write before loading i915 > module, everything works fine. > > Now I wonder whether we can get this max brightness value from > somewhere else. Is it defined in VBT or anywhere else persistent? Please run tools/intel_bios_reader from intel-gpu-tools, and post the results. If that fails, please attach hexdump of /sys/kernel/debug/dri/0/i915_opregion. The PWM value should be in the VBT, and we could use that as a fallback. If the value makes sense, that is. Additionally we could enable the PWM request from ASLE. It would be interesting to see if there are PWM requests, and with what values, if you enable drm.debug=0xe and do: diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index 53a82ea..2b379ec 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c @@ -390,6 +390,7 @@ static u32 asle_set_als_illum(struct drm_device *dev, u32 alsi) static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb) { + DRM_DEBUG_DRIVER("pfmb = 0x%08x\n", pfmb); DRM_DEBUG_DRIVER("PWM freq is not supported\n"); return ASLE_PWM_FREQ_FAILED; } @@ -618,7 +619,8 @@ void intel_opregion_init(struct drm_device *dev) } if (opregion->asle) { - iowrite32(ASLE_TCHE_BLC_EN, &opregion->asle->tche); + iowrite32(ASLE_TCHE_BLC_EN | ASLE_TCHE_PFMB_EN, + &opregion->asle->tche); iowrite32(ASLE_ARDY_READY, &opregion->asle->ardy); } } Adding support for this is a bit tedious, though, as the PWM value has been set as the max for the backlight device. It's probably not a good idea to change the max on the fly in the user space facing interface, so scaling would be required. Note to self, we need to take machines like [1] into account too. BR, Jani. [1] http://lkml.kernel.org/r/1347627426-3813-1-git-send-email-grant.likely@secretlab.ca ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: How to work around zero-initialized BLC_PWM_PCH_CTL2? 2013-08-29 11:58 ` Jani Nikula @ 2013-08-30 10:05 ` Takashi Iwai 0 siblings, 0 replies; 3+ messages in thread From: Takashi Iwai @ 2013-08-30 10:05 UTC (permalink / raw) To: Jani Nikula; +Cc: intel-gfx [-- Attachment #1: Type: text/plain, Size: 3089 bytes --] Hi Jani, At Thu, 29 Aug 2013 14:58:23 +0300, Jani Nikula wrote: > > > Hi Takashi - > > On Thu, 29 Aug 2013, Takashi Iwai <tiwai@suse.de> wrote: > > a new laptop model we've been struggling has some strange hardware > > configuration. BIOS turns off backlight and skips its initialization > > when the machine is booted with the lid closed. This leaves > > BLC_PWM_PCH_CTL2 and other registers uninitialized. Because a proper > > max brightness value can't be obtained from this register, i915 driver > > doesn't create the own backlight control any more. It results in the > > permanent blank screen even after the lid is opened. > > > > Actually, the only missing piece is the initial BLC_PWM_PCH_CTL2 > > value. If I overwrite it via intel_reg_write before loading i915 > > module, everything works fine. > > > > Now I wonder whether we can get this max brightness value from > > somewhere else. Is it defined in VBT or anywhere else persistent? > > Please run tools/intel_bios_reader from intel-gpu-tools, and post the > results. If that fails, please attach hexdump of > /sys/kernel/debug/dri/0/i915_opregion. The PWM value should be in the > VBT, and we could use that as a fallback. If the value makes sense, that > is. Attached below. The tarball contains the boot cases where the lid is opened and closed. The output of intel_bios_dumper couldn't be read when the lid is closed, as it seems. In anyway, I see no obvious value (the max brightness 0x3a9) in intel_bios_reader output. > Additionally we could enable the PWM request from ASLE. It would be > interesting to see if there are PWM requests, and with what values, if > you enable drm.debug=0xe and do: > diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c > index 53a82ea..2b379ec 100644 > --- a/drivers/gpu/drm/i915/intel_opregion.c > +++ b/drivers/gpu/drm/i915/intel_opregion.c > @@ -390,6 +390,7 @@ static u32 asle_set_als_illum(struct drm_device *dev, u32 alsi) > > static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb) > { > + DRM_DEBUG_DRIVER("pfmb = 0x%08x\n", pfmb); > DRM_DEBUG_DRIVER("PWM freq is not supported\n"); > return ASLE_PWM_FREQ_FAILED; > } > @@ -618,7 +619,8 @@ void intel_opregion_init(struct drm_device *dev) > } > > if (opregion->asle) { > - iowrite32(ASLE_TCHE_BLC_EN, &opregion->asle->tche); > + iowrite32(ASLE_TCHE_BLC_EN | ASLE_TCHE_PFMB_EN, > + &opregion->asle->tche); > iowrite32(ASLE_ARDY_READY, &opregion->asle->ardy); > } > } > > Adding support for this is a bit tedious, though, as the PWM value has > been set as the max for the backlight device. It's probably not a good > idea to change the max on the fly in the user space facing interface, so > scaling would be required. With the patch, no useful information showed up, unfortunately. > Note to self, we need to take machines like [1] into account too. Yep, we can't take some value blindly. thanks, Takashi > > > BR, > Jani. > > > [1] http://lkml.kernel.org/r/1347627426-3813-1-git-send-email-grant.likely@secretlab.ca > --- [-- Attachment #2: vbios-opregion.tar.bz2 --] [-- Type: application/octet-stream, Size: 88423 bytes --] [-- Attachment #3: Type: text/plain, Size: 159 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-30 10:03 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-08-29 8:29 How to work around zero-initialized BLC_PWM_PCH_CTL2? Takashi Iwai 2013-08-29 11:58 ` Jani Nikula 2013-08-30 10:05 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox