+static bool populate_connector_planes(struct connector_config *config,
+ toml_array_t *planes)
+{
+ config->nplanes = toml_array_nelem(planes);
+ config->planes = calloc(config->nplanes, sizeof(uint32_t));
+ if (!config->planes) {
+ DEBUG_LOG("Memory allocation failed: %s\n", strerror(errno));
+ return false;
+ }
+
+ for (int j = 0; j < config->nplanes; j++) {
+ toml_datum_t plane = toml_int_at(planes, j);
+ if (!plane.ok) {
+ return false;
+ }
+ config->planes[j] = plane.u.i;
+ }
+ return true;
+}
+