mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
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:
committed by
Jon Hunter
parent
d4f85d7379
commit
652c032bb5
@@ -185,6 +185,23 @@ cleanup:
|
|||||||
return err;
|
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.
|
* @brief Release an ISP syncpoint and clear its handle.
|
||||||
*
|
*
|
||||||
@@ -1588,6 +1605,8 @@ int isp_capture_reset(
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isp_capture_fastforward_syncpts(chan);
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -1786,6 +1805,22 @@ fail:
|
|||||||
return err;
|
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(
|
int isp_capture_request(
|
||||||
struct tegra_isp_channel *chan,
|
struct tegra_isp_channel *chan,
|
||||||
struct isp_capture_req *req)
|
struct isp_capture_req *req)
|
||||||
@@ -1901,6 +1936,10 @@ int isp_capture_request(
|
|||||||
goto fail;
|
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;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ static void isp5_release_syncpt(struct platform_device *pdev, uint32_t id)
|
|||||||
nvhost_syncpt_put_ref_ext(pdev, id);
|
nvhost_syncpt_put_ref_ext(pdev, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void isp5_fast_forward_syncpt(struct platform_device *pdev, uint32_t id, uint32_t threshold)
|
||||||
|
{
|
||||||
|
dev_dbg(&pdev->dev, "%s: id=%u -> thresh=%u\n", __func__, id, threshold);
|
||||||
|
nvhost_syncpt_set_min_update(pdev, id, threshold);
|
||||||
|
}
|
||||||
|
|
||||||
static int isp5_get_syncpt_gos_backing(struct platform_device *pdev,
|
static int isp5_get_syncpt_gos_backing(struct platform_device *pdev,
|
||||||
uint32_t id,
|
uint32_t id,
|
||||||
dma_addr_t *syncpt_addr,
|
dma_addr_t *syncpt_addr,
|
||||||
@@ -116,6 +122,7 @@ static uint32_t isp5_get_gos_table(struct platform_device *pdev,
|
|||||||
static struct isp_channel_drv_ops isp5_channel_drv_ops = {
|
static struct isp_channel_drv_ops isp5_channel_drv_ops = {
|
||||||
.alloc_syncpt = isp5_alloc_syncpt,
|
.alloc_syncpt = isp5_alloc_syncpt,
|
||||||
.release_syncpt = isp5_release_syncpt,
|
.release_syncpt = isp5_release_syncpt,
|
||||||
|
.fast_forward_syncpt = isp5_fast_forward_syncpt,
|
||||||
.get_gos_table = isp5_get_gos_table,
|
.get_gos_table = isp5_get_gos_table,
|
||||||
.get_syncpt_gos_backing = isp5_get_syncpt_gos_backing,
|
.get_syncpt_gos_backing = isp5_get_syncpt_gos_backing,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,18 @@ struct isp_channel_drv_ops {
|
|||||||
struct platform_device *pdev,
|
struct platform_device *pdev,
|
||||||
uint32_t id);
|
uint32_t id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fast forward a progres syncpt to Host1x.
|
||||||
|
*
|
||||||
|
* @param[in] pdev VI platform_device
|
||||||
|
* @param[in] id syncpt id to fast forward
|
||||||
|
* @param[in] threshold value to fast forward to
|
||||||
|
*/
|
||||||
|
void (*fast_forward_syncpt)(
|
||||||
|
struct platform_device *pdev,
|
||||||
|
uint32_t id,
|
||||||
|
uint32_t threshold);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieve the GoS table allocated in the ISP-THI carveout.
|
* @brief Retrieve the GoS table allocated in the ISP-THI carveout.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user