[Mesa-dev] mesa/st: unmap transfer only if not null

Submitted by Sebastian Wick on April 14, 2014, 4:17 p.m.

Details

Message ID 1397492225-29899-1-git-send-email-sebastian@sebastianwick.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Sebastian Wick April 14, 2014, 4:17 p.m.
Fixes crash for r600g in piglit tests
fbo-generatemipmap-3d RGB9_E5
fbo-generatemipmap-array RGB9_E5

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
---
 src/mesa/state_tracker/st_texture.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 8d559df..0e53823 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -271,7 +271,8 @@  st_texture_image_unmap(struct st_context *st,
 
    DBG("%s\n", __FUNCTION__);
 
-   pipe_transfer_unmap(pipe, stImage->transfer);
+   if (stImage->transfer)
+      pipe_transfer_unmap(pipe, stImage->transfer);
    stImage->transfer = NULL;
 }
 

Comments

On 04/14/2014 10:17 AM, Sebastian Wick wrote:
> Fixes crash for r600g in piglit tests
> fbo-generatemipmap-3d RGB9_E5
> fbo-generatemipmap-array RGB9_E5
>
> Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
> ---
>   src/mesa/state_tracker/st_texture.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
> index 8d559df..0e53823 100644
> --- a/src/mesa/state_tracker/st_texture.c
> +++ b/src/mesa/state_tracker/st_texture.c
> @@ -271,7 +271,8 @@ st_texture_image_unmap(struct st_context *st,
>
>      DBG("%s\n", __FUNCTION__);
>
> -   pipe_transfer_unmap(pipe, stImage->transfer);
> +   if (stImage->transfer)
> +      pipe_transfer_unmap(pipe, stImage->transfer);
>      stImage->transfer = NULL;
>   }
>
>

I think it would be interesting to know how this is happening in the 
first place.  We shouldn't be calling unmap on a texture that wasn't 
mapped or failed to map in the first place.

-Brian
Hi, the tests have already been fixed in the master branch. You seem
to use Mesa code that is quite old. This patch won't apply.

Marek

On Mon, Apr 14, 2014 at 6:17 PM, Sebastian Wick
<sebastian@sebastianwick.net> wrote:
> Fixes crash for r600g in piglit tests
> fbo-generatemipmap-3d RGB9_E5
> fbo-generatemipmap-array RGB9_E5
>
> Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
> ---
>  src/mesa/state_tracker/st_texture.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
> index 8d559df..0e53823 100644
> --- a/src/mesa/state_tracker/st_texture.c
> +++ b/src/mesa/state_tracker/st_texture.c
> @@ -271,7 +271,8 @@ st_texture_image_unmap(struct st_context *st,
>
>     DBG("%s\n", __FUNCTION__);
>
> -   pipe_transfer_unmap(pipe, stImage->transfer);
> +   if (stImage->transfer)
> +      pipe_transfer_unmap(pipe, stImage->transfer);
>     stImage->transfer = NULL;
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev