mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
video: tegra: host: nvdla: make get GoS abstract
- Add API to get GoS id and offset for given syncpoint, this should help simplify code and error reporting. - report error in case of issue in get GoS - Ignore GoS enabled error as GoS checkout is not done on all platforms - Re-order gos enable flag update in probe Jira DLA-673 Change-Id: Ica1ab27524ad4727171ba23306e1603313ee9b94 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1683292 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
696f635f9b
commit
26f05f8a95
@@ -614,12 +614,12 @@ int nvhost_nvdla_finalize_poweron(struct platform_device *pdev)
|
||||
goto fail_to_alloc_trace;
|
||||
}
|
||||
|
||||
nvdla_dev->is_gos_enabled = true;
|
||||
ret = nvdla_send_gos_region(pdev);
|
||||
if (ret) {
|
||||
nvdla_dbg_err(pdev, "set gos region is failed\n");
|
||||
nvdla_dev->is_gos_enabled = false;
|
||||
}
|
||||
nvdla_dev->is_gos_enabled = true;
|
||||
|
||||
if (nvdla_dev->quirks & NVDLA_QUIRK_T194_A01_WAR) {
|
||||
host1x_writel(pdev,
|
||||
|
||||
@@ -461,14 +461,33 @@ fail_to_pin_mem:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int nvdla_get_gos(struct platform_device *pdev, u32 syncpt_id,
|
||||
u32 *gos_id, u32 *gos_offset)
|
||||
{
|
||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||
struct nvdla_device *nvdla_dev = pdata->private_data;
|
||||
int err = 0;
|
||||
|
||||
if (!nvdla_dev->is_gos_enabled) {
|
||||
nvdla_dbg_err(pdev, "GoS is not enabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = nvhost_syncpt_get_gos(pdev, syncpt_id, gos_id, gos_offset);
|
||||
if (err) {
|
||||
nvdla_dbg_err(pdev,
|
||||
"Get GoS failed for syncpt[%d], err[%d]\n", syncpt_id, err);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int nvdla_fill_postactions(struct nvdla_task *task)
|
||||
{
|
||||
struct dla_task_descriptor *task_desc = task->task_desc;
|
||||
struct nvhost_buffers *buffers = task->buffers;
|
||||
struct nvhost_queue *queue = task->queue;
|
||||
struct platform_device *pdev = queue->pool->pdev;
|
||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||
struct nvdla_device *nvdla_dev = pdata->private_data;
|
||||
struct dla_action_list *postactionl;
|
||||
uint16_t postactionlist_of;
|
||||
u8 *next, *start;
|
||||
@@ -529,8 +548,7 @@ static int nvdla_fill_postactions(struct nvdla_task *task)
|
||||
u32 gos_id, gos_offset;
|
||||
|
||||
/* update GoS backing if available */
|
||||
if (nvdla_dev->is_gos_enabled &&
|
||||
!nvhost_syncpt_get_gos(pdev, queue->syncpt_id,
|
||||
if (!nvdla_get_gos(pdev, queue->syncpt_id,
|
||||
&gos_id, &gos_offset)) {
|
||||
u32 max;
|
||||
|
||||
@@ -646,8 +664,6 @@ static int nvdla_fill_preactions(struct nvdla_task *task)
|
||||
struct nvhost_buffers *buffers = task->buffers;
|
||||
struct nvhost_queue *queue = task->queue;
|
||||
struct platform_device *pdev = queue->pool->pdev;
|
||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||
struct nvdla_device *nvdla_dev = pdata->private_data;
|
||||
struct nvhost_master *host = nvhost_get_host(pdev);
|
||||
struct nvhost_syncpt *sp = &host->syncpt;
|
||||
struct dla_action_list *preactionl;
|
||||
@@ -694,8 +710,7 @@ static int nvdla_fill_preactions(struct nvdla_task *task)
|
||||
}
|
||||
|
||||
/* check if GoS backing available */
|
||||
if (nvdla_dev->is_gos_enabled &&
|
||||
!nvhost_syncpt_get_gos(pdev, id, &gos_id,
|
||||
if (!nvdla_get_gos(pdev, id, &gos_id,
|
||||
&gos_offset)) {
|
||||
nvdla_dbg_info(pdev, "pre i:%d syncfd_pt:[%u] gos_id[%u] gos_offset[%u] val[%u]",
|
||||
i, id, gos_id,
|
||||
@@ -726,8 +741,7 @@ static int nvdla_fill_preactions(struct nvdla_task *task)
|
||||
task->prefences[i].syncpoint_index,
|
||||
task->prefences[i].syncpoint_value);
|
||||
|
||||
if (nvdla_dev->is_gos_enabled &&
|
||||
!nvhost_syncpt_get_gos(pdev,
|
||||
if (!nvdla_get_gos(pdev,
|
||||
task->prefences[i].syncpoint_index, &gos_id,
|
||||
&gos_offset)) {
|
||||
nvdla_dbg_info(pdev, "pre i:%d syncpt:[%u] gos_id[%u] gos_offset[%u] val[%u]",
|
||||
|
||||
Reference in New Issue
Block a user