diff options
| author | Arto Merilainen <amerilainen@nvidia.com> | 2018-01-22 08:41:56 -0500 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-24 05:00:20 -0500 |
| commit | 58735e45bfd0810f4237d3b003952b620c641c2c (patch) | |
| tree | 279ebc52a551662407b4fe4cc9df8205d54999da | |
| parent | 57aa32792da64b842657f4297aaf579c938620e1 (diff) | |
video: tegra: host: Skip GoS if ctxs are isolated
Currently GoS is enabled always for the devices that support GoS,
however, this is not required in cases where engine channel submission
mode is enabled: All waits in this scneario are done on Host1x and the
engine does not need to access the GoS or syncpoint<->MSS interface.
Further, if context isolation is enabled as part of using channel
submission mode, the GoS mappings are not available thereby causing
invalid memory accesses if attempted.
This change modifies GoS code to skip over allocation of syncpoint
GoS backing if context isolation is enabled for a device.
Bug 2007922
Change-Id: I7b0eaf6e5fea1fe2266220682d0fee27674405a4
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1643630
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/video/tegra/host/nvhost_syncpt_unit_interface.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/nvhost_syncpt_unit_interface.c b/drivers/video/tegra/host/nvhost_syncpt_unit_interface.c index 086299f2f..a860ee1dc 100644 --- a/drivers/video/tegra/host/nvhost_syncpt_unit_interface.c +++ b/drivers/video/tegra/host/nvhost_syncpt_unit_interface.c | |||
| @@ -183,6 +183,7 @@ int nvhost_syncpt_get_gos(struct platform_device *engine_pdev, | |||
| 183 | dma_addr_t nvhost_syncpt_gos_address(struct platform_device *engine_pdev, | 183 | dma_addr_t nvhost_syncpt_gos_address(struct platform_device *engine_pdev, |
| 184 | u32 syncpt_id) | 184 | u32 syncpt_id) |
| 185 | { | 185 | { |
| 186 | struct nvhost_device_data *pdata = platform_get_drvdata(engine_pdev); | ||
| 186 | u32 gos_id, gos_offset; | 187 | u32 gos_id, gos_offset; |
| 187 | struct cv_dev_info *cv_dev_info; | 188 | struct cv_dev_info *cv_dev_info; |
| 188 | struct sg_table *sgt; | 189 | struct sg_table *sgt; |
| @@ -193,6 +194,10 @@ dma_addr_t nvhost_syncpt_gos_address(struct platform_device *engine_pdev, | |||
| 193 | if (err) | 194 | if (err) |
| 194 | return 0; | 195 | return 0; |
| 195 | 196 | ||
| 197 | /* if context isolation is enabled, GoS is not supported */ | ||
| 198 | if (pdata->isolate_contexts) | ||
| 199 | return 0; | ||
| 200 | |||
| 196 | cv_dev_info = nvmap_fetch_cv_dev_info(&engine_pdev->dev); | 201 | cv_dev_info = nvmap_fetch_cv_dev_info(&engine_pdev->dev); |
| 197 | if (!cv_dev_info) | 202 | if (!cv_dev_info) |
| 198 | return 0; | 203 | return 0; |
| @@ -249,6 +254,7 @@ static void nvhost_syncpt_insert_syncpt_backing(struct rb_root *root, | |||
| 249 | int nvhost_syncpt_alloc_gos_backing(struct platform_device *engine_pdev, | 254 | int nvhost_syncpt_alloc_gos_backing(struct platform_device *engine_pdev, |
| 250 | u32 syncpt_id) | 255 | u32 syncpt_id) |
| 251 | { | 256 | { |
| 257 | struct nvhost_device_data *pdata = platform_get_drvdata(engine_pdev); | ||
| 252 | struct nvhost_master *host = nvhost_get_host(engine_pdev); | 258 | struct nvhost_master *host = nvhost_get_host(engine_pdev); |
| 253 | struct syncpt_gos_backing *syncpt_gos_backing; | 259 | struct syncpt_gos_backing *syncpt_gos_backing; |
| 254 | struct cv_dev_info *cv_dev_info; | 260 | struct cv_dev_info *cv_dev_info; |
| @@ -261,6 +267,10 @@ int nvhost_syncpt_alloc_gos_backing(struct platform_device *engine_pdev, | |||
| 261 | if (!cv_dev_info) | 267 | if (!cv_dev_info) |
| 262 | return -EFAULT; | 268 | return -EFAULT; |
| 263 | 269 | ||
| 270 | /* if context isolation is enabled, GoS is not supported */ | ||
| 271 | if (pdata->isolate_contexts) | ||
| 272 | return -EINVAL; | ||
| 273 | |||
| 264 | /* check if backing already exists */ | 274 | /* check if backing already exists */ |
| 265 | syncpt_gos_backing = nvhost_syncpt_find_gos_backing(host, syncpt_id); | 275 | syncpt_gos_backing = nvhost_syncpt_find_gos_backing(host, syncpt_id); |
| 266 | if (syncpt_gos_backing) | 276 | if (syncpt_gos_backing) |
