From mboxrd@z Thu Jan 1 00:00:00 1970 From: harrykipper Subject: Help needed for unusual hack Date: Fri, 31 Jul 2015 14:34:06 +0100 Message-ID: <1438349646.1473.0@smtp.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0190676070==" Return-path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CC9B7A1CA for ; Fri, 31 Jul 2015 06:34:13 -0700 (PDT) Received: by wicmv11 with SMTP id mv11so58518087wic.0 for ; Fri, 31 Jul 2015 06:34:11 -0700 (PDT) Received: from dhcp-149-170-239-1.mmu.ac.uk ([149.170.239.1]) by smtp.gmail.com with ESMTPSA id ej5sm7234198wjd.22.2015.07.31.06.34.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 06:34:10 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0190676070== Content-Type: multipart/alternative; boundary="=-A+5xW7x9GVFKOzjRMeKz" --=-A+5xW7x9GVFKOzjRMeKz Content-Type: text/plain; charset=utf-8; format=flowed Hello, I have a Thinkpad X230 (IvyBridge, HD4000) with a very clever display mod (described to some extent by a guy here --> http://boweihe.me/?p=1442). Practically the low res native LVDS panel of the laptop was replaced with a FHD IPS eDP panel. The FHD eDP screen is attached to the dock DisplayPort connector on the laptop's mainboard, which has been rewired in some way, possibly with an interface board. The setup works fairly well, the screen is detected as DP-3 (the laptop has two other external digital ports) and treated as external. I could disable the non existent lvds screen using video=lvds1:d to prevent the gpu from duplicating the signal and wasting power, but that doesn't give me brightness controls because the lvds port is still initialized by the drm module and the intel_backlight/ directory is found in /sys/devices/pci0000\:00/0000\:00\:02.0/drm/card0/card0-LVDS-1/. To try and solve this I went ahead and: 1 - added my laptop's vendor and model number to the intel_no_lvds_dmi_callback() function in intel_lvds.c 2 - changed the is_edp() function in intel_dp.c to always return 'true' :-D This way the lvds port skips being initialized, so card0-LVDS-1 doesn't exist at all, the DP port is detected as eDP and intel_backlight sits correctly in /sys/devices/pci0000\:00/0000\:00\:02.0/drm/card0/card0-DP-1/. The screen works perfectly, I have full backlight control and xrandr shows all the modes supported by the panel. The backdrop is that the other two digital ports are lost, because the kernel disables them when it tries to initialize them as eDP, which obviously they are not. In dmesg I see [drm] failed to retrieve link info, disabling eDP repeated twice, suggesting that the third port is configured correctly, as in fact it is. Now obviously this is a very ugly hack that I came up with as a non programmer, unfamiliar with the kernel, and additionally I have an error at boot (see below) My question is (are): could anyone suggest a more clever way of forcing the third DP port to be detected as eDP and keeping the other two alive? Is the error below something that I should worry about? Thanks very much and sorry if this is not the right place to ask. WARNING: CPU: 0 PID: 6 at drivers/gpu/drm/i915/intel_display.c:1034 ironlake_crtc_disable+0x93/0x7f0() [ 3.220452] pipe_off wait timed out [ 3.220453] Modules linked in: [ 3.220456] CPU: 0 PID: 6 Comm: kworker/u16:0 Tainted: G U 4.1.3-eDP #7 [ 3.220458] Hardware name: LENOVO 2324B14/2324B14, BIOS G2ETA4WW (2.64 ) 04/09/2015 [ 3.220463] Workqueue: events_unbound async_run_entry_fn [ 3.220466] ffffffff8174a298 000000004c6f2a3f ffffffff8174a298 ffffffff815d398b [ 3.220468] ffff8802149377f0 ffffffff81071907 ffff8802146e0000 ffff880214a92800 [ 3.220470] 0000000000000000 ffff880214a92b38 ffff880214a92b40 ffffffff81071998 [ 3.220471] Call Trace: [ 3.220478] [] ? dump_stack+0x47/0x67 [ 3.220482] [] ? warn_slowpath_common+0x77/0xb0 [ 3.220484] [] ? warn_slowpath_fmt+0x58/0x80 [ 3.220488] [] ? ironlake_crtc_disable+0x93/0x7f0 [ 3.220492] [] ? drm_mode_copy+0x19/0x30 [ 3.220496] [] ? __kmalloc_track_caller+0x20/0x1d0 [ 3.220499] [] ? __intel_set_mode+0xb6c/0xc90 [ 3.220503] [] ? intel_dump_pipe_config.isra.52+0x33/0x3e0 [ 3.220508] [] ? gen6_write32+0x2c/0x90 [ 3.220510] [] ? intel_crtc_set_config+0xd3a/0x1060 [ 3.220514] [] ? drm_atomic_state_clear+0x10a/0x180 [ 3.220517] [] ? drm_mode_set_config_internal+0x5f/0x100 [ 3.220521] [] ? restore_fbdev_mode+0xb9/0xe0 [ 3.220524] [] ? drm_fb_helper_restore_fbdev_mode_unlocked+0x1b/0x60 [ 3.220526] [] ? drm_fb_helper_set_par+0x1d/0x40 [ 3.220530] [] ? intel_fbdev_set_par+0x11/0x60 [ 3.220533] [] ? fbcon_init+0x580/0x610 [ 3.220536] [] ? visual_init+0xac/0x110 [ 3.220539] [] ? do_bind_con_driver+0x1e4/0x440 [ 3.220542] [] ? do_take_over_console+0x110/0x1a0 [ 3.220545] [] ? do_fbcon_takeover+0x53/0xc0 [ 3.220550] [] ? notifier_call_chain+0x47/0x70 [ 3.220552] [] ? __blocking_notifier_call_chain+0x3c/0x60 [ 3.220556] [] ? register_framebuffer+0x210/0x360 [ 3.220559] [] ? drm_fb_helper_initial_config+0x282/0x470 [ 3.220561] [] ? async_run_entry_fn+0x3e/0x150 [ 3.220564] [] ? process_one_work+0x11e/0x3d0 [ 3.220566] [] ? worker_thread+0x48/0x4c0 [ 3.220570] [] ? preempt_schedule_common+0x1a/0x40 [ 3.220572] [] ? process_one_work+0x3d0/0x3d0 [ 3.220576] [] ? kthread+0xc8/0xe0 [ 3.220579] [] ? kthread_worker_fn+0x180/0x180 [ 3.220582] [] ? ret_from_fork+0x42/0x70 [ 3.220585] [] ? kthread_worker_fn+0x180/0x180 [ 3.220587] ---[ end trace 5ff7400acd9836ea ]--- [ 3.330758] [drm:ironlake_crtc_disable] *ERROR* failed to disable transcoder A [ 3.333347] [drm:intel_set_pch_fifo_underrun_reporting] *ERROR* uncleared pch fifo underrun on pch transcoder A [ 3.333350] [drm:cpt_irq_handler] *ERROR* PCH transcoder A FIFO underrun --=-A+5xW7x9GVFKOzjRMeKz Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hello, I have a Thinkpad X230 (IvyBridge, HD4000) with a very clever d= isplay mod (described to some extent by a guy here --> http://boweihe.me/?p=3D1442). Practically the lo= w res native LVDS panel of the laptop was replaced with a FHD IPS eDP panel= . The FHD eDP screen is attached to the dock DisplayPort connector on the l= aptop's mainboard, which has been rewired in some way, possibly with an int= erface board. The setup works fairly well, the screen is detected as DP-3 (= the laptop has two other external digital ports) and treated as external. I= could disable the non existent lvds screen using video=3Dlvds1:d to preven= t the gpu from duplicating the signal and wasting power, but that doesn't g= ive me brightness controls because the lvds port is still initialized by th= e drm module and the intel_backlight/ directory is found in /sys/devices/pc= i0000\:00/0000\:00\:02.0/drm/card0/card0-LVDS-1/. 

