mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
iris: refcount separate screen objects for resource tracking
this screen object can never, ever be accessed like this in a resource, as it may have previously been replaced by a wrapper (e.g., driver trace) which will then explode when it is accessed directly instead, keep a separate screen ref on the resource which is known to be the actual driver object and not a wrapper Fixes:0a497eb130("iris: make resources take a ref on the screen object") Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10632> (cherry picked from commiteb63c7dece)
This commit is contained in:
parent
2ef356c0c7
commit
eaecde60cb
3 changed files with 9 additions and 3 deletions
|
|
@ -13,7 +13,7 @@
|
|||
"description": "iris: refcount separate screen objects for resource tracking",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "0a497eb1303d23f04ad7d9c28abf953a9105e32a"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ iris_resource_destroy(struct pipe_screen *screen,
|
|||
|
||||
threaded_resource_deinit(p_res);
|
||||
iris_bo_unreference(res->bo);
|
||||
iris_pscreen_unref(res->base.b.screen);
|
||||
iris_pscreen_unref(res->orig_screen);
|
||||
|
||||
free(res);
|
||||
}
|
||||
|
|
@ -429,7 +429,8 @@ iris_alloc_resource(struct pipe_screen *pscreen,
|
|||
return NULL;
|
||||
|
||||
res->base.b = *templ;
|
||||
res->base.b.screen = iris_pscreen_ref(pscreen);
|
||||
res->base.b.screen = pscreen;
|
||||
res->orig_screen = iris_pscreen_ref(pscreen);
|
||||
pipe_reference_init(&res->base.b.reference, 1);
|
||||
threaded_resource_init(&res->base.b);
|
||||
|
||||
|
|
|
|||
|
|
@ -168,6 +168,11 @@ struct iris_resource {
|
|||
* be DRM_FORMAT_MOD_INVALID.
|
||||
*/
|
||||
const struct isl_drm_modifier_info *mod_info;
|
||||
|
||||
/**
|
||||
* The screen the resource was originally created with, stored for refcounting.
|
||||
*/
|
||||
struct pipe_screen *orig_screen;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue