mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: init: rename init functions
Rename init functions that still carry the gk20a moniker to use the more appropriate nvgpu name instead. JIRA NVGPU-2385 Change-Id: I5d40cd72943272c8b5f16b97d9a786d9c41496d4 Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2156220 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
9705c86b98
commit
91187b6db2
@@ -74,7 +74,7 @@ void nvgpu_check_gpu_state(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gk20a_warn_on_no_regs(void)
|
void nvgpu_warn_on_no_regs(void)
|
||||||
{
|
{
|
||||||
WARN_ONCE(true, "Attempted access to GPU regs after unmapping!");
|
WARN_ONCE(true, "Attempted access to GPU regs after unmapping!");
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ static void gk20a_mask_interrupts(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int gk20a_prepare_poweroff(struct gk20a *g)
|
int nvgpu_prepare_poweroff(struct gk20a *g)
|
||||||
{
|
{
|
||||||
int tmp_ret, ret = 0;
|
int tmp_ret, ret = 0;
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ int gk20a_prepare_poweroff(struct gk20a *g)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gk20a_finalize_poweron(struct gk20a *g)
|
int nvgpu_finalize_poweron(struct gk20a *g)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
#if defined(CONFIG_TEGRA_GK20A_NVHOST)
|
#if defined(CONFIG_TEGRA_GK20A_NVHOST)
|
||||||
@@ -583,7 +583,7 @@ int nvgpu_can_busy(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int gk20a_wait_for_idle(struct gk20a *g)
|
int nvgpu_wait_for_idle(struct gk20a *g)
|
||||||
{
|
{
|
||||||
int wait_length = 150; /* 3 second overall max wait. */
|
int wait_length = 150; /* 3 second overall max wait. */
|
||||||
int target_usage_count = 0;
|
int target_usage_count = 0;
|
||||||
@@ -612,7 +612,7 @@ int gk20a_wait_for_idle(struct gk20a *g)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gk20a_init_gpu_characteristics(struct gk20a *g)
|
void nvgpu_init_gpu_characteristics(struct gk20a *g)
|
||||||
{
|
{
|
||||||
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
|
#ifdef NV_BUILD_CONFIGURATION_IS_SAFETY
|
||||||
nvgpu_set_enabled(g, NVGPU_DRIVER_REDUCED_PROFILE, true);
|
nvgpu_set_enabled(g, NVGPU_DRIVER_REDUCED_PROFILE, true);
|
||||||
@@ -699,20 +699,20 @@ static void gk20a_free_cb(struct nvgpu_ref *refcount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gk20a_get() - Increment ref count on driver
|
* nvgpu_get() - Increment ref count on driver
|
||||||
*
|
*
|
||||||
* @g The driver to increment
|
* @g The driver to increment
|
||||||
* This will fail if the driver is in the process of being released. In that
|
* This will fail if the driver is in the process of being released. In that
|
||||||
* case it will return NULL. Otherwise a pointer to the driver passed in will
|
* case it will return NULL. Otherwise a pointer to the driver passed in will
|
||||||
* be returned.
|
* be returned.
|
||||||
*/
|
*/
|
||||||
struct gk20a * __must_check gk20a_get(struct gk20a *g)
|
struct gk20a * __must_check nvgpu_get(struct gk20a *g)
|
||||||
{
|
{
|
||||||
int success;
|
int success;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle the possibility we are still freeing the gk20a struct while
|
* Handle the possibility we are still freeing the gk20a struct while
|
||||||
* gk20a_get() is called. Unlikely but plausible race condition. Ideally
|
* nvgpu_get() is called. Unlikely but plausible race condition. Ideally
|
||||||
* the code will never be in such a situation that this race is
|
* the code will never be in such a situation that this race is
|
||||||
* possible.
|
* possible.
|
||||||
*/
|
*/
|
||||||
@@ -726,14 +726,14 @@ struct gk20a * __must_check gk20a_get(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gk20a_put() - Decrement ref count on driver
|
* nvgpu_put() - Decrement ref count on driver
|
||||||
*
|
*
|
||||||
* @g - The driver to decrement
|
* @g - The driver to decrement
|
||||||
*
|
*
|
||||||
* Decrement the driver ref-count. If neccesary also free the underlying driver
|
* Decrement the driver ref-count. If neccesary also free the underlying driver
|
||||||
* memory
|
* memory
|
||||||
*/
|
*/
|
||||||
void gk20a_put(struct gk20a *g)
|
void nvgpu_put(struct gk20a *g)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Note - this is racy, two instances of this could run before the
|
* Note - this is racy, two instances of this could run before the
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ int gk20a_as_alloc_share(struct gk20a *g,
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
nvgpu_log_fn(g, " ");
|
nvgpu_log_fn(g, " ");
|
||||||
g = gk20a_get(g);
|
g = nvgpu_get(g);
|
||||||
if (g == NULL) {
|
if (g == NULL) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share)
|
|||||||
|
|
||||||
release_fail:
|
release_fail:
|
||||||
release_as_share_id(as_share->as, as_share->id);
|
release_as_share_id(as_share->as, as_share->id);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
nvgpu_kfree(g, as_share);
|
nvgpu_kfree(g, as_share);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ void vgpu_init_gpu_characteristics(struct gk20a *g)
|
|||||||
{
|
{
|
||||||
nvgpu_log_fn(g, " ");
|
nvgpu_log_fn(g, " ");
|
||||||
|
|
||||||
gk20a_init_gpu_characteristics(g);
|
nvgpu_init_gpu_characteristics(g);
|
||||||
|
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_PREEMPTION_GFXP, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_PREEMPTION_GFXP, true);
|
||||||
|
|
||||||
|
|||||||
@@ -1034,7 +1034,7 @@ static const struct gpu_ops gm20b_ops = {
|
|||||||
.get_max_ltc_per_fbp = gm20b_top_get_max_ltc_per_fbp,
|
.get_max_ltc_per_fbp = gm20b_top_get_max_ltc_per_fbp,
|
||||||
.get_max_lts_per_ltc = gm20b_top_get_max_lts_per_ltc,
|
.get_max_lts_per_ltc = gm20b_top_get_max_lts_per_ltc,
|
||||||
},
|
},
|
||||||
.chip_init_gpu_characteristics = gk20a_init_gpu_characteristics,
|
.chip_init_gpu_characteristics = nvgpu_init_gpu_characteristics,
|
||||||
.get_litter_value = gm20b_get_litter_value,
|
.get_litter_value = gm20b_get_litter_value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
static void gp10b_init_gpu_characteristics(struct gk20a *g)
|
static void gp10b_init_gpu_characteristics(struct gk20a *g)
|
||||||
{
|
{
|
||||||
gk20a_init_gpu_characteristics(g);
|
nvgpu_init_gpu_characteristics(g);
|
||||||
g->ops.gr.ecc.detect(g);
|
g->ops.gr.ecc.detect(g);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
static void gv11b_init_gpu_characteristics(struct gk20a *g)
|
static void gv11b_init_gpu_characteristics(struct gk20a *g)
|
||||||
{
|
{
|
||||||
gk20a_init_gpu_characteristics(g);
|
nvgpu_init_gpu_characteristics(g);
|
||||||
g->ops.gr.ecc.detect(g);
|
g->ops.gr.ecc.detect(g);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_SCG, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_SCG, true);
|
||||||
|
|||||||
@@ -210,7 +210,7 @@
|
|||||||
|
|
||||||
static void tu104_init_gpu_characteristics(struct gk20a *g)
|
static void tu104_init_gpu_characteristics(struct gk20a *g)
|
||||||
{
|
{
|
||||||
gk20a_init_gpu_characteristics(g);
|
nvgpu_init_gpu_characteristics(g);
|
||||||
|
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_GET_TEMPERATURE, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_GET_TEMPERATURE, true);
|
||||||
|
|||||||
@@ -23,19 +23,19 @@
|
|||||||
#ifndef NVGPU_INIT_H
|
#ifndef NVGPU_INIT_H
|
||||||
#define NVGPU_INIT_H
|
#define NVGPU_INIT_H
|
||||||
|
|
||||||
int gk20a_finalize_poweron(struct gk20a *g);
|
int nvgpu_finalize_poweron(struct gk20a *g);
|
||||||
int gk20a_prepare_poweroff(struct gk20a *g);
|
int nvgpu_prepare_poweroff(struct gk20a *g);
|
||||||
|
|
||||||
int nvgpu_can_busy(struct gk20a *g);
|
int nvgpu_can_busy(struct gk20a *g);
|
||||||
int gk20a_wait_for_idle(struct gk20a *g);
|
int nvgpu_wait_for_idle(struct gk20a *g);
|
||||||
|
|
||||||
struct gk20a * __must_check gk20a_get(struct gk20a *g);
|
struct gk20a * __must_check nvgpu_get(struct gk20a *g);
|
||||||
void gk20a_put(struct gk20a *g);
|
void nvgpu_put(struct gk20a *g);
|
||||||
|
|
||||||
/* register accessors */
|
/* register accessors */
|
||||||
void nvgpu_check_gpu_state(struct gk20a *g);
|
void nvgpu_check_gpu_state(struct gk20a *g);
|
||||||
void gk20a_warn_on_no_regs(void);
|
void nvgpu_warn_on_no_regs(void);
|
||||||
|
|
||||||
void gk20a_init_gpu_characteristics(struct gk20a *g);
|
void nvgpu_init_gpu_characteristics(struct gk20a *g);
|
||||||
|
|
||||||
#endif /* NVGPU_INIT_H */
|
#endif /* NVGPU_INIT_H */
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ static ssize_t disable_bigpage_write(struct file *file, const char __user *user_
|
|||||||
|
|
||||||
if (strtobool(buf, &bv) == 0) {
|
if (strtobool(buf, &bv) == 0) {
|
||||||
g->mm.disable_bigpage = bv;
|
g->mm.disable_bigpage = bv;
|
||||||
gk20a_init_gpu_characteristics(g);
|
nvgpu_init_gpu_characteristics(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ static void gk20a_vidbuf_release(struct dma_buf *dmabuf)
|
|||||||
nvgpu_kfree(g, linux_buf);
|
nvgpu_kfree(g, linux_buf);
|
||||||
nvgpu_vidmem_buf_free(g, buf);
|
nvgpu_vidmem_buf_free(g, buf);
|
||||||
|
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *gk20a_vidbuf_kmap(struct dma_buf *dmabuf, unsigned long page_num)
|
static void *gk20a_vidbuf_kmap(struct dma_buf *dmabuf, unsigned long page_num)
|
||||||
@@ -178,7 +178,7 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes)
|
|||||||
/*
|
/*
|
||||||
* This ref is released when the dma_buf is closed.
|
* This ref is released when the dma_buf is closed.
|
||||||
*/
|
*/
|
||||||
if (!gk20a_get(g))
|
if (!nvgpu_get(g))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
vidmem_dbg(g, "Allocating vidmem buf: %zu bytes", bytes);
|
vidmem_dbg(g, "Allocating vidmem buf: %zu bytes", bytes);
|
||||||
@@ -224,7 +224,7 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes)
|
|||||||
fail:
|
fail:
|
||||||
nvgpu_vidmem_buf_free(g, buf);
|
nvgpu_vidmem_buf_free(g, buf);
|
||||||
nvgpu_kfree(g, priv);
|
nvgpu_kfree(g, priv);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
|
|
||||||
vidmem_dbg(g, "Failed to alloc Linux VIDMEM buf: %d", err);
|
vidmem_dbg(g, "Failed to alloc Linux VIDMEM buf: %d", err);
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp)
|
|||||||
const int vmid = 0;
|
const int vmid = 0;
|
||||||
|
|
||||||
l = container_of(inode->i_cdev, struct nvgpu_os_linux, ctxsw.cdev);
|
l = container_of(inode->i_cdev, struct nvgpu_os_linux, ctxsw.cdev);
|
||||||
g = gk20a_get(&l->g);
|
g = nvgpu_get(&l->g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ idle:
|
|||||||
gk20a_idle(g);
|
gk20a_idle(g);
|
||||||
free_ref:
|
free_ref:
|
||||||
if (err)
|
if (err)
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp)
|
|||||||
dev->g->ops.gr.fecs_trace.free_user_buffer(dev->g);
|
dev->g->ops.gr.fecs_trace.free_user_buffer(dev->g);
|
||||||
dev->hdr = NULL;
|
dev->hdr = NULL;
|
||||||
}
|
}
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ int gk20a_channel_release(struct inode *inode, struct file *filp)
|
|||||||
gk20a_idle(g);
|
gk20a_idle(g);
|
||||||
|
|
||||||
channel_release:
|
channel_release:
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
nvgpu_kfree(g, filp->private_data);
|
nvgpu_kfree(g, filp->private_data);
|
||||||
filp->private_data = NULL;
|
filp->private_data = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -464,7 +464,7 @@ static int __gk20a_channel_open(struct gk20a *g,
|
|||||||
tmp_runlist_id = runlist_id;
|
tmp_runlist_id = runlist_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
g = gk20a_get(g);
|
g = nvgpu_get(g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ static int __gk20a_channel_open(struct gk20a *g,
|
|||||||
fail_busy:
|
fail_busy:
|
||||||
nvgpu_kfree(g, priv);
|
nvgpu_kfree(g, priv);
|
||||||
free_ref:
|
free_ref:
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
|
|||||||
|
|
||||||
l = container_of(inode->i_cdev,
|
l = container_of(inode->i_cdev,
|
||||||
struct nvgpu_os_linux, ctrl.cdev);
|
struct nvgpu_os_linux, ctrl.cdev);
|
||||||
g = gk20a_get(&l->g);
|
g = nvgpu_get(&l->g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
|
|||||||
err = nvgpu_clk_arb_init_session(g, &priv->clk_session);
|
err = nvgpu_clk_arb_init_session(g, &priv->clk_session);
|
||||||
free_ref:
|
free_ref:
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
if (priv)
|
if (priv)
|
||||||
nvgpu_kfree(g, priv);
|
nvgpu_kfree(g, priv);
|
||||||
} else {
|
} else {
|
||||||
@@ -163,7 +163,7 @@ int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp)
|
|||||||
if (priv->clk_session)
|
if (priv->clk_session)
|
||||||
nvgpu_clk_arb_release_session(g, priv->clk_session);
|
nvgpu_clk_arb_release_session(g, priv->clk_session);
|
||||||
|
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
nvgpu_kfree(g, priv);
|
nvgpu_kfree(g, priv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
|
|||||||
nvgpu_mutex_destroy(&dbg_s->ioctl_lock);
|
nvgpu_mutex_destroy(&dbg_s->ioctl_lock);
|
||||||
|
|
||||||
nvgpu_kfree(g, dbg_session_linux);
|
nvgpu_kfree(g, dbg_session_linux);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -414,7 +414,7 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode,
|
|||||||
else
|
else
|
||||||
l = container_of(inode->i_cdev,
|
l = container_of(inode->i_cdev,
|
||||||
struct nvgpu_os_linux, prof.cdev);
|
struct nvgpu_os_linux, prof.cdev);
|
||||||
g = gk20a_get(&l->g);
|
g = nvgpu_get(&l->g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -445,7 +445,7 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free_ref:
|
free_ref:
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ static int gk20a_event_id_release(struct inode *inode, struct file *filp)
|
|||||||
nvgpu_mutex_release(&tsg->event_id_list_lock);
|
nvgpu_mutex_release(&tsg->event_id_list_lock);
|
||||||
|
|
||||||
nvgpu_mutex_destroy(&event_id_data->lock);
|
nvgpu_mutex_destroy(&event_id_data->lock);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
nvgpu_kfree(g, event_id_data);
|
nvgpu_kfree(g, event_id_data);
|
||||||
filp->private_data = NULL;
|
filp->private_data = NULL;
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ static int gk20a_tsg_event_id_enable(struct nvgpu_tsg *tsg,
|
|||||||
struct gk20a_event_id_data *event_id_data;
|
struct gk20a_event_id_data *event_id_data;
|
||||||
struct gk20a *g;
|
struct gk20a *g;
|
||||||
|
|
||||||
g = gk20a_get(tsg->g);
|
g = nvgpu_get(tsg->g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ clean_up_file:
|
|||||||
clean_up:
|
clean_up:
|
||||||
put_unused_fd(local_fd);
|
put_unused_fd(local_fd);
|
||||||
free_ref:
|
free_ref:
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ int nvgpu_ioctl_tsg_open(struct gk20a *g, struct file *filp)
|
|||||||
struct device *dev;
|
struct device *dev;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
g = gk20a_get(g);
|
g = nvgpu_get(g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -436,7 +436,7 @@ int nvgpu_ioctl_tsg_open(struct gk20a *g, struct file *filp)
|
|||||||
free_mem:
|
free_mem:
|
||||||
nvgpu_kfree(g, priv);
|
nvgpu_kfree(g, priv);
|
||||||
free_ref:
|
free_ref:
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,7 +473,7 @@ void nvgpu_ioctl_tsg_release(struct nvgpu_ref *ref)
|
|||||||
gk20a_sched_ctrl_tsg_removed(g, tsg);
|
gk20a_sched_ctrl_tsg_removed(g, tsg);
|
||||||
|
|
||||||
nvgpu_tsg_release(ref);
|
nvgpu_tsg_release(ref);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
int nvgpu_ioctl_tsg_dev_release(struct inode *inode, struct file *filp)
|
int nvgpu_ioctl_tsg_dev_release(struct inode *inode, struct file *filp)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void nvgpu_writel(struct gk20a *g, u32 r, u32 v)
|
|||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
|
|
||||||
if (unlikely(!l->regs)) {
|
if (unlikely(!l->regs)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
||||||
} else {
|
} else {
|
||||||
writel_relaxed(v, l->regs + r);
|
writel_relaxed(v, l->regs + r);
|
||||||
@@ -37,7 +37,7 @@ void nvgpu_writel_relaxed(struct gk20a *g, u32 r, u32 v)
|
|||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
|
|
||||||
if (unlikely(!l->regs)) {
|
if (unlikely(!l->regs)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
||||||
} else {
|
} else {
|
||||||
writel_relaxed(v, l->regs + r);
|
writel_relaxed(v, l->regs + r);
|
||||||
@@ -60,7 +60,7 @@ u32 nvgpu_readl_impl(struct gk20a *g, u32 r)
|
|||||||
u32 v = 0xffffffff;
|
u32 v = 0xffffffff;
|
||||||
|
|
||||||
if (unlikely(!l->regs)) {
|
if (unlikely(!l->regs)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
||||||
} else {
|
} else {
|
||||||
v = readl(l->regs + r);
|
v = readl(l->regs + r);
|
||||||
@@ -75,7 +75,7 @@ void nvgpu_writel_loop(struct gk20a *g, u32 r, u32 v)
|
|||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
|
|
||||||
if (unlikely(!l->regs)) {
|
if (unlikely(!l->regs)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
nvgpu_log(g, gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v);
|
||||||
} else {
|
} else {
|
||||||
nvgpu_wmb();
|
nvgpu_wmb();
|
||||||
@@ -91,7 +91,7 @@ void nvgpu_bar1_writel(struct gk20a *g, u32 b, u32 v)
|
|||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
|
|
||||||
if (unlikely(!l->bar1)) {
|
if (unlikely(!l->bar1)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v);
|
nvgpu_log(g, gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v);
|
||||||
} else {
|
} else {
|
||||||
nvgpu_wmb();
|
nvgpu_wmb();
|
||||||
@@ -106,7 +106,7 @@ u32 nvgpu_bar1_readl(struct gk20a *g, u32 b)
|
|||||||
u32 v = 0xffffffff;
|
u32 v = 0xffffffff;
|
||||||
|
|
||||||
if (unlikely(!l->bar1)) {
|
if (unlikely(!l->bar1)) {
|
||||||
gk20a_warn_on_no_regs();
|
nvgpu_warn_on_no_regs();
|
||||||
nvgpu_log(g, gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v);
|
nvgpu_log(g, gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v);
|
||||||
} else {
|
} else {
|
||||||
v = readl(l->bar1 + b);
|
v = readl(l->bar1 + b);
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ int gk20a_pm_finalize_poweron(struct device *dev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = gk20a_finalize_poweron(g);
|
err = nvgpu_finalize_poweron(g);
|
||||||
if (err)
|
if (err)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
|
|||||||
gk20a_cde_suspend(l);
|
gk20a_cde_suspend(l);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = gk20a_prepare_poweroff(g);
|
ret = nvgpu_prepare_poweroff(g);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@@ -1052,7 +1052,7 @@ int nvgpu_quiesce(struct gk20a *g)
|
|||||||
struct device *dev = dev_from_gk20a(g);
|
struct device *dev = dev_from_gk20a(g);
|
||||||
|
|
||||||
if (g->power_on) {
|
if (g->power_on) {
|
||||||
err = gk20a_wait_for_idle(g);
|
err = nvgpu_wait_for_idle(g);
|
||||||
if (err) {
|
if (err) {
|
||||||
nvgpu_err(g, "failed to idle GPU, err=%d", err);
|
nvgpu_err(g, "failed to idle GPU, err=%d", err);
|
||||||
return err;
|
return err;
|
||||||
@@ -1307,7 +1307,7 @@ int nvgpu_wait_for_gpu_idle(struct gk20a *g)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
ret = gk20a_wait_for_idle(g);
|
ret = nvgpu_wait_for_idle(g);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
nvgpu_err(g, "failed in wait for idle");
|
nvgpu_err(g, "failed in wait for idle");
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1338,7 +1338,7 @@ void gk20a_driver_start_unload(struct gk20a *g)
|
|||||||
if (g->is_virtual)
|
if (g->is_virtual)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gk20a_wait_for_idle(g);
|
nvgpu_wait_for_idle(g);
|
||||||
|
|
||||||
nvgpu_wait_for_deferred_interrupts(g);
|
nvgpu_wait_for_deferred_interrupts(g);
|
||||||
|
|
||||||
@@ -1602,7 +1602,7 @@ static int __exit gk20a_remove(struct platform_device *pdev)
|
|||||||
|
|
||||||
set_gk20a(pdev, NULL);
|
set_gk20a(pdev, NULL);
|
||||||
|
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
|
|
||||||
gk20a_pm_deinit(dev);
|
gk20a_pm_deinit(dev);
|
||||||
|
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ static void nvgpu_pci_remove(struct pci_dev *pdev)
|
|||||||
gk20a_get_platform(&pdev->dev)->g = NULL;
|
gk20a_get_platform(&pdev->dev)->g = NULL;
|
||||||
nvgpu_kfree(g, gk20a_get_platform(&pdev->dev));
|
nvgpu_kfree(g, gk20a_get_platform(&pdev->dev));
|
||||||
|
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nvgpu_pci_shutdown(struct pci_dev *pdev)
|
void nvgpu_pci_shutdown(struct pci_dev *pdev)
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ int gk20a_sched_dev_open(struct inode *inode, struct file *filp)
|
|||||||
struct gk20a_sched_ctrl *sched;
|
struct gk20a_sched_ctrl *sched;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
g = gk20a_get(&l->g);
|
g = nvgpu_get(&l->g);
|
||||||
if (!g)
|
if (!g)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
sched = &l->sched_ctrl;
|
sched = &l->sched_ctrl;
|
||||||
@@ -428,7 +428,7 @@ int gk20a_sched_dev_open(struct inode *inode, struct file *filp)
|
|||||||
|
|
||||||
free_ref:
|
free_ref:
|
||||||
if (err)
|
if (err)
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ int gk20a_sched_dev_release(struct inode *inode, struct file *filp)
|
|||||||
nvgpu_mutex_release(&sched->control_lock);
|
nvgpu_mutex_release(&sched->control_lock);
|
||||||
|
|
||||||
nvgpu_mutex_release(&sched->busy_lock);
|
nvgpu_mutex_release(&sched->busy_lock);
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ int vgpu_remove(struct platform_device *pdev)
|
|||||||
gk20a_user_deinit(dev, &nvgpu_class);
|
gk20a_user_deinit(dev, &nvgpu_class);
|
||||||
vgpu_remove_sysfs(dev);
|
vgpu_remove_sysfs(dev);
|
||||||
gk20a_get_platform(dev)->g = NULL;
|
gk20a_get_platform(dev)->g = NULL;
|
||||||
gk20a_put(g);
|
nvgpu_put(g);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -23,19 +23,19 @@
|
|||||||
#include <nvgpu/gk20a.h>
|
#include <nvgpu/gk20a.h>
|
||||||
#include <nvgpu/enabled.h>
|
#include <nvgpu/enabled.h>
|
||||||
|
|
||||||
void gk20a_init_gpu_characteristics(struct gk20a *g)
|
void nvgpu_init_gpu_characteristics(struct gk20a *g)
|
||||||
{
|
{
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct gk20a * __must_check gk20a_get(struct gk20a *g)
|
struct gk20a * __must_check nvgpu_get(struct gk20a *g)
|
||||||
{
|
{
|
||||||
BUG();
|
BUG();
|
||||||
|
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gk20a_put(struct gk20a *g)
|
void nvgpu_put(struct gk20a *g)
|
||||||
{
|
{
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user