iris: isv freeing fixes
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 7 Apr 2018 13:16:51 +0000 (06:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 4b400eee01f2951a18571c30852d26ab7f5fdfc4..7b4b66bd7cf4c769c183e2c3721e3b4fc101f94e 100644 (file)
@@ -273,16 +273,10 @@ translate_fill_mode(unsigned pipe_polymode)
    return map[pipe_polymode];
 }
 
-static struct iris_address
-bo_addr(struct iris_bo *bo)
-{
-   return (struct iris_address) { .offset = bo->gtt_offset };
-}
-
-
 static struct iris_address
 ro_bo(struct iris_bo *bo, uint64_t offset)
 {
+   /* Not for CSOs! */
    return (struct iris_address) { .bo = bo, .offset = offset };
 }
 
@@ -1310,8 +1304,10 @@ static void
 iris_sampler_view_destroy(struct pipe_context *ctx,
                           struct pipe_sampler_view *state)
 {
+   struct iris_surface *isv = (void *) state;
    pipe_resource_reference(&state->texture, NULL);
-   free(state);
+   pipe_resource_reference(&isv->surface_state_resource, NULL);
+   free(isv);
 }