Skip to content

Commit

Permalink
media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations
Browse files Browse the repository at this point in the history
In various places in the venus codebase we have if (IS_V4()) which takes
the code down paths for 4xx silicon. This logic is broadly applicable to
6xx silicon also. In this patch we add IS_V6() to various IS_V4() decision
locations.

Co-developed-by: Dikshita Agarwal <dikshita@qti.qualcomm.com>
Signed-off-by: Dikshita Agarwal <dikshita@qti.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Bryan O'Donoghue authored and Mauro Carvalho Chehab committed Apr 6, 2021
1 parent e396e75 commit 7ed9e0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions drivers/media/platform/qcom/venus/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static bool is_dynamic_bufmode(struct venus_inst *inst)
* v4 doesn't send BUFFER_ALLOC_MODE_SUPPORTED property and supports
* dynamic buffer mode by default for HFI_BUFFER_OUTPUT/OUTPUT2.
*/
if (IS_V4(core))
if (IS_V4(core) || IS_V6(core))
return true;

caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type);
Expand Down Expand Up @@ -1084,11 +1084,10 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
const u32 ptype = HFI_PROPERTY_PARAM_WORK_MODE;
struct hfi_video_work_mode wm;

if (!IS_V4(inst->core))
if (!IS_V4(inst->core) && !IS_V6(inst->core))
return 0;

wm.video_work_mode = mode;

return hfi_session_set_property(inst, ptype, &wm);
}
EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/qcom/venus/hfi_venus.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev)
* enable it explicitly in order to make suspend functional by checking
* WFI (wait-for-interrupt) bit.
*/
if (IS_V4(hdev->core))
if (IS_V4(hdev->core) || IS_V6(hdev->core))
venus_sys_idle_indicator = true;

ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator);
Expand Down Expand Up @@ -1577,7 +1577,7 @@ static int venus_suspend_3xx(struct venus_core *core)

static int venus_suspend(struct venus_core *core)
{
if (IS_V3(core) || IS_V4(core))
if (IS_V3(core) || IS_V4(core) || IS_V6(core))
return venus_suspend_3xx(core);

return venus_suspend_1xx(core);
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/platform/qcom/venus/vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ static int vdec_output_conf(struct venus_inst *inst)
if (width > 1920 && height > ALIGN(1080, 32))
ubwc = true;

/* For Venus v4 UBWC format is mandatory */
if (IS_V4(core))
/* For Venus v4/v6 UBWC format is mandatory */
if (IS_V4(core) || IS_V6(core))
ubwc = true;

ret = venus_helper_get_out_fmts(inst, inst->fmt_cap->pixfmt, &out_fmt,
Expand Down Expand Up @@ -731,7 +731,7 @@ static int vdec_output_conf(struct venus_inst *inst)
return ret;
}

if (IS_V3(core) || IS_V4(core)) {
if (IS_V3(core) || IS_V4(core) || IS_V6(core)) {
ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq);
if (ret)
return ret;
Expand Down

0 comments on commit 7ed9e0b

Please sign in to comment.