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

Ilia Mirkin imirkin at alum.mit.edu
Wed Jan 10 00:03:49 UTC 2018


On Tue, Jan 9, 2018 at 5:40 PM, Christopher Egert <cme3000 at gmail.com> wrote:
> 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 */

It used to be that there'd always be a draw before the first clear.
This no longer happens, and a ton of drivers had to get fixes for
that. Not sure if this is the right thing to do, but should look at
how/whether the draw function deals with this.

> +   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;

Note that for that first clear, you might not have a program bound.
Perhaps related?

>     }
>  }
>
> --
> 2.15.1
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list