Bug 41586 - [SNB] Add built-in HDTV Modelines for i915
Summary: [SNB] Add built-in HDTV Modelines for i915
Status: CLOSED WORKSFORME
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: low enhancement
Assignee: Paulo Zanoni
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-08 04:48 UTC by Chris Mayo
Modified: 2017-07-24 23:03 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
lspci -nn (2.28 KB, text/plain)
2011-10-08 07:12 UTC, Chris Mayo
no flags Details
dmesg (75.92 KB, text/plain)
2011-10-08 07:13 UTC, Chris Mayo
no flags Details
dmesg_tvon (75.92 KB, application/octet-stream)
2011-10-08 07:13 UTC, Chris Mayo
no flags Details
dmesg_videoset (92.02 KB, text/plain)
2011-10-08 07:14 UTC, Chris Mayo
no flags Details
dmesg (80.92 KB, text/plain)
2011-10-08 07:14 UTC, Chris Mayo
no flags Details
xrandr (3.45 KB, text/plain)
2011-10-08 10:19 UTC, Chris Mayo
no flags Details
xrandr_tvon (3.14 KB, text/plain)
2011-10-08 10:19 UTC, Chris Mayo
no flags Details
xrandr_videoset (3.18 KB, text/plain)
2011-10-08 10:20 UTC, Chris Mayo
no flags Details
dmesg1920x1080MD@50 (218.81 KB, text/plain)
2011-10-15 07:21 UTC, Chris Mayo
no flags Details

Description Chris Mayo 2011-10-08 04:48:25 UTC
Using graphics from a Pentium G630T on Z68 with HDMI output to Panasonic TX-L32D25 TV (full HD). I would like to get the HDMI output working when the TV is powered off on boot. If the TV is on when the computer boots all is well

If the TV is off at boot and I specify video=HDMI-A-1:1920x1080D@50 to the kernel, when I turn the TV on the display is there but it goes blank momentarily every few seconds.


Passing drm.debug=0xe to the kernel and looking at the logs when the TV is on at boot:
kernel: [drm:drm_crtc_helper_set_config], [CONNECTOR:14:HDMI-A-2] to [CRTC:3]
kernel: [drm:drm_crtc_helper_set_config], attempting to set mode from userspace
kernel: [drm:drm_mode_debug_printmodeline], Modeline 20:"1920x1080" 50 148500 1920 2448 2492 2640 1080 1084 1089 1125 0x48 0x5

Adding video=HDMI-A-2:1920x1080@50D to the kernel does not give a display.

With video=HDMI-A-1:1920x1080D@50 the log shows:
kernel: [drm:drm_fb_helper_parse_command_line], cmdline mode for connector HDMI-A-1 1920x1080@50Hz
...
kernel: [drm:drm_crtc_helper_set_config], [CONNECTOR:8:HDMI-A-1] to [CRTC:3]
kernel: [drm:drm_crtc_helper_set_config], attempting to set mode from userspace
kernel: [drm:drm_mode_debug_printmodeline], Modeline 23:"1920x1080" 0 141390 1920 2032 2232 2544 1080 1081 1084 1112 0x0 0x6
kernel: [drm:drm_crtc_helper_set_mode], [CRTC:3]

My workaround is to boot with i915.modeset=0 (no display) and when the TV is on:
modprobe -r drm i915; modprobe drm; modprobe i915 modeset=1

This is just the console, no X. Linux version 3.0.6-gentoo, booting in EFI with efifb.
Comment 1 Daniel Vetter 2011-10-08 05:08:12 UTC
Please boot your kernel with drm.debug=0xe and attach the full dmesg. Also please attach lspci -nn. We also need the version of the kernel, X server and xr86-vidoe-intel driver you've installed.

