Skip to content

intel/dev: implement json serialization for intel_device_info

Mark Janes requested to merge majanes/mesa:gen_serialize into main

What does this MR do and why?

intel/dev: implement json serialization for intel_device_info

Generate intel_device_serialize.c from a mako template, providing
functions to dump and parse intel_device_info.

intel_device_info.py declares python objects representing all type
declarations associated with intel_device_info.  It is used as a data
source for intel_device_serialize_c.py

intel_device_serialize_c.py emits a c++ file with routines to dump
or load all struct members to/from json.  The json format is a direct
translation of the c structure, with 2 exceptions:

 - When parsing json, the no_hw member is always set to true to
   indicate that the driver's intel_device_info does not correspond to
   the current platform.

 - When dumping to json, devinfo_type_sha1 is calculated to be a
   checksum which changes whenever intel_device_info is updated.  This
   checksum is encoded in json.  When parsing json, the driver verifies
   that the checksum matches before loading data into
   intel_device_info.  This verifies compatibility.

Merge request reports