12:13unlord: Does nouveau support the low resolution modes, like 320x240x32bpp ?
12:17karolherbst: unlord: by default we only expose what the GPU and what the display tell the driver are valid modes
12:17karolherbst: you can always add your own ones to X
12:25unlord: karolherbst: are the registers you need to set documented somewhere?
12:25karolherbst: unlord: why would you need to set some registers? you can just do that through xrandr
12:26unlord: karolherbst: I guess I don't understand
12:26unlord: does xrandr support 320x240x32bpp if nouveau doesn't expose it?
12:26karolherbst: you need to add the mode
12:26unlord: karolherbst: add it to what?
12:26karolherbst: through xrandr
12:27karolherbst: you can also add custom modes through a xorg.conf file
12:27unlord: what mechanism does nouveau use to detect the valid modes fro mthe GPU?
12:27karolherbst: that part doesn't matter as much
12:27karolherbst: it's what the display reports
12:27karolherbst: and for displays there is edid
12:27karolherbst: so if the lowest res reported through edid is 640x480 we won't get anything lower automatically
12:28karolherbst: some drivers add default modes without being part of the edid though
12:28unlord: but most displays can support 320x240
12:28karolherbst: most don't report that
12:28unlord: This is just line doubled 640x480
12:29unlord: let me go check the nouveau source I guess
12:30unlord: karolherbst: I have a custom OS where I am calling ax=4f00h int 0x10 to get a list of mode numbers, and 320x240x32bpp is not in the list
12:31unlord: Is this how nouveau knows what modes are supported?
12:31karolherbst: of course not
12:31karolherbst: it fetches the edid
12:31unlord: that is what I expected
12:31karolherbst: what you do is probably talking with the firmware framebuffer
12:31karolherbst: and there your bets are off anyway
12:32unlord: so edid is the monitor or the video card?
12:32karolherbst: the edid comes from the monitor
12:32unlord: OK, so this is not what I need
12:32karolherbst: mhh, 4f00 is vesa actually
12:33unlord: how do I know what modes the video card supports
12:33karolherbst: the GPU doens't really know the concept of modes
12:33karolherbst: you have a pixel clock
12:33karolherbst: and it has a min max range
12:33karolherbst: and some other constraints on the resolution
12:33karolherbst: but this is a different concept overall
12:34unlord: you write these values to some registers IIRC
12:34karolherbst: we are not using vesa
12:34karolherbst: so your entire approach is off already
12:34unlord: karolherbst: my question was not about vesa
12:34unlord: 05:25 unlord: karolherbst: are the registers you need to set documented somewhere?
12:35karolherbst: they are not, because those are GPU registers
12:35karolherbst: which have to be mapped via mmio
12:35unlord: so how does nouveau set 320x240x32bpp
12:35karolherbst: it doesn't, because the GPU doesn't know about modes
12:35karolherbst: we set the pixel clock ;)
12:36karolherbst: and talk with a display engine on the GPU to do stuff for us as well
12:36karolherbst: this is _way_ more complicated than what you do
12:36karolherbst: you use vesa
12:36unlord: you don't know what I'm doing, first of all
12:36unlord: I just asked how you set the gpu to display in this resolution
12:36karolherbst: well, do you already have the code to map the pci bar of the GPU and have a more or less working GPU driver?
12:37unlord: not yet :)
12:37karolherbst: right, that's what you have to do first if you want to use the gpu registers
12:37karolherbst: there is some basic docs about newer chips though
12:38karolherbst: but all that won't help you all that much
12:38karolherbst: you also would need to parse the vbios
12:38karolherbst: and more stuff
12:38karolherbst: in any case, either using vesa (which is super limited) or porting nouveau are your only options if you want to have something working this year
12:39karolherbst: we got some "register documentation" from nvidia for the v100 here: https://download.nvidia.com/open-gpu-doc/Display-Ref-Manuals/1/gv100/
12:39karolherbst: but then again, all that won't help you
12:40karolherbst: there is no "I poke the mode in registers X..Y and then it jus works"
12:43unlord: if I have the mmap'd IO, then it is just writing some values into memory
12:46karolherbst: unlord: more or less, yes. Depending on the GPU you have, you have to do some more stuff if you want to use the display engine
12:46unlord: karolherbst: I just want a frame buffer
12:46karolherbst: then you are limited by what your firmware is able to do
12:47karolherbst: either you get a more or less working GPU driver or stick to the firmware framebuffer
12:47karolherbst: there is really choice in between
12:47karolherbst: vesa is implemented by the motherboard firmware and you talk to the firmware, not the GPU
12:47karolherbst: so you get some basic modes, etc...
12:48unlord: I understand the distinction
12:48unlord: I am asking how to talk to the GPU
12:48karolherbst: well, by doing all the mmio and driver stuff.
12:49karolherbst: well, and using the pcie bus and so on
12:49karolherbst: if you are writing your own os and you don't have that infrastructure yet, then you should focus on that first
12:49unlord: I feel like we're talking past each other. I'm trying to just set this one mode, and have a FB I can write to
12:49karolherbst: and get the pcie controller working and stuff
12:49karolherbst: unlord: again, either vesa or a full GPU driver. There is no in between
12:50karolherbst: if vesa doesn't suport it, you can't use vesa for that
12:50karolherbst: then you need a full GPU driver
12:50karolherbst: you are searching for an easy way out, but there is none
12:51unlord: I really enjoy how you keep telling me what I'm trying to do
12:52karolherbst: I just skiped arguing about stuff which wouldn't work
12:53karolherbst: if you find a way to set/add that mode to vesa, fine, then you reached your goal. I have no idea how to do that and nouveau doesn't even use that and has 0 interactions with that
12:53karolherbst: but if that's not possible, then you there what I was talking about earlier
12:54karolherbst: if you don't believe me, then find something else tell me where I am wron
16:09imirkin: unlord: int10h is a (v)bios service. it disappears once you boot a proper operating system like linux.
16:10imirkin: the gpu option rom installs a handler for int10h which handles the various service calls so that e.g. DOS can work
16:11imirkin: once you go into protected mode, calling bios services is tricky (but doable). either way, they're not gpu-dependent
16:11imirkin: nouveau drives the gpu directly, not via bios service calls
16:12imirkin: on any semi-modern gpu, setting a mode is a highly involved process, unfortunately
16:14unlord: imirkin: my goal was to replace the int 10h handler and support the modes I want by writing directly to the GPU
16:15imirkin: which GPU?
16:15imirkin: i.e. what model?
16:15imirkin: it's not going to be easy.
16:15imirkin: it's not just like writing a few registers =/
16:15unlord: yeah, I suspected as much
16:15karolherbst: especially with a custom OS
16:15imirkin: you have to set up a command stream for the display engine, write commands, etc
16:16imirkin: not to mention all the bringup needed to even get that far
16:16imirkin: sorry to be a downer
16:16imirkin: on the bright side, it's not difficult to integrate nouveau into a custom operating system
16:17karolherbst: I think nowadays we even need VRAM, or not?
16:17karolherbst: Titan sounds like kepler+
16:17imirkin: titan is kepler, iirc
16:17imirkin: later ones are like titan-x and whatnot
16:17karolherbst: yeah.. I am just not sure since when we require virtual memory for stuff, even if the memory is in system memory
16:17karolherbst: so VRAM programming is also a requierment
16:18karolherbst: all the good stuff
16:18imirkin: it's an interesting question actually
16:18imirkin: nouveau certainly has to set it up - but is there a non-VMM mode the GPU can operate in? dunno.
16:18karolherbst: yeah, me neither
16:18karolherbst: nouveaus code won't help with that unfortunately
16:18imirkin: and if you're not actively managing the memory, you could do a 1:1 style of mapping all the time
16:19karolherbst: at least there is no signed devinit.... yet
16:19imirkin: but for someone not already intimately familiar with the details, it's ... not going to be easy.
16:19karolherbst: unlord: it's a gk110 titan, right?
16:19karolherbst: aka the "GeForce GTX TITAN"
16:19imirkin: unlord: what's wrong with using int10h btw?
16:20karolherbst: imirkin: something about a missing 320x240 mode
16:20imirkin: mmm... well 320x240x256 is one of the VGA modes you can very easily set
16:20imirkin: anything beyond that is vesa-land. dunno the details of that - i stuck to VGA back in the day :)
16:20karolherbst: well, the entyr question was "Does nouveau support the low resolution modes, like 320x240x32bpp ?"
16:21imirkin: er, 320x200x256
16:21karolherbst: anyway.. the vesa spec might help here
16:21imirkin: well - maybe
16:21imirkin: i dunno if you can have custom modelines in vesa
16:21karolherbst: and then the board in question doens't support it
16:21imirkin: iirc you get what you get
16:21karolherbst: yeah, that's what I would expect as well
16:22imirkin: otherwise those vbios's would have to be VERY complex
16:22karolherbst: mhhh, true
16:22unlord: imirkin: int10h doesn't have 320x240 modes
16:22unlord: 320x240 is not a VGA mode
16:22imirkin: right. 320x200 is.
16:23imirkin: 320x240 doesn't fit in 64K :)
16:23unlord: imirkin: the best would be if int 10h ax = 4f00h just included these modes
16:23unlord: I'm not sure why it does not
16:23imirkin: it's not a standard mode
16:23imirkin: it has very fixed programming for a few things
16:23imirkin: it's software installed by the bios
16:24imirkin: it's designed to just have enough to get the operating system going
16:24karolherbst: do we get multiple modes with uefi btw?
16:24imirkin: right ... note how 320x240 is not in the "common modes" list :)
16:24karolherbst: I think there you also just get one?
16:24imirkin: karolherbst: nope
16:25imirkin: karolherbst: although perhaps before booting, the efi can switch
16:25imirkin: but once you boot, it's over
16:25karolherbst: mhh, right
16:25karolherbst: well, a uefi bootloader might fix that issue then
16:26unlord: I don't understand why int 10h just doesn't support more modes?
16:27karolherbst: because it's complicated to do that
16:27imirkin: unlord: because it doesn't have to
16:27unlord: it doesn't seem that complicated
16:27imirkin: it only does the bare minimum of what it has to
16:27imirkin: it's not -- adding any one mode is likely to be easy
16:27unlord: imirkin: I realize this. hence the reason I am asking how to fix this with my own int10h handler
16:27karolherbst: unlord: where did you get the impression that it doesn't seem that complicated?
16:28imirkin: but then someone will ask for 320x241 and 320x242 etc :) they stick to the "standard" ones and that's it.
16:28unlord: imirkin: nobody will ask for 320x241
16:28imirkin: i will :p
16:28unlord: there is a list of modes on that site
16:28imirkin: "common" modes
16:28unlord: imirkin: okay, that is weird
16:28imirkin: note that 320x240 isn't on that list.
16:28unlord: imirkin: 320x200x24bpp isn't supported either
16:29unlord: go look at the ones supported, many of the common ones are missing
16:29imirkin: 320x200x256 should be trivial though
16:29imirkin: since it's supported as part of VGA
16:29unlord: imirkin: I am aware of this
16:29unlord: I didn't ask about that mode :)
16:30imirkin: yeah. basically, without writing your own driver, you're stuck with what you get. no real way around that.
16:30imirkin: the question then becomes... how hard is it to write a driver with the limited functionality that you require
16:30imirkin: i think the answer is, "surprisingly difficult". however you could take nouveau and integrate it into your OS fairly easily, and then you'd be able to do all this stuff.
16:30karolherbst: unlord: what kind of custom OS is it what you got? entirly self written?
16:31karolherbst: does it support pcie controller already?
16:31karolherbst: how custom is custom here?
16:31imirkin: anyways, good luck!
17:26x_crashing: ok, seems to work now. I dont get any more the error i were not able to write here
17:27x_crashing: my xorg is crashing the whole time just when using the E-Mail programm on a computer i try to convert from windows to linux
17:29x_crashing: can someone explain me this here? https://bugzilla.freedesktop.org/show_bug.cgi?id=110500#c1
17:31x_crashing: I am not using something special. I just installed the OS and its crashing
17:34karolherbst: x_crashing: did you try to install xf86-video-nouveau?
17:35x_crashing: karolherbst: there is no such package: https://packages.ubuntu.com/search?keywords=xf86-video-nouveau&searchon=names&suite=bionic§ion=all
17:37karolherbst: mhh, I think it's called xserver-xorg-video-nouveau on ubuntu
17:38x_crashing: yes, there is a package named like that. I would install it then
17:38x_crashing: installing not possible
17:39x_crashing: xserver-xorg-core (>= 2:126.96.36.1991) and xorg-video-abi-23 but they are beeing hold back
17:42karolherbst: do you have a ppa installed or something?
17:44x_crashing: https://download.mono-project.com/repo/ubuntu and a Live-TV-Playback service. Nothing that could/should affect anything really os-related
17:47karolherbst: maybe you want to do "apt-get dist-upgrade" before that?
17:48x_crashing: apt upgrade , dist-upgrade and autoremove = all nothing to do listed
17:49x_crashing: installed version of xserver-xorg-core: 2:1.19.6-1ubuntu4.2
17:50x_crashing: this video-abi does not show up
17:50x_crashing: its listed as a "virtual pacage" on the website
17:52x_crashing: when i try to apt install xorg-video-abi-23 it want to remove a ton of packages
17:53x_crashing: it wants to remove "sddm xorg xserver-xorg-core-hwe-18.04 xserver-xorg-hwe-18.04 ... xserver-xorg-video-nouveau-hwe-18.04 ... "
17:54x_crashing: i checked installing xserver-xorg-video-nouveau-hwe-18.04 . Its already installed. Thus this probably mean i have something with nouveau already installed.
17:56gnarface: this has all the telltale signatures of an install screwed up from mixing repos
17:56x_crashing: This is the already installed package: https://packages.ubuntu.com/bionic-updates/xserver-xorg-video-nouveau-hwe-18.04
17:56x_crashing: gnarface: ? I have not mixed up any repos. Its a Kubuntu installation from today
17:57gnarface: x_crashing: you did though. you said you mixed repos. using PPAs counts as mixing repos. ubuntu really shouldn't encourage that. it is irresponsible and possibly corrupt.
17:58x_crashing: ??? I installed mono. Mono is software to run windows tools.
17:58gnarface: go through every single package you installed from each of those repos, one by one. i guarantee you'll find one that doesn't belong there.
17:58gnarface: make sure you trace the dependencies.
17:58gnarface: it's gonna be some minor version issue, probably.
17:59gnarface: like literally a numeric mismatch
17:59karolherbst: gnarface: allthough that mono repository looks clean
17:59x_crashing: gnarface: there is no xorg affecting package here https://download.mono-project.com/repo/ubuntu/dists/vs-bionic/main/binary-amd64/Packages
18:00gnarface: karolherbst: aside from the fact he shouldn't even need a PPA to use mono in the first place, it's the live tv thing that looks more risky as well as xorg-related to me
18:00karolherbst: yeah.. but I doubt that is causing the issue
18:01karolherbst: mhh, xserver-xorg-video-nouveau-hwe should be fine though
18:01karolherbst: x_crashing: do you have a /usr/lib/xorg/modules/drivers/nouveau_drv.so file?
18:01x_crashing: gnarface: there is no xorg affecting things here: https://apt.tvheadend.org/stable/
18:02x_crashing: karolherbst: yes, i have this file
18:03x_crashing: lsmod: drm 458752 12 drm_kms_helper,ttm,nouveau
18:03x_crashing: nouveau 1851392 23
18:03x_crashing: video 45056 1 nouveau
18:08gnarface: x_crashing: well it could be a problem with the distro repo itself. they could have made a mistake that causes a similar error. it's just that usually this is a self-inflicted problem.
18:08gnarface: in fact almost always
18:12karolherbst: why does X load the modesetting driver though
18:12gnarface: that's just the default now, i thought
18:12karolherbst: anyway, this sounds like an ubuntu issue itself overall
18:12karolherbst: gnarface: well, question is, how do user switch over without much pain?
18:13gnarface: karolherbst: the answer is, the xorg people don't give a fuck
18:13karolherbst: the ubuntu ones?
18:13gnarface: karolherbst: no, upstream
18:13karolherbst: huh? how so?
18:14gnarface: karolherbst: if you want to load the intel driver on most hardware, you have to manually do it from the xorg.conf now, which they routinely lie and say you don't need. they just don't care if you get the wrong driver as long as the desktop renders
18:14gnarface: i guess they figure if you are smart enough to care, you're smart enough to disobey
18:14karolherbst: yeah.. but that's intel
18:14karolherbst: they have enough resources to fix all those bugs
18:15karolherbst: and it's kind of intels decision to prefer modesetting
18:15karolherbst: but modesetting on older nvidia GPUs is a very stupid thing to do
18:15gnarface: interesting, i didn't know that. it seemed to me that was xorg's default behavior and it's up to the distro to override it with xorg.conf snippets at installation time
18:15karolherbst: not that I am aware of
18:16karolherbst: distributions always have some patches somewhere
18:16gnarface: the behavior i observed is it tries kms, and if that doesn't stick it tries some framebuffer drivers and a generic vesa driver
18:17gnarface: and if all those fail and nouveau is next in line, you get nouveau
18:17gnarface: but sometimes the kms one sticks
18:17gnarface: and apparently most users never notice
18:17gnarface: (but gamers notice immediately)
18:19gnarface: the whole approach of just throwing a bunch of drivers at it at once until one doesn't fail is, i think, poorly conceived at best
18:19karolherbst: yeah.. I am not convinced that the modesetting approach is a good one, because even today the intel driver is usually superioir to the modesetting one
18:20karolherbst: I think nobody really provides enough data to show that though
18:21karolherbst: x_crashing: anyway. You should probably ask the ubuntu people. Using glamor on that GPU is a silly idea and ubuntu is responsible for that
18:23x_crashing: but what code part is broken here? To who should i report the issue?
18:24x_crashing: to my understanding its a graphics driver issue. Thats why i am here at nouveau
18:24karolherbst: the technical issue is, that your GPU ran out of VRAM
18:24karolherbst: and nouveau doens't really handle it all that well
18:24karolherbst: sadly the fix isn't that trivial either
18:25karolherbst: anyway, using the nouveau Xorg driver should help here a lot
18:25karolherbst: especially if your GPU doesn't have all that much VRAM
18:26karolherbst: is it a 256MB variant?
18:26x_crashing: From the time i played games i remember that the systems i used did not crash just because all of the graphics card memory was used. It ran just slower compared to other GPUs with more memory
18:26karolherbst: sure, and we should fix it at some point
18:27karolherbst: but it's not "gonna be ready in 2 weeks" thing
18:27karolherbst: and it's more complicated than that
18:27karolherbst: glamor is 2D over OpenGL
18:27karolherbst: and if you run more OpenGL applications (especially with the desktop environments these days) you need a lot of VRAM
18:28karolherbst: and even if some stuff stays inside system memory, some things can't be moved out
18:28x_crashing: I checked. It have 512MB of RAM
18:28karolherbst: anyway, this is a "run 2018 software on 2000 hardware" issue
18:28karolherbst: mhh, well, maybe with 512MB it should be okay...
18:28karolherbst: but then again... all that stuff isn't really optimized
18:30karolherbst: x_crashing: does dmesg report something
18:30x_crashing: Its not from 2000. Its a computer from 2010 that have been updted many times. Its have now a fast ssd, 8gb DDR3 ram, 8 Core CPU, ...
18:31karolherbst: yeah... and I don't blame your machine. I blame a decision made by ubuntu
18:32karolherbst: but even 8GB ram isn't something I would want to run modern software on. Sure it works, but not all that well
18:32karolherbst: and the OS and software should be aware of that limitation
18:32karolherbst: and make smart decisions
18:32x_crashing: My computer at home have 4GB of RAM and i never thought of upgrading it
18:33karolherbst: which is fine, depending on what software runs on it
18:33karolherbst: chrome with 20 tabs? probably not
18:33x_crashing: I dont open more then 1 tab. I dont like tabbing. I like to finish one work first. Then start the other one
18:34karolherbst: right, and then 4GB ram are probably enough :)
18:34karolherbst: anyway, I would first open a bug against glamor I think
18:34karolherbst: there is no nouveau bug I can see directly
18:34karolherbst: more like a missing feature
18:34karolherbst: glamor crashes because it failed to allocate memory
18:34karolherbst: stuff like that happens
18:34karolherbst: and glamor should be able to handle that
18:35x_crashing: Ok, i am at the same point like before. I sit here at a persons home and convert him to linux because he dont want Windows 10 and Windows 7 support ends soon. The machine is crashing. I need help
18:35karolherbst: right... you could have a crappy xorg.conf file to test things if you want
18:36karolherbst: file: /etc/X11/xorg.conf.d/20-nouveau.conf content: https://gist.githubusercontent.com/karolherbst/7b1d43d4d33fe93757c40436288b05d4/raw/880f32c04ca87cbdba202ccc7f60a4ad726e523e/gistfile1.txt
18:36karolherbst: that should help
18:36karolherbst: maybe adjust the PCI address
18:36x_crashing: would OS-updates kill the setting there inside or would this work until the OS is been reinstalled?
18:36karolherbst: but the nvidia GPU should be at 1:00
18:36karolherbst: in lspci
18:36karolherbst: x_crashing: it should work until it gets reinstalled
18:36karolherbst: well, reinstalling means reformatting the disc
18:37x_crashing: [ 3.032534] nouveau 0000:01:00.0: NVIDIA G96 (096000a1)
18:37karolherbst: yeah, then the ID is fine
18:39x_crashing: there is no xorg.conf.d/ directory. Should i create one or does that mean i have to put it somewhere else?
18:43karolherbst: let me think
18:43karolherbst: x_crashing: ls /etc/X11/
18:43karolherbst: there is stuff, right?
18:44x_crashing: yes, there is stuff. i made a directory now inside
18:44x_crashing: rebooting now and checking xorg log if it say now nouveau
18:45x_crashing: If its reporting nouveau, i would just report that here https://bugzilla.freedesktop.org/show_bug.cgi?id=110500 and hope it wont crash any more
19:18karolherbst: unlord: random thought: maybe a matrox GPU would help? They don't really have many features besides being stupid framebuffer devices and the driver should be a lot simplier... sadly I have no clue how expensive those are, but looking at the features they should be super cheap
19:18unlord: karolherbst: I'm doing this for NVIDIA
19:19karolherbst: mhh, mhh
19:19karolherbst: like literally for nvidia?
19:19karolherbst: like contract work for nvidia? or just because you have an nvidia GPU and you just want to use that one?