To try and solve this I went ahead and: 
1 - added my = laptop's vendor and model number to the intel_no_lvds_dmi_callback() functi= on in intel_lvds.c 
2 - changed the is_edp() function in int= el_dp.c to always return 'true' :-D

This way the l= vds port skips being initialized, so card0-LVDS-1 doesn't exist at all, the= DP port is detected as eDP and intel_backlight sits correctly in /sys/devi= ces/pci0000\:00/0000\:00\:02.0/drm/card0/card0-DP-1/. The screen works perf= ectly, I have full backlight control and xrandr shows all the modes support= ed by the panel. The backdrop is that the other two digital ports are lost,= because the kernel disables them when it tries to initialize them as eDP, = which obviously they are not. In dmesg I see 

[drm] failed to retrieve link info, disabling eDP

repeated twice, suggesting that the third port is configured correctly, as= in fact it is.

Now obviously this is a very ugly = hack that I came up with as a non programmer, unfamiliar with the kernel, a= nd additionally I have an error at boot (see below)

My question is (are): could anyone suggest a more clever way of forcing t= he third DP port to be detected as eDP and keeping the other two alive? Is = the error below something that I should worry about?

Thanks very much and sorry if this is not the right place to ask.<= div>
WARNING: CPU: 0 PID: 6 at drivers/gpu/drm/i915/intel_dis= play.c:1034 ironlake_crtc_disable+0x93/0x7f0()
[    3.2= 20452] pipe_off wait timed out
[    3.220453] Modules l= inked in:
[    3.220456] CPU: 0 PID: 6 Comm: kworker/u1= 6:0 Tainted: G     U          4.1.3-eDP = #7
[    3.220458] Hardware name: LENOVO 2324B14/2324B14= , BIOS G2ETA4WW (2.64 ) 04/09/2015
[    3.220463] Workq= ueue: events_unbound async_run_entry_fn
[    3.220466] =  ffffffff8174a298 000000004c6f2a3f ffffffff8174a298 ffffffff815d398b
[    3.220468]  ffff8802149377f0 ffffffff81071907 f= fff8802146e0000 ffff880214a92800
[    3.220470]  0= 000000000000000 ffff880214a92b38 ffff880214a92b40 ffffffff81071998
[    3.220471] Call Trace:
[    3.220478] &= nbsp;[<ffffffff815d398b>] ? dump_stack+0x47/0x67
[   &= nbsp;3.220482]  [<ffffffff81071907>] ? warn_slowpath_common+0x77= /0xb0
[    3.220484]  [<ffffffff81071998>] ?= warn_slowpath_fmt+0x58/0x80
[    3.220488]  [<= ffffffff813c7183>] ? ironlake_crtc_disable+0x93/0x7f0
[  =  3.220492]  [<ffffffff81358229>] ? drm_mode_copy+0x19/0x30=
[    3.220496]  [<ffffffff81158c30>] ? __km= alloc_track_caller+0x20/0x1d0
[    3.220499]  [<= ;ffffffff813c897c>] ? __intel_set_mode+0xb6c/0xc90
[   &n= bsp;3.220503]  [<ffffffff813be913>] ? intel_dump_pipe_config.isr= a.52+0x33/0x3e0
[    3.220508]  [<ffffffff813b1= 41c>] ? gen6_write32+0x2c/0x90
[    3.220510]  = [<ffffffff813cfc9a>] ? intel_crtc_set_config+0xd3a/0x1060
[=    3.220514]  [<ffffffff8136178a>] ? drm_atomic_state= _clear+0x10a/0x180
[    3.220517]  [<ffffffff81= 351fcf>] ? drm_mode_set_config_internal+0x5f/0x100
[   &n= bsp;3.220521]  [<ffffffff81340279>] ? restore_fbdev_mode+0xb9/0x= e0
[    3.220524]  [<ffffffff8134218b>] ? dr= m_fb_helper_restore_fbdev_mode_unlocked+0x1b/0x60
[    = 3.220526]  [<ffffffff813421ed>] ? drm_fb_helper_set_par+0x1d/0x4= 0
[    3.220530]  [<ffffffff813de4f1>] ? int= el_fbdev_set_par+0x11/0x60
[    3.220533]  [<ff= ffffff812a50e0>] ? fbcon_init+0x580/0x610
[    3.220= 536]  [<ffffffff8130bb4c>] ? visual_init+0xac/0x110
[ =    3.220539]  [<ffffffff8130d694>] ? do_bind_con_drive= r+0x1e4/0x440
[    3.220542]  [<ffffffff8130dc3= 0>] ? do_take_over_console+0x110/0x1a0
[    3.220545= ]  [<ffffffff812a51c3>] ? do_fbcon_takeover+0x53/0xc0
= [    3.220550]  [<ffffffff8108d647>] ? notifier_call_c= hain+0x47/0x70
[    3.220552]  [<ffffffff8108d9= 3c>] ? __blocking_notifier_call_chain+0x3c/0x60
[    = ;3.220556]  [<ffffffff812ae0d0>] ? register_framebuffer+0x210/0x= 360
[    3.220559]  [<ffffffff81342492>] ? d= rm_fb_helper_initial_config+0x282/0x470
[    3.220561] =  [<ffffffff8108ed7e>] ? async_run_entry_fn+0x3e/0x150
= [    3.220564]  [<ffffffff81086d4e>] ? process_one_wor= k+0x11e/0x3d0
[    3.220566]  [<ffffffff8108704= 8>] ? worker_thread+0x48/0x4c0
[    3.220570]  = [<ffffffff815d70ca>] ? preempt_schedule_common+0x1a/0x40
[ =    3.220572]  [<ffffffff81087000>] ? process_one_work+= 0x3d0/0x3d0
[    3.220576]  [<ffffffff8108ca38&= gt;] ? kthread+0xc8/0xe0
[    3.220579]  [<ffff= ffff8108c970>] ? kthread_worker_fn+0x180/0x180
[    = 3.220582]  [<ffffffff815da8d2>] ? ret_from_fork+0x42/0x70
<= div>[    3.220585]  [<ffffffff8108c970>] ? kthread_wor= ker_fn+0x180/0x180
[    3.220587] ---[ end trace 5ff740= 0acd9836ea ]---
[    3.330758] [drm:ironlake_crtc_disab= le] *ERROR* failed to disable transcoder A
[    3.33334= 7] [drm:intel_set_pch_fifo_underrun_reporting] *ERROR* uncleared pch fifo u= nderrun on pch transcoder A
[    3.333350] [drm:cpt_irq= _handler] *ERROR* PCH transcoder A FIFO underrun
= --=-A+5xW7x9GVFKOzjRMeKz-- --===============0190676070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0190676070==--