linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/25] media: venus: Enable 6xx support
@ 2021-02-22 16:02 Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
                   ` (24 more replies)
  0 siblings, 25 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

This series enables support for 6xx venus encode/decode as found on the
sm8250.

The new silicon has different base addresses for existing functional blocks
within the venus address space. We add a base address offset mechanism to
handle this. The offsetting mechanism has been validated on 6xx and 4xx
hardware.

The sm8250 supports:

- h264
- h265
- vp8
- vp9

The driver changes are contingent on yaml and dts patches already
in-flight.

yaml: pending
https://www.spinics.net/lists/devicetree/msg406892.html

dts: pending
https://lore.kernel.org/linux-arm-msm/20210222132817.1807788-1-bryan.odonoghue@linaro.org/T/#t

clk: applied
https://kernel.googlesource.com/pub/scm/linux/kernel/git/clk/linux/+/clk-next

Applies on top of 

https://git.linuxtv.org/svarbanov/media_tree.git / venus-for-next-v5.12-part2

Bryan O'Donoghue (11):
  media: venus: Update v6 buffer descriptors
  media: venus: core: add sm8250 DT compatible and resource data
  media: venus: core: Add io base variables for each block
  media: venus: hfi,pm,firmware: Convert to block relative addressing
  media: venus: core: Add differentiator IS_V6(core)
  media: venus: core: Add an io base for TZ wrapper regs
  media: venus: core: Add an io base for AON regs
  media: venus: core: Hook to V6 base registers when appropriate
  media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx
  media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if
    locations
  media: venus: pm: Hook 6xx pm ops into 4xx pm ops

Dikshita Agarwal (12):
  media: venus: core,pm: Vote for min clk freq during venus boot
  media: venus: hfi: Define block offsets for V6 hardware
  media: venus: hfi: Define additional 6xx registers
  media: venus: hfi: Add a 6xx boot logic
  media: venus: hfi: Add 6xx interrupt support
  media: venus: hfi: Add 6xx AXI halt logic
  media: venus: pm: Toggle 6xx wrapper power in vcodec_control
  media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx
  media: venus: helpers: Add internal buffer list for v6
  media: venus: helpers, hfi, vdec: Set actual plane constraints to FW
  media: venus: hfi: Increase plat_buf_v6 o/p buffer count.
  media: venus: helper: Decide work mode

Stanimir Varbanov (2):
  media: venus: core,pm: Add handling for resets
  media: venus: vdec: Fix decoder cmd STOP issue

 drivers/media/platform/qcom/venus/core.c      |  78 ++++++++
 drivers/media/platform/qcom/venus/core.h      |  19 ++
 drivers/media/platform/qcom/venus/firmware.c  |  34 ++--
 drivers/media/platform/qcom/venus/helpers.c   |  80 +++++++-
 drivers/media/platform/qcom/venus/helpers.h   |   3 +-
 drivers/media/platform/qcom/venus/hfi_cmds.c  |  15 +-
 .../media/platform/qcom/venus/hfi_helper.h    |   9 +-
 .../platform/qcom/venus/hfi_plat_bufs_v6.c    |   2 +-
 .../platform/qcom/venus/hfi_platform_v6.c     | 138 +++++++-------
 drivers/media/platform/qcom/venus/hfi_venus.c | 177 +++++++++++++-----
 .../media/platform/qcom/venus/hfi_venus_io.h  | 118 ++++++++----
 .../media/platform/qcom/venus/pm_helpers.c    |  92 ++++++++-
 drivers/media/platform/qcom/venus/vdec.c      |  14 +-
 drivers/media/platform/qcom/venus/venc.c      |   2 +-
 14 files changed, 584 insertions(+), 197 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 01/25] media: venus: Update v6 buffer descriptors
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:11   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 02/25] media: venus: core,pm: Add handling for resets Bryan O'Donoghue
                   ` (23 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

Currently hfi_platform_v6.c adds a bunch of capability parameters.
Reviewing downstream we can see a number of these need to be updated.

techpack/video/msm/vidc/msm_vidc_platform.c :: kona_capabilities[]

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 .../platform/qcom/venus/hfi_platform_v6.c     | 138 +++++++++---------
 1 file changed, 69 insertions(+), 69 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
index 2278be13cb90..6fa80353bcce 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c
+++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
@@ -9,15 +9,15 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_H264,
 	.domain = VIDC_SESSION_TYPE_DEC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 5760, 1},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 5760, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
 	/* ((5760 * 2880) / 256) */
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 36, 64800, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 200000000, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},
 	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
 	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 36, 1958400, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
 	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.num_caps = 9,
 	.pl[0] = {HFI_H264_PROFILE_BASELINE, HFI_H264_LEVEL_52},
@@ -35,15 +35,15 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_HEVC,
 	.domain = VIDC_SESSION_TYPE_DEC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
-	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
-	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},
+	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
+	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
 	.num_caps = 10,
 	.pl[0] = {HFI_HEVC_PROFILE_MAIN, HFI_HEVC_LEVEL_6 | HFI_HEVC_TIER_HIGH0},
@@ -61,15 +61,15 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_VP8,
 	.domain = VIDC_SESSION_TYPE_DEC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
-	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
-	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 100000000, 1},
+	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
+	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
 	.num_caps = 10,
 	.pl[0] = {HFI_VPX_PROFILE_MAIN, HFI_VPX_LEVEL_VERSION_0},
@@ -86,15 +86,15 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_VP9,
 	.domain = VIDC_SESSION_TYPE_DEC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
-	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
-	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},
+	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
+	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
 	.num_caps = 10,
 	.pl[0] = {HFI_VP9_PROFILE_P0, 200},
@@ -112,15 +112,15 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_MPEG2,
 	.domain = VIDC_SESSION_TYPE_DEC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 1920, 1},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 1920, 1},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 8160, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1920, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1},
 	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 40000000, 1},
-	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
-	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 244800, 1},
+	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
+	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
 	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 30, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 1, 1},
 	.num_caps = 10,
 	.pl[0] = {HFI_MPEG2_PROFILE_SIMPLE, HFI_MPEG2_LEVEL_H14},
@@ -135,21 +135,21 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_H264,
 	.domain = VIDC_SESSION_TYPE_ENC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},
 	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
 	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
-	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1},
-	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1},
+	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 6, 1},
+	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
 	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1},
 	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
-	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
+	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 6, 1},
 	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1},
 	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1},
 	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1},
@@ -172,24 +172,24 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_HEVC,
 	.domain = VIDC_SESSION_TYPE_ENC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 16},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 16},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 160000000, 1},
 	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
 	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
 	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1},
-	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1},
+	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
 	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 32, 32, 1},
 	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
 	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
-	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 63, 1},
-	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 63, 1},
-	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 63, 1},
+	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1},
+	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1},
+	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1},
 	.caps[18] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 2, 1},
 	.caps[19] = {HFI_CAPABILITY_RATE_CONTROL_MODES, 0x1000001, 0x1000005, 1},
 	.caps[20] = {HFI_CAPABILITY_COLOR_SPACE_CONVERSION, 0, 2, 1},
@@ -209,20 +209,20 @@ static const struct hfi_plat_caps caps[] = {
 	.codec = HFI_VIDEO_CODEC_VP8,
 	.domain = VIDC_SESSION_TYPE_ENC,
 	.cap_bufs_mode_dynamic = true,
-	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
-	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
-	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
-	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
+	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 16},
+	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 16},
+	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1},
+	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 74000000, 1},
 	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
 	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
-	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
-	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 240, 1},
-	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
+	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1},
+	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1},
+	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
 	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
 	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 3, 1},
 	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
 	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1},
-	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
+	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 0, 1},
 	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
 	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 127, 1},
 	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 127, 1},
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 02/25] media: venus: core,pm: Add handling for resets
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data Bryan O'Donoghue
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Stanimir Varbanov <stanimir.varbanov@linaro.org>

The Venus driver has to control two reset signals related to
gcc video_axi0 and videocc mvs0c for v6. Add it.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.h      |  4 ++
 .../media/platform/qcom/venus/pm_helpers.c    | 60 +++++++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index a252ed32cc14..771f5bb0981e 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -24,6 +24,7 @@
 #define VIDC_CLKS_NUM_MAX		4
 #define VIDC_VCODEC_CLKS_NUM_MAX	2
 #define VIDC_PMDOMAINS_NUM_MAX		3
+#define VIDC_RESETS_NUM_MAX		2
 
 extern int venus_fw_debug;
 
