This is done to boost performance of the GPU submit time, which
is critical for compute use-cases.
Bug
200215465
Change-Id: Ic4884ee4eac910b92b84a47fdc1b2e9f26b2f1f0
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/
1199860
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/
1201496
GVS: Gerrit_Virtual_Submit
/*
* Color decompression engine support
*
/*
* Color decompression engine support
*
- * Copyright (c) 2014-2015, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
struct gk20a_cde_app *cde_app = &g->cde_app;
bool channel_idle;
struct gk20a_cde_app *cde_app = &g->cde_app;
bool channel_idle;
- mutex_lock(&ch->jobs_lock);
+ spin_lock(&ch->jobs_lock);
channel_idle = list_empty(&ch->jobs);
channel_idle = list_empty(&ch->jobs);
- mutex_unlock(&ch->jobs_lock);
+ spin_unlock(&ch->jobs_lock);
if (!channel_idle)
return;
if (!channel_idle)
return;
/* release all job semaphores (applies only to jobs that use
semaphore synchronization) */
/* release all job semaphores (applies only to jobs that use
semaphore synchronization) */
- mutex_lock(&ch->jobs_lock);
+ spin_lock(&ch->jobs_lock);
list_for_each_entry_safe(job, n, &ch->jobs, list) {
if (job->post_fence->semaphore) {
gk20a_semaphore_release(job->post_fence->semaphore);
released_job_semaphore = true;
}
}
list_for_each_entry_safe(job, n, &ch->jobs, list) {
if (job->post_fence->semaphore) {
gk20a_semaphore_release(job->post_fence->semaphore);
released_job_semaphore = true;
}
}
- mutex_unlock(&ch->jobs_lock);
+ spin_unlock(&ch->jobs_lock);
if (released_job_semaphore)
wake_up_interruptible_all(&ch->semaphore_wq);
if (released_job_semaphore)
wake_up_interruptible_all(&ch->semaphore_wq);
msecs_to_jiffies(gk20a_get_gr_idle_timeout(ch->g));
do {
msecs_to_jiffies(gk20a_get_gr_idle_timeout(ch->g));
do {
- mutex_lock(&ch->jobs_lock);
+ spin_lock(&ch->jobs_lock);
channel_idle = list_empty(&ch->jobs);
channel_idle = list_empty(&ch->jobs);
- mutex_unlock(&ch->jobs_lock);
+ spin_unlock(&ch->jobs_lock);
job->wait_cmd = wait_cmd;
job->incr_cmd = incr_cmd;
job->wait_cmd = wait_cmd;
job->incr_cmd = incr_cmd;
- mutex_lock(&c->jobs_lock);
+ spin_lock(&c->jobs_lock);
list_add_tail(&job->list, &c->jobs);
list_add_tail(&job->list, &c->jobs);
- mutex_unlock(&c->jobs_lock);
+ spin_unlock(&c->jobs_lock);
} else {
return -ETIMEDOUT;
}
} else {
return -ETIMEDOUT;
}
while (1) {
bool completed;
while (1) {
bool completed;
- mutex_lock(&c->jobs_lock);
+ spin_lock(&c->jobs_lock);
if (list_empty(&c->jobs)) {
if (list_empty(&c->jobs)) {
- mutex_unlock(&c->jobs_lock);
+ spin_unlock(&c->jobs_lock);
break;
}
job = list_first_entry(&c->jobs,
struct channel_gk20a_job, list);
break;
}
job = list_first_entry(&c->jobs,
struct channel_gk20a_job, list);
- mutex_unlock(&c->jobs_lock);
+ spin_unlock(&c->jobs_lock);
completed = gk20a_fence_is_expired(job->post_fence);
if (!completed)
completed = gk20a_fence_is_expired(job->post_fence);
if (!completed)
* so this wouldn't get freed here. */
gk20a_channel_put(c);
* so this wouldn't get freed here. */
gk20a_channel_put(c);
- mutex_lock(&c->jobs_lock);
+ spin_lock(&c->jobs_lock);
list_del_init(&job->list);
list_del_init(&job->list);
- mutex_unlock(&c->jobs_lock);
+ spin_unlock(&c->jobs_lock);
c->referenceable = false;
init_waitqueue_head(&c->ref_count_dec_wq);
mutex_init(&c->ioctl_lock);
c->referenceable = false;
init_waitqueue_head(&c->ref_count_dec_wq);
mutex_init(&c->ioctl_lock);
- mutex_init(&c->jobs_lock);
+ spin_lock_init(&c->jobs_lock);
mutex_init(&c->last_submit.fence_lock);
INIT_DELAYED_WORK(&c->clean_up.wq, gk20a_channel_clean_up_jobs);
mutex_init(&c->clean_up.lock);
mutex_init(&c->last_submit.fence_lock);
INIT_DELAYED_WORK(&c->clean_up.wq, gk20a_channel_clean_up_jobs);
mutex_init(&c->clean_up.lock);
/*
* GK20A graphics channel
*
/*
* GK20A graphics channel
*
- * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
struct list_head ch_entry; /* channel's entry in TSG */
struct list_head jobs;
struct list_head ch_entry; /* channel's entry in TSG */
struct list_head jobs;
- struct mutex jobs_lock;