# Xorg, 10.0-RELEASE woes



## Cake (Feb 9, 2014)

Hi everyone,

I have an HP Envy 15 with a VESA which (up to 10.0-RC4) worked without a configuration and an NVIDIA GeForce 740M which I never got to function before (Xorg can't find a display device for nvidia but can with vesa for some reason).

Since moving to 10.0-RELEASE this morning, my touchpad seems to no longer be working under hald. I have since generated an xorg.conf which allows the cursor to move with the touchpad and click things. When I tap in the same place twice and drag I can select things but I cannot 'paste' them or use the right side as a right mouse button*. In an ideal world, I'd really like to use the 740M but if that's not an option I'd at least like normal mouse functionality. I'm sure there's a simple solution for it but I've just been staring at the same thing for far too long. I appreciate any help that's possible to provide!
`xdpyinfo`:

```
name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11204000
X.Org version: 1.12.4
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0xc0000d, revert to PointerRoot
number of extensions:    24
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    RANDR
    RECORD
    RENDER
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1920x1080 pixels (341x191 millimeters)
  resolution:    143x144 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x43
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store NO, save-unders NO
  largest cursor:    1920x1080
  current input event mask:    0x520054
    ButtonPressMask          EnterWindowMask          PointerMotionMask        
    StructureNotifyMask      SubstructureRedirectMask PropertyChangeMask       
  number of visuals:    2
  default visual id:  0x21
  visual:
    visual id:    0x21
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
  visual:
    visual id:    0x41
    class:    TrueColor
    depth:    32 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits
```

xorg.conf working with VESA and mouse left click only functionality:

```
Section "ServerLayout"
	Identifier     "X.org Configured"
        #Screen      0  "Screen0" 0 0
	#Screen      1  "Screen1" RightOf "Screen0"
        Screen      1   "Screen1" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
	#InputDevice    "Touchpad0" "SendCoreEvents"
	Option "AutoAddDevices" "0"
	Option "AutoEnableDevices" "0"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF/"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "dbe"
	Load  "dri"
	Load  "dri2"
	Load  "extmod"
	Load  "record"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier "Touchpad0"
        Driver "synaptics"
        Option "Protocol" "psm"
        Option "Device" "/dev/psm0"
        Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
        Option      "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
       #Option  "Emulate3Buttons" "true"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
	Identifier  "Card0"
	Driver      "nvidia"
	BusID       "PCI:1:0:0"
	Option      "IgnoreEdidChecksum" "DFP"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "DefaultRefresh"     	# [<bool>]
        #Option     "ModeSetClearScreen" 	# [<bool>]
	Identifier  "Card1"
	Driver      "vesa"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
    DefaultDepth 24
    Option "UseEdid" "True" 
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes "1920x1080"
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
    Option "UseEdid" "True"
	Device     "Card1"
	Monitor    "Monitor1"
	DefaultDepth 24
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
    Subsection "Display"
        Viewport 0  0
        Depth 32    
        EndSubSection
EndSection
```

make.conf

```
WITH_NEW_XORG=YES 
WITH_KMS=YES
WITH_GALLIUM=YES
MALLOC_PRODUCITON=YES
ACPI_DEBUG=1
VIDEO_DRIVER=nvidia
```

Errors from `dmesg` (and on console when trying to `startx` with the Nvidia card configured:

```
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
ACPI Warning: \134_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97)
```

Ad *: Not a problem right, except that the insert key does not work either so 'shift-insert' is out and it makes does not allow me to right click links when browsing, also annoying.


----------



## trh411 (Feb 9, 2014)

How did you upgrade to FreeBSD-10.0-RELEASE? `freebsd-update` or build from source?

Did you try rebuilding sysutils/hal? That is the first thing I would try to resolve the hald issue.

Did you follow this Nvidia guide when you set up your Nvidia card?

FYI, WITH_GALLIUM is only used with AMD cards. WITH_KMS is no longer used at all and applied only to the Intel i915 driver when it was used. Neither is required to use an Nvidia card. I don't think it does any harm to have them in /etc/make.conf though, just installs some unnecessary stuff.

Please paste a copy of /etc/X11/xorg.conf and /var/log/Xorg.0.log to http://www.pastebin.com and provide us with a link.


----------



## Cake (Feb 10, 2014)

Thanks, rebuilding HAL helped, I can't believe I didn't think of that myself 

I upgraded using freebsd-update and I read the nvidia page and followed the instructions. The extra make.conf options are because I ended up trying everything, but its nice to know I can remove them. 

*F*rom `kldstat`:

```
3    1 0xffffffff817fc000 e3d940   nvidia.ko
```

Xorg.0.log: http://pastebin.com/KfpM3m8a.

And the configuration, initially generated with nvidia-xconfig (where the hashes are some of the (many) options I've tried over the past while): http://pastebin.com/eG1h5Suz.

I am sure I am missing something really obvious.


----------



## Cake (Feb 10, 2014)

What happens exactly is that I say `startx` at the console which then freezes until I change to another TTY. I get the above ACPI error messages in the console, after that I can go back to the original TTY to Ctrl-C out of the frozen startx process.


----------



## trh411 (Feb 11, 2014)

You are using the x11/nvidia-driver, correct? Are you running `startx` as a normal user? What does your ~/.xinitrc file look like?


----------



## Cake (Feb 11, 2014)

*Y*es I am using x11/nvidia-driver (nvidia.ko is also loaded as _p_er the manual) and I am running as a normal user.

xinitrc is nothing fancy really but _I_ have also tried running without it and it doesn't make a difference:

```
xrdb -load $HOME/.Xresources
xsetroot -solid gray &
xterm -bg black -fg green&
exec i3
```


----------



## trh411 (Feb 13, 2014)

Just reread your initial post and noticed that you "have since generated an xorg.conf" after you first experienced your problems. What happens if you go back to running X with no /etc/X11/xorg.conf file? Or maybe you have already tried this?


----------



## Cake (Feb 14, 2014)

Then it uses the VESA gpu and not the NVIDIA one. Oh and my BIOS does not allow me to turn the vesa cpu off either


----------



## Cake (Feb 16, 2014)

I think this might be part of the problem:
`sysctl hw.nvidia.gpus`

```
hw.nvidia.gpus.0.model: GeForce GT 740M
hw.nvidia.gpus.0.irq: 264
hw.nvidia.gpus.0.vbios: ??.??.??.??.??
hw.nvidia.gpus.0.uuid: GPU-????????-????-????-????-????????????
hw.nvidia.gpus.0.type: PCIe
```

and the output from `nvidia-xconfig --query-gpu-info`

```
Number of GPUs: 1

GPU #0:
  Name      : GeForce GT 740M
  PCI BusID : PCI:1:0:0

  Number of Display Devices: 0
```


----------



## Cake (Feb 17, 2014)

Looks like it's not just FreeBSD, this looks like a similar issue on ArchLinux:
https://bugzilla.kernel.org/show_bug.cgi?id=66761
also this:
https://bugs.archlinux.org/task/37465

 No idea how to start fixing ACPI tables in the BIOS though. 
I have sent an email to NVIDIA too with the `nvidia-bug-report.sh` output. I hope I get a reply. Will update if I get something.


----------



## Cake (Mar 10, 2014)

could it be a drm/dri/agp type issue?


From http://dri.freedesktop.org/wiki/DriTroubleshooting/:

```
% dmesg | grep -i drm
info: [drm] Initialized drm 1.1.0 20060810
```

And agp is not found either.


----------



## Cake (Mar 10, 2014)

Also `edid-decode` just hangs and gives no results.


----------