@@ -64,6 +65,8 @@ struct venus_resources {
 	unsigned int vcodec_pmdomains_num;
 	const char **opp_pmdomain;
 	unsigned int vcodec_num;
+	const char * const resets[VIDC_RESETS_NUM_MAX];
+	unsigned int resets_num;
 	enum hfi_version hfi_version;
 	u32 max_load;
 	unsigned int vmem_id;
@@ -130,6 +133,7 @@ struct venus_core {
 	struct device *pmdomains[VIDC_PMDOMAINS_NUM_MAX];
 	struct device_link *opp_dl_venus;
 	struct device *opp_pmdomain;
+	struct reset_control *resets[VIDC_RESETS_NUM_MAX];
 	struct video_device *vdev_dec;
 	struct video_device *vdev_enc;
 	struct v4l2_device v4l2_dev;
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index e349d01422c5..4f5d42662963 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -11,6 +11,7 @@
 #include <linux/pm_domain.h>
 #include <linux/pm_opp.h>
 #include <linux/pm_runtime.h>
+#include <linux/reset.h>
 #include <linux/types.h>
 #include <media/v4l2-mem2mem.h>
 
@@ -830,6 +831,52 @@ static void vcodec_domains_put(struct venus_core *core)
 	dev_pm_opp_detach_genpd(core->opp_table);
 }
 
+static int core_resets_reset(struct venus_core *core)
+{
+	const struct venus_resources *res = core->res;
+	unsigned char i;
+	int ret;
+
+	if (!res->resets_num)
+		return 0;
+
+	for (i = 0; i < res->resets_num; i++) {
+		ret = reset_control_assert(core->resets[i]);
+		if (ret)
+			goto err;
+
+		usleep_range(150, 250);
+		ret = reset_control_deassert(core->resets[i]);
+		if (ret)
+			goto err;
+	}
+
+err:
+	return ret;
+}
+
+static int core_resets_get(struct venus_core *core)
+{
+	struct device *dev = core->dev;
+	const struct venus_resources *res = core->res;
+	unsigned char i;
+	int ret;
+
+	if (!res->resets_num)
+		return 0;
+
+	for (i = 0; i < res->resets_num; i++) {
+		core->resets[i] =
+			devm_reset_control_get_exclusive(dev, res->resets[i]);
+		if (IS_ERR(core->resets[i])) {
+			ret = PTR_ERR(core->resets[i]);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
 static int core_get_v4(struct venus_core *core)
 {
 	struct device *dev = core->dev;
@@ -853,6 +900,10 @@ static int core_get_v4(struct venus_core *core)
 	if (ret)
 		return ret;
 
+	ret = core_resets_get(core);
+	if (ret)
+		return ret;
+
 	if (legacy_binding)
 		return 0;
 
@@ -912,6 +963,13 @@ static int core_power_v4(struct venus_core *core, int on)
 			}
 		}
 
+		ret = core_resets_reset(core);
+		if (ret) {
+			if (pmctrl)
+				pm_runtime_put_sync(pmctrl);
+			return ret;
+		}
+
 		ret = core_clks_enable(core);
 		if (ret < 0 && pmctrl)
 			pm_runtime_put_sync(pmctrl);
@@ -922,6 +980,8 @@ static int core_power_v4(struct venus_core *core, int on)
 
 		core_clks_disable(core);
 
+		ret = core_resets_reset(core);
+
 		if (pmctrl)
 			pm_runtime_put_sync(pmctrl);
 	}
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 02/25] media: venus: core,pm: Add handling for resets Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:48   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot Bryan O'Donoghue
                   ` (21 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

Adds an sm8250 compatible binding to the venus core.

Co-developed-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Co-developed-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 54 ++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 61a245b4db68..67676f1632ab 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -627,12 +627,66 @@ static const struct venus_resources sc7180_res = {
 	.fwname = "qcom/venus-5.4/venus.mdt",
 };
 
+static const struct freq_tbl sm8250_freq_table[] = {
+	{ 0, 444000000 },
+	{ 0, 366000000 },
+	{ 0, 338000000 },
+	{ 0, 240000000 },
+};
+
+static const struct bw_tbl sm8250_bw_table_enc[] = {
+	{ 1944000, 1954000, 0, 3711000, 0 },	/* 3840x2160@60 */
+	{  972000,  996000, 0, 1905000, 0 },	/* 3840x2160@30 */
+	{  489600,  645000, 0,  977000, 0 },	/* 1920x1080@60 */
+	{  244800,  332000, 0,	498000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct bw_tbl sm8250_bw_table_dec[] = {
+	{ 2073600, 2403000, 0, 4113000, 0 },	/* 4096x2160@60 */
+	{ 1036800, 1224000, 0, 2079000, 0 },	/* 4096x2160@30 */
+	{  489600,  812000, 0,  998000, 0 },	/* 1920x1080@60 */
+	{  244800,  416000, 0,  509000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct reg_val sm8250_reg_preset[] = {
+	{ 0xb0088, 0 },
+};
+
+static const struct venus_resources sm8250_res = {
+	.freq_tbl = sm8250_freq_table,
+	.freq_tbl_size = ARRAY_SIZE(sm8250_freq_table),
+	.reg_tbl = sm8250_reg_preset,
+	.reg_tbl_size = ARRAY_SIZE(sm8250_reg_preset),
+	.bw_tbl_enc = sm8250_bw_table_enc,
+	.bw_tbl_enc_size = ARRAY_SIZE(sm8250_bw_table_enc),
+	.bw_tbl_dec = sm8250_bw_table_dec,
+	.bw_tbl_dec_size = ARRAY_SIZE(sm8250_bw_table_dec),
+	.clks = {"core", "iface"},
+	.clks_num = 2,
+	.resets = { "bus", "core" },
+	.resets_num = 2,
+	.vcodec0_clks = { "vcodec0_core" },
+	.vcodec_clks_num = 1,
+	.vcodec_pmdomains = { "venus", "vcodec0" },
+	.vcodec_pmdomains_num = 2,
+	.opp_pmdomain = (const char *[]) { "mx", NULL },
+	.vcodec_num = 1,
+	.max_load = 7833600,
+	.hfi_version = HFI_VERSION_6XX,
+	.vmem_id = VIDC_RESOURCE_NONE,
+	.vmem_size = 0,
+	.vmem_addr = 0,
+	.dma_mask = 0xe0000000 - 1,
+	.fwname = "qcom/sm8250/venus.mdt",
+};
+
 static const struct of_device_id venus_dt_match[] = {
 	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
 	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
 	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
 	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
 	{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
+	{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, venus_dt_match);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:25   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 05/25] media: venus: core: Add io base variables for each block Bryan O'Donoghue
                   ` (20 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

Vote for min clk frequency for core clks during prepare and enable clocks
at boot sequence. Without this the controller clock runs at very low value
(9.6MHz) which is not sufficient to boot venus.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 4f5d42662963..767cb00d4b46 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
 static int core_clks_enable(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;
+	const struct freq_tbl *freq_tbl = NULL;
+	unsigned int freq_tbl_size = 0;
+	unsigned long freq = 0;
 	unsigned int i;
 	int ret;
 
+	freq_tbl = core->res->freq_tbl;
+	freq_tbl_size = core->res->freq_tbl_size;
+	if (!freq_tbl)
+		return -EINVAL;
+
+	freq = freq_tbl[freq_tbl_size - 1].freq;
+
 	for (i = 0; i < res->clks_num; i++) {
+		ret = clk_set_rate(core->clks[i], freq);
+		if (ret)
+			goto err;
+
 		ret = clk_prepare_enable(core->clks[i]);
 		if (ret)
 			goto err;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 05/25] media: venus: core: Add io base variables for each block
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (3 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:28   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing Bryan O'Donoghue
                   ` (19 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

New silicon means that the pre-determined offsets we have been using
in this driver no longer hold. Existing blocks of registers can exist at
different offsets relative to the IO base address.

This commit adds a routine to assign the IO base hooks a subsequent commit
will convert from absolute to relative addressing.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 12 ++++++++++++
 drivers/media/platform/qcom/venus/core.h | 10 ++++++++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 67676f1632ab..01c1828830c7 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -22,6 +22,7 @@
 #include "core.h"
 #include "firmware.h"
 #include "pm_helpers.h"
+#include "hfi_venus_io.h"
 
 static void venus_coredump(struct venus_core *core)
 {
@@ -206,6 +207,15 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type)
 	return ret;
 }
 
+static void venus_assign_register_offsets(struct venus_core *core)
+{
+	core->vbif_base = core->base + VBIF_BASE;
+	core->cpu_base = core->base + CPU_BASE;
+	core->cpu_cs_base = core->base + CPU_CS_BASE;
+	core->cpu_ic_base = core->base + CPU_IC_BASE;
+	core->wrapper_base = core->base + WRAPPER_BASE;
+}
+
 static int venus_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -272,6 +282,8 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_core_put;
 
+	venus_assign_register_offsets(core);
+
 	ret = v4l2_device_register(dev, &core->v4l2_dev);
 	if (ret)
 		goto err_core_deinit;
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 771f5bb0981e..1be73c707d21 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -90,6 +90,11 @@ struct venus_format {
  * struct venus_core - holds core parameters valid for all instances
  *
  * @base:	IO memory base address
+ * @vbif_base	IO memory vbif base address
+ * @cpu_base	IO memory cpu base address
+ * @cpu_cs_base	IO memory cpu_cs base address
+ * @cpu_ic_base	IO memory cpu_ic base address
+ * @wrapper_base	IO memory wrapper base address
  * @irq:		Venus irq
  * @clks:	an array of struct clk pointers
  * @vcodec0_clks: an array of vcodec0 struct clk pointers
@@ -122,6 +127,11 @@ struct venus_format {
  */
 struct venus_core {
 	void __iomem *base;
+	void __iomem *vbif_base;
+	void __iomem *cpu_base;
+	void __iomem *cpu_cs_base;
+	void __iomem *cpu_ic_base;
+	void __iomem *wrapper_base;
 	int irq;
 	struct clk *clks[VIDC_CLKS_NUM_MAX];
 	struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (4 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 05/25] media: venus: core: Add io base variables for each block Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:31   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware Bryan O'Donoghue
                   ` (18 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

An upcoming silicon change places a number of existing blocks within the
Venus at different relative offsets to the base address of IO region.

In order to handle this difference this patch changes the address offsets
of the registers to function as offsets relative to the relevant sub-block
of registers within the IO region not the base address of the IO region.

As a result of this change venus_readl() and venus_writel() are deleted.

Co-developed-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/firmware.c  | 28 +++----
 drivers/media/platform/qcom/venus/hfi_venus.c | 82 ++++++++++---------
 .../media/platform/qcom/venus/hfi_venus_io.h  | 80 +++++++++---------
 .../media/platform/qcom/venus/pm_helpers.c    | 12 +--
 4 files changed, 105 insertions(+), 97 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 89defc21ea81..f9170f596849 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -27,19 +27,19 @@
 static void venus_reset_cpu(struct venus_core *core)
 {
 	u32 fw_size = core->fw.mapped_mem_size;
-	void __iomem *base = core->base;
+	void __iomem *wrapper_base = core->wrapper_base;
 
-	writel(0, base + WRAPPER_FW_START_ADDR);
-	writel(fw_size, base + WRAPPER_FW_END_ADDR);
-	writel(0, base + WRAPPER_CPA_START_ADDR);
-	writel(fw_size, base + WRAPPER_CPA_END_ADDR);
-	writel(fw_size, base + WRAPPER_NONPIX_START_ADDR);
-	writel(fw_size, base + WRAPPER_NONPIX_END_ADDR);
-	writel(0x0, base + WRAPPER_CPU_CGC_DIS);
-	writel(0x0, base + WRAPPER_CPU_CLOCK_CONFIG);
+	writel(0, wrapper_base + WRAPPER_FW_START_ADDR);
+	writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR);
+	writel(0, wrapper_base + WRAPPER_CPA_START_ADDR);
+	writel(fw_size, wrapper_base + WRAPPER_CPA_END_ADDR);
+	writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR);
+	writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR);
+	writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS);
+	writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG);
 
 	/* Bring ARM9 out of reset */
-	writel(0, base + WRAPPER_A9SS_SW_RESET);
+	writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET);
 }
 
 int venus_set_hw_state(struct venus_core *core, bool resume)
@@ -56,7 +56,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
 	if (resume)
 		venus_reset_cpu(core);
 	else
-		writel(1, core->base + WRAPPER_A9SS_SW_RESET);
+		writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
 
 	return 0;
 }
@@ -159,12 +159,12 @@ static int venus_shutdown_no_tz(struct venus_core *core)
 	size_t unmapped;
 	u32 reg;
 	struct device *dev = core->fw.dev;
-	void __iomem *base = core->base;
+	void __iomem *wrapper_base = core->wrapper_base;
 
 	/* Assert the reset to ARM9 */
-	reg = readl_relaxed(base + WRAPPER_A9SS_SW_RESET);
+	reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
 	reg |= WRAPPER_A9SS_SW_RESET_BIT;
-	writel_relaxed(reg, base + WRAPPER_A9SS_SW_RESET);
+	writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
 
 	/* Make sure reset is asserted before the mapping is removed */
 	mb();
diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 50e03f8fc278..f95cdd3d530c 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -345,16 +345,6 @@ static void venus_free(struct venus_hfi_device *hdev, struct mem_desc *mem)
 	dma_free_attrs(dev, mem->size, mem->kva, mem->da, mem->attrs);
 }
 
-static void venus_writel(struct venus_hfi_device *hdev, u32 reg, u32 value)
-{
-	writel(value, hdev->core->base + reg);
-}
-
-static u32 venus_readl(struct venus_hfi_device *hdev, u32 reg)
-{
-	return readl(hdev->core->base + reg);
-}
-
 static void venus_set_registers(struct venus_hfi_device *hdev)
 {
 	const struct venus_resources *res = hdev->core->res;
@@ -363,12 +353,14 @@ static void venus_set_registers(struct venus_hfi_device *hdev)
 	unsigned int i;
 
 	for (i = 0; i < count; i++)
-		venus_writel(hdev, tbl[i].reg, tbl[i].value);
+		writel(tbl[i].value, hdev->core->base + tbl[i].reg);
 }
 
 static void venus_soft_int(struct venus_hfi_device *hdev)
 {
-	venus_writel(hdev, CPU_IC_SOFTINT, BIT(CPU_IC_SOFTINT_H2A_SHIFT));
+	void __iomem *cpu_ic_base = hdev->core->cpu_ic_base;
+
+	writel(BIT(CPU_IC_SOFTINT_H2A_SHIFT), cpu_ic_base + CPU_IC_SOFTINT);
 }
 
 static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev,
@@ -452,14 +444,16 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	static const unsigned int max_tries = 100;
 	u32 ctrl_status = 0;
 	unsigned int count = 0;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
 	int ret = 0;
 
