Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC1 generates broken xorg.conf in Intel and nVidia dual device laptop. #28

Closed
jgroenveld opened this issue Oct 9, 2018 · 4 comments
Closed

Comments

Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
@jgroenveld
Copy link

@jgroenveld jgroenveld commented Oct 9, 2018

RC1's generate-xorg-conf.sh generates broken xorg.conf for all the right reasons.
The Intel should be Card0 in my case.
Section "Device"
  Identifier      "Card0"
  Driver          "modesetting"
  BusID           "0:2:0"
  Option   "AccelMethod"   "none"
EndSection


The work-around is to modify xorg.conf in /etc/X11 and enable to the exist test
in /usr/local/etc/init.d/trident_init
<       #if [ ! -e "${xorg_conf}" ] ; then
---
>       if [ ! -e "${xorg_conf}" ] ; then
44c44
<       #fi
---
>       fi


trident_init then loads the correct i915kms kernel module.

John
groenveld@acm.org

root@w650rc:~ # pciconf -lv |grep -A3 vga
vgapci1@pci0:0:2:0:     class=0x030000 card=0x65081558 chip=0x191b8086 rev=0x06 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 530'
    class      = display
--
vgapci0@pci0:1:0:0:     class=0x030200 card=0x65071558 chip=0x139a10de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GM107M [GeForce GTX 950M]'
    class      = display

root@w650rc:~ # about

===================
General information
===================

boot environment now (N) … 12.0-CURRENT-up-20181009_123053 NR 2018-10-09
       after restart (R) … 12.0-CURRENT-up-20181009_123053 NR 2018-10-09
boot loader …………………………………… BSD
            type ……………………… EFI
CPU ………………………………………………………… Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    number of cores ……………… 8
host ……………………………………………………… w650rc
memory ………………………………………………… 16384 MB available, 15303 MB free
OS git branch ……………………………………………………………………………………… Mon
OS git revision ………………………………………………………………………………… Mon
OS kernel build time ………………………………………………………… Oct root@poseidon:/usr/obj/usr/src_tmp/amd64.amd64/sys/GENERIC 8 16:37:41 UTC 2018
OS kernel identity …………………………………………… (uname -i) GENERIC
OS platform (architecture) ……………………… (uname -m) amd64
OS release level ………………………………………………… (uname -r) 12.0-CURRENT
OS version and patch level …… (freebsd-version) 12.0-CURRENT
TrueOS package set ………………… 
TrueOS version …………………………… 
uptime ………………………………………………… 22 mins
user  …………………………………………………… root

@beanpole135
Copy link
Member

@beanpole135 beanpole135 commented Oct 10, 2018

trident_init service updated to support both xorg.conf locations: 342b8e8

@beanpole135
Copy link
Member

@beanpole135 beanpole135 commented Oct 10, 2018

So does your working config only have one device section in it? (the one for the Intel card - corresponding to vgapci1 instead of the vgapci0/nvidia GPU).
If that is the case, we might need to make the multi-card logic a bit smarter and have it choose one of the available cards instead of just making entries for all of them (Intel for the case of Nvidia Optimus systems (intel+nvidia)).

Just to check thouch, could you take the auto-generated config (with 2 device entries) and change the "Screen" section right above that to use "Card1" instead of "Card0"? Does that make it properly use the intel GPU instead?

@jgroenveld
Copy link
Author

@jgroenveld jgroenveld commented Oct 11, 2018

Out of the box, autogenerated xorg.conf, below.
Changing Screen to use Card1 works, so long as I manually kldload /boot/modules/i915kms.ko.

Sorry for the Optimus suboptimalness. :(
Thank you for trying to hack around it.
John
groenveld@acm.org



#===========
# Auto-generated X11 graphics 
#    card/driver configuration
#===========
# Created by Project Trident
#===========
# DO NOT MODIFY
# - Will be replaced on every bootup by trident_init service
# - Place alternate X11 settings into separate file(s):
#  /usr/local/etc/X11/xorg.conf.d/[something].conf
#    OR 
#  /usr/local/etc/X11/xorg.conf
#===========
Section "ServerLayout"
        Identifier     "XFree86 Configured"
        Screen      0  "Screen0" 0 0
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
EndSection

  
Section "Device"
  Identifier      "Card1"
  Driver          "modesetting"
  BusID           "0:2:0"
  Option   "AccelMethod"   "none"
EndSection

Section "Device"
  Identifier      "Card0"
  Driver          "nv"
  BusID           "1:0:0"

@beanpole135
Copy link
Member

@beanpole135 beanpole135 commented Oct 17, 2018

This should be fixed for RC2.

Thanks for testing/reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment