Message ID | 20180627152725.9783-1-stanimir.varbanov@linaro.org |
---|---|
Headers | show |
Series | Venus updates | expand |
Hi Stanimir, Thanks for this very well organized series and sorry for not giving feedback earlier. I have tested this version against the 4.14 Chrome OS kernel tree (+ a few extra changes to comply with the codec API) and it was working flawlessly. Therefore, Tested-by: Alexandre Courbot <acourbot@chromium.org> For the whole series. I have a few comments/questions on some patches, would be great if you could take a look. Also wondering what is your plan regarding codec API compliance? Do you plan to integrate it into the current series, or work on it after merging this initial work? Both ways would be ok as far as I am concerned. Cheers, Alex. On Thu, Jun 28, 2018 at 12:27 AM Stanimir Varbanov <stanimir.varbanov@linaro.org> wrote: > > Hi, > > Here is v4 with following changes: > > - fixed kbuild test robot in 12/27. > - fixed destination of memcpy in fill_xxx functions. > > v3 can be found at https://lkml.org/lkml/2018/6/13/464 > > regards, > Stan > > Stanimir Varbanov (27): > venus: hfi_msgs: correct pointer increment > venus: hfi: preparation to support venus 4xx > venus: hfi: update sequence event to handle more properties > venus: hfi_cmds: add set_properties for 4xx version > venus: hfi: support session continue for 4xx version > venus: hfi: handle buffer output2 type as well > venus: hfi_venus: add halt AXI support for Venus 4xx > venus: hfi_venus: fix suspend function for venus 3xx versions > venus: hfi_venus: move set of default properties to core init > venus: hfi_venus: add suspend functionality for Venus 4xx > venus: core,helpers: add two more clocks found in Venus 4xx > venus: hfi_parser: add common capability parser > venus: helpers: rename a helper function and use buffer mode from caps > venus: helpers: add a helper function to set dynamic buffer mode > venus: helpers: add helper function to set actual buffer size > venus: core: delete not used buffer mode flags > venus: helpers: add buffer type argument to a helper > venus: helpers: add a new helper to set raw format > venus: helpers,vdec,venc: add helpers to set work mode and core usage > venus: helpers: extend set_num_bufs helper with one more argument > venus: helpers: add a helper to return opb buffer sizes > venus: vdec: get required input buffers as well > venus: vdec: a new function for output configuration > venus: helpers: move frame size calculations on common place > venus: implementing multi-stream support > venus: core: add sdm845 DT compatible and resource data > venus: add HEVC codec support > > .../devicetree/bindings/media/qcom,venus.txt | 1 + > drivers/media/platform/qcom/venus/Makefile | 3 +- > drivers/media/platform/qcom/venus/core.c | 107 ++++ > drivers/media/platform/qcom/venus/core.h | 100 ++-- > drivers/media/platform/qcom/venus/helpers.c | 555 +++++++++++++++++++-- > drivers/media/platform/qcom/venus/helpers.h | 23 +- > drivers/media/platform/qcom/venus/hfi.c | 12 +- > drivers/media/platform/qcom/venus/hfi.h | 10 + > drivers/media/platform/qcom/venus/hfi_cmds.c | 62 ++- > drivers/media/platform/qcom/venus/hfi_helper.h | 112 ++++- > drivers/media/platform/qcom/venus/hfi_msgs.c | 399 +++------------ > drivers/media/platform/qcom/venus/hfi_parser.c | 278 +++++++++++ > drivers/media/platform/qcom/venus/hfi_parser.h | 45 ++ > drivers/media/platform/qcom/venus/hfi_venus.c | 109 +++- > drivers/media/platform/qcom/venus/hfi_venus_io.h | 10 + > drivers/media/platform/qcom/venus/vdec.c | 326 +++++++----- > drivers/media/platform/qcom/venus/venc.c | 220 ++++---- > 17 files changed, 1694 insertions(+), 678 deletions(-) > create mode 100644 drivers/media/platform/qcom/venus/hfi_parser.c > create mode 100644 drivers/media/platform/qcom/venus/hfi_parser.h > > -- > 2.14.1 >
On Thu, Jun 28, 2018 at 12:31 AM Stanimir Varbanov <stanimir.varbanov@linaro.org> wrote: > > Adds a new helper function to set dynamic buffer mode if it is > supported by current HFI version. The dynamic buffer mode is > set unconditionally for both decoder outputs. > > Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> > --- > drivers/media/platform/qcom/venus/helpers.c | 22 ++++++++++++++++++++++ > drivers/media/platform/qcom/venus/helpers.h | 1 + > drivers/media/platform/qcom/venus/vdec.c | 15 +++------------ > 3 files changed, 26 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 03121dbb4175..e3dc2772946f 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -519,6 +519,28 @@ int venus_helper_set_color_format(struct venus_inst *inst, u32 pixfmt) > } > EXPORT_SYMBOL_GPL(venus_helper_set_color_format); > > +int venus_helper_set_dyn_bufmode(struct venus_inst *inst) > +{ > + u32 ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE; This could be const u32. > + struct hfi_buffer_alloc_mode mode; > + int ret; > + > + if (!is_dynamic_bufmode(inst)) > + return 0; > + > + mode.type = HFI_BUFFER_OUTPUT; > + mode.mode = HFI_BUFFER_MODE_DYNAMIC; > + > + ret = hfi_session_set_property(inst, ptype, &mode); > + if (ret) > + return ret; > + > + mode.type = HFI_BUFFER_OUTPUT2; > + > + return hfi_session_set_property(inst, ptype, &mode); > +} > +EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); > + > static void delayed_process_buf_func(struct work_struct *work) > { > struct venus_buffer *buf, *n; > diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h > index 0e64aa95624a..52b961ed491e 100644 > --- a/drivers/media/platform/qcom/venus/helpers.h > +++ b/drivers/media/platform/qcom/venus/helpers.h > @@ -40,6 +40,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, > int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, > unsigned int output_bufs); > int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); > +int venus_helper_set_dyn_bufmode(struct venus_inst *inst); > void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf); > void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx); > void venus_helper_init_instance(struct venus_inst *inst); > diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c > index 31a240ab142b..92669a358a90 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -557,18 +557,9 @@ static int vdec_set_properties(struct venus_inst *inst) > return ret; > } > > - if (core->res->hfi_version == HFI_VERSION_3XX || > - inst->cap_bufs_mode_dynamic) { > - struct hfi_buffer_alloc_mode mode; > - > - ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE; > - mode.type = HFI_BUFFER_OUTPUT; > - mode.mode = HFI_BUFFER_MODE_DYNAMIC; > - > - ret = hfi_session_set_property(inst, ptype, &mode); > - if (ret) > - return ret; > - } > + ret = venus_helper_set_dyn_bufmode(inst); > + if (ret) > + return ret; > > if (ctr->post_loop_deb_mode) { > ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; > -- > 2.14.1 >
On Thu, Jun 28, 2018 at 12:28 AM Stanimir Varbanov <stanimir.varbanov@linaro.org> wrote: > > This move the calculations of raw and compressed buffer sizes > on common helper and make it identical for encoder and decoder. > > Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> > --- > drivers/media/platform/qcom/venus/helpers.c | 98 +++++++++++++++++++++++++++++ > drivers/media/platform/qcom/venus/helpers.h | 2 + > drivers/media/platform/qcom/venus/vdec.c | 54 ++++------------ > drivers/media/platform/qcom/venus/venc.c | 56 ++++------------- > 4 files changed, 126 insertions(+), 84 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 6b31c91528ed..a342472ae2f0 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -452,6 +452,104 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, > } > EXPORT_SYMBOL_GPL(venus_helper_get_bufreq); > > +static u32 get_framesize_raw_nv12(u32 width, u32 height) > +{ > + u32 y_stride, uv_stride, y_plane; > + u32 y_sclines, uv_sclines, uv_plane; > + u32 size; > + > + y_stride = ALIGN(width, 128); > + uv_stride = ALIGN(width, 128); > + y_sclines = ALIGN(height, 32); > + uv_sclines = ALIGN(((height + 1) >> 1), 16); > + > + y_plane = y_stride * y_sclines; > + uv_plane = uv_stride * uv_sclines + SZ_4K; > + size = y_plane + uv_plane + SZ_8K; Do you know the reason for this extra 8K at the end?
On Tue, Jul 3, 2018 at 12:25 AM Stanimir Varbanov <stanimir.varbanov@linaro.org> wrote: > > Hi Alex, > > Thanks for review comments! > > On 07/02/2018 11:45 AM, Alexandre Courbot wrote: > > Hi Stanimir, > > > > Thanks for this very well organized series and sorry for not giving > > feedback earlier. > > > > I have tested this version against the 4.14 Chrome OS kernel tree (+ a > > few extra changes to comply with the codec API) and it was working > > flawlessly. > > > > Therefore, > > > > Tested-by: Alexandre Courbot <acourbot@chromium.org> > > Thanks for testing! > > > > > For the whole series. > > > > I have a few comments/questions on some patches, would be great if you > > could take a look. Also wondering what is your plan regarding codec > > API compliance? Do you plan to integrate it into the current series, > > or work on it after merging this initial work? Both ways would be ok > > as far as I am concerned. > > Unfortunately I'm not ready with codec API compliance (at least for > Venus v1 & v3). I'm working on that intensively these days and I'd say > with a good progress but I still have few issues/details which needs > more attention and time. > > So I guess the plan minimum is to merge this series first. I'm fine with that. That will also allow us to tune the Codec API spec using this driver as reference.