-	venus_writel(hdev, VIDC_CTRL_INIT, BIT(VIDC_CTRL_INIT_CTRL_SHIFT));
-	venus_writel(hdev, WRAPPER_INTR_MASK, WRAPPER_INTR_MASK_A2HVCODEC_MASK);
-	venus_writel(hdev, CPU_CS_SCIACMDARG3, 1);
+	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
+	writel(WRAPPER_INTR_MASK_A2HVCODEC_MASK, wrapper_base + WRAPPER_INTR_MASK);
+	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
 	while (!ctrl_status && count < max_tries) {
-		ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+		ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 		if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {
 			dev_err(dev, "invalid setting for UC_REGION\n");
 			ret = -EINVAL;
@@ -479,9 +473,11 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 static u32 venus_hwversion(struct venus_hfi_device *hdev)
 {
 	struct device *dev = hdev->core->dev;
-	u32 ver = venus_readl(hdev, WRAPPER_HW_VERSION);
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	u32 ver;
 	u32 major, minor, step;
 
+	ver = readl(wrapper_base + WRAPPER_HW_VERSION);
 	major = ver & WRAPPER_HW_VERSION_MAJOR_VERSION_MASK;
 	major = major >> WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT;
 	minor = ver & WRAPPER_HW_VERSION_MINOR_VERSION_MASK;
@@ -496,6 +492,7 @@ static u32 venus_hwversion(struct venus_hfi_device *hdev)
 static int venus_run(struct venus_hfi_device *hdev)
 {
 	struct device *dev = hdev->core->dev;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	int ret;
 
 	/*
@@ -504,12 +501,12 @@ static int venus_run(struct venus_hfi_device *hdev)
 	 */
 	venus_set_registers(hdev);
 
-	venus_writel(hdev, UC_REGION_ADDR, hdev->ifaceq_table.da);
-	venus_writel(hdev, UC_REGION_SIZE, SHARED_QSIZE);
-	venus_writel(hdev, CPU_CS_SCIACMDARG2, hdev->ifaceq_table.da);
-	venus_writel(hdev, CPU_CS_SCIACMDARG1, 0x01);
+	writel(hdev->ifaceq_table.da, cpu_cs_base + UC_REGION_ADDR);
+	writel(SHARED_QSIZE, cpu_cs_base + UC_REGION_SIZE);
+	writel(hdev->ifaceq_table.da, cpu_cs_base + CPU_CS_SCIACMDARG2);
+	writel(0x01, cpu_cs_base + CPU_CS_SCIACMDARG1);
 	if (hdev->sfr.da)
-		venus_writel(hdev, SFR_ADDR, hdev->sfr.da);
+		writel(hdev->sfr.da, cpu_cs_base + SFR_ADDR);
 
 	ret = venus_boot_core(hdev);
 	if (ret) {
@@ -524,17 +521,18 @@ static int venus_run(struct venus_hfi_device *hdev)
 
 static int venus_halt_axi(struct venus_hfi_device *hdev)
 {
-	void __iomem *base = hdev->core->base;
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	void __iomem *vbif_base = hdev->core->vbif_base;
 	struct device *dev = hdev->core->dev;
 	u32 val;
 	int ret;
 
 	if (IS_V4(hdev->core)) {
-		val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT);
+		val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT);
 		val |= WRAPPER_CPU_AXI_HALT_HALT;
-		venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val);
+		writel(val, wrapper_base + WRAPPER_CPU_AXI_HALT);
 
-		ret = readl_poll_timeout(base + WRAPPER_CPU_AXI_HALT_STATUS,
+		ret = readl_poll_timeout(wrapper_base + WRAPPER_CPU_AXI_HALT_STATUS,
 					 val,
 					 val & WRAPPER_CPU_AXI_HALT_STATUS_IDLE,
 					 POLL_INTERVAL_US,
@@ -548,12 +546,12 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
 	}
 
 	/* Halt AXI and AXI IMEM VBIF Access */
-	val = venus_readl(hdev, VBIF_AXI_HALT_CTRL0);
+	val = readl(vbif_base + VBIF_AXI_HALT_CTRL0);
 	val |= VBIF_AXI_HALT_CTRL0_HALT_REQ;
-	venus_writel(hdev, VBIF_AXI_HALT_CTRL0, val);
+	writel(val, vbif_base + VBIF_AXI_HALT_CTRL0);
 
 	/* Request for AXI bus port halt */
-	ret = readl_poll_timeout(base + VBIF_AXI_HALT_CTRL1, val,
+	ret = readl_poll_timeout(vbif_base + VBIF_AXI_HALT_CTRL1, val,
 				 val & VBIF_AXI_HALT_CTRL1_HALT_ACK,
 				 POLL_INTERVAL_US,
 				 VBIF_AXI_HALT_ACK_TIMEOUT_US);
@@ -1046,19 +1044,21 @@ static irqreturn_t venus_isr(struct venus_core *core)
 {
 	struct venus_hfi_device *hdev = to_hfi_priv(core);
 	u32 status;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
 
 	if (!hdev)
 		return IRQ_NONE;
 
-	status = venus_readl(hdev, WRAPPER_INTR_STATUS);
+	status = readl(wrapper_base + WRAPPER_INTR_STATUS);
 
 	if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
 	    status & WRAPPER_INTR_STATUS_A2HWD_MASK ||
 	    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
 		hdev->irq_status = status;
 
-	venus_writel(hdev, CPU_CS_A2HSOFTINTCLR, 1);
-	venus_writel(hdev, WRAPPER_INTR_CLEAR, status);
+	writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR);
+	writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
 
 	return IRQ_WAKE_THREAD;
 }
@@ -1391,6 +1391,7 @@ static int venus_suspend_1xx(struct venus_core *core)
 {
 	struct venus_hfi_device *hdev = to_hfi_priv(core);
 	struct device *dev = core->dev;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status;
 	int ret;
 
@@ -1425,7 +1426,7 @@ static int venus_suspend_1xx(struct venus_core *core)
 		return -EINVAL;
 	}
 
-	ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 	if (!(ctrl_status & CPU_CS_SCIACMDARG0_PC_READY)) {
 		mutex_unlock(&hdev->lock);
 		return -EINVAL;
@@ -1446,10 +1447,12 @@ static int venus_suspend_1xx(struct venus_core *core)
 
 static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
 {
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS);
-	ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+	cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
+	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 
 	if (cpu_status & WRAPPER_CPU_STATUS_WFI &&
 	    ctrl_status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
@@ -1460,10 +1463,12 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
 
 static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev)
 {
+	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS);
-	ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+	cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
+	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 
 	if (cpu_status & WRAPPER_CPU_STATUS_WFI &&
 	    ctrl_status & CPU_CS_SCIACMDARG0_PC_READY)
@@ -1476,6 +1481,7 @@ static int venus_suspend_3xx(struct venus_core *core)
 {
 	struct venus_hfi_device *hdev = to_hfi_priv(core);
 	struct device *dev = core->dev;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status;
 	bool val;
 	int ret;
@@ -1492,7 +1498,7 @@ static int venus_suspend_3xx(struct venus_core *core)
 		return -EINVAL;
 	}
 
-	ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 	if (ctrl_status & CPU_CS_SCIACMDARG0_PC_READY)
 		goto power_off;
 
diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
index 3b52f98478db..4c392b67252c 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
+++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
@@ -8,27 +8,28 @@
 
 #define VBIF_BASE				0x80000
 
-#define VBIF_AXI_HALT_CTRL0			(VBIF_BASE + 0x208)
-#define VBIF_AXI_HALT_CTRL1			(VBIF_BASE + 0x20c)
+#define VBIF_AXI_HALT_CTRL0			0x208
+#define VBIF_AXI_HALT_CTRL1			0x20c
 
 #define VBIF_AXI_HALT_CTRL0_HALT_REQ		BIT(0)
 #define VBIF_AXI_HALT_CTRL1_HALT_ACK		BIT(0)
 #define VBIF_AXI_HALT_ACK_TIMEOUT_US		500000
 
 #define CPU_BASE				0xc0000
+
 #define CPU_CS_BASE				(CPU_BASE + 0x12000)
 #define CPU_IC_BASE				(CPU_BASE + 0x1f000)
 
-#define CPU_CS_A2HSOFTINTCLR			(CPU_CS_BASE + 0x1c)
+#define CPU_CS_A2HSOFTINTCLR			0x1c
 
-#define VIDC_CTRL_INIT				(CPU_CS_BASE + 0x48)
+#define VIDC_CTRL_INIT				0x48
 #define VIDC_CTRL_INIT_RESERVED_BITS31_1_MASK	0xfffffffe
 #define VIDC_CTRL_INIT_RESERVED_BITS31_1_SHIFT	1
 #define VIDC_CTRL_INIT_CTRL_MASK		0x1
 #define VIDC_CTRL_INIT_CTRL_SHIFT		0
 
 /* HFI control status */
-#define CPU_CS_SCIACMDARG0			(CPU_CS_BASE + 0x4c)
+#define CPU_CS_SCIACMDARG0			0x4c
 #define CPU_CS_SCIACMDARG0_MASK			0xff
 #define CPU_CS_SCIACMDARG0_SHIFT		0x0
 #define CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK	0xfe
@@ -39,42 +40,43 @@
 #define CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK	BIT(30)
 
 /* HFI queue table info */
-#define CPU_CS_SCIACMDARG1			(CPU_CS_BASE + 0x50)
+#define CPU_CS_SCIACMDARG1			0x50
 
 /* HFI queue table address */
-#define CPU_CS_SCIACMDARG2			(CPU_CS_BASE + 0x54)
+#define CPU_CS_SCIACMDARG2			0x54
 
 /* Venus cpu */
-#define CPU_CS_SCIACMDARG3			(CPU_CS_BASE + 0x58)
+#define CPU_CS_SCIACMDARG3			0x58
 
-#define SFR_ADDR				(CPU_CS_BASE + 0x5c)
-#define MMAP_ADDR				(CPU_CS_BASE + 0x60)
-#define UC_REGION_ADDR				(CPU_CS_BASE + 0x64)
-#define UC_REGION_SIZE				(CPU_CS_BASE + 0x68)
+#define SFR_ADDR				0x5c
+#define MMAP_ADDR				0x60
+#define UC_REGION_ADDR				0x64
+#define UC_REGION_SIZE				0x68
 
-#define CPU_IC_SOFTINT				(CPU_IC_BASE + 0x18)
+/* Relative to CPU_IC_BASE */
+#define CPU_IC_SOFTINT				0x18
 #define CPU_IC_SOFTINT_H2A_MASK			0x8000
 #define CPU_IC_SOFTINT_H2A_SHIFT		0xf
 
 /* Venus wrapper */
 #define WRAPPER_BASE				0x000e0000
 
-#define WRAPPER_HW_VERSION			(WRAPPER_BASE + 0x00)
+#define WRAPPER_HW_VERSION			0x00
 #define WRAPPER_HW_VERSION_MAJOR_VERSION_MASK	0x78000000
 #define WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT	28
 #define WRAPPER_HW_VERSION_MINOR_VERSION_MASK	0xfff0000
 #define WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT	16
 #define WRAPPER_HW_VERSION_STEP_VERSION_MASK	0xffff
 
-#define WRAPPER_CLOCK_CONFIG			(WRAPPER_BASE + 0x04)
+#define WRAPPER_CLOCK_CONFIG			0x04
 
-#define WRAPPER_INTR_STATUS			(WRAPPER_BASE + 0x0c)
+#define WRAPPER_INTR_STATUS			0x0c
 #define WRAPPER_INTR_STATUS_A2HWD_MASK		0x10
 #define WRAPPER_INTR_STATUS_A2HWD_SHIFT		0x4
 #define WRAPPER_INTR_STATUS_A2H_MASK		0x4
 #define WRAPPER_INTR_STATUS_A2H_SHIFT		0x2
 
-#define WRAPPER_INTR_MASK			(WRAPPER_BASE + 0x10)
+#define WRAPPER_INTR_MASK			0x10
 #define WRAPPER_INTR_MASK_A2HWD_BASK		0x10
 #define WRAPPER_INTR_MASK_A2HWD_SHIFT		0x4
 #define WRAPPER_INTR_MASK_A2HVCODEC_MASK	0x8
@@ -82,41 +84,41 @@
 #define WRAPPER_INTR_MASK_A2HCPU_MASK		0x4
 #define WRAPPER_INTR_MASK_A2HCPU_SHIFT		0x2
 
-#define WRAPPER_INTR_CLEAR			(WRAPPER_BASE + 0x14)
+#define WRAPPER_INTR_CLEAR			0x14
 #define WRAPPER_INTR_CLEAR_A2HWD_MASK		0x10
 #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT		0x4
 #define WRAPPER_INTR_CLEAR_A2H_MASK		0x4
 #define WRAPPER_INTR_CLEAR_A2H_SHIFT		0x2
 
-#define WRAPPER_POWER_STATUS			(WRAPPER_BASE + 0x44)
-#define WRAPPER_VDEC_VCODEC_POWER_CONTROL	(WRAPPER_BASE + 0x48)
-#define WRAPPER_VENC_VCODEC_POWER_CONTROL	(WRAPPER_BASE + 0x4c)
-#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET	(WRAPPER_BASE + 0x64)
+#define WRAPPER_POWER_STATUS			0x44
+#define WRAPPER_VDEC_VCODEC_POWER_CONTROL	0x48
+#define WRAPPER_VENC_VCODEC_POWER_CONTROL	0x4c
+#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET	0x64
 
-#define WRAPPER_CPU_CLOCK_CONFIG		(WRAPPER_BASE + 0x2000)
-#define WRAPPER_CPU_AXI_HALT			(WRAPPER_BASE + 0x2008)
+#define WRAPPER_CPU_CLOCK_CONFIG		0x2000
+#define WRAPPER_CPU_AXI_HALT			0x2008
 #define WRAPPER_CPU_AXI_HALT_HALT		BIT(16)
-#define WRAPPER_CPU_AXI_HALT_STATUS		(WRAPPER_BASE + 0x200c)
+#define WRAPPER_CPU_AXI_HALT_STATUS		0x200c
 #define WRAPPER_CPU_AXI_HALT_STATUS_IDLE	BIT(24)
 
-#define WRAPPER_CPU_CGC_DIS			(WRAPPER_BASE + 0x2010)
-#define WRAPPER_CPU_STATUS			(WRAPPER_BASE + 0x2014)
+#define WRAPPER_CPU_CGC_DIS			0x2010
+#define WRAPPER_CPU_STATUS			0x2014
 #define WRAPPER_CPU_STATUS_WFI			BIT(0)
-#define WRAPPER_SW_RESET			(WRAPPER_BASE + 0x3000)
-#define WRAPPER_CPA_START_ADDR			(WRAPPER_BASE + 0x1020)
-#define WRAPPER_CPA_END_ADDR			(WRAPPER_BASE + 0x1024)
-#define WRAPPER_FW_START_ADDR			(WRAPPER_BASE + 0x1028)
-#define WRAPPER_FW_END_ADDR			(WRAPPER_BASE + 0x102C)
-#define WRAPPER_NONPIX_START_ADDR		(WRAPPER_BASE + 0x1030)
-#define WRAPPER_NONPIX_END_ADDR			(WRAPPER_BASE + 0x1034)
-#define WRAPPER_A9SS_SW_RESET			(WRAPPER_BASE + 0x3000)
+#define WRAPPER_SW_RESET			0x3000
+#define WRAPPER_CPA_START_ADDR			0x1020
+#define WRAPPER_CPA_END_ADDR			0x1024
+#define WRAPPER_FW_START_ADDR			0x1028
+#define WRAPPER_FW_END_ADDR			0x102C
+#define WRAPPER_NONPIX_START_ADDR		0x1030
+#define WRAPPER_NONPIX_END_ADDR			0x1034
+#define WRAPPER_A9SS_SW_RESET			0x3000
 #define WRAPPER_A9SS_SW_RESET_BIT		BIT(4)
 
 /* Venus 4xx */
-#define WRAPPER_VCODEC0_MMCC_POWER_STATUS	(WRAPPER_BASE + 0x90)
-#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL	(WRAPPER_BASE + 0x94)
+#define WRAPPER_VCODEC0_MMCC_POWER_STATUS	0x90
+#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL	0x94
 
-#define WRAPPER_VCODEC1_MMCC_POWER_STATUS	(WRAPPER_BASE + 0x110)
-#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL	(WRAPPER_BASE + 0x114)
+#define WRAPPER_VCODEC1_MMCC_POWER_STATUS	0x110
+#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL	0x114
 
 #endif
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 767cb00d4b46..ea08b4d71e39 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -321,9 +321,9 @@ vcodec_control_v3(struct venus_core *core, u32 session_type, bool enable)
 	void __iomem *ctrl;
 
 	if (session_type == VIDC_SESSION_TYPE_DEC)
-		ctrl = core->base + WRAPPER_VDEC_VCODEC_POWER_CONTROL;
+		ctrl = core->wrapper_base + WRAPPER_VDEC_VCODEC_POWER_CONTROL;
 	else
-		ctrl = core->base + WRAPPER_VENC_VCODEC_POWER_CONTROL;
+		ctrl = core->wrapper_base + WRAPPER_VENC_VCODEC_POWER_CONTROL;
 
 	if (enable)
 		writel(0, ctrl);
@@ -398,11 +398,11 @@ static int vcodec_control_v4(struct venus_core *core, u32 coreid, bool enable)
 	int ret;
 
 	if (coreid == VIDC_CORE_ID_1) {
-		ctrl = core->base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL;
-		stat = core->base + WRAPPER_VCODEC0_MMCC_POWER_STATUS;
+		ctrl = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL;
+		stat = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_STATUS;
 	} else {
-		ctrl = core->base + WRAPPER_VCODEC1_MMCC_POWER_CONTROL;
-		stat = core->base + WRAPPER_VCODEC1_MMCC_POWER_STATUS;
+		ctrl = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_CONTROL;
+		stat = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_STATUS;
 	}
 
 	if (enable) {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (5 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-23 13:32   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 08/25] media: venus: hfi: Define additional 6xx registers Bryan O'Donoghue
                   ` (17 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

This commit defines a range of new base addresses for already defined
blocks.

- CPU_BASE_V6
- CPU_CS_BASE_V6
- CPU_IC_BASE_V6
- WRAPPER_BASE_V6

The base addresses of the blocks are slightly different for 6xx but, aside
from that are layout and bit compatible.

New 6xx specific block addresses will be added in separate commits.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus_io.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
index 4c392b67252c..8604b213f03f 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
+++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
@@ -19,6 +19,9 @@
 
 #define CPU_CS_BASE				(CPU_BASE + 0x12000)
 #define CPU_IC_BASE				(CPU_BASE + 0x1f000)
+#define CPU_BASE_V6				0xa0000
+#define CPU_CS_BASE_V6				CPU_BASE_V6
+#define CPU_IC_BASE_V6				(CPU_BASE_V6 + 0x138)
 
 #define CPU_CS_A2HSOFTINTCLR			0x1c
 
@@ -59,6 +62,7 @@
 #define CPU_IC_SOFTINT_H2A_SHIFT		0xf
 
 /* Venus wrapper */
+#define WRAPPER_BASE_V6				0x000b0000
 #define WRAPPER_BASE				0x000e0000
 
 #define WRAPPER_HW_VERSION			0x00
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 08/25] media: venus: hfi: Define additional 6xx registers
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (6 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 09/25] media: venus: core: Add differentiator IS_V6(core) Bryan O'Donoghue
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

- Add X2 RPMh registers and definitions from the downstream example.
- Add 6xx core power definitions
- Add 6xx AON definitions
- Add 6xx wrapper tz definitions
- Add 6xx wrapper interrupt definitions
- Add 6xx soft interrupt definitions
- Define wrapper LPI register offsets

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 .../media/platform/qcom/venus/hfi_venus_io.h  | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
index 8604b213f03f..300c6e47e72f 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
+++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
@@ -56,10 +56,22 @@
 #define UC_REGION_ADDR				0x64
 #define UC_REGION_SIZE				0x68
 
+#define CPU_CS_H2XSOFTINTEN_V6			0x148
+
+#define CPU_CS_X2RPMH_V6			0x168
+#define CPU_CS_X2RPMH_MASK0_BMSK_V6		0x1
+#define CPU_CS_X2RPMH_MASK0_SHFT_V6		0x0
+#define CPU_CS_X2RPMH_MASK1_BMSK_V6		0x2
+#define CPU_CS_X2RPMH_MASK1_SHFT_V6		0x1
+#define CPU_CS_X2RPMH_SWOVERRIDE_BMSK_V6	0x4
+#define CPU_CS_X2RPMH_SWOVERRIDE_SHFT_V6	0x3
+
 /* Relative to CPU_IC_BASE */
 #define CPU_IC_SOFTINT				0x18
+#define CPU_IC_SOFTINT_V6			0x150
 #define CPU_IC_SOFTINT_H2A_MASK			0x8000
 #define CPU_IC_SOFTINT_H2A_SHIFT		0xf
+#define CPU_IC_SOFTINT_H2A_SHIFT_V6		0x0
 
 /* Venus wrapper */
 #define WRAPPER_BASE_V6				0x000b0000
@@ -88,6 +100,9 @@
 #define WRAPPER_INTR_MASK_A2HCPU_MASK		0x4
 #define WRAPPER_INTR_MASK_A2HCPU_SHIFT		0x2
 
+#define WRAPPER_INTR_STATUS_A2HWD_MASK_V6	0x8
+#define WRAPPER_INTR_MASK_A2HWD_BASK_V6		0x8
+
 #define WRAPPER_INTR_CLEAR			0x14
 #define WRAPPER_INTR_CLEAR_A2HWD_MASK		0x10
 #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT		0x4
@@ -97,6 +112,8 @@
 #define WRAPPER_POWER_STATUS			0x44
 #define WRAPPER_VDEC_VCODEC_POWER_CONTROL	0x48
 #define WRAPPER_VENC_VCODEC_POWER_CONTROL	0x4c
+#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6	0x54
+#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6	0x58
 #define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET	0x64
 
 #define WRAPPER_CPU_CLOCK_CONFIG		0x2000
@@ -125,4 +142,17 @@
 #define WRAPPER_VCODEC1_MMCC_POWER_STATUS	0x110
 #define WRAPPER_VCODEC1_MMCC_POWER_CONTROL	0x114
 
+/* Venus 6xx */
+#define WRAPPER_CORE_POWER_STATUS_V6		0x80
+#define WRAPPER_CORE_POWER_CONTROL_V6		0x84
+
+/* Wrapper TZ 6xx */
+#define WRAPPER_TZ_BASE_V6			0x000c0000
+#define WRAPPER_TZ_CPU_STATUS_V6		0x10
+
+/* Venus AON */
+#define AON_BASE_V6				0x000e0000
+#define AON_WRAPPER_MVP_NOC_LPI_CONTROL		0x00
+#define AON_WRAPPER_MVP_NOC_LPI_STATUS		0x04
+
 #endif
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 09/25] media: venus: core: Add differentiator IS_V6(core)
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (7 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 08/25] media: venus: hfi: Define additional 6xx registers Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 10/25] media: venus: core: Add an io base for TZ wrapper regs Bryan O'Donoghue
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

This commit adds the macro helper IS_V6() which will be used to
differentiate iris2/v6 silicon from previous versions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 1be73c707d21..0c90f48323f2 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -417,6 +417,7 @@ struct venus_inst {
 #define IS_V1(core)	((core)->res->hfi_version == HFI_VERSION_1XX)
 #define IS_V3(core)	((core)->res->hfi_version == HFI_VERSION_3XX)
 #define IS_V4(core)	((core)->res->hfi_version == HFI_VERSION_4XX)
+#define IS_V6(core)	((core)->res->hfi_version == HFI_VERSION_6XX)
 
 #define ctrl_to_inst(ctrl)	\
 	container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 10/25] media: venus: core: Add an io base for TZ wrapper regs
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (8 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 09/25] media: venus: core: Add differentiator IS_V6(core) Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 11/25] media: venus: core: Add an io base for AON regs Bryan O'Donoghue
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

6xx silicon needs to access registers from a wrapper trust-zone base
address range.
This commit defines the necessary variable for later use.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 1 +
 drivers/media/platform/qcom/venus/core.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 01c1828830c7..35a8956fe969 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -214,6 +214,7 @@ static void venus_assign_register_offsets(struct venus_core *core)
 	core->cpu_cs_base = core->base + CPU_CS_BASE;
 	core->cpu_ic_base = core->base + CPU_IC_BASE;
 	core->wrapper_base = core->base + WRAPPER_BASE;
+	core->wrapper_tz_base = 0;
 }
 
 static int venus_probe(struct platform_device *pdev)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 0c90f48323f2..54e6cd89b30a 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -95,6 +95,7 @@ struct venus_format {
  * @cpu_cs_base	IO memory cpu_cs base address
  * @cpu_ic_base	IO memory cpu_ic base address
  * @wrapper_base	IO memory wrapper base address
+ * @wrapper_base	IO memory wrapper TZ base address
  * @irq:		Venus irq
  * @clks:	an array of struct clk pointers
  * @vcodec0_clks: an array of vcodec0 struct clk pointers
@@ -132,6 +133,7 @@ struct venus_core {
 	void __iomem *cpu_cs_base;
 	void __iomem *cpu_ic_base;
 	void __iomem *wrapper_base;
+	void __iomem *wrapper_tz_base;
 	int irq;
 	struct clk *clks[VIDC_CLKS_NUM_MAX];
 	struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 11/25] media: venus: core: Add an io base for AON regs
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (9 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 10/25] media: venus: core: Add an io base for TZ wrapper regs Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 12/25] media: venus: core: Hook to V6 base registers when appropriate Bryan O'Donoghue
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

6xx silicon needs to access registers from a AON base address range.
This commit defines the necessary variable for later use.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 1 +
 drivers/media/platform/qcom/venus/core.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 35a8956fe969..dad597617961 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -215,6 +215,7 @@ static void venus_assign_register_offsets(struct venus_core *core)
 	core->cpu_ic_base = core->base + CPU_IC_BASE;
 	core->wrapper_base = core->base + WRAPPER_BASE;
 	core->wrapper_tz_base = 0;
+	core->aon_base = 0;
 }
 
 static int venus_probe(struct platform_device *pdev)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 54e6cd89b30a..8328f7210d6c 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -96,6 +96,7 @@ struct venus_format {
  * @cpu_ic_base	IO memory cpu_ic base address
  * @wrapper_base	IO memory wrapper base address
  * @wrapper_base	IO memory wrapper TZ base address
+ * @aon_base	AON base address
  * @irq:		Venus irq
  * @clks:	an array of struct clk pointers
  * @vcodec0_clks: an array of vcodec0 struct clk pointers
@@ -134,6 +135,7 @@ struct venus_core {
 	void __iomem *cpu_ic_base;
 	void __iomem *wrapper_base;
 	void __iomem *wrapper_tz_base;
+	void __iomem *aon_base;
 	int irq;
 	struct clk *clks[VIDC_CLKS_NUM_MAX];
 	struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 12/25] media: venus: core: Hook to V6 base registers when appropriate
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (10 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 11/25] media: venus: core: Add an io base for AON regs Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 13/25] media: venus: hfi: Add a 6xx boot logic Bryan O'Donoghue
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

This commit points the IO base registers 6xx offsets when probing for 6xx
hardware.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index dad597617961..e398d3bda65b 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -209,13 +209,23 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type)
 
 static void venus_assign_register_offsets(struct venus_core *core)
 {
-	core->vbif_base = core->base + VBIF_BASE;
-	core->cpu_base = core->base + CPU_BASE;
-	core->cpu_cs_base = core->base + CPU_CS_BASE;
-	core->cpu_ic_base = core->base + CPU_IC_BASE;
-	core->wrapper_base = core->base + WRAPPER_BASE;
-	core->wrapper_tz_base = 0;
-	core->aon_base = 0;
+	if (IS_V6(core)) {
+		core->vbif_base = core->base + VBIF_BASE;
+		core->cpu_base = core->base + CPU_BASE_V6;
+		core->cpu_cs_base = core->base + CPU_CS_BASE_V6;
+		core->cpu_ic_base = core->base + CPU_IC_BASE_V6;
+		core->wrapper_base = core->base + WRAPPER_BASE_V6;
+		core->wrapper_tz_base = core->base + WRAPPER_TZ_BASE_V6;
+		core->aon_base = core->base + AON_BASE_V6;
+	} else {
+		core->vbif_base = core->base + VBIF_BASE;
+		core->cpu_base = core->base + CPU_BASE;
+		core->cpu_cs_base = core->base + CPU_CS_BASE;
+		core->cpu_ic_base = core->base + CPU_IC_BASE;
+		core->wrapper_base = core->base + WRAPPER_BASE;
+		core->wrapper_tz_base = 0;
+		core->aon_base = 0;
+	}
 }
 
 static int venus_probe(struct platform_device *pdev)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 13/25] media: venus: hfi: Add a 6xx boot logic
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (11 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 12/25] media: venus: core: Hook to V6 base registers when appropriate Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 14/25] media: venus: hfi: Add 6xx interrupt support Bryan O'Donoghue
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

This patch adds a 6xx specific boot logic. The goal is to share as much
code as possible between 3xx, 4xx and 6xx silicon.

We need to do a different write to WRAPPER_INTR_MASK with an additional
write to CPU_CS_H2XSOFTINTEN_V6 and CPU_CS_X2RPMh_V6.

The other writes are the same for 6xx and non-6xx silicon albeit at
different absolute relative locations to the base of the venus address
space.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index f95cdd3d530c..5f9c8aa84cd0 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -442,14 +442,21 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 {
 	struct device *dev = hdev->core->dev;
 	static const unsigned int max_tries = 100;
-	u32 ctrl_status = 0;
+	u32 ctrl_status = 0, mask_val;
 	unsigned int count = 0;
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
 	int ret = 0;
 
 	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
-	writel(WRAPPER_INTR_MASK_A2HVCODEC_MASK, wrapper_base + WRAPPER_INTR_MASK);
+	if (IS_V6(hdev->core)) {
+		mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);
+		mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |
+			      WRAPPER_INTR_MASK_A2HCPU_MASK);
+	} else {
+		mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK;
+	}
+	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
 	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
 	while (!ctrl_status && count < max_tries) {
@@ -467,6 +474,9 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	if (count >= max_tries)
 		ret = -ETIMEDOUT;
 
+	if (IS_V6(hdev->core))
+		writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6);
+
 	return ret;
 }
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 14/25] media: venus: hfi: Add 6xx interrupt support
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (12 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 13/25] media: venus: hfi: Add a 6xx boot logic Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 15/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx Bryan O'Donoghue
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

This commit adds 6xx specific interrupt support, some register offsets and
bitmasks differ from 4xx, which we account for in this commit.

[bod: Added commit log. Moved register definition into commit]

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 32 +++++++++++++------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 5f9c8aa84cd0..09fc81da0645 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -359,8 +359,14 @@ static void venus_set_registers(struct venus_hfi_device *hdev)
 static void venus_soft_int(struct venus_hfi_device *hdev)
 {
 	void __iomem *cpu_ic_base = hdev->core->cpu_ic_base;
+	u32 clear_bit;
 
-	writel(BIT(CPU_IC_SOFTINT_H2A_SHIFT), cpu_ic_base + CPU_IC_SOFTINT);
+	if (IS_V6(hdev->core))
+		clear_bit = BIT(CPU_IC_SOFTINT_H2A_SHIFT_V6);
+	else
+		clear_bit = BIT(CPU_IC_SOFTINT_H2A_SHIFT);
+
+	writel(clear_bit, cpu_ic_base + CPU_IC_SOFTINT);
 }
 
 static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev,
@@ -474,8 +480,10 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	if (count >= max_tries)
 		ret = -ETIMEDOUT;
 
-	if (IS_V6(hdev->core))
+	if (IS_V6(hdev->core)) {
+		writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6);
 		writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6);
+	}
 
 	return ret;
 }
@@ -1061,14 +1069,20 @@ static irqreturn_t venus_isr(struct venus_core *core)
 		return IRQ_NONE;
 
 	status = readl(wrapper_base + WRAPPER_INTR_STATUS);
-
-	if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
-	    status & WRAPPER_INTR_STATUS_A2HWD_MASK ||
-	    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
-		hdev->irq_status = status;
-
+	if (IS_V6(core)) {
+		if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
+		    status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 ||
+		    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
+			hdev->irq_status = status;
+	} else {
+		if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
+		    status & WRAPPER_INTR_STATUS_A2HWD_MASK ||
+		    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
+			hdev->irq_status = status;
+	}
 	writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR);
-	writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
+	if (!IS_V6(core))
+		writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
 
 	return IRQ_WAKE_THREAD;
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 15/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (13 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 14/25] media: venus: hfi: Add 6xx interrupt support Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 16/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Bryan O'Donoghue
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

On 6xx we should read wrapper cpu status from the wrapper TZ register set.

Co-developed-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Co-developed-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 09fc81da0645..dabff8654f97 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -1472,10 +1472,14 @@ static int venus_suspend_1xx(struct venus_core *core)
 static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
 {
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	void __iomem *wrapper_tz_base = hdev->core->wrapper_tz_base;
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
+	if (IS_V6(hdev->core))
+		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
+	else
+		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
 	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 
 	if (cpu_status & WRAPPER_CPU_STATUS_WFI &&
@@ -1488,10 +1492,14 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
 static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev)
 {
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
+	void __iomem *wrapper_tz_base = hdev->core->wrapper_tz_base;
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
+	if (IS_V6(hdev->core))
+		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
+	else
+		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
 	ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 
 	if (cpu_status & WRAPPER_CPU_STATUS_WFI &&
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 16/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (14 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 15/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 17/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops Bryan O'Donoghue
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia, Dikshita Agarwal

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>
---
 drivers/media/platform/qcom/venus/helpers.c   | 5 ++---
 drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--
 drivers/media/platform/qcom/venus/vdec.c      | 6 +++---
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 76ece2ff8d39..2515a2225614 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -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);
@@ -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);
diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index dabff8654f97..24cf20f76e7f 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -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);
@@ -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);
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index e4dc97f00fc3..84c16f33e01b 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -662,8 +662,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,
@@ -714,7 +714,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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 17/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (15 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 16/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic Bryan O'Donoghue
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

At this time there is no need to differentiate between the two, we can
reuse the 4xx pm ops callback structure for 6xx.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index ea08b4d71e39..f163526c3f83 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -1119,6 +1119,7 @@ const struct venus_pm_ops *venus_pm_get(enum hfi_version version)
 	case HFI_VERSION_3XX:
 		return &pm_ops_v3;
 	case HFI_VERSION_4XX:
+	case HFI_VERSION_6XX:
 		return &pm_ops_v4;
 	}
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (16 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 17/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-25  7:29   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control Bryan O'Donoghue
                   ` (6 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

This patch takes the downstream AXI halt routine and applies it when
IS_V6() is true.

bod: Converted to readl_poll_timeout()
     Converted LPI update timeout to dev_dbg. In practice this register
     never appears to update with the value 0x07. Discussing with contacts
     in qcom video team, this toggle only pertains to low-power mode.
     Keeping the write for the sake of fidelity with downstream.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 24cf20f76e7f..01c100db07d3 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -541,10 +541,55 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
 {
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
 	void __iomem *vbif_base = hdev->core->vbif_base;
+	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
+	void __iomem *aon_base = hdev->core->aon_base;
 	struct device *dev = hdev->core->dev;
 	u32 val;
+	u32 mask_val;
 	int ret;
 
+	if (IS_V6(hdev->core)) {
+		writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
+
+		writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
+		ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS,
+					 val,
+					 val & BIT(0),
+					 POLL_INTERVAL_US,
+					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
+		if (ret) {
+			dev_err(dev, "NOC not in qaccept status %x\n", val);
+			return -ETIMEDOUT;
+		}
+
+		/* HPG 6.1.2 Step 3, debug bridge to low power */
+		mask_val = (BIT(2) | BIT(1) | BIT(0));
+		writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6);
+
+		ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6,
+					 val,
+					 (val & mask_val) == mask_val,
+					 POLL_INTERVAL_US,
+					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
+
+		if (ret)
+			dev_dbg(dev, "DBLP Set: status %x\n", val);
+
+		/* HPG 6.1.2 Step 4, debug bridge to lpi release */
+		writel(0x00, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6);
+		ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6,
+					 val,
+					 val == 0,
+					 POLL_INTERVAL_US,
+					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
+
+		if (ret) {
+			dev_err(dev, "DBLP Release: lpi_status %x\n", val);
+			return -ETIMEDOUT;
+		}
+		return 0;
+	}
+
 	if (IS_V4(hdev->core)) {
 		val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT);
 		val |= WRAPPER_CPU_AXI_HALT_HALT;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (17 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx Bryan O'Donoghue
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

When in vcodec_control_v4() on the 4xx path we select between one of two
vcodec cores to toggle power control bits. In 6xx there is only one core
which offsets the relevant control registers to a slightly different
address.

This patch accounts for the address offset for 6xx silicon.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index f163526c3f83..9ca90632c60e 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -397,7 +397,10 @@ static int vcodec_control_v4(struct venus_core *core, u32 coreid, bool enable)
 	u32 val;
 	int ret;
 
-	if (coreid == VIDC_CORE_ID_1) {
+	if (IS_V6(core)) {
+		ctrl = core->wrapper_base + WRAPPER_CORE_POWER_CONTROL_V6;
+		stat = core->wrapper_base + WRAPPER_CORE_POWER_STATUS_V6;
+	} else if (coreid == VIDC_CORE_ID_1) {
 		ctrl = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL;
 		stat = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_STATUS;
 	} else {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (18 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6 Bryan O'Donoghue
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

Do not toggle the WRAPPER_A9SS_SW_RESET on 6xx.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/firmware.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index f9170f596849..a7ebe8de2812 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -53,10 +53,12 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
 		return ret;
 	}
 
-	if (resume)
+	if (resume) {
 		venus_reset_cpu(core);
-	else
-		writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
+	} else {
+		if (!IS_V6(core))
+			writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
+	}
 
 	return 0;
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (19 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-25  7:57   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Bryan O'Donoghue
                   ` (3 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

- Internal buffers required by v6 are different than v4,
  add new list of internal buffers for v6.
- Differentiate encoder/decoder buffers for 6xx

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/helpers.c   | 23 ++++++++++++++++++-
 .../media/platform/qcom/venus/hfi_helper.h    |  9 +++++---
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 2515a2225614..f0413236a56f 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -279,13 +279,34 @@ static const unsigned int intbuf_types_4xx[] = {
 	HFI_BUFFER_INTERNAL_PERSIST_1,
 };
 
+static const unsigned int intbuf_types_6xx_enc[] = {
+	HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_6XX),
+	HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_6XX),
+	HFI_BUFFER_INTERNAL_SCRATCH_2(HFI_VERSION_6XX),
+	HFI_BUFFER_INTERNAL_PERSIST,
+};
+
+static const unsigned int intbuf_types_6xx_dec[] = {
+	HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_6XX),
+	HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_6XX),
+	HFI_BUFFER_INTERNAL_PERSIST_1,
+};
+
 int venus_helper_intbufs_alloc(struct venus_inst *inst)
 {
 	const unsigned int *intbuf;
 	size_t arr_sz, i;
 	int ret;
 
-	if (IS_V4(inst->core)) {
+	if (IS_V6(inst->core)) {
+		if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
+			arr_sz = ARRAY_SIZE(intbuf_types_6xx_dec);
+			intbuf = intbuf_types_6xx_dec;
+		} else {
+			arr_sz = ARRAY_SIZE(intbuf_types_6xx_enc);
+			intbuf = intbuf_types_6xx_enc;
+		}
+	} else if (IS_V4(inst->core)) {
 		arr_sz = ARRAY_SIZE(intbuf_types_4xx);
 		intbuf = intbuf_types_4xx;
 	} else {
diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
index 6b524c7cde5f..f367f43c9fb7 100644
--- a/drivers/media/platform/qcom/venus/hfi_helper.h
+++ b/drivers/media/platform/qcom/venus/hfi_helper.h
@@ -395,11 +395,14 @@
 #define HFI_BUFFER_INTERNAL_PERSIST		0x4
 #define HFI_BUFFER_INTERNAL_PERSIST_1		0x5
 #define HFI_BUFFER_INTERNAL_SCRATCH(ver)	\
-	(((ver) == HFI_VERSION_4XX) ? 0x6 : 0x1000001)
+	(((ver) == HFI_VERSION_4XX ||		\
+	(ver) == HFI_VERSION_6XX) ? 0x6 : 0x1000001)
 #define HFI_BUFFER_INTERNAL_SCRATCH_1(ver)	\
-	(((ver) == HFI_VERSION_4XX) ? 0x7 : 0x1000005)
+	(((ver) == HFI_VERSION_4XX ||		\
+	(ver) == HFI_VERSION_6XX) ? 0x7 : 0x1000005)
 #define HFI_BUFFER_INTERNAL_SCRATCH_2(ver)	\
-	(((ver) == HFI_VERSION_4XX) ? 0x8 : 0x1000006)
+	(((ver) == HFI_VERSION_4XX ||		\
+	(ver) == HFI_VERSION_6XX) ? 0x8 : 0x1000006)
 #define HFI_BUFFER_EXTRADATA_INPUT(ver)		\
 	(((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002)
 #define HFI_BUFFER_EXTRADATA_OUTPUT(ver)	\
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (20 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6 Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-25  8:00   ` Stanimir Varbanov
  2021-02-22 16:02 ` [PATCH 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count Bryan O'Donoghue
                   ` (2 subsequent siblings)
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

Set actual plane alignments to FW with
HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO to calculate
correct buffer size.

bod: Fixed fall-through error in pkt_session_set_property_6xx() switch

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/helpers.c  | 21 ++++++++++++++++++++
 drivers/media/platform/qcom/venus/helpers.h  |  1 +
 drivers/media/platform/qcom/venus/hfi_cmds.c | 13 ++++++++++++
 drivers/media/platform/qcom/venus/vdec.c     |  4 ++++
 4 files changed, 39 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index f0413236a56f..49c52ef1084a 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -1113,6 +1113,27 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
 }
 EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
 
+int venus_helper_set_format_constraints(struct venus_inst *inst)
+{
+	const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO;
+	struct hfi_uncompressed_plane_actual_constraints_info pconstraint;
+
+	pconstraint.buffer_type = HFI_BUFFER_OUTPUT2;
+	pconstraint.num_planes = 2;
+	pconstraint.plane_format[0].stride_multiples = 128;
+	pconstraint.plane_format[0].max_stride = 8192;
+	pconstraint.plane_format[0].min_plane_buffer_height_multiple = 32;
+	pconstraint.plane_format[0].buffer_alignment = 256;
+
+	pconstraint.plane_format[1].stride_multiples = 128;
+	pconstraint.plane_format[1].max_stride = 8192;
+	pconstraint.plane_format[1].min_plane_buffer_height_multiple = 16;
+	pconstraint.plane_format[1].buffer_alignment = 256;
+
+	return hfi_session_set_property(inst, ptype, &pconstraint);
+}
+EXPORT_SYMBOL_GPL(venus_helper_set_format_constraints);
+
 int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
 			      unsigned int output_bufs,
 			      unsigned int output2_bufs)
diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
index 351093845499..98106e6eee85 100644
--- a/drivers/media/platform/qcom/venus/helpers.h
+++ b/drivers/media/platform/qcom/venus/helpers.h
@@ -33,6 +33,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
 				       unsigned int width, unsigned int height,
 				       u32 buftype);
 int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
+int venus_helper_set_format_constraints(struct venus_inst *inst);
 int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
 			      unsigned int output_bufs,
 			      unsigned int output2_bufs);
diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
index 4f7565834469..cc282b0df8c3 100644
--- a/drivers/media/platform/qcom/venus/hfi_cmds.c
+++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
@@ -1249,6 +1249,19 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt,
 	pkt->data[0] = ptype;
 
 	switch (ptype) {
+	case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: {
+		struct hfi_uncompressed_plane_actual_constraints_info *in = pdata;
+		struct hfi_uncompressed_plane_actual_constraints_info *info = prop_data;
+
+		info->buffer_type = in->buffer_type;
+		info->num_planes = in->num_planes;
+		info->plane_format[0] = in->plane_format[0];
+		if (in->num_planes > 1)
+			info->plane_format[1] = in->plane_format[1];
+
+		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info);
+		break;
+	}
 	case HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY: {
 		struct hfi_heic_frame_quality *in = pdata, *cq = prop_data;
 
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 84c16f33e01b..88ac40ce12e6 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -698,6 +698,10 @@ static int vdec_output_conf(struct venus_inst *inst)
 	if (ret)
 		return ret;
 
+	ret = venus_helper_set_format_constraints(inst);
+	if (ret)
+		return ret;
+
 	if (inst->dpb_fmt) {
 		ret = venus_helper_set_multistream(inst, false, true);
 		if (ret)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count.
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (21 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:02 ` [PATCH 24/25] media: venus: helper: Decide work mode Bryan O'Donoghue
  2021-02-22 16:03 ` [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue Bryan O'Donoghue
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

Presently, minimum buffer count for output buffers for h264 &
hevc codec is kept as 8 which might not be sufficient for
few use cases so increasing the value to 18.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
index d43d1a53e72d..075d9546b15e 100644
--- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
+++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
@@ -1159,7 +1159,7 @@ static int output_buffer_count(u32 session_type, u32 codec)
 		case V4L2_PIX_FMT_H264:
 		case V4L2_PIX_FMT_HEVC:
 		default:
-			output_min_count = 8;
+			output_min_count = 18;
 			break;
 		}
 	} else {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 24/25] media: venus: helper: Decide work mode
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (22 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count Bryan O'Donoghue
@ 2021-02-22 16:02 ` Bryan O'Donoghue
  2021-02-22 16:03 ` [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue Bryan O'Donoghue
  24 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:02 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Dikshita Agarwal <dikshita@codeaurora.org>

Decide work mode for encoder and decoder based on different
use-cases.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/helpers.c | 31 ++++++++++++++++++++-
 drivers/media/platform/qcom/venus/helpers.h |  2 +-
 drivers/media/platform/qcom/venus/vdec.c    |  2 +-
 drivers/media/platform/qcom/venus/venc.c    |  2 +-
 4 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 49c52ef1084a..49f2667ac5fa 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -18,6 +18,9 @@
 #include "hfi_platform.h"
 #include "hfi_parser.h"
 
+#define NUM_MBS_720P	(((1280 + 15) >> 4) * ((720 + 15) >> 4))
+#define NUM_MBS_4K	(((4096 + 15) >> 4) * ((2304 + 15) >> 4))
+
 struct intbuf {
 	struct list_head list;
 	u32 type;
@@ -1100,14 +1103,40 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
 }
 EXPORT_SYMBOL_GPL(venus_helper_set_output_resolution);
 
-int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
+static u32 venus_helper_get_work_mode(struct venus_inst *inst)
+{
+	u32 mode;
+	u32 num_mbs;
+
+	mode = VIDC_WORK_MODE_2;
+	if (IS_V6(inst->core)) {
+		if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
+			num_mbs = (ALIGN(inst->height, 16) * ALIGN(inst->width, 16)) / 256;
+			if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
+			    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
+			    num_mbs <= NUM_MBS_720P)
+				mode = VIDC_WORK_MODE_1;
+		} else {
+			num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256;
+			if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
+			    num_mbs <= NUM_MBS_4K)
+				mode = VIDC_WORK_MODE_1;
+		}
+	}
+
+	return mode;
+}
+
+int venus_helper_set_work_mode(struct venus_inst *inst)
 {
 	const u32 ptype = HFI_PROPERTY_PARAM_WORK_MODE;
 	struct hfi_video_work_mode wm;
+	u32 mode;
 
 	if (!IS_V4(inst->core) && !IS_V6(inst->core))
 		return 0;
 
+	mode = venus_helper_get_work_mode(inst);
 	wm.video_work_mode = mode;
 	return hfi_session_set_property(inst, ptype, &wm);
 }
diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
index 98106e6eee85..e6269b4be3af 100644
--- a/drivers/media/platform/qcom/venus/helpers.h
+++ b/drivers/media/platform/qcom/venus/helpers.h
@@ -32,7 +32,7 @@ int venus_helper_set_input_resolution(struct venus_inst *inst,
 int venus_helper_set_output_resolution(struct venus_inst *inst,
 				       unsigned int width, unsigned int height,
 				       u32 buftype);
-int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
+int venus_helper_set_work_mode(struct venus_inst *inst);
 int venus_helper_set_format_constraints(struct venus_inst *inst);
 int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
 			      unsigned int output_bufs,
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 88ac40ce12e6..903443a7a757 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -647,7 +647,7 @@ static int vdec_output_conf(struct venus_inst *inst)
 	u32 ptype;
 	int ret;
 
-	ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2);
+	ret = venus_helper_set_work_mode(inst);
 	if (ret)
 		return ret;
 
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 6976ed553647..4b5ab0c790c9 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -550,7 +550,7 @@ static int venc_set_properties(struct venus_inst *inst)
 	u32 profile, level;
 	int ret;
 
-	ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2);
+	ret = venus_helper_set_work_mode(inst);
 	if (ret)
 		return ret;
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue
  2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
                   ` (23 preceding siblings ...)
  2021-02-22 16:02 ` [PATCH 24/25] media: venus: helper: Decide work mode Bryan O'Donoghue
@ 2021-02-22 16:03 ` Bryan O'Donoghue
  2021-02-26 10:25   ` Stanimir Varbanov
  24 siblings, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-02-22 16:03 UTC (permalink / raw)
  To: stanimir.varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: bryan.odonoghue, dikshita, jonathan, vgarodia

From: Stanimir Varbanov <stanimir.varbanov@linaro.org>

Fixes an issue when issuing a stop command to the controller, negating the
following firmware error.

"SFR message from FW: Exception: TID = Unknown IP = 0x3b7dc FA = 0x0
 cause = 0x6"

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +-
 drivers/media/platform/qcom/venus/vdec.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
index cc282b0df8c3..0a32bb44506c 100644
--- a/drivers/media/platform/qcom/venus/hfi_cmds.c
+++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
@@ -254,7 +254,7 @@ int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,
 int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt,
 			    void *cookie, struct hfi_frame_data *in_frame)
 {
-	if (!cookie || !in_frame->device_addr)
+	if (!cookie)
 		return -EINVAL;
 
 	pkt->shdr.hdr.size = sizeof(*pkt);
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 903443a7a757..9fbff40c4568 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -515,7 +515,7 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd)
 
 		fdata.buffer_type = HFI_BUFFER_INPUT;
 		fdata.flags |= HFI_BUFFERFLAG_EOS;
-		fdata.device_addr = 0xdeadb000;
+		fdata.device_addr = 0;
 
 		ret = hfi_session_process_buf(inst, &fdata);
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* Re: [PATCH 01/25] media: venus: Update v6 buffer descriptors
  2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
@ 2021-02-23 13:11   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:11 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> Currently hfi_platform_v6.c adds a bunch of capability parameters.
> Reviewing downstream we can see a number of these need to be updated.
> 
> techpack/video/msm/vidc/msm_vidc_platform.c :: kona_capabilities[]
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  .../platform/qcom/venus/hfi_platform_v6.c     | 138 +++++++++---------
>  1 file changed, 69 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
> index 2278be13cb90..6fa80353bcce 100644
> --- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c
> +++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
> @@ -9,15 +9,15 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_H264,
>  	.domain = VIDC_SESSION_TYPE_DEC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 5760, 1},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 5760, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
>  	/* ((5760 * 2880) / 256) */
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 36, 64800, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 200000000, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},

s/22000000/220000000

>  	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
>  	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 36, 1958400, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
>  	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.num_caps = 9,
>  	.pl[0] = {HFI_H264_PROFILE_BASELINE, HFI_H264_LEVEL_52},
> @@ -35,15 +35,15 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_HEVC,
>  	.domain = VIDC_SESSION_TYPE_DEC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> -	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
> -	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},

s/22000000/220000000

> +	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
> +	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
>  	.num_caps = 10,
>  	.pl[0] = {HFI_HEVC_PROFILE_MAIN, HFI_HEVC_LEVEL_6 | HFI_HEVC_TIER_HIGH0},
> @@ -61,15 +61,15 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_VP8,
>  	.domain = VIDC_SESSION_TYPE_DEC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> -	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
> -	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 100000000, 1},
> +	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
> +	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
>  	.num_caps = 10,
>  	.pl[0] = {HFI_VPX_PROFILE_MAIN, HFI_VPX_LEVEL_VERSION_0},
> @@ -86,15 +86,15 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_VP9,
>  	.domain = VIDC_SESSION_TYPE_DEC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> -	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
> -	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},

s/22000000/220000000

> +	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
> +	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1},
>  	.num_caps = 10,
>  	.pl[0] = {HFI_VP9_PROFILE_P0, 200},
> @@ -112,15 +112,15 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_MPEG2,
>  	.domain = VIDC_SESSION_TYPE_DEC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 1920, 1},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 1920, 1},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 8160, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1920, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1},
>  	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 40000000, 1},
> -	.caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1},
> -	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 244800, 1},
> +	.caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1},
> +	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},

