Solved Intel i3-2120 Integrated Graphics with drm-kmod is working only in software rendering mode (llvmpipe)?

Hi,
this is a Core i3-2120 (2nd gen) processor & 6 GB DDR3 RAM based desktop with FreeBSD 12.1 running on UEFI mode with Gnome-3.28.x . I can get the graphics working only by installing drm-legacy-kmod. However, pkg says:
Legacy DRM driver that used to be in FreeBSD base before the removal in FreeBSD
13. For newer Intel and AMD hardware, please use graphics/drm-kmod which will
pick an appropriate driver for your system.

If I install drm-kmod, it isn't working.Also, I will prefer 1080x1920 @70Hz which is the resolution working in Linux distros. With legacy-kmod, 1080p@60Hz it's showing. I'm setting up FreeBSD after a long time. Please bear with my doubts.

Code:
vgapci0@pci0:0:2:0:    class=0x030000 card=0x20038086 chip=0x01028086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '2nd Generation Core Processor Family Integrated Graphics Controller'
    class      = display
    subclass   = VGA
Code:
kldstat
Id Refs Address                Size Name
1   35 0xffffffff80200000  2272498 kernel
2    1 0xffffffff82474000    27cc0 fuse.ko
3    1 0xffffffff828e6000    7aac0 i915kms.ko
4    1 0xffffffff82961000    44448 drm2.ko
5    4 0xffffffff829a6000     3754 iicbus.ko
6    1 0xffffffff829aa000      f98 iic.ko
7    1 0xffffffff829ab000     18a4 iicbb.ko
8    1 0xffffffff829ad000     1860 uhid.ko
9    1 0xffffffff829af000     2908 ums.ko
10    1 0xffffffff829b2000    25248 ipfw.ko
11    1 0xffffffff829d8000     87d0 tmpfs.ko
 
I read again. Sandybridge IGP is supported only in drm-legacy-kmod. What is worrying is, there is a message which said drm-legacy-kmod will be deprecated in 3 months time. So, I'm curious what will happen then? Will the legacy driver gets merged with drm-kmod?

Another doubt - Gnome 3, despite all bad reputations is the major DE in popular Linux distributions. Will the ports/pkgs see upgrade to 3.38 or the latest version anytime soon? I know, seems volunteers are less.
 
Sandybridge IGP is supported only in drm-legacy-kmod.

That's not true, drm-kmod is supposed to support all these legacy devices as well. However, it was mostly tested with relatively new hardware, so there might be regressions.

What is worrying is, there is a message which said drm-legacy-kmod will be deprecated in 3 months time. So, I'm curious what will happen then?

Removal, obviously.

Will the legacy driver gets merged with drm-kmod?

drm-legacy-kmod is an old port of the same set of drivers, there is nothing to merge.
 
I have a weird issue with gdm (Gnome3) - When the sytem boots into gdm screen, if I enter password, a black screen comes and Gnome-shell fails to load, returning to gdm. But, the 2nd time, I can login to Gnome-shell fine. What is the problem? Any policykit or consolekit issue?
That's not true, drm-kmod is supposed to support all these legacy devices as well. However, it was mostly tested with relatively new hardware, so there might be regressions.
drm-legacy-kmod is an old port of the same set of drivers, there is nothing to merge.
I am really not sure. I was checking the dmesg and saw this:
Code:
% dmesg |grep i915
info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
info: [drm] capturing error event; look for more information in sysctl hw.dri.0.info.i915_error_state
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid0:i915_reset] *ERROR* GPU hanging too fast, declaring wedged!
error: [drm:pid0:i915_reset] *ERROR* Failed to reset chip.
Code:
% glxinfo|grep rend
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
    GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 8.0, 256 bits)
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_MESA_ycbcr_texture, GL_NV_conditional_render, GL_NV_depth_clamp,
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance,
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,

Also, coretemp module is not loading.
Code:
% doas sysctl -a | grep -i temperature
fg: no job control in this shell.
 
By looking at your glxinfo, it appears that you didn't get 3D acceleration which means that the intel kms driver is not used. Make sure that sysrc kld_list contain at least /boot/modules/i915kms.ko
Normally the drm-kms driver are using linuxkpi so it is odd that there is no linuxkpi.ko in kldstat output
I am using an i3-2328M, and have 3D acceleration using drm-kmod, I can run Xorg either with modesetting driver or with the intel driver from x11-drivers/xf86-video-intel .
Also I have microcode update setup in /boot/loader.conf
Code:
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"

