diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2018-09-26 10:29:49 -0400 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2018-09-28 02:57:08 -0400 |
commit | 1b9a01d62cb1bed2bc98f8b4e31d5b9daf0a446b (patch) | |
tree | e26303fbb82b5c14f7fe502926ffb52befb02a5c /drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | |
parent | 508108ea274788888408f4245438e40c90d821da (diff) |
drm/vmwgfx: Don't refcount cotable lookups during command buffer validation
The typical pattern of these lookups are
-Lookup
-Put on validate list if not already there.
-Unreference
And since we are the exclusive user of the context during lookup time,
we can be sure that the resource will stay alive during the sequence.
So avoid taking a reference during lookup, and also avoid unreferencing
when done. There are two users outside of command buffer validation and
those are refcounted explicitly.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_shader.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c index 6915c8258e6b..bf32fe446219 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | |||
@@ -636,7 +636,8 @@ int vmw_dx_shader_add(struct vmw_cmdbuf_res_manager *man, | |||
636 | 636 | ||
637 | res = &shader->res; | 637 | res = &shader->res; |
638 | shader->ctx = ctx; | 638 | shader->ctx = ctx; |
639 | shader->cotable = vmw_context_cotable(ctx, SVGA_COTABLE_DXSHADER); | 639 | shader->cotable = vmw_resource_reference |
640 | (vmw_context_cotable(ctx, SVGA_COTABLE_DXSHADER)); | ||
640 | shader->id = user_key; | 641 | shader->id = user_key; |
641 | shader->committed = false; | 642 | shader->committed = false; |
642 | INIT_LIST_HEAD(&shader->cotable_head); | 643 | INIT_LIST_HEAD(&shader->cotable_head); |