this should be 64 - 244800.

>  	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 30, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 1, 1},
>  	.num_caps = 10,
>  	.pl[0] = {HFI_MPEG2_PROFILE_SIMPLE, HFI_MPEG2_LEVEL_H14},
> @@ -135,21 +135,21 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_H264,
>  	.domain = VIDC_SESSION_TYPE_ENC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 22000000, 1},

s/22000000/220000000

>  	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
>  	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
> -	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1},
> -	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1},
> +	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 6, 1},
> +	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
>  	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1},
>  	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
> -	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
> +	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 6, 1},
>  	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1},
>  	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1},
>  	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1},
> @@ -172,24 +172,24 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_HEVC,
>  	.domain = VIDC_SESSION_TYPE_ENC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 16},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 16},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 160000000, 1},
>  	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
>  	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1},
> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
>  	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1},
> -	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1},
> +	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
>  	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 32, 32, 1},
>  	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
>  	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
> -	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 63, 1},
> -	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 63, 1},
> -	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 63, 1},
> +	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1},
> +	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1},
> +	.caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1},
>  	.caps[18] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 2, 1},
>  	.caps[19] = {HFI_CAPABILITY_RATE_CONTROL_MODES, 0x1000001, 0x1000005, 1},
>  	.caps[20] = {HFI_CAPABILITY_COLOR_SPACE_CONVERSION, 0, 2, 1},
> @@ -209,20 +209,20 @@ static const struct hfi_plat_caps caps[] = {
>  	.codec = HFI_VIDEO_CODEC_VP8,
>  	.domain = VIDC_SESSION_TYPE_ENC,
>  	.cap_bufs_mode_dynamic = true,
> -	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16},
> -	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16},
> -	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1},
> -	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1},
> +	.caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 16},
> +	.caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 16},
> +	.caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1},
> +	.caps[3] = {HFI_CAPABILITY_BITRATE, 1, 74000000, 1},
>  	.caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1},
>  	.caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1},
> -	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1},
> -	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 240, 1},
> -	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1},
> +	.caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1},
> +	.caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1},