We may need a full Xorg.0.log to understand the current issue
 
Code:
sysrc kld_list
kld_list: /boot/modules/i915kms.ko
I tried drm-kmod and believe me, nothing is detected. I also have another issue - gdm fails to login at the first attempt and login fine on 2nd attempt. From what I understand drm-kmod supports Haswell (4th gen) onwards only?

There is no linuxkpi modules in kldstat output. If I run glxgears, the graphics is smooth. Xorg.0.log is attached. I have a /usr/local/share/X11/xorg.conf generated for this system. My monitor is a LG 22MK430H using hdmi out and supported resolution is 1920x1080 @ 75Hz, while @60Hz is what is working currently. I have added the Horizontal and Vertical frequency range limit for this monitor. But, not working @75Hz. I have the icm profile of this monitor auto detected in Linux, but not happening in FreeBSD Gnome.
 

Attachments

  • Xorg.0.txt
    39.8 KB · Views: 169
  • xorg.conf.txt
    3.4 KB · Views: 162
With software rendering glxgears can be smooth, looking at Xorg.0.log I can see that the intel driver is loaded. Can you try starting X without the xorg.conf files? (You can rename it as xorg.conf.back for example), and then post back the Xorg.0.log as well as the output of glxinfo
Ideally by using startx and a simple window manager
 
With software rendering glxgears can be smooth, looking at Xorg.0.log I can see that the intel driver is loaded. Can you try starting X without the xorg.conf files? (You can rename it as xorg.conf.back for example), and then post back the Xorg.0.log as well as the output of glxinfo
Ideally by using startx and a simple window manager
I have attached the output of glxinfo & Xorg log after removing xorg.conf.
No, we are not going to just believe you. What exactly is the dmesg/Xorg output in that case?
Hmm. I will update in a few minutes (remove drm-legacy, install drm-kmod & rebooting).
 

Attachments

  • glxinfo.txt
    81.3 KB · Views: 122
  • Xorg.0.log.txt
    35.3 KB · Views: 165
@shkhln : Display is working with drm-kmod. But, some manual jobs done. I removed drm-legacy-kmod package and reinstalled drm-kmod. I have attached the kldstat and dmesg with drm-kmod in this post. It is loading drm.ko and i915kms.ko which are I presume the legacy modules. So, I moved these modules out of /boot/modules folder and rebooted, and it worked!

My doubt is, after purging drm-legacy-kmod, should've removed drm & i915kms modules?
 

Attachments

  • dmesg-drm-kmod.txt
    9 KB · Views: 163
  • kldstat-drm-kmod.txt
    592 bytes · Views: 173
This thread helped: https://forums.freebsd.org/threads/t430-and-drm2-driver-deprecation-message.77076/

And what is the basis for this assumption?
kldstat said so. But, when I removed the modules, this is what kldstat looks now:
Code:
%  kldstat
Id Refs Address                Size Name
1   39 0xffffffff80200000  2272498 kernel
2    1 0xffffffff82777000     2ba0 coretemp.ko
3    1 0xffffffff8277a000    27cc0 fuse.ko
4    1 0xffffffff82ae6000     1860 uhid.ko
5    1 0xffffffff82ae8000     2908 ums.ko
6    1 0xffffffff82aeb000    25248 ipfw.ko
7    1 0xffffffff82b11000     1000 cpuctl.ko
8    1 0xffffffff82b12000    7e070 i915kms.ko
9    1 0xffffffff82b91000    44448 drm2.ko
10    4 0xffffffff82bd6000     3754 iicbus.ko
11    1 0xffffffff82bda000      f98 iic.ko
12    1 0xffffffff82bdb000     18a4 iicbb.ko
13    1 0xffffffff82bdd000     87d0 tmpfs.ko
Suppose, if I move back the old modules (drm & i915kms) back to the /boot/modules directory, most probably X will not work. I will check now. I had a line in /etc/rc.conf which is removed now:
kld_list="/boot/modules/i915kms.ko"
 
