debug.drm.mode.force causes Invalid Argument Exception

262 views
Skip to first unread message

Florian E

unread,
Apr 5, 2018, 4:36:05 AM4/5/18
to Android-x86
Hey guys,

I'm trying to set a fixed resolution but it is not working somehow.

130|x86_64:/ # cat /proc/fb
0 inteldrmfb

I always get this message if i try to set a mode manually

04-05 08:26:39.422  1317  1317 E GRALLOC-KMS: failed to set crtc (Invalid argument) (crtc_id 39, fb_id 80, conn 73, mode 1920x1080)

original error no is -22

after adding some detail log messages in gralloc_drm_kms.c i also changed the parameters of the created mode 
so for example this one is working well as it is set automatically:

04-05 08:04:47.281  1316  1316 I GRALLOC-KMS: drmModeSetCrtc, mode values clock 74250, hdisplay 1920, hsync_start 2008, hsync_end 2052, htotal 2200, hskew 0, vdisplay 1080, vsync_start 1084, vsync_end 1094, vtotal 1125, vscan 0, vrefresh 60, flags 21, type 64, name 1920x1080i

and this one failes (i even tried to set the SAME values in generate_mode(int h_pixels, int v_lines, float freq))

04-05 08:05:57.340  2429  2429 I GRALLOC-KMS: drmModeSetCrtc, mode values clock 148500, hdisplay 1920, hsync_start 2008, hsync_end 2052, htotal 2200, hskew 0, vdisplay 1080, vsync_start 1084, vsync_end 1094, vtotal 1125, vscan 0, vrefresh 60, flags 5, type 72, name 1920x1080i

in general - all forced modes fail - even if they are available in the found modes connectors list.

any ideas how to get this working? i dont really get the exception, as the arguments dont differ at all?!



Florian E

unread,
Apr 9, 2018, 8:23:55 AM4/9/18
to Android-x86
I'm not getting very far on this.

currently i'm trying to get the debug messages out of the drm modules,

[    0.000000] Command line: BOOT_IMAGE=/android-2018-04-09/kernel root=/dev/ram0 androidboot.selinux=permissive drm.debug=7 DEBUG=2 buildvariant=userdebug

But i do not get any of the DRM_DEBUG_KMS("") messages from kernel in my dmesg.

am i missing something?

Florian E

unread,
Apr 9, 2018, 10:27:22 AM4/9/18
to Android-x86

So i rebuilt a part of the kernel using DRM_INFO instead of DRM_DEBUG_KMS - because i somehow can't get the debug messages to my output.

and now i see why the modes are not used:

[    6.944236] [drm] Not using 1920x1080 mode: CLOCK_HIGH
[    6.944237] [drm] Not using 1920x1080i mode: CLOCK_HIGH
[    6.944238] [drm] Not using 1280x720 mode: CLOCK_HIGH
[    6.944239] [drm] Not using 1280x1024 mode: CLOCK_HIGH
[    6.944240] [drm] Not using 1600x900 mode: CLOCK_HIGH
[    6.944241] [drm] Not using 1680x1050 mode: CLOCK_HIGH
[    6.944241] [drm] Not using 1280x1024 mode: CLOCK_HIGH
[    6.944242] [drm] Not using 1024x768 mode: CLOCK_HIGH
[    6.944243] [drm] Not using 1152x864 mode: CLOCK_HIGH
[    6.944244] [drm] Not using 1280x720 mode: CLOCK_HIGH
[    6.944245] [drm] Not using 1920x1080i mode: CLOCK_HIGH
[    6.944246] [drm] Not using 720x480i mode: H_ILLEGAL
[    6.944247] [drm] Not using 720x576i mode: H_ILLEGAL
[    6.944248] [drm] Not using 1920x1080 mode: CLOCK_HIGH
[    6.944249] [drm] Not using 1920x1080 mode: CLOCK_HIGH
[    6.944249] [drm] Not using 1920x1080i mode: CLOCK_HIGH
[    6.944250] [drm] Not using 1280x720 mode: CLOCK_HIGH
[    6.944251] [drm] Not using 720x480i mode: H_ILLEGAL
[    6.944252] [drm] Not using 1280x768 mode: CLOCK_HIGH

the mode 1280x768 is a test setting, i entered using the video= flag on kernel cmd line.

however i can't find anything about the CLOCK_HIGH field.

i'll keep this updated. it might be an apollo lake issue.

Florian E

unread,
Apr 11, 2018, 4:29:32 AM4/11/18
to Android-x86
Just in case anyone is facing this.

see here:

and here:

Problem is, kernel versions higher than 4.12 have a fallback for invalid/corrupt DP links. in my case it is because of my ZOTAC PI335 has a HDMI which might be a internal DP - this causes problems and the error message [drm:intel_dp_get_link_train_fallback_values [i915]] *ERROR* Link Training Unsuccessful

So my "fix" is to use the code from kernel 4.9 in intel_dp_link_training.c (method: intel_dp_start_link_train)

it might be already fixed in kernel 4.16, as it does not fall back for eDP.
However i built in a log which gives me:

[    4.211500] [drm] intel_dp_is_edp is true
[    4.480684] [drm] intel_dp_is_edp is false
[    4.480704] [drm] intel_dp_is_edp is false

so first run it is detected as edp, afterwards somehow it's not and the fallback would appear.

this however has nothing to do with the android x86 project itself
but now i can choose my resolution myself using the video= kernel cmdline and the debug.drm.mode property
Reply all
Reply to author
Forward
0 new messages