It's also a bit unclear what does not work when you boot up with your TV switched off. Is it not detected with xrandr? Or does it fail to show a picture? Also, does re-pluggin the hdmi cable after the tv is switched on change anything?
Comment 2 Chris Mayo 2011-10-08 07:12:37 UTC
Created attachment 52114 [details]
lspci -nn
Comment 3 Chris Mayo 2011-10-08 07:13:09 UTC
Created attachment 52115 [details]
dmesg
Comment 4 Chris Mayo 2011-10-08 07:13:51 UTC
Created attachment 52116 [details]
dmesg_tvon
Comment 5 Chris Mayo 2011-10-08 07:14:12 UTC
Created attachment 52117 [details]
dmesg_videoset
Comment 6 Chris Mayo 2011-10-08 07:14:32 UTC
Created attachment 52119 [details]
dmesg
Comment 7 Chris Mayo 2011-10-08 07:14:44 UTC
The issue is the screen is blank (there doesn't appear to be any signal - TV OSD does not indicate resolution/refresh).

It is not using anything like GDM, X is not started. This is just booting to the console.

Kernel is 3.0.6-gentoo but with linux-media from http://www.aregel.de/file_download/6/linux-media.tar.bz2/http://powarman.dyndns.org/hgwebdir.cgi/v4l-dvb-saa716x/summary - as you will see from the dmesg there is a TT6400 card.

Attached 
lspcinn - lspci -nn
dmesg - drm.debug only, TV off on boot turned on later (still blank screen)
dmesg_tvon - drm.debug only, TV on on boot
dmesg_videoset - video=HDMI-A-1:1920x1080D@50, TV off on boot turned on later
(console is visible but screen goes blank momentarily every few seconds)

I was expecting to have to start the kernel with the video value.
Isn't the problem that the modeline calculated for 1920x1080D@50 is not quite the same as the one used after probing the TV and the TV can't maintain it?
Comment 8 Daniel Vetter 2011-10-08 08:33:39 UTC
As far as I can tell the issue is that we bogously kick out all the Modelines on hotplug:

[drm:drm_mode_debug_printmodeline], Modeline 22:"1920x1080i" 0 74250 1920 2008 2052 2200 1080 1084 1094 1125 0x40 0x15
[drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[drm:drm_mode_debug_printmodeline], Modeline 21:"1920x1080i" 0 74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15
[drm:drm_mode_prune_invalid], Not using 1920x1080i mode 7
[drm:drm_mode_debug_printmodeline], Modeline 20:"1920x1080" 0 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5
[drm:drm_mode_prune_invalid], Not using 1920x1080 mode 12
[drm:drm_mode_debug_printmodeline], Modeline 19:"1920x1080" 0 148500 1920 2448 2492 2640 1080 1084 1089 1125 0x48 0x5
[drm:drm_mode_prune_invalid], Not using 1920x1080 mode 12

When the monitor is on from the beginning, we only kick out the interlaced modes (as expected). 12 = MODE_VIRTUAL_Y which makes absolutely no sense.

Can you fire up X and confirm this by running xrandr (before and after hotplug and for the other two configurations)?

I'll look into this later, have to leave now.
Comment 9 Chris Mayo 2011-10-08 10:19:21 UTC
Created attachment 52121 [details]
xrandr
Comment 10 Chris Mayo 2011-10-08 10:19:38 UTC
Created attachment 52122 [details]
xrandr_tvon
Comment 11 Chris Mayo 2011-10-08 10:20:01 UTC
Created attachment 52123 [details]
xrandr_videoset
Comment 12 Chris Mayo 2011-10-08 10:22:28 UTC
Naming as before, except xrandr_videoset are only the values with the TV never turned on.
Comment 13 Daniel Vetter 2011-10-08 14:01:18 UTC
Ok, I've read through some of the code, and as far as I can tell, everything works as it should. The kernel console doesn't support resizing, so when you plug in your TV/switch it on, it can't light it up because the TV only supports 1920x1080, which is larger than what your lvds supports (and hence larger than the initial fb console).

Also, the xrandr output is ok, too, so it should work.

The occasional blackout with the manual modeline is expected, too: Your TV only supports 50Hz and 60Hz whereas the default clock for 1920x1080 is 48,5Hz. The dirt-cheap receiver on your TV can't cope with that clock skew and hence gives up.

[Aside: The real question is why you want hotplug&resize support for the kernel console. That code only exists to show early boot messages (and kernel oopses). To use your display hw a more intelligent display server like X or wayland needs to take over.]
Comment 14 Chris Mayo 2011-10-15 04:07:05 UTC
Thanks for the thorough investigation and taking the time to explain.

Sounds like what I am asking for is to build in support for the HDTV (CEA-861?) Modelines (these are fixed and not calculated?). And then the ability to set something like video=hd1080@60.

Why do I want to do this? The box is a PVR and the TT6400 card mentioned before has its own HDMI which is the primary output here. The Z68 HDMI is only used occasionally, switching between tty1,8 and 12 and even more occasionally start and stop X manually. As a PVR the TV is often not on when the box starts.

Atypical maybe, but apparently not a completely unique wish:
http://lists.freedesktop.org/archives/intel-gfx/2009-September/004048.html
Comment 15 Daniel Vetter 2011-10-15 05:04:03 UTC
Actually you _can_ specify the refresh rate on the kernel cmdline with e.g. @50 See drm_mode_parse_command_line_for_connector in drivers/gpu/drm/drm_modes.c for the full plethora of of options. Can you check whether this is good enough for you?
Comment 16 Chris Mayo 2011-10-15 07:21:57 UTC
Created attachment 52363 [details]
dmesg1920x1080MD@50

I've tried a few different options, none of which give a stable picture:

video=HDMI-A-1:1920x1080D@50 in the original post - which gives a picture but blanks regularly for a few seconds

video=HDMI-A-1:D@50 no picture, chooses:
Modeline 22:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa

drivers/video/modedb.c does have 
#ifdef CONFIG_FB_MODE_HELPERS
const struct fb_videomode cea_modes[64]
containing 1920x1080i@50 & 60
so that inspired me to try a few i modes:

video=HDMI-A-1:1920x1080D@60i no picture,
Modeline 19:"1920x540i" 0 179214 1920 2040 2248 2576 540 541 544 1158 0x0 0x6
video=HDMI-A-1:1920x1080D@50i no picture,
Modeline 19:"1920x540i" 0 146690 1920 2032 2240 2560 540 541 544 1146 0x0 0x6

I guess what I need is either the 50 or 60Hz modes captured in the xrandr_tvon attachment using 148.5MHz pixel clock.

I tried using cvt from:
http://www.uruk.org/~erich/projects/cvt/
to see if using M with or without R might work but couldn't get a 148.5MHz mode. The closest was:

./cvt 1920 1080 50

  # 1920x1080 @ 50.00 Hz (CVT)
  #   field rate 49.93 Hz; hsync: 55.62 kHz; pclk: 141.50 MHz
  Modeline "1920x1080_50.00"  141.50  1920 2032 2232 2544  1080 1083 1088 1114  -HSync +Vsync

So I tried:
video=HDMI-A-1:1920x1080MD@50

This gives a picture but blanks regularly for a few seconds. However, looking at dmesg (attached) it looks like hotplug tried to set the correct 148.5 mode when the TV was turned on?
Comment 17 Chris Mayo 2012-05-13 12:25:51 UTC
I can now get a working display when booting without the TV on, using the new CONFIG_DRM_LOAD_EDID_FIRMWARE:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=da0df92b57311aa1b26a2a90599ed16e1e968b90

and passing to the kernel:
video=HDMI-A-2:e drm_kms_helper.edid_firmware=edid/1920x1080.bin
Comment 18 Chris Wilson 2012-11-22 09:36:44 UTC
Looking at the EDID, and as your own results confirm, your TV doesn't support any of the predefined standard modes. Judging from your information and final solution, the issue behind the flickering every few seconds is hotplug polling (bug 49906). As annoying as it may seem, I think your solution is the best that can be achieved for your scenario (ignoring the residual bugs tracked elsewhere).


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.