graphics/mesa-dri: Fix a crash for radeon r600 graphic cards.

Add an upstream patch to fix an immediate crash of Xorg and wayland
on systems with radeon r600 based graphic cards. See:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/7931

PR: 268327
This commit is contained in:
Florian Walpen 2022-12-20 17:55:02 +01:00 committed by Emmanuel Vadot
parent 9153b6064b
commit ad2ced80de
2 changed files with 17 additions and 0 deletions

View file

@ -1,5 +1,6 @@
PORTNAME= mesa-dri
PORTVERSION= ${MESAVERSION}
PORTREVISION= 1
CATEGORIES= graphics
COMMENT= OpenGL hardware acceleration drivers for DRI2+

View file

@ -0,0 +1,16 @@
--- src/gallium/drivers/r600/sfn/sfn_optimizer.cpp.orig 2022-12-14 21:06:11 UTC
+++ src/gallium/drivers/r600/sfn/sfn_optimizer.cpp
@@ -354,7 +354,12 @@ CopyPropFwdVisitor::visit(AluInstr *instr)
auto src = instr->psrc(0);
auto dest = instr->dest();
- for (auto& i : dest->uses()) {
+ auto ii = dest->uses().begin();
+ auto ie = dest->uses().end();
+
+ while(ii != ie) {
+ auto i = *ii;
+ ++ii;
/* SSA can always be propagated, registers only in the same block
* and only if they are assigned in the same block */
bool can_propagate = dest->is_ssa();