UPDATE: I removed the line "kld_list="/boot/modules/i915kms.ko" from /etc/rc.conf and moved back drm.ko & i915kms.ko to /boot/modules and rebooted. And now drm2 is loaded and X is working fine.

But, there are some error messages in dmesg:
Code:
fbd0 on drmn0
VT: Replacing driver "efifb" with new "fb".
drmn0: No ACPI video bus found
info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0
info: [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
pid 44785 (tracker-miner-fs), jid 0, uid 1001: exited on signal 11
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
info: [drm] capturing error event; look for more information in sysctl hw.dri.0.info.i915_error_state
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid0:i915_reset] *ERROR* GPU hanging too fast, declaring wedged!
error: [drm:pid0:i915_reset] *ERROR* Failed to reset chip.
pid 32999 (gnome-keyring-daemo), jid 0, uid 1001: exited on signal 11
pid 64110 (tracker-miner-fs), jid 0, uid 1001: exited on signal 11
 

Attachments

  • dmesg-new.txt
    26.3 KB · Views: 138
I would suggest to also remove x11-drivers/xf86-video-scfb and x11-drivers/xf86-video-vesa so that it cannot fail back to llvm pipe. Also it could be that graphics/drm-fbsd12.0-kmod was not build against the same FreeBSD version. The latest 12.1 should be : FreeBSD_version: 1201000
If you do pkg info drm-fbsd12.0-kmod and look at the annotations part you will see the fields FreeBSD_version, check it. If it is 1200086 then this may be the origin of the issue, you will need to build this port so that it match your FreeBSD_version
 
