#asahi-gpu · 2022-10-03 07:56
marcanThe problem is there is still one IOMFB, which means one "connector" in DRM parlance. Making it behave as two independent ones is... not going to be pretty.#asahi-gpu · 2022-10-03 07:55
karolherbstbut it also doesn't sound like it will be needed... hopefully. Tiled displays working is quite an optimistic sign#asahi-gpu · 2022-10-03 07:54
karolherbstright...#asahi-gpu · 2022-10-03 07:54
karolherbst:D#asahi-gpu · 2022-10-03 07:54
marcanThat is not to say there aren't any ways around that due to bugs... I found one... but it's not practical for firmware replacement.#asahi-gpu · 2022-10-03 07:54
marcankarolherbst: It's asymmetric signatures, there are no "signature keys" to leak. Apple are not Nvidia, they actually know how to design secure hardware.#asahi-gpu · 2022-10-02 22:18
karolherbstcould be worse though#asahi-gpu · 2022-10-02 22:18
karolherbststill.. they are annoying to use#asahi-gpu · 2022-10-02 22:17
karolherbstI know :)#asahi-gpu · 2022-10-02 22:17
i509VCBYou can mark it as a bitfield enum, but you have to name all the types... https://docs.rs/bindgen/0.60.1/bindgen/struct.Builder.html#method.bitfield_enum#asahi-gpu · 2022-10-02 22:17
karolherbstI think I use all of them in mesa...#asahi-gpu · 2022-10-02 22:17
karolherbstall those enum types have pro and cons#asahi-gpu · 2022-10-02 22:17
karolherbstyeah...#asahi-gpu · 2022-10-02 22:17
i509VCBAlthough bitflags are a bit out of it: https://docs.rs/bindgen/0.60.1/bindgen/struct.Builder.html#method.rustified_enum#asahi-gpu · 2022-10-02 22:17
karolherbsti509VCB: yeah, and then 4 other enum types#asahi-gpu · 2022-10-02 22:16
alyssakarolherbst: especially bit enums#asahi-gpu · 2022-10-02 22:16
i509VCBIsn't there an option to generate rust enums in bindgen?#asahi-gpu · 2022-10-02 22:15
karolherbstbut looking at bindgen I think rust really needs to improve handling of "int enums", to make interacting with C code less painfull#asahi-gpu · 2022-10-02 22:14
karolherbstbut not sure if serde supports that out of the box now#asahi-gpu · 2022-10-02 22:14
karolherbstahh yes#asahi-gpu · 2022-10-02 22:14
karolherbstit does seem to use serde It hink...#asahi-gpu · 2022-10-02 22:14
karolherbstor maybe it's part of serde now#asahi-gpu · 2022-10-02 22:13
i509VCBThe author seems to exist still, I guess it could be brought back up#asahi-gpu · 2022-10-02 22:13
i509VCBWell the open pull request is my metric of that#asahi-gpu · 2022-10-02 22:13
karolherbstor it's the first crate to be "done"#asahi-gpu · 2022-10-02 22:12
i509VCBlooks abandoned sadly#asahi-gpu · 2022-10-02 22:11
karolherbstI think this was the one I found way earlier: https://docs.rs/int-enum/latest/int_enum/trait.IntEnum.html#asahi-gpu · 2022-10-02 22:11
i509VCBan int <-> enum derive macro sounds interesting#asahi-gpu · 2022-10-02 22:11
i509VCBsure I get don't want more ticking timebombs that explode when you forget to update little things.#asahi-gpu · 2022-10-02 22:10
karolherbstbut then I also want to just declare a type to get derived serialize/deserialize methods#asahi-gpu · 2022-10-02 22:09
karolherbstI think there are also crates making that int <-> enum conversion less painful#asahi-gpu · 2022-10-02 22:08
karolherbstheh...#asahi-gpu · 2022-10-02 22:08
karolherbstbecause when it gets changed, the code needs got get updated#asahi-gpu · 2022-10-02 22:08
alyssamako template generating rust code? :-p#asahi-gpu · 2022-10-02 22:08
karolherbsti509VCB: my point was more, that I don't want to have to write the code for it :)#asahi-gpu · 2022-10-02 22:08
karolherbstthough I am sure that the 1st place of unsafe \ loc goes to the stdlib#asahi-gpu · 2022-10-02 22:08
i509VCBOr `impl From<u32> for Option<TheEnum>` could be another option#asahi-gpu · 2022-10-02 22:07
karolherbstalready having enough unsafe blocks :D#asahi-gpu · 2022-10-02 22:07
karolherbstmhhh#asahi-gpu · 2022-10-02 22:07
alyssais not very good at Rust#asahi-gpu · 2022-10-02 22:07
alyssaunsafe { transmute } all the things#asahi-gpu · 2022-10-02 22:07
karolherbstbut yeah.. maybe repr(C) would help#asahi-gpu · 2022-10-02 22:06
karolherbstbecause the fallback is to just compile the source regardless#asahi-gpu · 2022-10-02 22:06
karolherbstwell.. returning an Error doesn't help with anything though#asahi-gpu · 2022-10-02 22:06
i509VCB(repr(C) is an example, could be repr(u32) or whatever_#asahi-gpu · 2022-10-02 22:06
i509VCBThat way you can just do self.enum_value as u32#asahi-gpu · 2022-10-02 22:06
i509VCBOr something like this: https://gist.github.com/i509VCB/d0ffc8ad1f061a220b60b1ef24af63a0#asahi-gpu · 2022-10-02 22:04
i509VCBI'd think TryFrom implementation that returns an Err given an invalid value would make more sense#asahi-gpu · 2022-10-02 21:58
karolherbstmostly that enum to int mapping is annoying, though I could just unsafe it I think?#asahi-gpu · 2022-10-02 21:58
karolherbstbut I also use that in some other places, like https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs#L370