1. 02 Aug, 2021 8 commits
  2. 01 Aug, 2021 10 commits
    • Ian Romanick's avatar
      mesa: Fix tiny race condition in _mesa_debug_get_id · 5cee8434
      Ian Romanick authored
      
      
      Two threads enter and see *id == 0.  Both threads update the value.
      Upon returning, one of the threads might see the overwritten value some
      of the time and the updated value other times.  Use cmpxchg to ensure
      that there's only ever one value written to *id.
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Part-of: <mesa/mesa!12136>
      5cee8434
    • Ian Romanick's avatar
      intel/compiler: Add id parameter to shader_perf_log callback · 5ffbee84
      Ian Romanick authored
      There are two problems with the current architecture.
      
      In OpenGL, the id is supposed to be a unique identifier for a particular
      log source.  This is done so that applications can (theoretically)
      filter particular log messages.  The debug callback infrastructure in
      Mesa assigns a uniqe value when a value of 0 is passed in.  This causes
      the id to get set once to a unique value for each message.
      
      By passing a stack variable that is initialized to 0 on every call,
      every time the same message is logged, it will have a different id.
      This isn't great, but it's also not catastrophic.
      
      When threaded shader compiles are used, the id *pointer* is saved and
      dereferenced at a possibly much later time on a possibly different
      thread.  This causes one thread to access the stack from a different
      thread... and that stack frame might not be valid any more. :(
      
      I have not observed any crashes related to this particular issue.
      
      Reviewed-by: Matt Turner <mattst88@gma...
      5ffbee84
    • Ian Romanick's avatar
      intel/compiler: Add id parameter to shader_debug_log callback · 043c5bf9
      Ian Romanick authored
      There are two problems with the current architecture.
      
      In OpenGL, the id is supposed to be a unique identifier for a particular
      log source.  This is done so that applications can (theoretically)
      filter particular log messages.  The debug callback infrastructure in
      Mesa assigns a uniqe value when a value of 0 is passed in.  This causes
      the id to get set once to a unique value for each message.
      
      By passing a stack variable that is initialized to 0 on every call,
      every time the same message is logged, it will have a different id.
      This isn't great, but it's also not catastrophic.
      
      When threaded shader compiles are used, the id *pointer* is saved and
      dereferenced at a possibly much later time on a possibly different
      thread.  This causes one thread to access the stack from a different
      thread... and that stack frame might not be valid any more. :(
      
      This fixes shader-db crashes of various kinds on Iris with threaded
      shader compiles enabled.
      
      Fixes: 42c34e1a
      
       ("iris: Enable threaded shader compilation")
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Reviewed-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
      Part-of: <mesa/mesa!12136>
      043c5bf9
    • xantares's avatar
      meson: dont use missing dumpbin path · 80160a67
      xantares authored
      
      Reviewed-by: Dylan Baker's avatarDylan Baker <dylan@pnwbakers.com>
      Cc: 21.2 mesa-stable
      Closes #5142
      
      Part-of: <mesa/mesa!12139>
      80160a67
    • Icecream95's avatar
      pan/mdg: Analyze helper termination after scheduling · a2b37e95
      Icecream95 authored
      Similar to the fix in 6bf8e960 ("pan/bi: Do helper termination
      analysis on clauses")
      
      Though apparently a "theoretical issue only", fixes artefacts in
      DarkPlaces with both D3D9 and GL renderers.
      
      Fixes: 9a7f0e26 ("pan/mdg: Use the helper invo analyze passes")
      Part-of: <mesa/mesa!12156>
      a2b37e95
    • Dave Airlie's avatar
      e79a78a1
    • Dave Airlie's avatar
      0dec873f
    • Icecream95's avatar
      pan/bi: Fix infinite loop parsing arguments for bifrost_compiler · 490d09f1
      Icecream95 authored
      While char is signed on macOS AArch64, on Linux it is unsigned. This
      means it cannot represent the -1 return value of getopt_long.
      
      Change the type of `c` to int, the type that getopt_long returns, so
      that the -1 will be kept intact and can be checked for.
      
      Fixes: c6be4f85 ("pan/bi: Use getopt for bifrost_compiler")
      Part-of: <mesa/mesa!12153>
      490d09f1
    • Icecream95's avatar
      pan/bi: Use padding bytes for checking whether to stop disassembly · 1acc3394
      Icecream95 authored
      Both Panfrost and the DDK add padding zero bytes to the end of
      shaders, so we can use this instead of the end-of-shader clause for
      checking whether to stop disassembling.
      
      Shaders can have end-of-shader clauses partway through; these shaders
      will now be completely disassembled instead of cut off at the first
      end-of-shader clause.
      
      A tag byte of zero is an invalid encoding, so unlike the previous
      version of this test only check the first word.
      
      Part-of: <mesa/mesa!12153>
      1acc3394
    • Icecream95's avatar
      pan/bi: Print the clause of branch targets · 8574ca44
      Icecream95 authored
      Rather than just printing an offset such as '(pc + 192)', print the
      target of branches as a clause number that matches up with the clause
      headers printed by disassemble_bifrost.
      
      Part-of: <mesa/mesa!12153>
      8574ca44
  3. 31 Jul, 2021 1 commit
  4. 30 Jul, 2021 14 commits
  5. 29 Jul, 2021 7 commits
    • Connor Abbott's avatar
      tu: Handle multisample vkCmdCopyColorImage() · d9a4a0ae
      Connor Abbott authored
      There was a bit of code already to select the 3d path, but we actually
      need another shader variant for it.
      
      Part-of: <!12080>
      d9a4a0ae
    • Alyssa Rosenzweig's avatar
      pan/bi: Validate the live set starts empty · 1e29f57b
      Alyssa Rosenzweig authored
      
      
      Otherwise there is an uninitialized read, and the register allocation
      will fail. (In the sense of failing a precondition. This manifests as
      synthetic interference leading to higher register pressure and useless
      moves. The allocation itself is ok, but it indicates a real bug.)
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      Part-of: <mesa/mesa!12130>
      1e29f57b
    • Alyssa Rosenzweig's avatar
      pan/bi: Stub 64-bit in count_write_registers · 7d60a888
      Alyssa Rosenzweig authored
      
      
      When Valhall lands, we'll need to be more methodical about this. In the
      mean time, this gets validation passing on
      KHR-GLES31.core.compute_shader.atomic-case3 which was crashing in RA and
      now again passes.
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      Part-of: <mesa/mesa!12130>
      7d60a888
    • Alyssa Rosenzweig's avatar
      pan/bi: Handle asymmetric staging in bi_count_read_registers · 502ffe6f
      Alyssa Rosenzweig authored
      
      
      Needed for atomics.
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      Part-of: <mesa/mesa!12130>
      502ffe6f
    • Alyssa Rosenzweig's avatar
      pan/bi: Add bi_entry_block helper · e3f14b98
      Alyssa Rosenzweig authored
      
      
      Useful for checking invariants at the start of the program.
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      Part-of: <mesa/mesa!12130>
      e3f14b98
    • Alyssa Rosenzweig's avatar
      pan/bi: Lower fragment output with <4 components · c4f8b52e
      Alyssa Rosenzweig authored
      
      
      This avoids undefined behaviour in the shader, which will fail
      validation added later in the series. shader-db results are neglible --
      the extra moves required in a few cases are cancelled out by the extra
      moves eliminated by allowing register allocation to work properly.
      
      total instructions in shared programs: 146903 -> 146907 (<.01%)
      instructions in affected programs: 33 -> 37 (12.12%)
      helped: 0
      HURT: 1
      
      total tuples in shared programs: 123616 -> 123613 (<.01%)
      tuples in affected programs: 764 -> 761 (-0.39%)
      helped: 6
      HURT: 4
      helped stats (abs) min: 1.0 max: 4.0 x̄: 1.67 x̃: 1
      helped stats (rel) min: 0.54% max: 5.88% x̄: 2.64% x̃: 1.86%
      HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.75 x̃: 2
      HURT stats (rel)   min: 4.55% max: 13.33% x̄: 8.57% x̃: 8.19%
      95% mean confidence interval for tuples value: -1.73 1.13
      95% mean confidence interval for tuples %-change: -2.72% 6.41%
      Inconclusive result (value mean confidence interval includes 0).
      
      total clauses in shared programs: 25656 -> 25654 (<.01%)
      clauses in affected programs: 43 -> 41 (-4.65%)
      helped: 2
      HURT: 1
      helped stats (abs) min: 1.0 max: 2.0 x̄: 1.50 x̃: 1
      helped stats (rel) min: 6.25% max: 12.50% x̄: 9.38% x̃: 9.38%
      HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
      HURT stats (rel)   min: 33.33% max: 33.33% x̄: 33.33% x̃: 33.33%
      
      total cycles in shared programs: 12114.21 -> 12114.12 (<.01%)
      cycles in affected programs: 27.42 -> 27.33 (-0.30%)
      helped: 4
      HURT: 3
      helped stats (abs) min: 0.04166700000000034 max: 0.08333299999999966 x̄: 0.06 x̃: 0
      helped stats (rel) min: 0.57% max: 1.59% x̄: 1.02% x̃: 0.96%
      HURT stats (abs)   min: 0.0416669999999999 max: 0.08333299999999999 x̄: 0.06 x̃: 0
      HURT stats (rel)   min: 4.17% max: 16.67% x̄: 8.80% x̃: 5.56%
      95% mean confidence interval for cycles value: -0.07 0.05
      95% mean confidence interval for cycles %-change: -2.90% 9.27%
      Inconclusive result (value mean confidence interval includes 0).
      
      total arith in shared programs: 4601.08 -> 4601.04 (<.01%)
      arith in affected programs: 29 -> 28.96 (-0.14%)
      helped: 6
      HURT: 4
      helped stats (abs) min: 0.04166700000000001 max: 0.08333299999999966 x̄: 0.06 x̃: 0
      helped stats (rel) min: 0.57% max: 10.00% x̄: 3.63% x̃: 1.39%
      HURT stats (abs)   min: 0.04166700000000001 max: 0.08333399999999991 x̄: 0.07 x̃: 0
      HURT stats (rel)   min: 5.56% max: 16.67% x̄: 10.85% x̃: 10.60%
      95% mean confidence interval for arith value: -0.05 0.05
      95% mean confidence interval for arith %-change: -3.95% 8.28%
      Inconclusive result (value mean confidence interval includes 0).
      
      total quadwords in shared programs: 110008 -> 110002 (<.01%)
      quadwords in affected programs: 1090 -> 1084 (-0.55%)
      helped: 11
      HURT: 8
      helped stats (abs) min: 1.0 max: 7.0 x̄: 2.18 x̃: 1
      helped stats (rel) min: 0.61% max: 13.16% x̄: 4.07% x̃: 1.82%
      HURT stats (abs)   min: 1.0 max: 6.0 x̄: 2.25 x̃: 1
      HURT stats (rel)   min: 3.70% max: 42.86% x̄: 12.55% x̃: 7.50%
      95% mean confidence interval for quadwords value: -1.76 1.13
      95% mean confidence interval for quadwords %-change: -2.95% 8.81%
      Inconclusive result (value mean confidence interval includes 0).
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      Part-of: <mesa/mesa!12130>
      c4f8b52e
    • Connor Abbott's avatar
      ir3: Delete old packed struct encoding · 9b0a4cc8
      Connor Abbott authored
      turnip clear/blit shaders were the last user of these.
      
      Part-of: <mesa/mesa!12079>
      9b0a4cc8