Bug 79813

Summary: [hsw bisected regression] Chromebook loses backlight control in 3.15
Product: DRI Reporter: Scot Doyle <lkml14>
Component: DRM/IntelAssignee: Scot Doyle <lkml14>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: critical    
Priority: high CC: intel-gfx-bugs, james.ausmus
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg output with drm.debug=0xe, acer c720 3.15
none
intel bios dump, acer c720, 3.15
none
Revert "drm/i915: do not setup backlight if not available according to VBT"
none
vbios for 3.14 with working backlight
none
vbios for 3.15 with no backlight control
none
dmesg for 3.15 with no backlight control
none
Patch against Linux 3.16-rc2
none
Patch against drm-intel-nightly
none
dmidecode/product & lscpi/vga none

Description Scot Doyle 2014-06-09 04:10:28 UTC
/sys/class/backlight/intel_backlight was available on a Toshiba CB35 Chromebook during the 3.14 series kernels, but disappeared with the release of 3.15. Bisecting identified the cause as:

commit b93124202fc10450a923e24cb052cacb40b2aa46 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

With the following patch (just for testing), the backlight is available again and works as expected.


diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index aff4a11..6743817 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -302,7 +302,7 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 
        entry = &backlight_data->data[panel_type];
 
-       dev_priv->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM;
+       dev_priv->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_NONE;
        if (!dev_priv->vbt.backlight.present) {
                DRM_DEBUG_KMS("PWM backlight not present in VBT (type %u)\n",
                              entry->type);




Linux 3.15 dmesg
----------------
Jun 08 23:28:00 pc kernel: [drm:i915_dump_device_info] i915 device info: gen=7, pciid=0x0a06 flags=is_mobile,need_gfx_hws,is_haswell,has_fbc,has_hotplug,has_llc,has_ddi,has_fpga_dbg,
...
Jun 08 23:28:00 pc kernel: [drm:parse_general_features] BDB_GENERAL_FEATURES int_tv_support 0 int_crt_support 0 lvds_use_ssc 0 lvds_ssc_freq 120000 display_clock_mode 0 fdi_rx_polarity_inverted 0
Jun 08 23:28:00 pc kernel: [drm:parse_general_definitions] crt_ddc_bus_pin: 0
Jun 08 23:28:00 pc kernel: [drm:parse_lfp_panel_data] Found panel mode in BIOS VBT tables:
Jun 08 23:28:00 pc kernel: [drm:drm_mode_debug_printmodeline] Modeline 0:"1366x768" 0 70000 1366 1402 1438 1476 768 772 780 790 0x8 0xa
Jun 08 23:28:00 pc kernel: [drm:parse_lfp_panel_data] VBT initial LVDS value 300300
Jun 08 23:28:00 pc kernel: [drm:parse_lfp_backlight] PWM backlight not present in VBT (type 0)
Jun 08 23:28:00 pc kernel: [drm:parse_sdvo_panel_data] Found SDVO panel mode in BIOS VBT tables:
Jun 08 23:28:00 pc kernel: [drm:drm_mode_debug_printmodeline] Modeline 0:"1600x1200" 0 162000 1600 1664 1856 2160 1200 1201 1204 1250 0x8 0xa
Jun 08 23:28:00 pc kernel: [drm:parse_sdvo_device_mapping] No SDVO device info is found in VBT
Jun 08 23:28:00 pc kernel: [drm:parse_mipi] No MIPI BDB found
Jun 08 23:28:00 pc kernel: [drm:parse_ddi_port] Port A VBT info: DP:1 HDMI:0 DVI:0 EDP:1 CRT:0
Jun 08 23:28:00 pc kernel: [drm:parse_ddi_port] VBT HDMI level shift for port A: 0
Jun 08 23:28:00 pc kernel: [drm:parse_ddi_port] Port B VBT info: DP:0 HDMI:1 DVI:1 EDP:0 CRT:0
Jun 08 23:28:00 pc kernel: [drm:parse_ddi_port] VBT HDMI level shift for port B: 6
...
Jun 08 23:28:00 pc kernel: [drm:_edp_panel_vdd_on] Turning eDP VDD on
Jun 08 23:28:00 pc kernel: [drm:_edp_panel_vdd_on] PP_STATUS: 0x80000008 PP_CONTROL: 0xabcd000f
Jun 08 23:28:00 pc kernel: [drm:intel_dp_get_dpcd] DPCD: 11 0a 81 01 00 00 01 80 02 00 00 00 00 01 00
Jun 08 23:28:00 pc kernel: [drm:intel_dp_init_panel_power_sequencer_registers] panel power sequencer register settings: PP_ON 0x7d00001, PP_OFF 0x1f40001, PP_DIV 0x4af06
Jun 08 23:28:00 pc kernel: [drm:drm_edid_to_eld] ELD: no CEA Extension found
Jun 08 23:28:00 pc kernel: [drm:intel_panel_setup_backlight] native backlight control not available per VBT



Linux 3.15 dmesg with patch
---------------------------
Jun 09 00:23:59 pc kernel: [drm:i915_dump_device_info] i915 device info: gen=7, pciid=0x0a06 flags=is_mobile,need_gfx_hws,is_haswell,has_fbc,has_hotplug,has_llc,has_ddi,has_fpga_dbg,
...
Jun 09 00:23:59 pc kernel: [drm:parse_general_features] BDB_GENERAL_FEATURES int_tv_support 0 int_crt_support 0 lvds_use_ssc 0 lvds_ssc_freq 120000 display_clock_mode 0 fdi_rx_polarity_inverted 0
Jun 09 00:23:59 pc kernel: [drm:parse_general_definitions] crt_ddc_bus_pin: 0
Jun 09 00:23:59 pc kernel: [drm:parse_lfp_panel_data] Found panel mode in BIOS VBT tables:
Jun 09 00:23:59 pc kernel: [drm:drm_mode_debug_printmodeline] Modeline 0:"1366x768" 0 70000 1366 1402 1438 1476 768 772 780 790 0x8 0xa
Jun 09 00:23:59 pc kernel: [drm:parse_lfp_panel_data] VBT initial LVDS value 300300
Jun 09 00:23:59 pc kernel: [drm:parse_lfp_backlight] VBT backlight PWM modulation frequency 200 Hz, active high, min brightness 0, level 255
Jun 09 00:23:59 pc kernel: [drm:parse_sdvo_panel_data] Found SDVO panel mode in BIOS VBT tables:
Jun 09 00:23:59 pc kernel: [drm:drm_mode_debug_printmodeline] Modeline 0:"1600x1200" 0 162000 1600 1664 1856 2160 1200 1201 1204 1250 0x8 0xa
Jun 09 00:23:59 pc kernel: [drm:parse_sdvo_device_mapping] No SDVO device info is found in VBT
Jun 09 00:23:59 pc kernel: [drm:parse_mipi] No MIPI BDB found
Jun 09 00:23:59 pc kernel: [drm:parse_ddi_port] Port A VBT info: DP:1 HDMI:0 DVI:0 EDP:1 CRT:0
Jun 09 00:23:59 pc kernel: [drm:parse_ddi_port] VBT HDMI level shift for port A: 0
Jun 09 00:23:59 pc kernel: [drm:parse_ddi_port] Port B VBT info: DP:0 HDMI:1 DVI:1 EDP:0 CRT:0
Jun 09 00:23:59 pc kernel: [drm:parse_ddi_port] VBT HDMI level shift for port B: 6
...
Jun 09 00:23:59 pc kernel: [drm:intel_panel_setup_backlight] backlight initialized, enabled, brightness 937/937, sysfs interface registered
...
Jun 09 00:23:59 pc kernel: [drm:intel_panel_actually_set_backlight] set backlight PWM = 0
...
Jun 09 00:24:00 pc kernel: [drm:intel_panel_actually_set_backlight] set backlight PWM = 937
...
Jun 09 00:24:00 pc kernel: [drm:intel_backlight_device_update_status] updating intel_backlight, brightness=900/937
Jun 09 00:24:00 pc kernel: [drm:intel_panel_actually_set_backlight] set backlight PWM = 900
Comment 1 Chris Wilson 2014-06-09 06:02:24 UTC
Either the bios is incorrect on your machine, or we are interpreting that version of the bios incorrectly. If it is just a bad bios, you will need to quirk.
Comment 2 Jani Nikula 2014-06-10 09:58:02 UTC
Caused by
commit c675949ec58ca50d5a3ae3c757892f1560f6e896
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Apr 9 11:31:37 2014 +0300

    drm/i915: do not setup backlight if not available according to VBT

There are plenty of machines that have a dedicated EC for backlight control, and break if we provide a backlight interface and touch the backlight registers. The way to provide the information to the kernel is the VBT.
Comment 3 Scot Doyle 2014-06-10 12:05:11 UTC
How would this problem be fixed on my machine? Do I need to submit a patch to enable a "quirk mode" for it? Or maybe there is already a kernel command line option that solves this problem?
Comment 4 Scot Doyle 2014-06-10 12:09:03 UTC
How would this problem be fixed on my machine? Do I need to submit a patch to enable a quirk mode for it? Or maybe there is already a kernel command line option that solves this problem?
Comment 5 Scot Doyle 2014-06-12 11:43:46 UTC
An Acer C720 user has confirmed this diagnostic patch has restored their backlight functionality that disappeared in 3.15.

The Acer C720 is another Haswell generation Chromebook that uses coreboot with seabios.
Comment 6 Jani Nikula 2014-06-13 08:48:24 UTC
Please attach /sys/kernel/debug/dri/0/i915_opregion.
Comment 7 Jani Nikula 2014-06-13 10:08:30 UTC
I think we need to treat this as a regression and fix it one way or another.
Comment 8 Jani Nikula 2014-06-13 14:20:57 UTC
Same bisect result but likely different fix required:
https://bugzilla.kernel.org/show_bug.cgi?id=77831
Comment 9 Scot Doyle 2014-06-14 17:16:13 UTC
/sys/kernel/debug/dri/0/i915_opregion has length 0 bytes under both 3.14.4 (where backlight works) and 3.15.0 (where it doesn't).

Just for the record (in regard to the kernel.org bugzilla report) apple_bl isn't loaded on the chromebook.
Comment 10 Jani Nikula 2014-06-16 12:38:29 UTC
Hmm, please attach dmesg with drm.debug=0xe module parameter set all the way from boot.
Comment 11 Jani Nikula 2014-06-16 12:41:56 UTC
Please attach the dump produced by intel_bios_dumper tool from the intel-gpu-tools package: http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/
Comment 12 James Duley 2014-06-16 19:31:06 UTC
Created attachment 101189 [details]
dmesg output with drm.debug=0xe, acer c720 3.15
Comment 13 James Duley 2014-06-16 19:33:09 UTC
Created attachment 101190 [details]
intel bios dump, acer c720, 3.15
Comment 14 James Duley 2014-06-17 08:42:58 UTC
Is the patch in the first post the best there is at the moment?
Comment 15 Jani Nikula 2014-06-17 12:13:10 UTC
Created attachment 101223 [details] [review]
Revert "drm/i915: do not setup backlight if not available according to VBT"

(In reply to comment #14)
> Is the patch in the first post the best there is at the moment?

If you want to run a patched system, the attached patch is better. I am still hesitant to merge it, as it will regress a load of other systems. Still trying to figure out a better alternative.
Comment 16 Scot Doyle 2014-06-17 12:52:39 UTC
Created attachment 101229 [details]
vbios for 3.14 with working backlight
Comment 17 Scot Doyle 2014-06-17 12:53:40 UTC
Created attachment 101230 [details]
vbios for 3.15 with no backlight control
Comment 18 Scot Doyle 2014-06-17 12:54:26 UTC
Created attachment 101231 [details]
dmesg for 3.15 with no backlight control
Comment 19 Scot Doyle 2014-06-17 13:15:46 UTC
It looks like the chromebooks aren't adding the backlight control because the VBT size check passes but the VBT says there is no backlight.

Do we know of any other machines besides the chromebooks with this exact problem? If not, maybe a quirk would be the best approach? I think I know how to identify the machines in question.
Comment 20 Jani Nikula 2014-06-17 15:00:04 UTC
(In reply to comment #19)
> It looks like the chromebooks aren't adding the backlight control because
> the VBT size check passes but the VBT says there is no backlight.

Yes. Either the VBT is wrong or we're interpreting the VBT wrong. I'm still waiting on an enquiry about the latter possibility.
Comment 21 Jesse Barnes 2014-06-20 17:30:29 UTC
Chromebooks generally don't have fully configured VBTs, so we'll probably need a DMI match table for them, or some other detection method.  Starting with the BYT chromebooks, the VBTs will have a bit more info, but we still rely on the OEMs to program it, so it'll likely only have the bare minimum set of info required to get Chrome up and running with the Chrome kernel, so there may be missing or uninitialized fields relative to a typical PC.
Comment 22 Scot Doyle 2014-06-21 01:30:17 UTC
Jani, do you have a preference as to who writes the patch?

Here's some DMI information for Haswell Chromebook laptops.

DMI_BIOS_VENDOR
all four laptops = "coreboot"

DMI_PRODUCT_NAME
Acer C720 = "Peppy"
Dell Chromebook 11 = "Wolf"
HP Chromebook 14 = "Falco"
Toshiba CB35 = "Leon"
Comment 23 Scot Doyle 2014-06-21 01:41:46 UTC
As far as I can tell, those are the only four Haswell Chromebooks.
Comment 24 Scot Doyle 2014-06-26 00:35:27 UTC
I'm working on a patch. If anyone with an HP 14 Chromebook or Dell 11 Chromebook would like to help, please post the output from:

sudo dmidecode|grep Product
sudo lspci -vnn|grep -A 10 "Graphics Controller"
Comment 25 Scot Doyle 2014-06-26 16:08:06 UTC
Created attachment 101813 [details] [review]
Patch against Linux 3.16-rc2
Comment 26 Scot Doyle 2014-06-26 16:09:30 UTC
Created attachment 101814 [details] [review]
Patch against drm-intel-nightly
Comment 27 Scot Doyle 2014-06-26 16:15:14 UTC
Looking for testers for the patch posted today (either against 3.16-rc2 or drm-intel-nightly) by users of Acer C720, Dell 11, HP 14, and Toshiba CB35 Chromebooks. Thanks!
Comment 28 Jani Nikula 2014-06-27 08:20:34 UTC
Scot, please submit your patch (against drm-intel-nightly) to the intel-gfx mailing list for a wider audience. Thanks.
Comment 29 damocles 2014-06-27 15:44:28 UTC
Created attachment 101879 [details]
dmidecode/product & lscpi/vga
Comment 30 damocles 2014-06-27 15:45:55 UTC
macbook 4,1 also affected.
Comment 31 damocles 2014-06-27 15:48:18 UTC
Comment on attachment 101879 [details]
dmidecode/product & lscpi/vga


kernel 3.13.x all works
kernel 3.14.x black screen at kernel boot time, but restored by init programs
kernel 3.15.x screen to full bright and not backlight
Comment 32 damocles 2014-06-27 15:51:33 UTC
(In reply to comment #29)
> Created attachment 101879 [details]
> dmidecode/product & lscpi/vga
Comment 33 Scot Doyle 2014-06-27 16:37:52 UTC
damocles, have you seen https://bugzilla.kernel.org/show_bug.cgi?id=77831 ?
Comment 34 Scot Doyle 2014-07-04 12:43:43 UTC
Patches applied to drm-intel-fixes

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.