airlied / gsp-parse

parser for GSP headers
0 stars 0 forks source link

what should be in the json? #1

Open airlied opened 3 months ago

airlied commented 3 months ago

I've played around here, and I'm trying to consider what the final json file should be.

It will definitely contain a #define to value list, but the struct info is more where a decision needs to be made.

The options are mostly

a) encode C representations structs/typdefs/anon structs so we can recreate the C structs nearly 1:1 just with versioning

b) a set of memory descriptors per RPC describing what the buffer to send to the fw for a command should contain

The first is where the code is at in gsp-parse-c-structs typedefs and anon structs make this messy.

I'm mostly leaning towards (b) some flat structs per command that we just encode in the driver. It might make it slightly harder to validate against the NVIDIA C headers but I think it makes more sense in the long run.

airlied commented 3 months ago

master now emits two files, one "C" json and the other more "hw" like