[Mesa-dev] [PATCH] i915g: fix crashes with wined3d

Christopher Egert cme3000 at gmail.com
Tue Jan 9 22:40:43 UTC 2018


I'm not too familiar with gallium3d, but this fixes
crashes with 3DMark2001 and GTA3 in wine-staging.

This should be fixed properly in the future.

Signed-off-by: Christopher Egert <cme3000 at gmail.com>
---
 src/gallium/drivers/i915/i915_clear.c        | 3 ++-
 src/gallium/drivers/i915/i915_state_static.c | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c
index a1af789104..7a6f3fbb9a 100644
--- a/src/gallium/drivers/i915/i915_clear.c
+++ b/src/gallium/drivers/i915/i915_clear.c
@@ -250,7 +250,8 @@ i915_clear_render(struct pipe_context *pipe, unsigned buffers,
 {
    struct i915_context *i915 = i915_context(pipe);

-   if (i915->dirty)
+   /* XXX not sure why this happens, but it works around one crash */
+   if (i915->dirty || (i915->hardware_dirty == ~0))
       i915_update_derived(i915);

    i915_clear_emit(pipe, buffers, color, depth, stencil,
diff --git a/src/gallium/drivers/i915/i915_state_static.c b/src/gallium/drivers/i915/i915_state_static.c
index 88b418b1ac..48bb137019 100644
--- a/src/gallium/drivers/i915/i915_state_static.c
+++ b/src/gallium/drivers/i915/i915_state_static.c
@@ -244,7 +244,9 @@ static void update_dst_buf_vars(struct i915_context *i915)
       i915->current.target_fixup_format = need_fixup;
       i915->current.fixup_swizzle = fixup;
       /* we also send a new program to make sure the fixup for RGBA surfaces happens */
-      i915->hardware_dirty |= I915_HW_PROGRAM;
+      /* XXX there is no program to upload, not sure where this should
+       * be coming from, so comment this out for now */
+      //i915->hardware_dirty |= I915_HW_PROGRAM;
    }
 }

-- 
2.15.1


More information about the mesa-dev mailing list