freedreno: Early exit in device matching if id doesn't have chip_id
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 27 Apr 2023 20:33:19 +0000 (22:33 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 21:06:46 +0000 (21:06 +0000)
Assert was wrong and caused issues when there are devices defined
after devices that are matched by chip_id.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21498>

src/freedreno/common/freedreno_dev_info.c
src/freedreno/ir3/tests/disasm.c

index d32695c..a9bc2a5 100644 (file)
@@ -45,7 +45,9 @@ dev_id_compare(const struct fd_dev_id *ref, const struct fd_dev_id *id)
    if (ref->gpu_id && id->gpu_id) {
       return ref->gpu_id == id->gpu_id;
    } else {
-      assert(ref->chip_id && id->chip_id);
+      if (!id->chip_id)
+         return false;
+
       /* Match on either:
        * (a) exact match:
        */
index c40302c..cdfe781 100644 (file)
@@ -489,6 +489,7 @@ main(int argc, char **argv)
       unsigned gen = test->gpu_id / 100;
       if (!compilers[gen]) {
          dev_ids[gen].gpu_id = test->gpu_id;
+         dev_ids[gen].chip_id = 0;
          compilers[gen] = ir3_compiler_create(NULL, &dev_ids[gen],
                                               &(struct ir3_compiler_options){});
       }