s/120/60

> +	.caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1},
>  	.caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1},
>  	.caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 3, 1},
>  	.caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1},
>  	.caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1},
> -	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1},
> +	.caps[13] = {HFI_CAPABILITY_BFRAME, 0, 0, 1},

>  	.caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1},
>  	.caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 127, 1},
>  	.caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 127, 1},
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-02-22 16:02 ` [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot Bryan O'Donoghue
@ 2021-02-23 13:25   ` Stanimir Varbanov
  2021-03-06 15:01     ` Stanimir Varbanov
  0 siblings, 1 reply; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:25 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> From: Dikshita Agarwal <dikshita@codeaurora.org>
> 
> Vote for min clk frequency for core clks during prepare and enable clocks
> at boot sequence. Without this the controller clock runs at very low value
> (9.6MHz) which is not sufficient to boot venus.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
> index 4f5d42662963..767cb00d4b46 100644
> --- a/drivers/media/platform/qcom/venus/pm_helpers.c
> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c
> @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
>  static int core_clks_enable(struct venus_core *core)
>  {
>  	const struct venus_resources *res = core->res;
> +	const struct freq_tbl *freq_tbl = NULL;
> +	unsigned int freq_tbl_size = 0;
> +	unsigned long freq = 0;

no need to initialize to zero.

>  	unsigned int i;
>  	int ret;
>  
> +	freq_tbl = core->res->freq_tbl;
> +	freq_tbl_size = core->res->freq_tbl_size;

could you initialize those at the variables declaration?

> +	if (!freq_tbl)
> +		return -EINVAL;
> +
> +	freq = freq_tbl[freq_tbl_size - 1].freq;
> +
>  	for (i = 0; i < res->clks_num; i++) {
> +		ret = clk_set_rate(core->clks[i], freq);

I'm not sure that we have to set the rate for all core->clks[i] ?

> +		if (ret)
> +			goto err;
> +
>  		ret = clk_prepare_enable(core->clks[i]);
>  		if (ret)
>  			goto err;
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 05/25] media: venus: core: Add io base variables for each block
  2021-02-22 16:02 ` [PATCH 05/25] media: venus: core: Add io base variables for each block Bryan O'Donoghue
