- do not request syncpts in hwctx handler init which is common path
for all clients
- this results in unnecessary booking of syncpts at init time and for
all clients
- request the syncpt from *_alloc_hwctx() call which is specific
to each client
- this way we can request syncpt for client who really needs it for its
hwctx
Bug
1305024
Change-Id: Ib5276da0d9d013487149262223bf5f9cf4e79bbf
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/363888
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
*
* Tegra Graphics Host 3D
*
- * Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2012-2014 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,
struct nvhost_channel *ch, bool mem_flag)
{
struct host1x_hwctx *ctx;
+ struct nvhost_device_data *pdata = nvhost_get_devdata(ch->dev);
+ u32 syncpt;
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return NULL;
+ syncpt = pdata->syncpts[0];
+ if (!syncpt) {
+ syncpt = nvhost_get_syncpt_host_managed(ch->dev, 0);
+ pdata->syncpts[0] = syncpt;
+ }
+ p->h.syncpt = syncpt;
+
if (mem_flag)
ctx->cpuva = dma_alloc_writecombine(&ch->dev->dev,
p->restore_size * 4,
*
* Tegra Graphics Host 3d hardware context
*
- * Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2011-2014 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,
if (!p)
return NULL;
- p->h.syncpt = syncpt;
p->h.waitbase = waitbase;
setup_save(p, NULL);
int err = 0;
struct nvhost_device_data *pdata = platform_get_drvdata(ch->dev);
- u32 syncpt = pdata->syncpts[0];
+ u32 syncpt = NVSYNCPT_INVALID;
u32 waitbase = pdata->waitbases[0];
if (pdata->alloc_hwctx_handler) {
struct nvhost_channel *ch)
{
struct host1x_hwctx_handler *p = to_host1x_hwctx_handler(h);
+ struct nvhost_device_data *pdata = nvhost_get_devdata(ch->dev);
struct vic03 *v = get_vic03(ch->dev);
struct host1x_hwctx *ctx;
u32 *ptr;
- u32 syncpt = nvhost_get_devdata(ch->dev)->syncpts[0];
+ u32 syncpt;
u32 nvhost_vic03_restore_size = 10; /* number of words written below */
nvhost_dbg_fn("");
if (!ctx)
return NULL;
+ syncpt = pdata->syncpts[0];
+ if (!syncpt) {
+ syncpt = nvhost_get_syncpt_host_managed(ch->dev, 0);
+ pdata->syncpts[0] = syncpt;
+ }
+ h->syncpt = syncpt;
+
ctx->restore_size = nvhost_vic03_restore_size;
ctx->cpuva = dma_alloc_writecombine(&ch->dev->dev,
if (!p)
return NULL;
- p->h.syncpt = syncpt;
p->h.waitbase = waitbase;
p->h.alloc = vic03_alloc_hwctx;