nvidia-oot: camera: isp: track syncpt threshold

This change does the following:
 - Keep the capture progress syncpt threshold up to date by
   incrementing it when a capture request is made
 - Fast forward the syncpoints via host1x api on reset

Bug 4882047

Change-Id: If971bf4f248bd7a0be6a79ccb0e124f2768c0af4
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248427
(cherry picked from commit cbac4a12165c2d19f9f5889cbeffffb3b63e54d0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3253387
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Reviewed-by: Justin Kim (SW-TEGRA) <juskim@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rakibul Hassan
2024-11-14 01:15:11 +00:00
committed by Jon Hunter
parent d4f85d7379
commit 652c032bb5
3 changed files with 58 additions and 0 deletions

View File

@@ -185,6 +185,23 @@ cleanup:
return err;
}
static void isp_capture_fastforward_syncpt(
struct tegra_isp_channel *chan,
struct syncpoint_info *sp)
{
if (sp->id)
chan->ops->fast_forward_syncpt(chan->ndev, sp->id, sp->threshold);
}
static void isp_capture_fastforward_syncpts(
struct tegra_isp_channel *chan)
{
struct isp_capture *capture = chan->capture_data;
isp_capture_fastforward_syncpt(chan, &capture->progress_sp);
isp_capture_fastforward_syncpt(chan, &capture->stats_progress_sp);
}
/**
* @brief Release an ISP syncpoint and clear its handle.
*
@@ -1588,6 +1605,8 @@ int isp_capture_reset(
goto error;
}
isp_capture_fastforward_syncpts(chan);
err = 0;
error:
@@ -1786,6 +1805,22 @@ fail:
return err;
}
static uint32_t isp_capture_get_num_progress(
struct tegra_isp_channel *chan,
struct isp_capture_req *req)
{
struct isp_desc_rec *capture_desc_ctx =
&chan->capture_data->capture_desc_ctx;
struct isp_capture_descriptor *desc = (struct isp_capture_descriptor *)
(capture_desc_ctx->requests.va +
req->buffer_index * capture_desc_ctx->request_size);
uint16_t sliceHeight = desc->surface_configs.slice_height;
uint16_t height = desc->surface_configs.mr_height;
return ((height + (sliceHeight - 1U)) / sliceHeight);
}
int isp_capture_request(
struct tegra_isp_channel *chan,
struct isp_capture_req *req)
@@ -1901,6 +1936,10 @@ int isp_capture_request(
goto fail;
}
// Progress syncpoints + 1 for frame completion
capture->progress_sp.threshold += isp_capture_get_num_progress(chan, req) + 1;
capture->stats_progress_sp.threshold += isp_capture_get_num_progress(chan, req) + 1 + 2;
return 0;
fail: