{
struct amdxdna_dev *xdna = hwctx->client->xdna;
struct alloc_requests *xrs_req;
+ u32 temporal_only_col = 0;
int ret;
- if (AIE_FEATURE_ON(&xdna->dev_handle->aie, AIE2_TEMPORAL_ONLY)) {
- hwctx->num_unused_col = xdna->dev_handle->total_col - hwctx->num_col;
- hwctx->num_col = xdna->dev_handle->total_col;
- return aie2_create_context(xdna->dev_handle, hwctx);
- }
-
xrs_req = kzalloc_obj(*xrs_req);
if (!xrs_req)
return -ENOMEM;
- xrs_req->cdo.start_cols = hwctx->col_list;
- xrs_req->cdo.cols_len = hwctx->col_list_len;
- xrs_req->cdo.ncols = hwctx->num_col;
- xrs_req->cdo.qos_cap.opc = hwctx->max_opc;
+ if (AIE_FEATURE_ON(&xdna->dev_handle->aie, AIE2_TEMPORAL_ONLY)) {
+ xrs_req->cdo.start_cols = &temporal_only_col;
+ xrs_req->cdo.cols_len = 1;
+ xrs_req->cdo.ncols = xdna->dev_handle->total_col;
+ } else {
+ xrs_req->cdo.start_cols = hwctx->col_list;
+ xrs_req->cdo.cols_len = hwctx->col_list_len;
+ xrs_req->cdo.ncols = hwctx->num_col;
+ }
+ /* Use platform opc */
+ xrs_req->cdo.qos_cap.opc = xdna->dev_handle->priv->col_opc * hwctx->num_col;
xrs_req->rqos.gops = hwctx->qos.gops;
xrs_req->rqos.fps = hwctx->qos.fps;
struct amdxdna_dev *xdna = hwctx->client->xdna;
int ret;
- if (AIE_FEATURE_ON(&xdna->dev_handle->aie, AIE2_TEMPORAL_ONLY)) {
- ret = aie2_destroy_context(xdna->dev_handle, hwctx);
- if (ret && ret != -ENODEV)
- XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret);
- } else {
- ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
- if (ret)
- XDNA_ERR(xdna, "Release AIE resource failed, ret %d", ret);
- }
+ ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
+ if (ret)
+ XDNA_ERR(xdna, "Release AIE resource failed, ret %d", ret);
}
static int aie2_ctx_syncobj_create(struct amdxdna_hwctx *hwctx)
xdna = hwctx->client->xdna;
hwctx->start_col = action->part.start_col;
+ hwctx->num_unused_col = action->part.ncols - hwctx->num_col;
hwctx->num_col = action->part.ncols;
ret = aie2_create_context(xdna->dev_handle, hwctx);
if (ret)
#define COL_ALIGN_NONE 0
#define COL_ALIGN_NATURE 1
u32 col_align;
+ u32 col_opc;
u32 mbox_dev_addr;
/* If mbox_size is 0, use BAR size. See MBOX_SIZE macro */
u32 mbox_size;
return ret;
ndev->pw_mode = POWER_MODE_DEFAULT;
- ndev->dft_dpm_level = ndev->max_dpm_level;
+ ndev->dft_dpm_level = 0;
return 0;
}
u32 service_rate = 0;
if (rqos->latency)
- service_rate = (1000 / rqos->latency);
+ service_rate = max_t(u32, 1000 / rqos->latency, 1);
if (rqos->fps > service_rate)
return rqos->fps * rqos->gops;
{
struct solver_state *xrs = hdl;
struct solver_node *node;
+ u32 level = 0;
node = rg_search_node(&xrs->rgp, rid);
if (!node) {
xrs->cfg.actions->unload(node->cb_arg);
remove_solver_node(&xrs->rgp, node);
+ /* set the dpm level which fits all the sessions */
+ list_for_each_entry(node, &xrs->rgp.node_list, list) {
+ if (node->dpm_level > level)
+ level = node->dpm_level;
+ }
+ xrs->cfg.actions->set_dft_dpm_level(xrs->cfg.ddev, level);
+
return 0;
}
.rt_config = npu1_default_rt_cfg,
.dpm_clk_tbl = npu1_dpm_clk_table,
.col_align = COL_ALIGN_NONE,
+ .col_opc = 2048,
.mbox_dev_addr = NPU1_MBOX_BAR_BASE,
.mbox_size = 0, /* Use BAR size */
.sram_dev_addr = NPU1_SRAM_BAR_BASE,
.rt_config = npu4_default_rt_cfg,
.dpm_clk_tbl = npu4_dpm_clk_table,
.col_align = COL_ALIGN_NATURE,
+ .col_opc = 4096,
.mbox_dev_addr = NPU4_MBOX_BAR_BASE,
.mbox_size = 0, /* Use BAR size */
.sram_dev_addr = NPU4_SRAM_BAR_BASE,
.rt_config = npu4_default_rt_cfg,
.dpm_clk_tbl = npu4_dpm_clk_table,
.col_align = COL_ALIGN_NATURE,
+ .col_opc = 4096,
.mbox_dev_addr = NPU5_MBOX_BAR_BASE,
.mbox_size = 0, /* Use BAR size */
.sram_dev_addr = NPU5_SRAM_BAR_BASE,
.rt_config = npu4_default_rt_cfg,
.dpm_clk_tbl = npu4_dpm_clk_table,
.col_align = COL_ALIGN_NATURE,
+ .col_opc = 4096,
.mbox_dev_addr = NPU6_MBOX_BAR_BASE,
.mbox_size = 0, /* Use BAR size */
.sram_dev_addr = NPU6_SRAM_BAR_BASE,