+ group->fixed_length = fixed_length;
+ group->dword_length_field = NULL;
+ group->dw_length = 0;
+ group->engine_mask = I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
+ I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
+ I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
+ group->bias = 1;
+
+ for (int i = 0; atts[i]; i += 2) {
+ char *p;
+ if (strcmp(atts[i], "length") == 0) {
+ group->dw_length = strtoul(atts[i + 1], &p, 0);
+ } else if (strcmp(atts[i], "bias") == 0) {
+ group->bias = strtoul(atts[i + 1], &p, 0);
+ } else if (strcmp(atts[i], "engine") == 0) {
+ void *mem_ctx = ralloc_context(NULL);
+ char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
+ char *save_ptr;
+ char *tok = strtok_r(tmp, "|", &save_ptr);
+
+ group->engine_mask = 0;
+ while (tok != NULL) {
+ if (strcmp(tok, "render") == 0) {
+ group->engine_mask |= I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
+ } else if (strcmp(tok, "video") == 0) {
+ group->engine_mask |= I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
+ } else if (strcmp(tok, "blitter") == 0) {
+ group->engine_mask |= I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
+ } else {
+ fprintf(stderr, "unknown engine class defined for instruction \"%s\": %s\n", name, atts[i + 1]);
+ }
+
+ tok = strtok_r(NULL, "|", &save_ptr);
+ }
+
+ ralloc_free(mem_ctx);
+ }
+ }