diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 24 |
4 files changed, 27 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 8122d213..55ee5181 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -343,8 +343,8 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c) | |||
343 | return NULL; | 343 | return NULL; |
344 | 344 | ||
345 | sp->c = c; | 345 | sp->c = c; |
346 | sp->host1x_pdev = to_platform_device(c->g->dev->dev.parent); | 346 | sp->host1x_pdev = c->g->host1x_dev; |
347 | sp->id = nvhost_get_syncpt_host_managed(c->g->dev, c->hw_chid); | 347 | sp->id = nvhost_get_syncpt_host_managed(sp->host1x_pdev, c->hw_chid); |
348 | 348 | ||
349 | sp->ops.wait_cpu = gk20a_channel_syncpt_wait_cpu; | 349 | sp->ops.wait_cpu = gk20a_channel_syncpt_wait_cpu; |
350 | sp->ops.is_expired = gk20a_channel_syncpt_is_expired; | 350 | sp->ops.is_expired = gk20a_channel_syncpt_is_expired; |
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 3f1f4f0a..f5e0b73d 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c | |||
@@ -147,8 +147,7 @@ static void gk20a_debug_show_channel(struct gk20a *g, | |||
147 | gk20a_debug_output(o, "%s on syncpt %u (%s) val %u\n", | 147 | gk20a_debug_output(o, "%s on syncpt %u (%s) val %u\n", |
148 | (status == 3 || status == 8) ? "Waiting" : "Waited", | 148 | (status == 3 || status == 8) ? "Waiting" : "Waited", |
149 | pbdma_syncpointb_syncpt_index_v(syncpointb), | 149 | pbdma_syncpointb_syncpt_index_v(syncpointb), |
150 | nvhost_syncpt_get_name( | 150 | nvhost_syncpt_get_name(g->host1x_dev, |
151 | to_platform_device(g->dev->dev.parent), | ||
152 | pbdma_syncpointb_syncpt_index_v(syncpointb)), | 151 | pbdma_syncpointb_syncpt_index_v(syncpointb)), |
153 | pbdma_syncpointa_payload_v(syncpointa)); | 152 | pbdma_syncpointa_payload_v(syncpointa)); |
154 | 153 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index b8de8744..fc488a28 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -209,6 +209,7 @@ struct gpu_ops { | |||
209 | 209 | ||
210 | struct gk20a { | 210 | struct gk20a { |
211 | struct platform_device *dev; | 211 | struct platform_device *dev; |
212 | struct platform_device *host1x_dev; | ||
212 | 213 | ||
213 | struct resource *reg_mem; | 214 | struct resource *reg_mem; |
214 | void __iomem *regs; | 215 | void __iomem *regs; |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 05aec1a7..7af801f8 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |||
@@ -15,6 +15,7 @@ | |||
15 | * more details. | 15 | * more details. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/of_platform.h> | ||
18 | #include <linux/debugfs.h> | 19 | #include <linux/debugfs.h> |
19 | #include <linux/tegra-powergate.h> | 20 | #include <linux/tegra-powergate.h> |
20 | #include <linux/platform_data/tegra_edp.h> | 21 | #include <linux/platform_data/tegra_edp.h> |
@@ -403,12 +404,33 @@ static void gk20a_tegra_debug_dump(struct platform_device *pdev) | |||
403 | { | 404 | { |
404 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | 405 | struct gk20a_platform *platform = gk20a_get_platform(pdev); |
405 | struct gk20a *g = platform->g; | 406 | struct gk20a *g = platform->g; |
406 | nvhost_debug_dump_device(g->dev); | 407 | nvhost_debug_dump_device(g->host1x_dev); |
407 | } | 408 | } |
408 | 409 | ||
409 | static int gk20a_tegra_probe(struct platform_device *dev) | 410 | static int gk20a_tegra_probe(struct platform_device *dev) |
410 | { | 411 | { |
411 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 412 | struct gk20a_platform *platform = gk20a_get_platform(dev); |
413 | struct device_node *np = dev->dev.of_node; | ||
414 | const __be32 *host1x_ptr; | ||
415 | struct platform_device *host1x_pdev = NULL; | ||
416 | |||
417 | host1x_ptr = of_get_property(np, "nvidia,host1x", NULL); | ||
418 | if (host1x_ptr) { | ||
419 | struct device_node *host1x_node = | ||
420 | of_find_node_by_phandle(be32_to_cpup(host1x_ptr)); | ||
421 | |||
422 | host1x_pdev = of_find_device_by_node(host1x_node); | ||
423 | if (!host1x_pdev) { | ||
424 | dev_warn(&dev->dev, "host1x device not available"); | ||
425 | return -EPROBE_DEFER; | ||
426 | } | ||
427 | |||
428 | } else { | ||
429 | host1x_pdev = to_platform_device(dev->dev.parent); | ||
430 | dev_warn(&dev->dev, "host1x reference not found. assuming host1x to be parent"); | ||
431 | } | ||
432 | |||
433 | platform->g->host1x_dev = host1x_pdev; | ||
412 | 434 | ||
413 | if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA13) { | 435 | if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA13) { |
414 | t132_gk20a_tegra_platform.g = platform->g; | 436 | t132_gk20a_tegra_platform.g = platform->g; |