2

I have a rough idea what KMS setting is:

Kernel mode-setting (KMS) shifts responsibility for selecting and setting up the
graphics mode from X.org to the kernel. When X.org is started, it then detects
and uses the mode without any further mode changes. This promises to make 
booting faster, more graphical, and less flickery.

and I gather that nomodeset turns this off (I have not selected that), presumably shifting responsibility back to the graphics card module?

When I do cat /sys/module/i915/parameters/modeset I get -1, what does that mean exactly?

Examing

 modinfo i915 | grep modeset
parm:           modeset:Use kernel modesetting [KMS] (0=DRM_I915_KMS from 
.config, 1=on, -1=force vga console preference [default]) (int)

So looks like it means "force vga console preference", whatever that means...

fpghost
  • 1,649
  • 3
  • 24
  • 33

1 Answers1

4

The documentations for most module parameters is accessible from modinfo (lines wrapped for readability):

$ modinfo i915 | grep modeset
parm:           modeset:Use kernel modesetting [KMS] (0=DRM_I915_KMS from
                .config, 1=on, -1=force vga console preference [default]) (int)

Reading through the Linux source code, it seems that the -1 setting ("force vga console preference") depends on the nomodeset option. That is, if the nomodeset option is present, it acts like i915.modeset=0. Otherwise, if nomodeset is omitted, it is treated as if i915.modeset=1 is set.


Code path:

  • drivers/gpu/drm/i915/i915_drv.c (disables modeset if text console mode is forced):

    if (vgacon_text_force() && i915_modeset == -1)
        driver.driver_features &= ~DRIVER_MODESET;
    
  • video/console/vgacon.c:

    static int vgacon_text_mode_force;
    
    bool vgacon_text_force(void)
    {
        return vgacon_text_mode_force ? true : false;
    }
    
  • (same file):

    static int __init text_mode(char *str)
    {
        vgacon_text_mode_force = 1;
        return 1;
    }
    
  • (same file, set through the kernel cmdline):

    /* force text mode - used by kernel modesetting */
    __setup("nomodeset", text_mode);
    
Lekensteyn
  • 171,743
  • 65
  • 311
  • 401
  • Hah, just that second found that and added to question. But what does force vga console preference mean? – fpghost Jan 20 '14 at 14:09
  • @fpghost See edit, it means that the result depends on `nomodeset` (not) being set. – Lekensteyn Jan 20 '14 at 14:19
  • thanks, btw where exactly are these source files? very useful to see... – fpghost Jan 20 '14 at 17:50
  • 1
    @fpghost I took them from my local git repo (https://git.kernel.org/linus/), but you can also get the package sources using `apt-get source linux-headers-$(uname -r)`. Alternatively, you can use LXR such as http://lxr.free-electrons.com/ to search through the sources. – Lekensteyn Jan 20 '14 at 19:59