summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t30/t30.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/t30/t30.c')
-rw-r--r--drivers/video/tegra/host/t30/t30.c92
1 files changed, 16 insertions, 76 deletions
diff --git a/drivers/video/tegra/host/t30/t30.c b/drivers/video/tegra/host/t30/t30.c
index b74c561c05aa..88a489244b48 100644
--- a/drivers/video/tegra/host/t30/t30.c
+++ b/drivers/video/tegra/host/t30/t30.c
@@ -18,24 +18,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <linux/mutex.h>
#include <linux/nvhost_ioctl.h>
#include <mach/powergate.h>
#include <mach/iomap.h>
#include "t20/t20.h"
#include "t30.h"
-#include "gr3d/gr3d.h"
#include "gr3d/gr3d_t30.h"
#include "gr3d/scale3d.h"
#include "mpe/mpe.h"
#include "host1x/host1x.h"
-#include "host1x/host1x_hardware.h"
-#include "host1x/host1x_syncpt.h"
+#include "host1x/host1x01_hardware.h"
#include "chip_support.h"
#include "nvhost_channel.h"
-#include "host1x/host1x_cdma.h"
-#include "nvmap.h"
#include "nvhost_memmgr.h"
+#include "host1x/host1x_syncpt.h"
#define NVMODMUTEX_2D_FULL (1)
#define NVMODMUTEX_2D_SIMPLE (2)
@@ -259,60 +255,6 @@ int tegra3_register_host1x_devices(void)
return nvhost_add_devices(t30_devices, ARRAY_SIZE(t30_devices));
}
-static inline int t30_nvhost_hwctx_handler_init(struct nvhost_channel *ch)
-{
- int err = 0;
- unsigned long syncpts = ch->dev->syncpts;
- unsigned long waitbases = ch->dev->waitbases;
- u32 syncpt = find_first_bit(&syncpts, BITS_PER_LONG);
- u32 waitbase = find_first_bit(&waitbases, BITS_PER_LONG);
- struct nvhost_driver *drv = to_nvhost_driver(ch->dev->dev.driver);
-
- if (drv->alloc_hwctx_handler) {
- ch->ctxhandler = drv->alloc_hwctx_handler(syncpt,
- waitbase, ch);
- if (!ch->ctxhandler)
- err = -ENOMEM;
- }
-
- return err;
-}
-
-static inline void __iomem *t30_channel_aperture(void __iomem *p, int ndx)
-{
- p += ndx * NV_HOST1X_CHANNEL_MAP_SIZE_BYTES;
- return p;
-}
-
-static int t30_channel_init(struct nvhost_channel *ch,
- struct nvhost_master *dev, int index)
-{
- ch->chid = index;
- mutex_init(&ch->reflock);
- mutex_init(&ch->submitlock);
-
- ch->aperture = t30_channel_aperture(dev->aperture, index);
-
- return t30_nvhost_hwctx_handler_init(ch);
-}
-
-int nvhost_init_t30_channel_support(struct nvhost_master *host,
- struct nvhost_chip_support *op)
-{
- int result = nvhost_init_t20_channel_support(host, op);
- op->channel.init = t30_channel_init;
-
- return result;
-}
-
-int nvhost_init_t30_debug_support(struct nvhost_chip_support *op)
-{
- nvhost_init_t20_debug_support(op);
- op->debug.debug_init = nvhost_scale3d_debug_init;
-
- return 0;
-}
-
static void t30_free_nvhost_channel(struct nvhost_channel *ch)
{
nvhost_free_channel_internal(ch, &t30_num_alloc_channels);
@@ -326,27 +268,25 @@ static struct nvhost_channel *t30_alloc_nvhost_channel(
&t30_num_alloc_channels);
}
+#include "host1x/host1x_channel.c"
+#include "host1x/host1x_cdma.c"
+#include "host1x/host1x_debug.c"
+#include "host1x/host1x_syncpt.c"
+#include "host1x/host1x_intr.c"
+
int nvhost_init_t30_support(struct nvhost_master *host,
struct nvhost_chip_support *op)
{
int err;
- /* don't worry about cleaning up on failure... "remove" does it. */
- err = nvhost_init_t30_channel_support(host, op);
- if (err)
- return err;
- err = host1x_init_cdma_support(op);
- if (err)
- return err;
- err = nvhost_init_t30_debug_support(op);
- if (err)
- return err;
- err = host1x_init_syncpt_support(host, op);
- if (err)
- return err;
- err = nvhost_init_t20_intr_support(op);
- if (err)
- return err;
+ op->channel = host1x_channel_ops;
+ op->cdma = host1x_cdma_ops;
+ op->push_buffer = host1x_pushbuffer_ops;
+ op->debug = host1x_debug_ops;
+ op->debug.debug_init = nvhost_scale3d_debug_init;
+ host->sync_aperture = host->aperture + HOST1X_CHANNEL_SYNC_REG_BASE;
+ op->syncpt = host1x_syncpt_ops;
+ op->intr = host1x_intr_ops;
err = nvhost_memmgr_init(op);
if (err)
return err;