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