diff options
author | monk.liu <monk.liu@amd.com> | 2015-08-13 11:19:54 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 23:51:19 +0300 |
commit | 1939e3e265d2fb984b56829c51f5843bfc6d5292 (patch) | |
tree | b5a27809441aa7b90df96ed3d30add5daa07f6c2 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | a895c222e7ab5f50ec10e209cd4548ecd5dd9443 (diff) | |
download | linux-1939e3e265d2fb984b56829c51f5843bfc6d5292.tar.xz |
drm/amdgpu: drop bo_list_clone when no scheduler
bo_list_clone() will take a lot of time when bo_list hold too much
elements, like above 7000
Signed-off-by: Monk.Liu <monk.liu@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 8796938216d6..07e3380ee0f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -186,15 +186,19 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) goto out; } bo_list = amdgpu_bo_list_get(fpriv, cs->in.bo_list_handle); - if (bo_list && !bo_list->has_userptr) { - p->bo_list = amdgpu_bo_list_clone(bo_list); - amdgpu_bo_list_put(bo_list); - if (!p->bo_list) - return -ENOMEM; - } else if (bo_list && bo_list->has_userptr) + if (!amdgpu_enable_scheduler) p->bo_list = bo_list; - else - p->bo_list = NULL; + else { + if (bo_list && !bo_list->has_userptr) { + p->bo_list = amdgpu_bo_list_clone(bo_list); + amdgpu_bo_list_put(bo_list); + if (!p->bo_list) + return -ENOMEM; + } else if (bo_list && bo_list->has_userptr) + p->bo_list = bo_list; + else + p->bo_list = NULL; + } /* get chunks */ INIT_LIST_HEAD(&p->validated); @@ -495,7 +499,7 @@ static void amdgpu_cs_parser_fini_late(struct amdgpu_cs_parser *parser) if (parser->ctx) amdgpu_ctx_put(parser->ctx); if (parser->bo_list) { - if (!parser->bo_list->has_userptr) + if (amdgpu_enable_scheduler && !parser->bo_list->has_userptr) amdgpu_bo_list_free(parser->bo_list); else amdgpu_bo_list_put(parser->bo_list); |