diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index a0160274..084f1793 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -18,9 +18,6 @@ | |||
18 | 18 | ||
19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
21 | #ifdef CONFIG_DEBUG_FS | ||
22 | #include <linux/debugfs.h> | ||
23 | #endif | ||
24 | #include <linux/dma-buf.h> | 21 | #include <linux/dma-buf.h> |
25 | 22 | ||
26 | #include <trace/events/gk20a.h> | 23 | #include <trace/events/gk20a.h> |
@@ -40,8 +37,6 @@ | |||
40 | #include "cde_gk20a.h" | 37 | #include "cde_gk20a.h" |
41 | #include "fence_gk20a.h" | 38 | #include "fence_gk20a.h" |
42 | #include "gr_gk20a.h" | 39 | #include "gr_gk20a.h" |
43 | #include "debug_gk20a.h" | ||
44 | #include "platform_gk20a.h" | ||
45 | 40 | ||
46 | #include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> | 41 | #include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> |
47 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 42 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
@@ -1585,8 +1580,7 @@ int gk20a_prepare_compressible_read( | |||
1585 | if (IS_ERR(dmabuf)) | 1580 | if (IS_ERR(dmabuf)) |
1586 | return -EINVAL; | 1581 | return -EINVAL; |
1587 | 1582 | ||
1588 | err = gk20a_dmabuf_get_state(dmabuf, dev_from_gk20a(g), | 1583 | err = gk20a_dmabuf_get_state(dmabuf, g, offset, &state); |
1589 | offset, &state); | ||
1590 | if (err) { | 1584 | if (err) { |
1591 | dma_buf_put(dmabuf); | 1585 | dma_buf_put(dmabuf); |
1592 | return err; | 1586 | return err; |
@@ -1650,7 +1644,7 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, | |||
1650 | return -EINVAL; | 1644 | return -EINVAL; |
1651 | } | 1645 | } |
1652 | 1646 | ||
1653 | err = gk20a_dmabuf_get_state(dmabuf, dev_from_gk20a(g), offset, &state); | 1647 | err = gk20a_dmabuf_get_state(dmabuf, g, offset, &state); |
1654 | if (err) { | 1648 | if (err) { |
1655 | nvgpu_err(g, "could not get state from dmabuf"); | 1649 | nvgpu_err(g, "could not get state from dmabuf"); |
1656 | dma_buf_put(dmabuf); | 1650 | dma_buf_put(dmabuf); |
@@ -1671,38 +1665,3 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, | |||
1671 | dma_buf_put(dmabuf); | 1665 | dma_buf_put(dmabuf); |
1672 | return 0; | 1666 | return 0; |
1673 | } | 1667 | } |
1674 | |||
1675 | #ifdef CONFIG_DEBUG_FS | ||
1676 | static ssize_t gk20a_cde_reload_write(struct file *file, | ||
1677 | const char __user *userbuf, size_t count, loff_t *ppos) | ||
1678 | { | ||
1679 | struct gk20a *g = file->private_data; | ||
1680 | gk20a_cde_reload(g); | ||
1681 | return count; | ||
1682 | } | ||
1683 | |||
1684 | static const struct file_operations gk20a_cde_reload_fops = { | ||
1685 | .open = simple_open, | ||
1686 | .write = gk20a_cde_reload_write, | ||
1687 | }; | ||
1688 | |||
1689 | void gk20a_cde_debugfs_init(struct device *dev) | ||
1690 | { | ||
1691 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
1692 | struct gk20a *g = get_gk20a(dev); | ||
1693 | |||
1694 | if (!platform->has_cde) | ||
1695 | return; | ||
1696 | |||
1697 | debugfs_create_u32("cde_parameter", S_IWUSR | S_IRUGO, | ||
1698 | platform->debugfs, &g->cde_app.shader_parameter); | ||
1699 | debugfs_create_u32("cde_ctx_count", S_IWUSR | S_IRUGO, | ||
1700 | platform->debugfs, &g->cde_app.ctx_count); | ||
1701 | debugfs_create_u32("cde_ctx_usecount", S_IWUSR | S_IRUGO, | ||
1702 | platform->debugfs, &g->cde_app.ctx_usecount); | ||
1703 | debugfs_create_u32("cde_ctx_count_top", S_IWUSR | S_IRUGO, | ||
1704 | platform->debugfs, &g->cde_app.ctx_count_top); | ||
1705 | debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs, | ||
1706 | g, &gk20a_cde_reload_fops); | ||
1707 | } | ||
1708 | #endif | ||