@ 2021-02-23 13:28   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:28 UTC (permalink / raw)
  To: Bryan O'Donoghue, stanimir.varbanov, agross, bjorn.andersson,
	mchehab, linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> New silicon means that the pre-determined offsets we have been using
> in this driver no longer hold. Existing blocks of registers can exist at
> different offsets relative to the IO base address.
> 
> This commit adds a routine to assign the IO base hooks a subsequent commit
> will convert from absolute to relative addressing.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/core.c | 12 ++++++++++++
>  drivers/media/platform/qcom/venus/core.h | 10 ++++++++++
>  2 files changed, 22 insertions(+)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>


-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing
  2021-02-22 16:02 ` [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing Bryan O'Donoghue
@ 2021-02-23 13:31   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:31 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> An upcoming silicon change places a number of existing blocks within the
> Venus at different relative offsets to the base address of IO region.
> 
> In order to handle this difference this patch changes the address offsets
> of the registers to function as offsets relative to the relevant sub-block
> of registers within the IO region not the base address of the IO region.
> 
> As a result of this change venus_readl() and venus_writel() are deleted.
> 
> Co-developed-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/firmware.c  | 28 +++----
>  drivers/media/platform/qcom/venus/hfi_venus.c | 82 ++++++++++---------
>  .../media/platform/qcom/venus/hfi_venus_io.h  | 80 +++++++++---------
>  .../media/platform/qcom/venus/pm_helpers.c    | 12 +--
>  4 files changed, 105 insertions(+), 97 deletions(-)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware
  2021-02-22 16:02 ` [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware Bryan O'Donoghue
@ 2021-02-23 13:32   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:32 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> This commit defines a range of new base addresses for already defined
> blocks.
> 
> - CPU_BASE_V6
> - CPU_CS_BASE_V6
> - CPU_IC_BASE_V6
> - WRAPPER_BASE_V6
> 
> The base addresses of the blocks are slightly different for 6xx but, aside
> from that are layout and bit compatible.
> 
> New 6xx specific block addresses will be added in separate commits.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/hfi_venus_io.h | 4 ++++
>  1 file changed, 4 insertions(+)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data
  2021-02-22 16:02 ` [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data Bryan O'Donoghue
@ 2021-02-23 13:48   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-23 13:48 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia

Could you move this patch at the end of the series where the support for
v6xx will be fully functional?

On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> Adds an sm8250 compatible binding to the venus core.
> 
> Co-developed-by: Jonathan Marek <jonathan@marek.ca>
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> Co-developed-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/core.c | 54 ++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic
  2021-02-22 16:02 ` [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic Bryan O'Donoghue
@ 2021-02-25  7:29   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-25  7:29 UTC (permalink / raw)
  To: Bryan O'Donoghue, stanimir.varbanov, agross, bjorn.andersson,
	mchehab, linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> From: Dikshita Agarwal <dikshita@codeaurora.org>
> 
> This patch takes the downstream AXI halt routine and applies it when
> IS_V6() is true.
> 
> bod: Converted to readl_poll_timeout()
>      Converted LPI update timeout to dev_dbg. In practice this register
>      never appears to update with the value 0x07. Discussing with contacts
>      in qcom video team, this toggle only pertains to low-power mode.
>      Keeping the write for the sake of fidelity with downstream.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/hfi_venus.c | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
> index 24cf20f76e7f..01c100db07d3 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
> @@ -541,10 +541,55 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
>  {
>  	void __iomem *wrapper_base = hdev->core->wrapper_base;
>  	void __iomem *vbif_base = hdev->core->vbif_base;
> +	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
> +	void __iomem *aon_base = hdev->core->aon_base;
>  	struct device *dev = hdev->core->dev;
>  	u32 val;
> +	u32 mask_val;
>  	int ret;
>  
> +	if (IS_V6(hdev->core)) {
> +		writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
> +
> +		writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
> +		ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS,
> +					 val,
> +					 val & BIT(0),
> +					 POLL_INTERVAL_US,
> +					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
> +		if (ret) {
> +			dev_err(dev, "NOC not in qaccept status %x\n", val);

Could you drop this error msg. I don't see any valuable information in it.

> +			return -ETIMEDOUT;
> +		}
> +
> +		/* HPG 6.1.2 Step 3, debug bridge to low power */

This comment does not add any information, please drop it.

> +		mask_val = (BIT(2) | BIT(1) | BIT(0));
> +		writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6);
> +
> +		ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6,
> +					 val,
> +					 (val & mask_val) == mask_val,
> +					 POLL_INTERVAL_US,
> +					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
> +
> +		if (ret)
> +			dev_dbg(dev, "DBLP Set: status %x\n", val);

Do we need this as well? From what I can see this always timeouts and
increase the time of module loading.

> +
> +		/* HPG 6.1.2 Step 4, debug bridge to lpi release */

ditto

> +		writel(0x00, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6);
> +		ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6,
> +					 val,
> +					 val == 0,
> +					 POLL_INTERVAL_US,
> +					 VBIF_AXI_HALT_ACK_TIMEOUT_US);
> +
> +		if (ret) {
> +			dev_err(dev, "DBLP Release: lpi_status %x\n", val);
> +			return -ETIMEDOUT;
> +		}
> +		return 0;
> +	}
> +
>  	if (IS_V4(hdev->core)) {
>  		val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT);
>  		val |= WRAPPER_CPU_AXI_HALT_HALT;
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6
  2021-02-22 16:02 ` [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6 Bryan O'Donoghue
@ 2021-02-25  7:57   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-25  7:57 UTC (permalink / raw)
  To: Bryan O'Donoghue, stanimir.varbanov, agross, bjorn.andersson,
	mchehab, linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> From: Dikshita Agarwal <dikshita@codeaurora.org>
> 
> - Internal buffers required by v6 are different than v4,
>   add new list of internal buffers for v6.
> - Differentiate encoder/decoder buffers for 6xx
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c   | 23 ++++++++++++++++++-
>  .../media/platform/qcom/venus/hfi_helper.h    |  9 +++++---
>  2 files changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 2515a2225614..f0413236a56f 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -279,13 +279,34 @@ static const unsigned int intbuf_types_4xx[] = {
>  	HFI_BUFFER_INTERNAL_PERSIST_1,
>  };
>  
> +static const unsigned int intbuf_types_6xx_enc[] = {
> +	HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_6XX),
> +	HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_6XX),
> +	HFI_BUFFER_INTERNAL_SCRATCH_2(HFI_VERSION_6XX),
> +	HFI_BUFFER_INTERNAL_PERSIST,
> +};
> +
> +static const unsigned int intbuf_types_6xx_dec[] = {
> +	HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_6XX),
> +	HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_6XX),
> +	HFI_BUFFER_INTERNAL_PERSIST_1,
> +};
> +

This division of decoder and encoder internal buffers smells like a
problem in hfi_plat_bufs_v6.c. I think we can modify the extracting of
buffer requirements in hfi_plat_bufs_v6.c so that they return
buffer_size as zero for internal buffer types which are not applicable
to the current session type. After this this intbuf_type_6xx will
combine both session types and will look like v1 and v4.

>  int venus_helper_intbufs_alloc(struct venus_inst *inst)
>  {
>  	const unsigned int *intbuf;
>  	size_t arr_sz, i;
>  	int ret;
>  
> -	if (IS_V4(inst->core)) {
> +	if (IS_V6(inst->core)) {
> +		if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
> +			arr_sz = ARRAY_SIZE(intbuf_types_6xx_dec);
> +			intbuf = intbuf_types_6xx_dec;
> +		} else {
> +			arr_sz = ARRAY_SIZE(intbuf_types_6xx_enc);
> +			intbuf = intbuf_types_6xx_enc;
> +		}
> +	} else if (IS_V4(inst->core)) {
>  		arr_sz = ARRAY_SIZE(intbuf_types_4xx);
>  		intbuf = intbuf_types_4xx;
>  	} else {
> diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
> index 6b524c7cde5f..f367f43c9fb7 100644
> --- a/drivers/media/platform/qcom/venus/hfi_helper.h
> +++ b/drivers/media/platform/qcom/venus/hfi_helper.h
> @@ -395,11 +395,14 @@
>  #define HFI_BUFFER_INTERNAL_PERSIST		0x4
>  #define HFI_BUFFER_INTERNAL_PERSIST_1		0x5
>  #define HFI_BUFFER_INTERNAL_SCRATCH(ver)	\
> -	(((ver) == HFI_VERSION_4XX) ? 0x6 : 0x1000001)
> +	(((ver) == HFI_VERSION_4XX ||		\
> +	(ver) == HFI_VERSION_6XX) ? 0x6 : 0x1000001)
>  #define HFI_BUFFER_INTERNAL_SCRATCH_1(ver)	\
> -	(((ver) == HFI_VERSION_4XX) ? 0x7 : 0x1000005)
> +	(((ver) == HFI_VERSION_4XX ||		\
> +	(ver) == HFI_VERSION_6XX) ? 0x7 : 0x1000005)
>  #define HFI_BUFFER_INTERNAL_SCRATCH_2(ver)	\
> -	(((ver) == HFI_VERSION_4XX) ? 0x8 : 0x1000006)
> +	(((ver) == HFI_VERSION_4XX ||		\
> +	(ver) == HFI_VERSION_6XX) ? 0x8 : 0x1000006)
>  #define HFI_BUFFER_EXTRADATA_INPUT(ver)		\
>  	(((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002)
>  #define HFI_BUFFER_EXTRADATA_OUTPUT(ver)	\
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW
  2021-02-22 16:02 ` [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Bryan O'Donoghue
@ 2021-02-25  8:00   ` Stanimir Varbanov
  2021-03-12  2:58     ` Bryan O'Donoghue
  0 siblings, 1 reply; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-25  8:00 UTC (permalink / raw)
  To: Bryan O'Donoghue, stanimir.varbanov, agross, bjorn.andersson,
	mchehab, linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
> From: Dikshita Agarwal <dikshita@codeaurora.org>
> 
> Set actual plane alignments to FW with
> HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO to calculate
> correct buffer size.
> 
> bod: Fixed fall-through error in pkt_session_set_property_6xx() switch
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c  | 21 ++++++++++++++++++++
>  drivers/media/platform/qcom/venus/helpers.h  |  1 +
>  drivers/media/platform/qcom/venus/hfi_cmds.c | 13 ++++++++++++
>  drivers/media/platform/qcom/venus/vdec.c     |  4 ++++
>  4 files changed, 39 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index f0413236a56f..49c52ef1084a 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -1113,6 +1113,27 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
>  }
>  EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
>  
> +int venus_helper_set_format_constraints(struct venus_inst *inst)
> +{
> +	const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO;
> +	struct hfi_uncompressed_plane_actual_constraints_info pconstraint;
> +
> +	pconstraint.buffer_type = HFI_BUFFER_OUTPUT2;
> +	pconstraint.num_planes = 2;
> +	pconstraint.plane_format[0].stride_multiples = 128;
> +	pconstraint.plane_format[0].max_stride = 8192;
> +	pconstraint.plane_format[0].min_plane_buffer_height_multiple = 32;
> +	pconstraint.plane_format[0].buffer_alignment = 256;
> +
> +	pconstraint.plane_format[1].stride_multiples = 128;
> +	pconstraint.plane_format[1].max_stride = 8192;
> +	pconstraint.plane_format[1].min_plane_buffer_height_multiple = 16;
> +	pconstraint.plane_format[1].buffer_alignment = 256;
> +
> +	return hfi_session_set_property(inst, ptype, &pconstraint);

I wonder shouldn't we set this property for v6 only? Or mark this
property as not supported for v1 up to v4.  Otherwise, I would expect
regressions on the older v1 - v4.

> +}
> +EXPORT_SYMBOL_GPL(venus_helper_set_format_constraints);
> +
>  int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
>  			      unsigned int output_bufs,
>  			      unsigned int output2_bufs)
> diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
> index 351093845499..98106e6eee85 100644
> --- a/drivers/media/platform/qcom/venus/helpers.h
> +++ b/drivers/media/platform/qcom/venus/helpers.h
> @@ -33,6 +33,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
>  				       unsigned int width, unsigned int height,
>  				       u32 buftype);
>  int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
> +int venus_helper_set_format_constraints(struct venus_inst *inst);
>  int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
>  			      unsigned int output_bufs,
>  			      unsigned int output2_bufs);
> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
> index 4f7565834469..cc282b0df8c3 100644
> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c
> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
> @@ -1249,6 +1249,19 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt,
>  	pkt->data[0] = ptype;
>  
>  	switch (ptype) {
> +	case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: {
> +		struct hfi_uncompressed_plane_actual_constraints_info *in = pdata;
> +		struct hfi_uncompressed_plane_actual_constraints_info *info = prop_data;
> +
> +		info->buffer_type = in->buffer_type;
> +		info->num_planes = in->num_planes;
> +		info->plane_format[0] = in->plane_format[0];
> +		if (in->num_planes > 1)
> +			info->plane_format[1] = in->plane_format[1];
> +
> +		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info);
> +		break;
> +	}
>  	case HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY: {
>  		struct hfi_heic_frame_quality *in = pdata, *cq = prop_data;
>  
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 84c16f33e01b..88ac40ce12e6 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -698,6 +698,10 @@ static int vdec_output_conf(struct venus_inst *inst)
>  	if (ret)
>  		return ret;
>  
> +	ret = venus_helper_set_format_constraints(inst);
> +	if (ret)
> +		return ret;
> +
>  	if (inst->dpb_fmt) {
>  		ret = venus_helper_set_multistream(inst, false, true);
>  		if (ret)
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue
  2021-02-22 16:03 ` [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue Bryan O'Donoghue
@ 2021-02-26 10:25   ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-02-26 10:25 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/22/21 6:03 PM, Bryan O'Donoghue wrote:
> From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> 
> Fixes an issue when issuing a stop command to the controller, negating the
> following firmware error.
> 
> "SFR message from FW: Exception: TID = Unknown IP = 0x3b7dc FA = 0x0
>  cause = 0x6"
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +-
>  drivers/media/platform/qcom/venus/vdec.c     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
> index cc282b0df8c3..0a32bb44506c 100644
> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c
> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
> @@ -254,7 +254,7 @@ int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,
>  int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt,
>  			    void *cookie, struct hfi_frame_data *in_frame)
>  {
> -	if (!cookie || !in_frame->device_addr)
> +	if (!cookie)
>  		return -EINVAL;
>  
>  	pkt->shdr.hdr.size = sizeof(*pkt);
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 903443a7a757..9fbff40c4568 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -515,7 +515,7 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd)
>  
>  		fdata.buffer_type = HFI_BUFFER_INPUT;
>  		fdata.flags |= HFI_BUFFERFLAG_EOS;
> -		fdata.device_addr = 0xdeadb000;
> +		fdata.device_addr = 0;

This should be 0 for v6 only until we find some better way for this EOS
packet.

>  
>  		ret = hfi_session_process_buf(inst, &fdata);
>  
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-02-23 13:25   ` Stanimir Varbanov
@ 2021-03-06 15:01     ` Stanimir Varbanov
  2021-03-06 16:48       ` Bryan O'Donoghue
  2021-03-10 17:33       ` Bryan O'Donoghue
  0 siblings, 2 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-03-06 15:01 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 2/23/21 3:25 PM, Stanimir Varbanov wrote:
> 
> 
> On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
>> From: Dikshita Agarwal <dikshita@codeaurora.org>
>>
>> Vote for min clk frequency for core clks during prepare and enable clocks
>> at boot sequence. Without this the controller clock runs at very low value
>> (9.6MHz) which is not sufficient to boot venus.
>>
>> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> ---
>>  drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
>> index 4f5d42662963..767cb00d4b46 100644
>> --- a/drivers/media/platform/qcom/venus/pm_helpers.c
>> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c
>> @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
>>  static int core_clks_enable(struct venus_core *core)
>>  {
>>  	const struct venus_resources *res = core->res;
>> +	const struct freq_tbl *freq_tbl = NULL;
>> +	unsigned int freq_tbl_size = 0;
>> +	unsigned long freq = 0;
> 
> no need to initialize to zero.
> 
>>  	unsigned int i;
>>  	int ret;
>>  
>> +	freq_tbl = core->res->freq_tbl;
>> +	freq_tbl_size = core->res->freq_tbl_size;
> 
> could you initialize those at the variables declaration?
> 
>> +	if (!freq_tbl)
>> +		return -EINVAL;
>> +
>> +	freq = freq_tbl[freq_tbl_size - 1].freq;
>> +
>>  	for (i = 0; i < res->clks_num; i++) {
>> +		ret = clk_set_rate(core->clks[i], freq);
> 
> I'm not sure that we have to set the rate for all core->clks[i] ?

Confirmed. This produces regressions on db410c (I haven't tested on
other platforms yet).

> 
>> +		if (ret)
>> +			goto err;
>> +
>>  		ret = clk_prepare_enable(core->clks[i]);
>>  		if (ret)
>>  			goto err;
>>
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-03-06 15:01     ` Stanimir Varbanov
@ 2021-03-06 16:48       ` Bryan O'Donoghue
  2021-03-07 10:44         ` Stanimir Varbanov
  2021-03-10 17:33       ` Bryan O'Donoghue
  1 sibling, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-03-06 16:48 UTC (permalink / raw)
  To: Stanimir Varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: dikshita, jonathan, vgarodia

On 06/03/2021 15:01, Stanimir Varbanov wrote:
> Confirmed. This produces regressions on db410c (I haven't tested on
> other platforms yet).

db410c was broken for me on the reference branch prior to sm8250 
additions however AFAICT this change was fine on sdm845.

---
bod

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-03-06 16:48       ` Bryan O'Donoghue
@ 2021-03-07 10:44         ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-03-07 10:44 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mchehab,
	linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 3/6/21 6:48 PM, Bryan O'Donoghue wrote:
> On 06/03/2021 15:01, Stanimir Varbanov wrote:
>> Confirmed. This produces regressions on db410c (I haven't tested on
>> other platforms yet).
> 
> db410c was broken for me on the reference branch prior to sm8250
> additions however AFAICT this change was fine on sdm845.

I found this after I fixed db410c issues.

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-03-06 15:01     ` Stanimir Varbanov
  2021-03-06 16:48       ` Bryan O'Donoghue
@ 2021-03-10 17:33       ` Bryan O'Donoghue
  2021-03-10 22:02         ` Stanimir Varbanov
  1 sibling, 1 reply; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-03-10 17:33 UTC (permalink / raw)
  To: Stanimir Varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: dikshita, jonathan, vgarodia

On 06/03/2021 15:01, Stanimir Varbanov wrote:
> 
> 
> On 2/23/21 3:25 PM, Stanimir Varbanov wrote:
>>
>>
>> On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
>>> From: Dikshita Agarwal <dikshita@codeaurora.org>
>>>
>>> Vote for min clk frequency for core clks during prepare and enable clocks
>>> at boot sequence. Without this the controller clock runs at very low value
>>> (9.6MHz) which is not sufficient to boot venus.
>>>
>>> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
>>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>>> ---
>>>   drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++
>>>   1 file changed, 14 insertions(+)
>>>
>>> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
>>> index 4f5d42662963..767cb00d4b46 100644
>>> --- a/drivers/media/platform/qcom/venus/pm_helpers.c
>>> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c
>>> @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
>>>   static int core_clks_enable(struct venus_core *core)
>>>   {
>>>   	const struct venus_resources *res = core->res;
>>> +	const struct freq_tbl *freq_tbl = NULL;
>>> +	unsigned int freq_tbl_size = 0;
>>> +	unsigned long freq = 0;
>>
>> no need to initialize to zero.
>>
>>>   	unsigned int i;
>>>   	int ret;
>>>   
>>> +	freq_tbl = core->res->freq_tbl;
>>> +	freq_tbl_size = core->res->freq_tbl_size;
>>
>> could you initialize those at the variables declaration?
>>
>>> +	if (!freq_tbl)
>>> +		return -EINVAL;
>>> +
>>> +	freq = freq_tbl[freq_tbl_size - 1].freq;
>>> +
>>>   	for (i = 0; i < res->clks_num; i++) {
>>> +		ret = clk_set_rate(core->clks[i], freq);
>>
>> I'm not sure that we have to set the rate for all core->clks[i] ?
> 
> Confirmed. This produces regressions on db410c (I haven't tested on
> other platforms yet).
> 
>>
>>> +		if (ret)
>>> +			goto err;
>>> +
>>>   		ret = clk_prepare_enable(core->clks[i]);
>>>   		if (ret)
>>>   			goto err;
>>>
>>
> 

OK, I have this now on db410c

I made a tree out of

svarbanov-linux-tv/venus-for-next-v5.13
+
svarbanov-linux-tv/venus-msm8916-fixes - minor fix here integrating on 
top of 5.13

and then put the sm8250 changes on top of that

https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=tracking-qcomlt-sm8250-venus-integrated-sm8250

So confirm db410c works up to tag 
tracking-qcomlt-sm8250-venus-integrated-sm8250-02+svarbanov-linux-tv/venus-msm8916-fixes

I'll work on fixing your feedback on that putative branch.

---
bod

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot
  2021-03-10 17:33       ` Bryan O'Donoghue
@ 2021-03-10 22:02         ` Stanimir Varbanov
  0 siblings, 0 replies; 42+ messages in thread
From: Stanimir Varbanov @ 2021-03-10 22:02 UTC (permalink / raw)
  To: Bryan O'Donoghue, Stanimir Varbanov, agross, bjorn.andersson,
	mchehab, linux-media, linux-arm-msm
  Cc: dikshita, jonathan, vgarodia



On 3/10/21 7:33 PM, Bryan O'Donoghue wrote:
> On 06/03/2021 15:01, Stanimir Varbanov wrote:
>>
>>
>> On 2/23/21 3:25 PM, Stanimir Varbanov wrote:
>>>
>>>
>>> On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
>>>> From: Dikshita Agarwal <dikshita@codeaurora.org>
>>>>
>>>> Vote for min clk frequency for core clks during prepare and enable
>>>> clocks
>>>> at boot sequence. Without this the controller clock runs at very low
>>>> value
>>>> (9.6MHz) which is not sufficient to boot venus.
>>>>
>>>> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
>>>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>>>> ---
>>>>   drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++
>>>>   1 file changed, 14 insertions(+)
>>>>
>>>> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c
>>>> b/drivers/media/platform/qcom/venus/pm_helpers.c
>>>> index 4f5d42662963..767cb00d4b46 100644
>>>> --- a/drivers/media/platform/qcom/venus/pm_helpers.c
>>>> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c
>>>> @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
>>>>   static int core_clks_enable(struct venus_core *core)
>>>>   {
>>>>       const struct venus_resources *res = core->res;
>>>> +    const struct freq_tbl *freq_tbl = NULL;
>>>> +    unsigned int freq_tbl_size = 0;
>>>> +    unsigned long freq = 0;
>>>
>>> no need to initialize to zero.
>>>
>>>>       unsigned int i;
>>>>       int ret;
>>>>   +    freq_tbl = core->res->freq_tbl;
>>>> +    freq_tbl_size = core->res->freq_tbl_size;
>>>
>>> could you initialize those at the variables declaration?
>>>
>>>> +    if (!freq_tbl)
>>>> +        return -EINVAL;
>>>> +
>>>> +    freq = freq_tbl[freq_tbl_size - 1].freq;
>>>> +
>>>>       for (i = 0; i < res->clks_num; i++) {
>>>> +        ret = clk_set_rate(core->clks[i], freq);
>>>
>>> I'm not sure that we have to set the rate for all core->clks[i] ?
>>
>> Confirmed. This produces regressions on db410c (I haven't tested on
>> other platforms yet).
>>
>>>
>>>> +        if (ret)
>>>> +            goto err;
>>>> +
>>>>           ret = clk_prepare_enable(core->clks[i]);
>>>>           if (ret)
>>>>               goto err;
>>>>
>>>
>>
> 
> OK, I have this now on db410c
> 
> I made a tree out of
> 
> svarbanov-linux-tv/venus-for-next-v5.13
> +
> svarbanov-linux-tv/venus-msm8916-fixes - minor fix here integrating on
> top of 5.13
> 
> and then put the sm8250 changes on top of that
> 
> https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=tracking-qcomlt-sm8250-venus-integrated-sm8250
> 
> 
> So confirm db410c works up to tag
> tracking-qcomlt-sm8250-venus-integrated-sm8250-02+svarbanov-linux-tv/venus-msm8916-fixes
> 
> 
> I'll work on fixing your feedback on that putative branch.

Thanks!

I fixed the regression on db410c by set the rate for the core->clks[0]
only, e.g. the clock at which the remote processor is running.

> 
> ---
> bod

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW
  2021-02-25  8:00   ` Stanimir Varbanov
@ 2021-03-12  2:58     ` Bryan O'Donoghue
  0 siblings, 0 replies; 42+ messages in thread
From: Bryan O'Donoghue @ 2021-03-12  2:58 UTC (permalink / raw)
  To: Stanimir Varbanov, agross, bjorn.andersson, mchehab, linux-media,
	linux-arm-msm
  Cc: dikshita, jonathan, vgarodia

On 25/02/2021 08:00, Stanimir Varbanov wrote:
> 
> 
> On 2/22/21 6:02 PM, Bryan O'Donoghue wrote:
>> From: Dikshita Agarwal <dikshita@codeaurora.org>
>>
>> Set actual plane alignments to FW with
>> HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO to calculate
>> correct buffer size.
>>
>> bod: Fixed fall-through error in pkt_session_set_property_6xx() switch
>>
>> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
>> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> ---
>>   drivers/media/platform/qcom/venus/helpers.c  | 21 ++++++++++++++++++++
>>   drivers/media/platform/qcom/venus/helpers.h  |  1 +
>>   drivers/media/platform/qcom/venus/hfi_cmds.c | 13 ++++++++++++
>>   drivers/media/platform/qcom/venus/vdec.c     |  4 ++++
>>   4 files changed, 39 insertions(+)
>>
>> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
>> index f0413236a56f..49c52ef1084a 100644
>> --- a/drivers/media/platform/qcom/venus/helpers.c
>> +++ b/drivers/media/platform/qcom/venus/helpers.c
>> @@ -1113,6 +1113,27 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
>>   }
>>   EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
>>   
>> +int venus_helper_set_format_constraints(struct venus_inst *inst)
>> +{
>> +	const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO;
>> +	struct hfi_uncompressed_plane_actual_constraints_info pconstraint;
>> +
>> +	pconstraint.buffer_type = HFI_BUFFER_OUTPUT2;
>> +	pconstraint.num_planes = 2;
>> +	pconstraint.plane_format[0].stride_multiples = 128;
>> +	pconstraint.plane_format[0].max_stride = 8192;
>> +	pconstraint.plane_format[0].min_plane_buffer_height_multiple = 32;
>> +	pconstraint.plane_format[0].buffer_alignment = 256;
>> +
>> +	pconstraint.plane_format[1].stride_multiples = 128;
>> +	pconstraint.plane_format[1].max_stride = 8192;
>> +	pconstraint.plane_format[1].min_plane_buffer_height_multiple = 16;
>> +	pconstraint.plane_format[1].buffer_alignment = 256;
>> +
>> +	return hfi_session_set_property(inst, ptype, &pconstraint);
> 
> I wonder shouldn't we set this property for v6 only? Or mark this
> property as not supported for v1 up to v4.  Otherwise, I would expect
> regressions on the older v1 - v4.

BTW you're right, this breaks 1xx.

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2021-03-12  2:57 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 16:02 [PATCH 00/25] media: venus: Enable 6xx support Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 01/25] media: venus: Update v6 buffer descriptors Bryan O'Donoghue
2021-02-23 13:11   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 02/25] media: venus: core,pm: Add handling for resets Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 03/25] media: venus: core: add sm8250 DT compatible and resource data Bryan O'Donoghue
2021-02-23 13:48   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 04/25] media: venus: core,pm: Vote for min clk freq during venus boot Bryan O'Donoghue
2021-02-23 13:25   ` Stanimir Varbanov
2021-03-06 15:01     ` Stanimir Varbanov
2021-03-06 16:48       ` Bryan O'Donoghue
2021-03-07 10:44         ` Stanimir Varbanov
2021-03-10 17:33       ` Bryan O'Donoghue
2021-03-10 22:02         ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 05/25] media: venus: core: Add io base variables for each block Bryan O'Donoghue
2021-02-23 13:28   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 06/25] media: venus: hfi,pm,firmware: Convert to block relative addressing Bryan O'Donoghue
2021-02-23 13:31   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 07/25] media: venus: hfi: Define block offsets for V6 hardware Bryan O'Donoghue
2021-02-23 13:32   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 08/25] media: venus: hfi: Define additional 6xx registers Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 09/25] media: venus: core: Add differentiator IS_V6(core) Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 10/25] media: venus: core: Add an io base for TZ wrapper regs Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 11/25] media: venus: core: Add an io base for AON regs Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 12/25] media: venus: core: Hook to V6 base registers when appropriate Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 13/25] media: venus: hfi: Add a 6xx boot logic Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 14/25] media: venus: hfi: Add 6xx interrupt support Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 15/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 16/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 17/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 18/25] media: venus: hfi: Add 6xx AXI halt logic Bryan O'Donoghue
2021-02-25  7:29   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 21/25] media: venus: helpers: Add internal buffer list for v6 Bryan O'Donoghue
2021-02-25  7:57   ` Stanimir Varbanov
2021-02-22 16:02 ` [PATCH 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Bryan O'Donoghue
2021-02-25  8:00   ` Stanimir Varbanov
2021-03-12  2:58     ` Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count Bryan O'Donoghue
2021-02-22 16:02 ` [PATCH 24/25] media: venus: helper: Decide work mode Bryan O'Donoghue
2021-02-22 16:03 ` [PATCH 25/25] media: venus: vdec: Fix decoder cmd STOP issue Bryan O'Donoghue
2021-02-26 10:25   ` Stanimir Varbanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).