I had used this iso for installation - FreeBSD-12.1-STABLE-amd64-20200827-r364849-memstick.img . Is this the problem?
I would suggest to also remove x11-drivers/xf86-video-scfb and x11-drivers/xf86-video-vesa so that it cannot fail back to llvm pipe. Also it could be that graphics/drm-fbsd12.0-kmod was not build against the same FreeBSD version. The latest 12.1 should be : FreeBSD_version: 1201000
If you do pkg info drm-fbsd12.0-kmod and look at the annotations part you will see the fields FreeBSD_version, check it. If it is 1200086 then this may be the origin of the issue, you will need to build this port so that it match your FreeBSD_version
I removed scfb and vesa. The fbsd12.0-kmod version is 1201000. But, gdm fails to login on the first try, and when I check dmesg there is a list of errors and warnings about gnome-keyring and drm -
Code:
intel_sdvo_ddc_proxy921920 on drmn0
intel_sdvo_ddc_proxy921920: detached
drm_iic_dp_aux0 on drmn0
drm_iic_dp_aux1 on drmn0
drmn0: taking over the fictitious range 0xe0000000-0xf0000000
info: [drm] Connector VGA-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.VGA-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-2
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector DP-2: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.DP-2
info: [drm]   - kern.vt.fb.default_mode
fbd0 on drmn0
VT: Replacing driver "efifb" with new "fb".
drmn0: No ACPI video bus found
info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0
info: [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
pid 73198 (tracker-miner-fs), jid 0, uid 1001: exited on signal 11
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
info: [drm] capturing error event; look for more information in sysctl hw.dri.0.info.i915_error_state
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid12:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
error: [drm:pid0:i915_reset] *ERROR* GPU hanging too fast, declaring wedged!
error: [drm:pid0:i915_reset] *ERROR* Failed to reset chip.
pid 21043 (gnome-keyring-daemo), jid 0, uid 1001: exited on signal 11
pid 82736 (tracker-miner-fs), jid 0, uid 1001: exited on signal 11
pid 12540 (gnome-keyring-daemo), jid 0, uid 1001: exited on signal 11
pid 80800 (gdm), jid 0, uid 0: exited on signal 11 (core dumped)
pid 66631 (tracker-miner-fs), jid 0, uid 1001: exited on signal 11

I can login on 2nd attempt with gdm and this is a consistent behaviour.
Also, Gnome > About is showing graphics as llvmpipe, despite no scfb or vesa drivers installed.
Screenshot from 2020-09-24 12-41-00.png
 
Either there is an issue with gnome and gdm, or there is an issue with graphics. I would suggest to try a lighter window manager, like fluxbox or openbox, and not using gdm as login manager. You can just login with getty and configure $HOME/.xinitrc to start the window manager with startx and then check with glxinfo if it still use llvmpipe.
The following error :
Code:
error: [drm:pid0:i915_reset] *ERROR* Failed to reset chip.
May suggest to configure the gpu driver to do a full reset of the gpu in case of gpu hang.
For that you can do(as root) before starting X
sysctl compat.linuxkpi.i915_reset = 1
If this solve the issue you can add in /etc/sysctl.conf
Code:
compat.linuxkpi.i915_reset = 1

Note that by using STABLE version you may encounter bugs that are not in the RELEASE version, so it may be also that.

Side note, are you using drm-kmod and loading /boot/modules/i915kms.ko in the last attempt ?

PS
The fact that you can log in in the 2nd attempt is mostly due to the fact that gnome will try to use hardware acceleration, which will result in several gpu hang in your case.
At some point the gpu is not reset which will make gnome stop. The second login will directly use software rendering since the gpu failed to reset. Note that this is my guess.

Maybe intel HD 2000 have issue with the driver, I use intel HD 3000 and have no issue (both are sandy bridge).
 
Clarification:
  1. There are DRM, KMS & GPU (intel/amd/radeon) drivers in base, under /boot/kernel. These are deprecated. They are blacklisted from beeing loaded by the loader(8) in /boot/defaults/loader.conf, but found by kldload(8) because they live in the default module path; i.e. they can be loaded manually or through kld_list in rc.conf(5). Those who build their own system from source can disable them in src.conf(7): WITHOUT_MODULE_DRM=t and WITHOUT_MODULE_DRM2=t (why "t" not "yes"? Because you can't disable with "no". See build(7) & src.conf(5)).
  2. The graphics/drm-kmod is a meta-port to install the "real" (more modern) drivers and does not contain any files on it's own. The files installed via the dependent ports are installed in /boot/modules.
  3. Thus, if your kldstat shows a kernel module without path (like drm.ko), it is from base, not from ports(7).
 
This is still either drm-legacy-kmod or a driver from base.
I have only drm-kmod & drm-fbsd12.0-kmod installed. The modules drm.ko, drm2.ko, i915kms.ko are present in /boot/kernel and /boot/modules. I have no idea except moving out the unwanted modules from these directories?
Code:
% pkg which /boot/modules/drm.ko
/boot/modules/drm.ko was installed by package drm-fbsd12.0-kmod-4.16.g20200221

% pkg which /boot/modules/i915kms.ko
/boot/modules/i915kms.ko was installed by package drm-fbsd12.0-kmod-4.16.g20200221

% pkg which /boot/kernel/drm.ko
/boot/kernel/drm.ko was not found in the database

% pkg which /boot/kernel/drm2.ko
/boot/kernel/drm2.ko was not found in the database

% pkg which /boot/kernel/i915kms.ko
/boot/kernel/i915kms.ko was not found in the database

Side note, are you using drm-kmod and loading /boot/modules/i915kms.ko in the last attempt ?
I have only drm-kmod installed. No line to load /boot/modules/i915kms.ko in /etc/rc.conf
EDIT: I tried the compat.linuxkpi.i915_reset = 1 and it did not worked. 2nd attempt at gdm only works!

Is there a way to blacklist legacy driver modules which are still getting loaded?
 
FreeBSD does not automatically load i915kms, you need to load it via /etc/rc.conf
Code:
kld_list = /boot/modules/i915kms.ko
What is the content of /boot/loader.conf ? If there is
Code:
i915kms_load="YES"
Then the old driver from base will definitely be loaded. So you need to remove that line

Try running kldstat -v | grep i915 and report here the result. This will indicate which i915kms modules is loaded.
 
What is the content of /boot/loader.conf ? If there is

Code:
% cat /boot/loader.conf
autoboot_delay="0"
fuse_load="YES"
kern.vty=vt
coretemp_load="YES"
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"
Try running kldstat -v | grep i915 and report here the result. This will indicate which i915kms modules is loaded.

Code:
% kldstat -v | grep i915
 8    1 0xffffffff82b12000    7e070 i915kms.ko (/boot/kernel/i915kms.ko)
        518 vgapci/i915kms
 
Back
Top