06:57 danvet: sravn, patches 21 and 22 are also still looking for review ...
07:14 airlied: jekstrand: oh one thing that I had in my brain to tell you, for sw vulkan you can't block on queue submit
07:15 airlied: since you have to be able to let event work
07:15 airlied:has a cpu thread and the llvmpipe stuff executes in the "gpu" thread
07:53 pepp: https://gitlab.freedesktop.org/pepp/mesa/-/jobs/2034822 ends with "ERROR: No files to upload. Job succeeded" : I don't see any other error in the log that could explain this failure
07:53 pepp: (that's meson-arm64 job)
08:05 tomeu: pepp: I see those occasionally, retrying always work for me
08:05 pepp: tomeu: ok. I'll do that, thanks
08:20 MrCooper: robclark: somebody should try to get some ASan coverage in CI :)
08:22 MrCooper: karolherbst: click on the commit title on the MR Commits tab, then clock the button to the left of the line of code where you want to comment
08:52 sagner: Hi, I am debugging a DRM driver issue, my display looks distorted when starting Weston with DRM backend. Framebuffer console/plymouth with DRM backend before that looks fine. This is a panel with a single mode, so Weston can actually not change much, but I now printed the complete atomic state, and the only difference I see is the layers pitch: its 3200 vs. 3328 (the resolution is 480x800). Any
08:52 sagner: idea where this could come from?
08:53 sagner: FWIW, this is the mxsfb DRM driver
08:54 sagner: Hm, is Weston trying to cache align the pitch?
08:55 MrCooper: I doubt the pitch is chosen by Weston, more likely the EGL implementation
08:55 sagner: This is a non-GPU device, just a display controller...
08:56 MrCooper: ah, never mind then :)
08:57 sagner: 4x800 -> 3200, 4x832 -> 3328, and 832 is 64 byte aligned... But who is taking that descision, and probably more importantly, can I do something about it
08:58 danvet: sagner, yeah for display-only without egl or anything the pitch should be exactly the same
08:58 danvet: since everyone should allocate it as a dumb buffer
08:58 danvet: could be a driver bug too
08:58 sagner: https://pastebin.com/QjbtLHPx
08:59 danvet: console is using the fbdev emulation, plymouth might also accidentally prefer fbdev over native kms
08:59 danvet: and the two paths can differ (but really shouldn't)
08:59 sagner: danvet: pretty sure I use the KMS backend of plymouth though
08:59 danvet: sagner, double checked which /dev node plymouth has open?
09:00 danvet: sagner, either way there's definitely a kms driver bug too, since the driver is supposed to either program hw correctly, or if there's a constraint, reject the buffer
09:00 sagner: danvet: doesn't allocated by = plymouth already tells us that?
09:00 danvet: silent corruption isn't good
09:00 pinchartl: vsyrjala: ping
09:01 sagner: danvet: hm, I'll check if I can use non fb with pitch, and otherwise reject
09:01 danvet: sagner, hm maybe?
09:01 danvet: sagner, but yeah I think there's two things, the different pitch and the corruption itself
09:02 sagner: danvet: oh stupid me: I was using EGL through Mesa emulation! Passing --use-pixman helps :-0
09:02 sagner: danvet: oh stupid me: I was using EGL through Mesa emulation! Passing --use-pixman helps :-)
09:04 danvet: sagner, still a kernel bug to fix I think
09:04 sagner: (Sry, use too much Slack lately)
09:04 sagner: danvet: yeah agreed, will check
09:09 pq: sagner, is weston with Pixman-renderer or GL-renderer? Yes, you can use GL-renderer without a GPU.
09:10 pq: aha
09:11 pq: so why does the pitch chosen by Mesa not work?
09:11 pq: Why is Mesa picking a pitch that does not work?
09:11 danvet: pq, bug in kernel driver
09:12 pq: danvet, well, kernel driver accepting a buffer and showing garbage is a kernel driver bug, sure. But if the driver rejects it, I think Weston just wouldn't work at all.
09:13 pq: so something needs to know to use the right pitch somehow, even with GL-renderer
09:13 pq: with GL-renderer, the buffer allocation is inside Mesa (EGL/GBM)
09:17 sagner: pq: yeah kernel driver bug I agree, it should reject that pitch. Currently checking if the IP supports such framebuffers, but from what I can tell it does not, so I guess it should just reject it.
09:19 pq: sagner, right, but that also moves the failure to another place I assume. Depends on what Mesa does.
09:38 sagner: Rejecting it now, it seems that Weston/Mesa does not do much in this case, Weston prints this at the end but is running wihtout anything on the display: [09:35:06.916] atomic: couldn't commit new state: Invalid argument
09:39 pq: sagner, well, yes. Weston assumes that when you initialize GBM with the DRM KMS device, then Mesa will produce good fraembuffers.
09:40 pq: If Mesa does not, then what could Weston do? Falling back to Pixman-renderer would be a lot of code for a corner case.
09:40 pq: Mesa failing to initialize with GBM or failing to create an EGLSurface might be manageable to fall back, but still not handled in Weston today.
09:41 pq: I would point the finger at Mesa for producing framebuffers that don't actually work on the device it was passed in.
09:43 pq: It may also be that the pitch difference comes from llvmpipe requirements, in which case Mesa would need to fall back to softpipe or something, and I imagine that too might be quite hard to implement.
09:44 pq: sagner, hm, do you by any chance have VKMS loaded in your kernel, creating a DRM device?
09:44 pq: err, I mean VGEM, not VKMS
09:46 pq: sagner, anyway, I think filing a Mesa issue would be nice.
09:47 sagner: pq: "# CONFIG_DRM_VGEM is not set" but I can easily...
10:00 sagner: pq: enabled it, but it does not make a difference.
10:10 daniels: sagner: Weston doesn't try to align the pitch, but llvmpipe (the Mesa sw renderer) does
10:10 daniels: so if you use EGL with no hardware GPU, tat's what'll happen
10:11 sagner: Yeah I see now, that makes sense. I guess what I wonder if we can do something smart about it. I now reject in the planes atomic_check callback, similar to how tilcdc is doing this.
10:12 sagner: Now I was about to report a Mesa bug, but can Mesa do something abotu this? E.g. isn't Weston actually setting up the DRM planes and all that?
10:14 sagner: From what I understand, Mesa allocates the frame buffer, but Weston then tries to display it on a plane, and only then the kernel rejects this. So at allocation time we don't know about this yet, or do I understand something wrong here?
10:15 daniels: there's no way the KMS can tell Weston that pitch must be equal to width * bpp
10:15 daniels: for the (many) drivers which require alignment to e.g. 32 bytes, there's no way they can tell Weston that the pitch must be aligned to 32 bytes either
10:15 daniels: so there's no way for Weston to tell llvmpipe about the requirements it doesn't know about
10:17 sagner: daniels: So no real solution for this issue then?
10:20 lynxeye: sagner: daniels: Hm, shouldn't llvmpipe do a dumb buffer allocation? In which case the DRM driver should be able to decide on pitch.
10:20 sravn: danvet: I gave up reviewing 21, the code movements looked OK but I could not see the full picture. Will take a look again later today, after work sometime
10:22 sagner: lynxeye: this is probably me not understanding KMS quite yet, can the driver influence buffer allocation? I guess not when using the regular gem stuff?
10:24 daniels: lynxeye: it should
10:24 lynxeye: sagner: With regular GPU drivers the Mesa GPU driver also needs to know about the scanout side (KMS) constraints and make sure to layout the buffer correctly. But with a dumb buffer the KMS side actually gets to decide on the pitch requirement.
10:25 danvet: sravn, I might have botched something in rebasing, bisecting a bug towards that range of patches right now :-/
10:27 sagner: lynxeye: I see, so maybe I should open a kernel bug then instead?
10:28 lynxeye: sagner: sorry, I missed the start of the conversation. Are you talking about mxsfb?
10:28 sagner: lynxeye: yes
10:29 sagner: lynxeye: there is definitly a bug that it does not implement stride != width, and also not reject it (from what I understand the IP can't handle that)
10:29 pinchartl: sagner: thanks for you review btw
10:29 pinchartl: I'll work on a v2
10:30 lynxeye: sagner: The problem (to me) seems to be that this driver uses drm_gem_cma_dumb_create without feeding in the HW pitch alignment requirements. It should use drm_gem_cma_dumb_create_internal and adjust pitch to HW requirements as needed. meson driver seems to do this correctly.
10:30 sagner: pinchartl: you're welcome! Oh btw, crash I reported was most likely a power issue, I wanted to send you a email about it.
10:30 pinchartl: sagner: good :-)
10:30 pinchartl: I like hardware issues, that's less debugging for me
10:31 sagner: Hehe, yeah me too!
10:31 sagner: lynxeye: oh cool, ok will check how meson driver is doing this.
10:32 sagner: pinchartl: since you worked on the IP recently, do you agree with me that the IP can't handle pitch which do not match width?
10:36 pq: sagner, VGEM could have only caused confusion, not fix anything - sorry :-)
10:37 sagner: pq: ok, got it, so worries
10:37 sagner: s/so/no
10:40 pq: sagner, so yeah, I was assuming the kernel driver was already doing dumb buffer allocation correctly (it works if weston does it manually, so why does it not work from Mesa?)
10:41 pq: erm, it works if weston calls dumb buffer alloc manually
10:41 pq: so I jumped to the conclusion that Mesa must be doing something different from Weston
10:44 pq: sagner, the KMS dumb buffer alloc works such that userspace submits DRM_IOCTL_MODE_CREATE_DUMB with width,height,bpp, and the driver returns a buffer and pitch (in bytes) which userspace must use.
10:45 pq: it's hard for me to imagine how it can work for one caller (weston) but not for another (Mesa)
10:47 pinchartl: sagner: I haven't looked at that, but I can :-)
10:47 pinchartl: on i.MX7 specifically, or in general ?
10:50 sagner: pinchartl: I use i.MX 7 so probably the first thing to look at. I also assume that if it can't do it the olders most likely cannot do it either
10:55 pinchartl: sagner: indeed, I see no stride support in the datasheet for i.MX7D
10:56 sagner: pinchartl: Ok, thx for checking!
10:59 pinchartl: sagner: it's a pretty bad display controller :-S very limited
11:02 sagner: pinchartl: yeah I know, I was surprised that they put it even in newer designs (several i.MX 8 series SoC have it)
11:02 pinchartl: same for the camera side, several i.MX8 SoCs have the same IPs as i.MX7, and they're missing very basic features
11:03 sagner: pq: using softpipe Gallium driver works as well, seems to use pitch which matches stride
11:04 pq: sagner, ok. I wonder if Mesa just "forgets" to use the pitch returned by the DRM driver.
11:28 sagner: pq: unfortunately strace cannot decode the arguments/return value of DRM_IOCTL_MODE_CREATE_DUMB, but I can see that in one case DRM_IOCTL_MODE_ATOMIC subsequently fails of course.
11:30 pq: sagner, you want to make sure the driver returns the pitch you expect?
11:31 pq: nothing comes to mind really, not sure even drm.debug would print it
11:31 sagner: pq: Yes. Ok, will try that.
11:32 sagner: pq: I guess after making sure DRM behaves as we expect I should then create a bug report with mesa..
11:37 pq: yeah, if the driver returns the right pitch, but then the DRM FB is created with a wrong pitch, that's a userspace fumble.
11:42 pq: sagner, Mesa GBM hands out a gbm_bo, weston queries the gbm_bo and creates a DRM FB, then uses that in KMS. drm_fb_get_from_bo() is the relevant Weston function, fwiw.
12:34 sagner: pq: hm, I added some printk in drm_mode_create_dumb and it seems width is 832
12:41 danvet: tzimmermann, uh ... I need this or fireworks https://paste.debian.net/1136325/
12:41 danvet: and the fireworks happens on the kfree_const
12:41 danvet: tzimmermann, since you suggested this, any idea where the bug is?
12:41 danvet: or is this just not working
12:46 pq: sagner, I presume that's not what you expect? Maybe check the size in weston to see if it's Mesa or Weston?
12:51 sagner: pq: yeah not sure what I was expecting, probably a with of 800. But when I think more about it, I guess its the only way user space can allocate a buffer with a larger pitch than width...
12:52 sagner: pq: but that would mean that Mesa would just assume that the display controller can handle width < pitch..
13:05 sagner: lynxeye: from what I can tell meson used to have the oposite problem: user space chosed a pitch which was not aligned by 64 bytes. Hence the new .dumb_create forces DRM_IOCTL_MODE_CREATE_DUMB to create a framebuffer with a higher pitch than with.
13:06 sagner: But with mxsfb we have the opposite problem.
13:10 sagner: Anyways, created a Mesa issue and will leave it at that for the moment. Thanks everyone for your help getting to the bottom of this!
13:15 sagner: FWIW: https://gitlab.freedesktop.org/mesa/mesa/issues/2677
13:15 gitbot: Mesa issue 2677 in mesa "llvmpipe backend fails on device with pitch/width restrictions" [Opened]
13:38 tzimmermann: danvet, is the 'name' field of type const char*? the string "kmalloc" has to be in the kernel's read-only data section. maybe it's considered writeable if you assign directly to 'name'. otherwise, no idea
13:38 danvet: tzimmermann, yeah the name field in the struct is const char *
13:45 tzimmermann: danvet, idk i don't know why. i'd first check if "kmalloc" is in the rodata section. and then see if that changes w/o kstrdup_const. maybe the compipler expects the const to be cast away and puts it into writeable memory.
13:46 tzimmermann: if it get's too complicated to use, i'd leave out the whole _const stuff
13:48 emersion: dunno if that helps, but you need to define strings with `const char str[] = "…"` rather than `const char *str = "…"` to get it in .rodata
13:51 tzimmermann: emersion, yeah, that's the better solution. but not really possible here
13:53 pq: sagner, userspace has no way to allocate a dumb buffer with a pitch different from what the kernel driver determines. If userspace attempts to, e.g. by hacking the width, the driver can no longer guarantee the pitch will be right for the *actual* width.
13:53 pq: sagner, Mesa might well assume that - and it would be wrong I suppose.
13:53 emersion: you might want to try `char *const str`
13:57 danvet: emersion, most of our const char * strings are random arguments to functions
13:58 danvet: so these are all outside of .rodata?
13:59 emersion: err, i mixed it up again
14:00 pq: I think writable string constants is a compiler option.
14:00 emersion: const char * is a mutable pointer to a constant char
14:00 emersion: char *const is the other way around
14:01 pq: I mean literal string constants
14:02 emersion: i don't think it's ever legal to write to a string literal?
14:03 pq: yeah, you'd think ;-)
14:03 pq: and probably usually is
14:06 linkmauve: emersion, it actually is. :x
14:06 linkmauve: Just like it is legal to modify another static array somewhere.
14:11 emersion: linkmauve: this segfaults for me
14:11 emersion: char *str = "abc"; str[0] = 'b';
14:12 emersion: and it's stored in .rodata
14:30 linkmauve: Indeed, I was wrong.
14:31 jekstrand: airlied: Uh.... :-(
14:34 pq: linkmauve, emersion, sounds like UB: https://stackoverflow.com/questions/56743877/can-a-string-literal-in-c-be-modified
14:35 emersion: makes sense
14:41 danvet: emersion, so the const story, if I pass it to kstrdup_const("kmalloc", GFP_KERNEL)
14:41 danvet: then it's in .rodata
14:41 danvet: but if I assign the pointer directly then it's not in .rodata
14:41 danvet: or at least everything blows up
14:42 danvet: so yeah magic
14:42 danvet:still doesn't know how C works
14:43 pq: danvet, do you mean that is what happens, or that is how you understand what emersion said?
14:44 danvet: that is what seems to happen
14:44 danvet: i.e. ptr = "kmalloc"; -> somehow the string isn't .rodata
14:44 pq: wacky
14:44 danvet: but as a parameter to the funcion is is in .rodata
14:44 danvet: it's C so I'm not surprised, but yes
14:45 pq: I don't understand that either.
14:45 danvet: anyway intel-gfx-ci says there's also something else still broken, oh well
14:45 ickle: note also that the _const() only recognise char[] in the builtin .rodata and not modules
14:46 danvet: oh disappoint
14:47 danvet: maybe it should check the pte flags
14:47 danvet: or something like that
14:51 pq: sagner, I don't understand "Invalid pitch: fb and crtc widths must be the same" - which one is wrong, pitch or width?
14:53 sagner: pq: pitch is wrong (Invalid pitch)...
14:53 sagner: pq: FWIW, the message is from drivers/gpu/drm/tilcdc/tilcdc_plane.c
14:53 pq: misleading error message then, talking about width
14:54 sagner: pq: hm I see, probably should be Invalid pitch: fb's pitch and crtc's width must be the same
14:55 pq: also, always be careful with pitch/stride units, you can never assume pixels vs. bytes ;-)
14:56 pq: maybe "Invalid pitch: padding not allowed"?
14:56 vsyrjala: pinchartl: yes?
14:57 arora: Hey jekstrand, here's the deliverables part as of now: http://vpaste.net/ysCxe
14:57 arora: What should be the second milestone accordingly?
14:57 sagner: pq: hm not sure if that is accurate, as smaller pitch would also not be allowd
14:57 sagner: pq: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/tilcdc/tilcdc_plane.c#L57
14:57 pinchartl: vsyrjala: I had a question for you regarding pixel formats
14:58 pq: sagner, a smaller pitch does not make sense anyway, at least to me
14:58 pinchartl: do I understand correctly, from the descriptions in drm_fourcc.h that define pixel formats as "[n-1:0] X:Y:Z:... little endian" that the layout on memory, as seen in a u8[], is the same for both little-endian and big-endian platforms ?
14:59 pq: but yeah, I see
15:00 vsyrjala: pinchartl: yes, that was the idea
15:02 pinchartl: thanks
15:03 pinchartl: I was trying to map DRM formats to Qt formats (https://doc.qt.io/qt-5/qimage.html#Format-enum), it seems that most of them have a different memory layout depending on the endianness of the underlying platform
15:03 pinchartl: a bit of a mess
15:04 vsyrjala: there was some cool tool someone wrote to map pixel formats of different systems to each other
15:04 vsyrjala: on github somewhere
15:05 vsyrjala: https://github.com/afrantzis/pixel-format-guide i guess
15:07 vsyrjala: seems to know about qt as well
15:54 jekstrand: kusma: Getting tired of working on Linux are we?
15:56 daniels: jekstrand: PowerShell is actually _really_ nice
15:56 daniels: the secret is setting up OpenSSH so you can just SSH in and execute on PowerShell, plus VS Code's SSH-remote support, so you can still use your Linux machine to do everything, and it just happens to execute on something with DX :)
15:57 jekstrand: daniels: Yeah, I've heard really good things about VS Code via SSH
15:58 dj-death: you really need ot throw in wine in there to do vulkan over dx over vulkan
15:58 daniels: i've been really happy with it, and can't say enough good about PowerShell. the naming is a bit verbose, but apart from that it's really what every shell should be - sort of like the good bits of shell (easy piping/chaining, DWIM by default) and Python (rich objects) together.
15:58 imirkin: fwiw when nouveau allocates framebuffers, they're all aligned to 256 (which is what the hw requires to scan out for like 99% of the cases)
15:59 imirkin: sagner: --^
15:59 jekstrand: daniels: Yeah, I've heard good things. I just don't have reason to spend time in a Windows environment so I've not bothered to really learn much about it.
16:00 imirkin: i think if the driver produces correctly-sized fb's, things should be fine? dunno. maybe those driver-allocated ones only get used in certain situations but not with DRI3...
16:03 kusma: jekstrand: too much kernel-recompiling :(
16:03 kusma: See, with windows that's not even an option!
16:04 jekstrand: kusma: Ah! Yeah, we can't have people compiling their own code. That's just not a good plan.
16:06 kusma: jekstrand: Maybe we can port to ReactOS?
16:06 kusma: I mean, kernel recompiling is *really* a use-case that I want to support.
16:06 bnieuwenhuizen: jekstrand: wrt workarounds for syncing with "bindless" stuff, you talked earlier about adding and removing a WSI buffer from a global buffer list based on AcquireNextImage and QueuePresent. However, can an application still read from an image that is currently being presented?
16:07 jekstrand: bnieuwenhuizen: I'm not sure. There is some image ownership language in the WSI extensions that I've never fully understood.
16:07 kusma: jekstrand: To be a bit more serious, I hope to get some more time for Zink again in the not too distant future. My passion for Vulkan is bigger than my passion for D3D12 ;)
16:08 jekstrand: kusma: Yeah, I get that. But someone's got to pay the bills...
16:09 kusma: jekstrand: Something like that. And it's not like these two projects can't share a bunch of code, lots of details are exactly the same ;)
16:09 jekstrand: Yeah, they're really very similar
16:09 jekstrand: bnieuwenhuizen:
16:09 jekstrand: The presentable images of a swapchain are owned by the presentation engine. An application can acquire use of a presentable image from the presentation engine. Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR, and before it is presented by vkQueuePresentKHR. This includes transitioning the image layout and rendering commands.
16:10 ccr: sooon .. <kusma @ 2022> meh .. this modern multimedia sux, going to OCS Amiga now
16:10 bnieuwenhuizen: jekstrand: ok, that is helpful
16:10 kusma: ccr: A copper-list NIR-backend would be awesome.
16:11 ccr: =)
16:11 jekstrand: bnieuwenhuizen: So I think you can just hook acquire/present and set/unset a flag.
16:11 jekstrand: bnieuwenhuizen: If you want a hook for that, feel free to add one; otherwise you can do it internally.
16:12 jekstrand: vkDeviceMemoryEnableImplicitSync
16:13 bnieuwenhuizen: thanks, I'll work with that
16:18 arora: Hey jekstrand, here's the deliverables part as of now: http://vpaste.net/ysCxe
16:18 arora: What should be the second milestone accordingly?
16:19 jekstrand: Right, I think the first milestone is basically to take ownership of the current MR and land it.
16:20 jekstrand: Or maybe that's milestone 0?
16:20 jekstrand: For the second one, I think having a basic config file system which is able to detect a app by name and apply a policy.
16:21 jekstrand: We don't need to have all of the details of exactly how the policy system works finalized but we should at least have a POC which is able to detect an app using a few different mechanisms (engineName, appName, and executable name) and apply some different policies such as re-order, or force a specific GPU.
16:22 jekstrand: Once we have all of the mechanics in place (this likely won't be landed yet), we can finalize what we want the config file format to look like when it comes to specifying the policies to apply.
16:24 jekstrand: arora: We could also go the other way around and try to specify the policy format first but, in my experience, we're likely to come across "fun" issues in the implemenation which will need to impact the policy file format so it's probably better to get an implementation at least half working first.
16:27 arora: jekstrand: Right, the implementation will come with some quirkiness, but isn't the config file system the final milestone?
16:27 jekstrand: arora: Yes
16:27 jekstrand: arora: The final config file system is the final milestone
16:28 jekstrand: arora: There are going to be a lot of decisions to make between prototype and final
16:28 arora: So the implementation would be the second milestone?
16:29 jekstrand: arora: Yeah, roughly.
16:30 jekstrand: arora: What I'm thinking is bsically three steps: 1. land what we have now, 2. Get a more complex policy prototype mostly working, 3. polish the policy system until we're happy with it.
16:31 arora: Yes, this sounds like a good plan.
18:05 kusma: what happened to the mesa CI? I keep getting lot of container-conflicts...
18:06 karolherbst:wished we would see less marketing/PR driven emails on technical MLs
18:06 kusma: for example: https://gitlab.freedesktop.org/kusma/mesa/-/jobs/2044650
18:16 krh: karolherbst: seems pretty relevant and on topic for mesa-dev
18:16 krh: in particular now that we have most technical discussion happening in MRs
18:16 karolherbst: krh: I am not against the topic, I am against the wording/phrasing
18:16 karolherbst: this comes out of marketing, not engineering
18:18 krh: maybe it's just great news and it's hard to describe without sounding like marketing?
18:18 karolherbst: I am also not gainst discussing non technical stuff, but if I feel like the emails sounds like marketing bs, I get annoyed
18:19 karolherbst: krh: I highly doubt this
18:19 karolherbst: even the good news part
18:19 Venemo: kusma: I just read about the opengl/cl on dx12 announcement, congrats
18:19 karolherbst: the actual interesting bits they don't even want to add to mesa, like the CL runtime
18:20 Venemo: sadly
18:20 Venemo: yeah
18:20 kusma: Venemo: thanks :)
18:20 ajax: one of the less marketese-y announcements i've seen tbh
18:20 karolherbst: so.. this sounds like the annoying bits (keeping up with nir changes) are left to us
18:20 karolherbst: and the juice bits thei keep for themselves
18:20 karolherbst: soo.. waht's the deal here?
18:20 Venemo: I'm wondering how much code is shared with zink, and would it be possible to also use the same infrastructure to run opencl on vulkan
18:20 kusma: karolherbst: the OpenCL runtime will be open sourced.
18:20 karolherbst: kusma: doesn't matter
18:21 karolherbst: I'd like this runtime to be a gallium state tracker everybody could benefit from
18:21 karolherbst: so why should only MS benefit from it?
18:21 kusma: karolherbst: Well, that makes your comment about the juicy bits being kept to ourselves just... wrong?
18:21 karolherbst: who will control the repo?
18:22 karolherbst: us or MS?
18:22 karolherbst: also, why isn't it a new state tracker targeting a d3d12 driver like zink
18:22 kusma: karolherbst: I don't know. I don't even know if it will be upstreamed in mesa or not yet. But in either case, code can be forked.
18:22 karolherbst: yeah... but then we have a forked situation
18:22 karolherbst: I'd just rather see it inside mesa directly
18:22 kusma: karolherbst: we *are* making that also.
18:23 karolherbst: what bothers me a little is that inside MS announcement they speak about "Make it easier for developers to port their apps to D3D12."
18:23 karolherbst: and I don't want to support this either
18:23 karolherbst: I mean, don't get me wrong, it's good to see MS showing interest and such
18:24 ajax: supporting it suggests you think it will, in fact, accomplish that goal
18:24 karolherbst: I just see that a lot of educating needs to be done here
18:24 karolherbst: and to push it in a form it actually benefits us as well
18:24 ajax: that gl apps would somehow be more likely to want to port to dx12 just because mesa exists atop dx12/
18:24 karolherbst: and not just MS
18:24 ajax: which to me seems like it runs counter to how software works, which is that APIs never die
18:25 ajax: so if anything having gl on d3d12 _ensures_ that app will not get ported to the lower layer, because why, it works already
18:25 ajax: so... *shrug*
18:25 kusma: karolherbst: by the way, I don't think anything will prevent people from using the d3d12 gallium driver with clover. All of the OpenCL-supporting bits go into the shared compiler + vtn.
18:25 Venemo: kusma: I'm wondering how much code is shared with zink, and would it be possible to also use the same infrastructure to run opencl on vulkan?
18:25 karolherbst: kusma: that's beside by point entirely
18:26 karolherbst: s/by/my/
18:26 kusma: Venemo: not much apart from general gallium/mesa code at the moment, but we hope to improve that.
18:27 Venemo: if we could run opencl on vulkan, that'd mean we could actually drop clover eventually
18:27 kusma: Venemo: Yeeeah, so CL on Vulkan is about the same complexity as CL on DX12, which means... surprisingly hard :-P
18:27 krh: lol, src/microsoft
18:27 kusma: Venemo: It should be possible, but it might take a lot of work.
18:28 kusma: krh: that's where you find the shared compiler
18:28 karolherbst: "shared"
18:28 Venemo: kusma: I'm not familiar enough with CL so I can't judge that. I'm just curious about the possibility, because there are lots of people complaining about half-baked opencl implementations on amd cards
18:28 kusma: Venemo: I sadly suspect that CL on Vulkan would also end up kinda half-baked unless a lot of time was invested in it :-?
18:28 karolherbst: I doubt that CL can be implemented on VK
18:29 karolherbst: google tried and there is still a ton of bs CL requires
18:29 karolherbst: CL 1.2 maybe, CL 2.0 no way
18:29 kusma: Yeah, but CL 2.0 is, uh. Not a thing.
18:29 krh: kusma: yeah, I had a quick look... the path maybe do a double-take though
18:30 krh: s/maybe/made me/
18:30 karolherbst: kusma: because nvidia is the only one not implementing it?
18:30 Venemo: kusma: hehe, yeah
18:30 kusma: karolherbst: Because it's something nobody wanted.
18:31 karolherbst: yeah.. maybe
18:31 kusma: Well, apart from Apple.
18:31 karolherbst: now do you mean CL 2.0 or CL in general?
18:31 kusma: karolherbst: Well, CL up to 1.2 was somewhat defensible, but you're not wrong.
18:32 kusma: People *did* want an industry-standard compute-API, but the way CL was made was not the right way.
18:32 karolherbst: anyway, I am not against anything technical here, just that I dislike the way how things are done
18:32 karolherbst: and yes, I agree in regards to CL being not the best thing
18:33 karolherbst: and I know that educating companies on how to be a good upstream citizen and doing things the proper and good way can be tiring and exhausting
18:33 karolherbst: nonetheless I don't see why MS should be treated differently
18:33 karolherbst: if it looks like something only benefiting MS in the end, I am completly against it
18:33 karolherbst: they can keep their fork in sync themselves
18:34 kusma: karolherbst: I still fail to see what your big worry is.
18:34 karolherbst: that we do work for them without getting anything out of it
18:34 karolherbst: like porting their code to nir changes
18:35 kusma: You don't like it because Microsoft might benefit from it? One could for sure say that about any other corporate contributors to Mesa?
18:35 kusma: karolherbst: Uhm, what are you talking about now?
18:35 karolherbst: well, if we do changes in nir, we have to update code making use of it, so that's just more work for us
18:36 kusma: karolherbst: But that goes for all drivers, not just this one?
18:36 karolherbst: also, for the other drivers there are usually users actually benefiting from them or are interested in contributing etc...
18:36 kusma: karolherbst: are you saying people won't benefit from this?
18:37 karolherbst: well, here is the difference: for the drivers we have, we also see a lot of contributions to core parts of mesa, etc...
18:37 karolherbst: with MS I don't see it
18:37 karolherbst: juicy bits are already left out like the CL runtime
18:37 karolherbst: it should be a proper state tracker
18:37 karolherbst: so why is that not the case?
18:38 kusma: karolherbst: sounds to me like you're making a lot of assumptions without much data.
18:38 karolherbst: again, why is the CL runtime not a state tracker?
18:39 karolherbst: if that would have been a state tracker, we all benefit from it
18:39 kusma: karolherbst: because it predates microsoft's interest in mesa.
18:39 karolherbst: okay, do you think they would be willing to port it over to be one?
18:39 kusma: or even knowledge about mesa and opencl support
18:39 kusma: karolherbst: might be, yes.
18:40 karolherbst: okay, if it turns out that way, I'd say they showed enough evidence to try to be a good citizen so to speak
18:40 kusma: also, that runtime is a lot less code than you' assume, it's *very* d3d12-centric
18:40 karolherbst: I can imagine
18:40 kusma: "you'" -> "you'd"
18:41 karolherbst: anyway, if I continue with my CL work I will be probably affected by all of that as well and will probably also either see how that helps with clover or not
18:41 karolherbst: but
18:41 kusma: TBH, I would kinda love it if clover + the d3d12 driver became viable also
18:41 karolherbst: it seems like missing CL stuff was also rather implemented in their compiler
18:41 karolherbst: and not vtn
18:41 karolherbst: or at least it sounds like it from the email
18:41 kusma: karolherbst: No, it's in vtn
18:42 karolherbst: okay, then it's a mistake in the email
18:42 karolherbst: or I can't read
18:42 karolherbst: either way
18:42 karolherbst: ahh yeah, this is my mistake
18:45 karolherbst: anyway, I am not a big fan of clover myself, so a nice replacement would be a big help
18:46 kusma: karolherbst: I agree.
18:47 kusma: karolherbst: I'll start upstreaming some vtn-patches tomorrow, hopefully that'll put things in a bit of a better light.
18:47 karolherbst: yeah, probably
18:48 karolherbst: this will take quite some time anyway, so let's see how it turns out in the end
18:48 karolherbst: kusma: do you know when the code got branched out of mesa?
18:49 kusma: karolherbst: a while ago, but we rebased last week, so it's pretty up to date.
18:50 karolherbst: kusma: another thing as this is probably super required here as well: how to deal with unstructured spirv?
18:50 kusma: (but the rebase is a bit nasty, so we could keep merging a cross... looks like a lot of patches, but it's not too bad.
18:51 kusma: karolherbst: yeah, we're using the patches from Julian Winkler
18:51 karolherbst: ahh, okay
18:51 kusma: (on top of yours)
18:51 karolherbst: yeah
18:51 kusma: They seem to work really well for us.
18:51 karolherbst: yep
18:51 karolherbst: here as well
18:52 kusma: So we definately want to try to help getting these upstream :)
18:52 karolherbst: I guess you ignored this issue for a long time as well :p
18:52 kusma: karolherbst: kinda, yeah.
18:52 karolherbst: :)
18:52 karolherbst: understandable
18:53 karolherbst: which makes me feel less bad about ignoring it as well
18:53 kusma: Hehe, yeah :)
18:53 karolherbst: kusma: btw, I have a patch to implement OpSwitch support
18:54 kusma: karolherbst: cool! :)
18:54 karolherbst: https://gitlab.freedesktop.org/karolherbst/mesa/-/commit/30d085dc6247df93e02f0e7e60723d0c54f13d4c
18:54 karolherbst: it's not the best, but it does seem to work
18:55 karolherbst: didn't give it a proper testing though besides running the OCL CTS
18:55 kusma: karolherbst: not the best is my kinda code! ;)
18:55 airlied: OpencL 3.0 will solve all problems :-P
18:55 karolherbst: anyway, it should apply cleanly on top of the patches
18:55 karolherbst: so if you want to give it a shot feel free
18:55 kusma: karolherbst: cool, I just might!
18:55 karolherbst: I might also have random vtn stuff here: https://gitlab.freedesktop.org/karolherbst/mesa/-/commits/clover_support_hmm_wip/
18:55 karolherbst: but not so much these days
18:55 kusma: ooh, images :)
18:56 karolherbst: yeah...
18:56 karolherbst: that's what I am kind of focusing right now
18:56 kusma: We're not doing those for now, but we might have to eventually.
18:56 karolherbst: heh :D
18:56 karolherbst: you are procrastinating the same things I do :p
18:56 kusma: There's... real-world applications waiting for this stuff to ship.
18:57 kusma: So we'll have to see a bit what those particular applications depend on.
18:57 karolherbst: I see
18:57 karolherbst: well.. I might get images stuff to work.. I am sure the vtn bits are done
18:57 karolherbst: just some weird runtime issues
18:57 karolherbst: like clover doing x*yx1 blits :7
18:57 kusma: Cool
18:57 karolherbst: * :/
18:57 kusma: wat?
18:57 karolherbst: yep
18:58 karolherbst: wait.. the code is somewhere
18:59 karolherbst: mhh.. but it's kind of like this: clover creates a transfer mapping flattened out
18:59 karolherbst: so if the applications wants to upload 256x256 pixels to an image
18:59 karolherbst: clover flattens it
19:00 airlied: it's pretty much vulkan buffer->image transfer
19:01 karolherbst: yeah.. I think it might be actually a nouveau limitation
19:02 karolherbst: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/gallium/state_trackers/clover/core/resource.cpp#L189
19:02 karolherbst: transfer_map but with y and z set to 1
19:03 karolherbst: that code is just a bit painful to follow :/
19:04 karolherbst: kusma: anyway... on llvmpipe this code worked afaik.... so I might start to create MR for some of the vtn bits there as well
19:05 karolherbst: I just don't understand why clover would flatten that out
19:05 karolherbst: but maybe... we can just configure our hw to deal with that
19:05 karolherbst: just need to figure out how
19:05 airlied: it shouldn't matter to fix it
19:05 airlied: since I don't think images really work on r600 either
19:06 karolherbst: yeah...
19:06 karolherbst: but it fails different probably
19:06 airlied: I suspect in fixing it you will work out why :-P
19:06 karolherbst: don't have r600 hw :p
19:06 karolherbst: but yeah...
19:06 karolherbst: the code is just a bit annoying to fix
19:07 airlied: no I mean you'll figure out why clover does it irrespective of r600
19:07 airlied: there is no r600 hw reason for doing it
19:07 airlied: it's more likely a CL api reason
19:07 karolherbst: it's not
19:07 karolherbst: clover flattens is, not the API
19:09 karolherbst: I also don't see why we need to do the copy in software either
19:10 karolherbst: llike.. it uses a staging buffer
19:11 karolherbst: sure.. the client can provide their own row and column pitch and everything, but then the code needs to deal with it differently anyway
19:11 karolherbst: kind of seems wasteful to do the copy in sw if the client just wants to update 256x256 pixels without any special pitch
19:12 airlied: karolherbst: I expect the answer isn't as simple as you think it will be, but hey anything that works is good
19:12 airlied: the clover API talks in terms of image/buffer transfers
19:12 airlied: which to me implies the buffer has no structure
19:13 karolherbst: well.. images have always a size in CL and dimensionality
19:14 karolherbst: and for buffers there is no problem
19:15 airlied: also earlier ppl were talking about CL on VK, yes it will forever remain a toy bridge
19:17 imirkin: karolherbst: probably at some point was the idea that images would just be raw resources
19:17 imirkin: look at some of the commented out code around resource handling in nv50_ir_from_tgsi.cpp
19:18 imirkin: however i don't think that works out in practice, and makes for unnecessary complications for drivers
19:18 karolherbst: maybe
19:22 karolherbst: imirkin: anywaay, with nvc0 I hit nve4_m2mf_transfer_rect here
19:23 karolherbst: with a ... 1d rect being super big
19:23 imirkin: yeah
19:23 karolherbst: no idea if we can configure m2mf differently to dal with a linear copy
19:23 karolherbst: but it sounds like something the hw could do
19:23 imirkin: don't think so
19:23 karolherbst: but then again.. why do the sw memcpy in the first place for a 256x256 upload of data without an explicit pitch
19:24 karolherbst: and use a staging buffer
19:25 imirkin: staging buffer is almost always the way to go
19:25 imirkin: for non-UMA systems
19:25 imirkin: you can look at how PBO's are uploaded in st/mesa for example
19:26 karolherbst: well.. clover does hw copy for other things
19:26 karolherbst: if the API has no way to specify a pitch it uses a hw based copy
19:27 karolherbst: otherwise sw+staging buffer
19:27 karolherbst: mhh.. not even always
19:27 karolherbst: it does feel a bit random to be honest
19:28 karolherbst: ohh, hw copy only if you have two pipe resources
19:28 karolherbst: okay
19:28 karolherbst: and no pitch
19:36 karolherbst: mhh, actually now I have an idea on how to fix it
19:47 imirkin: right, can't do hw copy if it's nto from resource to resource
19:48 imirkin: hence the staging texture that you copy into (and is cpu-side)
19:48 karolherbst: yeah.. I understand this part
19:48 karolherbst: the point is just that we could have some checks about the pitch the API hands in and do a sw or hw copy from resource to resource if it fits
19:48 karolherbst: but yeah...
19:52 mareko: that microsoft - collabora partnership is great news
20:11 craftyguy: mareko: the TGL failures for vk cts in your CI build can be ignored
20:12 craftyguy: we're trying to figure out what is causing those intermittent failures
20:12 craftyguy: but it's unrelated to your branch. sorry for the noise. the other failures there look real
20:21 mareko: craftyguy: do you mean the primitive restart failures?
20:22 mareko: craftyguy: I'm mainly concerned about those
20:22 craftyguy: mareko: those look like real failures
20:23 craftyguy: ah, your latest build hasn't made it to the result site yet
20:23 craftyguy: so you don't see the TGL failures I'm talking about. it should be up shortly