gpu: nvgpu: use nvgpu API to check for allocated memory

In __gr_gk20a_exec_ctx_ops(), we directly access linux specific pages to check
if memory is allocated or not
Since we need to remove this linux specific dependency from common code,
use common API nvgpu_mem_is_valid() to check if memory is allocated or not

Jira NVGPU-448

Change-Id: Iad62482ad1c0dfad3b96c6c125c2641bbe6ea596
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1612445
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2017-12-06 05:03:39 -08:00
committed by mobile promotions
parent 9f404b811c
commit ac78f5d95e

View File

@@ -7895,7 +7895,7 @@ int __gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch,
} }
if (!pm_ctx_ready) { if (!pm_ctx_ready) {
/* Make sure ctx buffer was initialized */ /* Make sure ctx buffer was initialized */
if (!ch_ctx->pm_ctx.mem.priv.pages) { if (!nvgpu_mem_is_valid(&ch_ctx->pm_ctx.mem)) {
nvgpu_err(g, nvgpu_err(g,
"Invalid ctx buffer"); "Invalid ctx buffer");
err = -EINVAL; err = -EINVAL;