Skip to contentSkip to conversation

Fix for VP9 DRC and Decoder STOP issue.

PATCH Superseded [email protected] 8 participants 22 messages Nov 15, 2022 – Mar 23, 2023

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Fix for VP9 DRC and Decoder STOP issue.

From: Viswanath Boma <[email protected]>

Tested the changes on v5.15 and v5.4 kernels .
For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and Fix
for Decoder STOP command issue.

 drivers/media/platform/qcom/venus/core.h       | 10 ++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 33 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 venus: Enable sufficient sequence change support for sc7180 and Fix for Decoder STOP command issue.

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe,
for driver to get notified of such resolution change, enable the property in video firmware. Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

---
 drivers/media/platform/qcom/venus/core.h       | 10 ++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 33 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +10 -0
index 32551c2602a9..538d7cd41edd 100644
@@ -202,6 +202,11 @@ struct venus_core {
 	unsigned int core0_usage_count;
 	unsigned int core1_usage_count;
 	struct dentry *root;
+	struct venus_img_version {
+		u32 major;
+		u32 minor;
+		u32 rev;
+	} venus_ver;
 };
 
 struct vdec_controls {
@@ -472,6 +477,11 @@ struct venus_inst {
 #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 IS_FW_REV_OR_NEWER(core, vmajor, vminor, vrev)  ((core)->venus_ver.major == vmajor && \
+			(core)->venus_ver.minor == vminor && (core)->venus_ver.rev >= vrev)
+#define IS_FW_REV_OR_OLDER(core, vmajor, vminor, vrev)  ((core)->venus_ver.major == vmajor && \
+			(core)->venus_ver.minor == vminor && (core)->venus_ver.rev <= vrev)
+
 
 #define ctrl_to_inst(ctrl)	\
 	container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
 		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
 		break;
 	}
+	case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
 	case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
 		struct hfi_enable *in = pdata;
 		struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH			0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT			0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE			0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+								0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +9 -2
index df96db3761a7..4a398f77fe9c 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
 			   struct hfi_msg_sys_property_info_pkt *pkt)
 {
+	struct device *dev = core->dev;
 	u8 *smem_tbl_ptr;
 	u8 *img_ver;
 	int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
 		return;
 
 	img_ver = pkt->data;
+	if (IS_V4(core))
+		sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+			&core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+	else if (IS_V6(core))
+		sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+			&core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
 
 	dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
 	switch (pkt->property) {
 	case HFI_PROPERTY_SYS_IMAGE_VERSION:
-		sys_get_prop_image_version(dev, pkt);
+		sys_get_prop_image_version(core, pkt);
 		break;
 	default:
 		dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +11 -1
index 4ceaba37e2e5..cc19eb62b723 100644
@@ -545,7 +545,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;
-		if (IS_V6(inst->core))
+		if (IS_V6(inst->core) && IS_FW_REV_OR_OLDER(inst->core, 1, 0, 87))
 			fdata.device_addr = 0;
 		else
 			fdata.device_addr = 0xdeadb000;
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
 			return ret;
 	}
 
+	/* Enabling sufficient sequence change support for VP9 */
+	if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {
+		if (IS_FW_REV_OR_NEWER(inst->core, 5, 4, 51)) {
+			ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+			ret = hfi_session_set_property(inst, ptype, &en);
+			if (ret)
+				return ret;
+		}
+	}
+
 	ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
 	conceal = ctr->conceal_color & 0xffff;
 	conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
Signature · 1 line
2.17.1
Tested-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] venus: Enable sufficient sequence change support for sc7180 and Fix for Decoder STOP command issue.

Quoted 8 lines · On Tue, Nov 15, 2022 at 4:12 AM <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe,
for driver to get notified of such resolution change, enable the property in video firmware. Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

With this patch and the latest Venus SC7180 firmware, VP9 interframe resolution changes are handled and decoded correctly.

Quoted 134 lines
---
 drivers/media/platform/qcom/venus/core.h       | 10 ++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 33 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +10 -0
index 32551c2602a9..538d7cd41edd 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {
@@ -472,6 +477,11 @@ struct venus_inst {
 #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 IS_FW_REV_OR_NEWER(core, vmajor, vminor, vrev)  ((core)->venus_ver.major == vmajor && \
+                       (core)->venus_ver.minor == vminor && (core)->venus_ver.rev >= vrev)
+#define IS_FW_REV_OR_OLDER(core, vmajor, vminor, vrev)  ((core)->venus_ver.major == vmajor && \
+                       (core)->venus_ver.minor == vminor && (core)->venus_ver.rev <= vrev)
+
 
 #define ctrl_to_inst(ctrl)     \
        container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH                 0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE                   0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+                                                               0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +9 -2
index df96db3761a7..4a398f77fe9c 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
 
        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:
                dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +11 -2
index 4ceaba37e2e5..cc19eb62b723 100644
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) && IS_FW_REV_OR_OLDER(inst->core, 1, 0, 87))
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000;
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {
+               if (IS_FW_REV_OR_NEWER(inst->core, 5, 4, 51)) {
+                       ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
--

2.17.1

#3 lore raw

Re: [PATCH 1/1] venus: Enable sufficient sequence change support for sc7180 and Fix for Decoder STOP command issue.

In reply to [email protected]
Quoted 6 lines · On 15/11/2022 12:12, [email protected] wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe,
for driver to get notified of such resolution change, enable the property in video firmware. Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Could you figure out the right Fixes: and Cc: stable to add here ?

---
bod

#4 lore raw

v2 cover Fix for VP9 DRC and Decoder STOP issue.

In reply to [email protected]

From: Viswanath Boma <[email protected]>

Tested the changes on v5.15 and v5.4 kernels .
For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#5 lore raw

PATCH v2 1/1 venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change,
enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +18 -0
index 32551c2602a9..8f94d795cc2b 100644
@@ -202,6 +202,11 @@ struct venus_core {
 	unsigned int core0_usage_count;
 	unsigned int core1_usage_count;
 	struct dentry *root;
+	struct venus_img_version {
+		u32 major;
+		u32 minor;
+		u32 rev;
+	} venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
 	return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+	return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+		vminor && (core)->venus_ver.rev >= vrev);
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+	return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+		vminor && (core)->venus_ver.rev <= vrev);
+}
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
 		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
 		break;
 	}
+	case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
 	case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
 		struct hfi_enable *in = pdata;
 		struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH			0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT			0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE			0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+								0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +9 -2
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
 			   struct hfi_msg_sys_property_info_pkt *pkt)
 {
+	struct device *dev = core->dev;
 	u8 *smem_tbl_ptr;
 	u8 *img_ver;
 	int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
 		return;
 
 	img_ver = pkt->data;
+	if (IS_V4(core))
+		sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+		       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+	else if (IS_V6(core))
+		sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+		       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
 
 	dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
 	switch (pkt->property) {
 	case HFI_PROPERTY_SYS_IMAGE_VERSION:
-		sys_get_prop_image_version(dev, pkt);
+		sys_get_prop_image_version(core, pkt);
 		break;
 	default:
 		dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +11 -1
index 4ceaba37e2e5..36c88858ea9d 100644
@@ -545,7 +545,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;
-		if (IS_V6(inst->core))
+		if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
 			fdata.device_addr = 0;
 		else
 			fdata.device_addr = 0xdeadb000;
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
 			return ret;
 	}
 
+	/* Enabling sufficient sequence change support for VP9 */
+	if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {
+		if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+			ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+			ret = hfi_session_set_property(inst, ptype, &en);
+			if (ret)
+				return ret;
+		}
+	}
+
 	ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
 	conceal = ctr->conceal_color & 0xffff;
 	conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Quoted 13 lines · On Thu, 2 Feb 2023 at 08:47, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change,
enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 7 lines
---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)

Several generic comments:
- Please move your work on top of the recent kernels. 5.15 was released half of the year ago. I'm not going to mention 5.4 age.
- Please split your patch into smaller logical patches.

Quoted 18 lines
drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..8f94d795cc2b 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain) · line 512

Quoted 8 lines
drivers/media/platform/qcom/venus/core.h +5 -0
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev >= vrev);

Please make the indentation logical here (and below). Also is 5.6.1 (e.g.) newer than 5.4.51? Or 5.4.1 newer than 4.2.0?

Quoted 51 lines
drivers/media/platform/qcom/venus/core.h +8 -0
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev <= vrev);
+}
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH                 0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE                   0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+                                                               0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +2 -1
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev, · line 272

Quoted 9 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +6 -0
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);

What about older (V1/V3) cores?

Quoted 26 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:
                dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +1 -1
index 4ceaba37e2e5..36c88858ea9d 100644
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000;

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_properties(struct venus_inst *inst) · line 675

Quoted 5 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {

Do newer chips support this property? Do you intend to list all of them here?

Quoted 11 lines
drivers/media/platform/qcom/venus/vdec.c +8 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
Signature · 2 lines
With best wishes
Dmitry
#7 lore raw

RE: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Will ensure more on V3 patch if any comments from Stan/Vikash .
Thanks,
viswanath
-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, February 2, 2023 3:41 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>
Cc: [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; [email protected]; [email protected]; [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 13 lines · On Thu, 2 Feb 2023 at 08:47, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change, enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 7 lines
---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)

Several generic comments:
- Please move your work on top of the recent kernels. 5.15 was released half of the year ago. I'm not going to mention 5.4 age.
- Please split your patch into smaller logical patches.
[vboma]

Quoted 22 lines
Quoted 3 lines

As per the current client environment working on 5.15 kernel and the same changes were also ensured on 5.4 . Current changes related bringing up the utility functions to fix couple of bugs on latest firmware versions. In future , As sugggested will split the changes if they can be isolated as smaller meaningful part .

drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..8f94d795cc2b 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain) · line 512

Quoted 8 lines
drivers/media/platform/qcom/venus/core.h +5 -0
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor, 
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev >= vrev);

Please make the indentation logical here (and below). Also is 5.6.1 (e.g.) newer than 5.4.51? Or 5.4.1 newer than 4.2.0? [vboma]

Quoted 57 lines
Quoted 2 lines

Expected one more indent to right ? will ensure .
These versions check related to major/minor versions of the Firmware releases to address the mentioned issues and also if any role back preserves the older behavior.

drivers/media/platform/qcom/venus/core.h +7 -0
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor, 
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev <= vrev); }
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data; diff --git 

a/drivers/media/platform/qcom/venus/hfi_helper.h
b/drivers/media/platform/qcom/venus/hfi_helper.h
index d2d6719a2ba4..20516b4361d3 100644

drivers/media/platform/qcom/venus/hfi_helper.h +3 -0
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH                 0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE                   0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+                                                               
+0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +2 -1
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core 
 *core, struct venus_inst *inst,  }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)  
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev, · line 273

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +7 -0
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, 
+ &core->venus_ver.rev);

What about older (V1/V3) cores?
[vboma]

Quoted 28 lines
Quoted 1 line

Older cores not having these issues , hence as required V4 and V6 were handled as per Current client issues.

        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct 
 venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:

dev_dbg(dev, VDBGL "unknown property data\n"); diff
--git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ceaba37e2e5..36c88858ea9d 100644

drivers/media/platform/qcom/venus/vdec.c +2 -1
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) && 
+ is_fw_rev_or_older(inst->core, 1, 0, 87))

drivers/media/platform/qcom/venus/vdec.c vdec_decoder_cmd(struct file *file, void *fh,

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +4 -0
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000; @@ -671,6 
+671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node, 
+ "qcom,sc7180-venus")) {

Do newer chips support this property? Do you intend to list all of them here? [vboma]

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_properties(struct venus_inst *inst) · line 686

Quoted 13 lines
Quoted 1 line

Basing on capability of the valid chipset vs firmware support ,current changes were added .

drivers/media/platform/qcom/venus/vdec.c +8 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;

--
With best wishes
Dmitry

#8 lore raw

Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Quoted 5 lines · Viswanath Boma (Temp)

Will ensure more on V3 patch if any comments from Stan/Vikash . Thanks,
viswanath

Please fix your email configuration. Top-posting is generally frowned upon. All the headers bellow are frowned upon too.

Quoted 31 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, February 2, 2023 3:41 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>
Cc: [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; [email protected]; [email protected]; [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 13 lines · On Thu, 2 Feb 2023 at 08:47, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change, enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 7 lines
---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
Quoted 7 lines

Several generic comments:
- Please move your work on top of the recent kernels. 5.15 was released half of the year ago. I'm not going to mention 5.4 age.
- Please split your patch into smaller logical patches.
[vboma]

Quoted 3 lines
Quoted 3 lines

As per the current client environment working on 5.15 kernel and the same changes were also ensured on 5.4 . Current changes related bringing up the utility functions to fix couple of bugs on latest firmware versions. In future , As sugggested will split the changes if they can be isolated as smaller meaningful part .

UGH. This looks like a third level quotation, not like your reply. Could you please spend some time and fix your email client? It is close to impossible to notice your replies otherwise.

Were these changes validated on top of linux-master or linux-next? If not, please go ahead and validate them before sending the next patch revision.

Quoted 22 lines
Quoted 22 lines
drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..8f94d795cc2b 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
        return NULL;
 }
 
Quoted 10 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain) · line 512

Quoted 5 lines
drivers/media/platform/qcom/venus/core.h +5 -0
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev >= vrev);

Please make the indentation logical here (and below). Also is 5.6.1 (e.g.) newer than 5.4.51? Or 5.4.1 newer than 4.2.0? [vboma]

Quoted 1 line
Quoted 1 line

Expected one more indent to right ? will ensure .

Expected is to have the indentation logical. Saying if ((major == A) && (minor ==
B)) is not logical.

A good (and easier to comprehend) example might be:

if ((major == A) &&

    (minor == B)) {
}
Quoted 58 lines
Quoted 58 lines
Quoted 1 line

These versions check related to major/minor versions of the Firmware releases to address the mentioned issues and also if any role back preserves the older behavior.

drivers/media/platform/qcom/venus/core.h +7 -0
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+               vminor && (core)->venus_ver.rev <= vrev); }
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data; diff --git

a/drivers/media/platform/qcom/venus/hfi_helper.h
b/drivers/media/platform/qcom/venus/hfi_helper.h
index d2d6719a2ba4..20516b4361d3 100644

drivers/media/platform/qcom/venus/hfi_helper.h +3 -0
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH                 0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE                   0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+
+0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +2 -1
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core
 *core, struct venus_inst *inst,  }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
Quoted 12 lines

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev,

Quoted 8 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +7 -0
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor,
+ &core->venus_ver.rev);

What about older (V1/V3) cores?
[vboma]

Quoted 1 line
Quoted 1 line

Older cores not having these issues , hence as required V4 and V6 were handled as per Current client issues.

There are no clients here and no client issues. If you are handling parsing versions, please make it work for all supported devices.

Quoted 34 lines
Quoted 34 lines

        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct
 venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:

dev_dbg(dev, VDBGL "unknown property data\n"); diff
--git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ceaba37e2e5..36c88858ea9d 100644

drivers/media/platform/qcom/venus/vdec.c +3 -1
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) &&
+ is_fw_rev_or_older(inst->core, 1, 0, 87))
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000; @@ -671,6
+671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
Quoted 7 lines

drivers/media/platform/qcom/venus/vdec.c

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +3 -0
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node,
+ "qcom,sc7180-venus")) {

Do newer chips support this property? Do you intend to list all of them here? [vboma]

Quoted 1 line
Quoted 1 line

Basing on capability of the valid chipset vs firmware support ,current changes were added .

Are there any other chipsets using 5.4 firmware. If they are, are you going to list them here? If not, you can skip the of_device_is_compatible and just check for fw 5.4

Quoted 18 lines

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_properties(struct venus_inst *inst) · line 686

Quoted 12 lines
drivers/media/platform/qcom/venus/vdec.c +8 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;

--
With best wishes
Dmitry

Signature · 2 lines
With best wishes
Dmitry
#9 lore raw

RE: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

HI Dmirty ,

Thanks for reviews .

Quoted 21 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, March 16, 2023 3:58 PM
To: Viswanath Boma (Temp) <[email protected]>
Cc: Viswanath Boma (Temp) (QUIC) <[email protected]>; [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 2 lines · Viswanath Boma (Temp)
Quoted 7 lines
Quoted 3 lines

Will ensure more on V3 patch if any comments from Stan/Vikash . Thanks,
viswanath

Please fix your email configuration. Top-posting is generally frowned upon. All the headers bellow are frowned upon too.

Sure, will ensure proper version tag in the next patch set.

Quoted 261 lines
Quoted 4 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, February 2, 2023 3:41 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>

Quoted 8 lines

Cc: [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; [email protected]; [email protected]; [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH V2 1/1] venus: Enable sufficient sequence change support

for sc7180 and fix for Decoder STOP command issue.

Quoted 2 lines

WARNING: This email originated from outside of Qualcomm. Please be wary

of any links or attachments, and do not enable macros.

Quoted 23 lines · On Thu, 2 Feb 2023 at 08:47, <[email protected]> wrote:
Quoted 13 lines

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change, enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 7 lines
---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
Quoted 2 lines

Several generic comments:
- Please move your work on top of the recent kernels. 5.15 was released half

of the year ago. I'm not going to mention 5.4 age.

Quoted 3 lines

- Please split your patch into smaller logical patches. [vboma]

Quoted 1 line
Quoted 1 line

As per the current client environment working on 5.15 kernel and the

same changes were also ensured on 5.4 .

Quoted 1 line
Quoted 1 line
Quoted 1 line

Current changes related bringing up the utility functions to fix couple of

bugs on latest firmware versions.

Quoted 1 line
Quoted 1 line
Quoted 1 line

In future , As sugggested will split the changes if they can be isolated as

smaller meaningful part .

UGH. This looks like a third level quotation, not like your reply. Could you please spend some time and fix your email client? It is close to impossible to notice your replies otherwise.

Were these changes validated on top of linux-master or linux-next? If not, please go ahead and validate them before sending the next patch revision.

Quoted 17 lines
Quoted 17 lines
drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..8f94d795cc2b 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
Quoted 2 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core,

Quoted 2 lines
drivers/media/platform/qcom/venus/core.h +0 -0
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core,

u32 codec, u32 domain)

Quoted 8 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)

Quoted 7 lines
drivers/media/platform/qcom/venus/core.h +4 -0
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

Quoted 6 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain) · line 512

Quoted 1 line
drivers/media/platform/qcom/venus/core.h +1 -0
+               vminor && (core)->venus_ver.rev >= vrev);

Please make the indentation logical here (and below). Also is 5.6.1 (e.g.) newer than 5.4.51? Or 5.4.1 newer than 4.2.0? [vboma]

Quoted 1 line
Quoted 1 line

Expected one more indent to right ? will ensure .

Expected is to have the indentation logical. Saying if ((major == A) && (minor ==
B)) is not logical.

A good (and easier to comprehend) example might be:

if ((major == A) &&

    (minor == B)) {
}
Quoted 1 line
Quoted 1 line
Quoted 1 line

These versions check related to major/minor versions of the Firmware

releases to address the mentioned issues and also if any role back preserves the older behavior.

Quoted 8 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)

Quoted 7 lines
drivers/media/platform/qcom/venus/core.h +6 -0
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

Quoted 8 lines

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct

Quoted 8 lines
drivers/media/platform/qcom/venus/core.h +1 -0
+               vminor && (core)->venus_ver.rev <= vrev); }
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct

hfi_session_set_property_pkt *pkt,

Quoted 4 lines

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,

Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:

Quoted 10 lines

drivers/media/platform/qcom/venus/hfi_helper.h line 469

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data; diff --git

a/drivers/media/platform/qcom/venus/hfi_helper.h
b/drivers/media/platform/qcom/venus/hfi_helper.h
index d2d6719a2ba4..20516b4361d3 100644

drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH

0x1003007

Quoted 1 line

drivers/media/platform/qcom/venus/hfi_helper.h line 470

Quoted 1 line
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT

0x1003009

Quoted 1 line

drivers/media/platform/qcom/venus/hfi_helper.h line 471

Quoted 1 line
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE

0x100300a

Quoted 1 line

drivers/media/platform/qcom/venus/hfi_helper.h line 472

Quoted 1 line
drivers/media/platform/qcom/venus/hfi_helper.h +1 -0
+#define

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \

Quoted 30 lines
Quoted 23 lines
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
+
+0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +2 -1
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core
 *core, struct venus_inst *inst,  }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt
 *pkt) {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev, · line 269

Quoted 6 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +3 -0
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core-

venus_ver.rev);

Quoted 8 lines

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev,

Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_msgs.c +4 -0
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major,
+ &core->venus_ver.minor, &core->venus_ver.rev);

What about older (V1/V3) cores?
[vboma]

Quoted 1 line
Quoted 1 line

Older cores not having these issues , hence as required V4 and V6 were

handled as per Current client issues.

There are no clients here and no client issues. If you are handling parsing versions, please make it work for all supported devices.

Quoted 34 lines
Quoted 34 lines

        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct
 venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:

dev_dbg(dev, VDBGL "unknown property data\n"); diff
--git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ceaba37e2e5..36c88858ea9d 100644

drivers/media/platform/qcom/venus/vdec.c +3 -1
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) &&
+ is_fw_rev_or_older(inst->core, 1, 0, 87))
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000; @@ -671,6
+671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
Quoted 7 lines

drivers/media/platform/qcom/venus/vdec.c

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +3 -0
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node,
+ "qcom,sc7180-venus")) {

Do newer chips support this property? Do you intend to list all of them here? [vboma]

Quoted 1 line
Quoted 1 line

Basing on capability of the valid chipset vs firmware support ,current

changes were added .

Are there any other chipsets using 5.4 firmware. If they are, are you going to list them here? If not, you can skip the of_device_is_compatible and just check for fw 5.4

Quoted 3 lines

drivers/media/platform/qcom/venus/vdec.c

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype =

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;

Quoted 12 lines

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_properties(struct venus_inst *inst) · line 686

Quoted 9 lines
drivers/media/platform/qcom/venus/vdec.c +6 -0
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
Quoted 3 lines

--
With best wishes
Dmitry

--
With best wishes
Dmitry

#10 lore raw

v3 cover Fix for VP9 DRC and Decoder STOP issue.

In reply to [email protected]

From: Viswanath Boma <[email protected]>

Fixed indent comments, ensured rebase and checkpatch with --strict. Tested the changes on v5.15 and v5.4 kernels .
For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
#11 lore raw

PATCH 1/1 venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change,
enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

---
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +18 -0
index 32551c2602a9..ee8b70a34656 100644
@@ -202,6 +202,11 @@ struct venus_core {
 	unsigned int core0_usage_count;
 	unsigned int core1_usage_count;
 	struct dentry *root;
+	struct venus_img_version {
+		u32 major;
+		u32 minor;
+		u32 rev;
+	} venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
 	return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+	return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+			vminor && (core)->venus_ver.rev >= vrev);
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+	return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+			vminor && (core)->venus_ver.rev <= vrev);
+}
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
 		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
 		break;
 	}
+	case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
 	case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
 		struct hfi_enable *in = pdata;
 		struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH			0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT			0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE			0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+								0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +9 -2
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
 			   struct hfi_msg_sys_property_info_pkt *pkt)
 {
+	struct device *dev = core->dev;
 	u8 *smem_tbl_ptr;
 	u8 *img_ver;
 	int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
 		return;
 
 	img_ver = pkt->data;
+	if (IS_V4(core))
+		sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+		       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+	else if (IS_V6(core))
+		sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+		       &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
 
 	dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
 	switch (pkt->property) {
 	case HFI_PROPERTY_SYS_IMAGE_VERSION:
-		sys_get_prop_image_version(dev, pkt);
+		sys_get_prop_image_version(core, pkt);
 		break;
 	default:
 		dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +11 -1
index 4ceaba37e2e5..36c88858ea9d 100644
@@ -545,7 +545,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;
-		if (IS_V6(inst->core))
+		if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
 			fdata.device_addr = 0;
 		else
 			fdata.device_addr = 0xdeadb000;
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
 			return ret;
 	}
 
+	/* Enabling sufficient sequence change support for VP9 */
+	if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {
+		if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+			ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+			ret = hfi_session_set_property(inst, ptype, &en);
+			if (ret)
+				return ret;
+		}
+	}
+
 	ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
 	conceal = ctr->conceal_color & 0xffff;
 	conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
Signature · 1 line
2.17.1
#12 lore raw

Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Quoted 10 lines · On Thu, 16 Mar 2023 at 10:17, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change,
enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 4 lines

---

Which version of the patch is this? Were there any changes compared to the previous version? Please include a changelog below the dashed line to let other people know what has changed

Quoted 118 lines
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +18 -0
index 32551c2602a9..ee8b70a34656 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain)
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+                       vminor && (core)->venus_ver.rev >= vrev);
+}
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor, u32 vrev)
+{
+       return ((core)->venus_ver.major == vmajor && (core)->venus_ver.minor ==
+                       vminor && (core)->venus_ver.rev <= vrev);
+}
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data;
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
index d2d6719a2ba4..20516b4361d3 100644
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH                 0x1003007
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE                   0x100300a
+#define HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \
+                                                               0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +9 -2
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev);
 
        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
 
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:
                dev_dbg(dev, VDBGL "unknown property data\n");
drivers/media/platform/qcom/venus/vdec.c +1 -1
index 4ceaba37e2e5..36c88858ea9d 100644
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000;

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_properties(struct venus_inst *inst) · line 675

Quoted 5 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
@@ -671,6 +671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node, "qcom,sc7180-venus")) {

Is it really specific just to sc7180 or will it be applicable to any other platform using venus-5.4 firmware?

Quoted 14 lines
drivers/media/platform/qcom/venus/vdec.c +8 -1
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype = HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
--

2.17.1

Signature · 2 lines
With best wishes
Dmitry
#13 lore raw

RE: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Hi Dmirty ,

Thanks for reviews .

Quoted 27 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, March 16, 2023 3:50 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>
Cc: [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 10 lines · On Thu, 16 Mar 2023 at 10:17, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change, enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 9 lines
Quoted 4 lines

---

Which version of the patch is this? Were there any changes compared to the previous version? Please include a changelog below the dashed line to let other people know what has changed

This is version v2 or v3 --> Keep this as per the version. Sure, let me fix the version and changes info in the next revision.

Quoted 165 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32

Quoted 25 lines
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..ee8b70a34656 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32

codec, u32 domain)

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct

Quoted 23 lines
drivers/media/platform/qcom/venus/core.h +4 -0
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

drivers/media/platform/qcom/venus/core.h +6 -0
+                       vminor && (core)->venus_ver.rev >= vrev); }
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

drivers/media/platform/qcom/venus/core.h +1 -0
+                       vminor && (core)->venus_ver.rev <= vrev); }
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct

hfi_session_set_property_pkt *pkt,

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,

Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:

drivers/media/platform/qcom/venus/hfi_helper.h line 469

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data; diff --git

a/drivers/media/platform/qcom/venus/hfi_helper.h
b/drivers/media/platform/qcom/venus/hfi_helper.h
index d2d6719a2ba4..20516b4361d3 100644

drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH

0x1003007

drivers/media/platform/qcom/venus/hfi_helper.h line 471

Quoted 2 lines
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE

0x100300a

drivers/media/platform/qcom/venus/hfi_helper.h line 472

Quoted 1 line
drivers/media/platform/qcom/venus/hfi_helper.h +1 -0
+#define

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \

Quoted 60 lines
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
+
+0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +10 -2
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core
 *core, struct venus_inst *inst,  }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core-
 venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor,
+ &core->venus_ver.rev);
 
        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct
 venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:

dev_dbg(dev, VDBGL "unknown property data\n"); diff
--git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ceaba37e2e5..36c88858ea9d 100644

drivers/media/platform/qcom/venus/vdec.c +2 -1
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) &&
+ is_fw_rev_or_older(inst->core, 1, 0, 87))

drivers/media/platform/qcom/venus/vdec.c vdec_decoder_cmd(struct file *file, void *fh,

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +4 -0
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000; @@ -671,6
+671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node,
+ "qcom,sc7180-venus")) {

Is it really specific just to sc7180 or will it be applicable to any other platform using venus-5.4 firmware?

drivers/media/platform/qcom/venus/vdec.c

Quoted 2 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype =

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +6 -1
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
--
Quoted 2 lines

2.17.1

--
With best wishes
Dmitry

#14 lore raw

Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Quoted 3 lines · Viswanath Boma (Temp)

Hi Dmirty ,

Thanks for reviews .

Please don't top-post.

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

Konrad

Quoted 205 lines
Quoted 28 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, March 16, 2023 3:50 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>
Cc: [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 10 lines · On Thu, 16 Mar 2023 at 10:17, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

For VP9 bitstreams, there could be a change in resolution at interframe, for driver to get notified of such resolution change, enable the property in video firmware.
Also, EOS handling is now made same in video firmware across all V6 SOCs, hence above a certain firmware version, the driver handling is made generic for all V6s

Quoted 9 lines
Quoted 4 lines

---

Which version of the patch is this? Were there any changes compared to the previous version? Please include a changelog below the dashed line to let other people know what has changed

This is version v2 or v3 --> Keep this as per the version. Sure, let me fix the version and changes info in the next revision.

Quoted 165 lines

drivers/media/platform/qcom/venus/core.h venus_caps_by_codec(struct venus_core *core, u32

Quoted 25 lines
 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.h +5 -0
index 32551c2602a9..ee8b70a34656 100644
@@ -202,6 +202,11 @@ struct venus_core {
        unsigned int core0_usage_count;
        unsigned int core1_usage_count;
        struct dentry *root;
+       struct venus_img_version {
+               u32 major;
+               u32 minor;
+               u32 rev;
+       } venus_ver;
 };
 
 struct vdec_controls {
@@ -500,4 +505,17 @@ venus_caps_by_codec(struct venus_core *core, u32

codec, u32 domain)

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct

Quoted 23 lines
drivers/media/platform/qcom/venus/core.h +4 -0
        return NULL;
 }
 
+static inline int
+is_fw_rev_or_newer(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

drivers/media/platform/qcom/venus/core.h +6 -0
+                       vminor && (core)->venus_ver.rev >= vrev); }
+
+static inline int
+is_fw_rev_or_older(struct venus_core *core, u32 vmajor, u32 vminor,
+u32 vrev) {
+       return ((core)->venus_ver.major == vmajor && (core)-

venus_ver.minor ==

drivers/media/platform/qcom/venus/core.h +1 -0
+                       vminor && (core)->venus_ver.rev <= vrev); }
 #endif
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
index 930b743f225e..e2539b58340f 100644
@@ -521,6 +521,7 @@ static int pkt_session_set_property_1x(struct

hfi_session_set_property_pkt *pkt,

drivers/media/platform/qcom/venus/hfi_cmds.c static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,

Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +1 -0
                pkt->shdr.hdr.size += sizeof(u32) + sizeof(*en);
                break;
        }
+       case

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT:

drivers/media/platform/qcom/venus/hfi_helper.h line 469

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_cmds.c +0 -0
        case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: {
                struct hfi_enable *in = pdata;
                struct hfi_enable *en = prop_data; diff --git

a/drivers/media/platform/qcom/venus/hfi_helper.h
b/drivers/media/platform/qcom/venus/hfi_helper.h
index d2d6719a2ba4..20516b4361d3 100644

drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
@@ -469,6 +469,8 @@
 #define HFI_PROPERTY_PARAM_VDEC_PIXEL_BITDEPTH

0x1003007

drivers/media/platform/qcom/venus/hfi_helper.h line 471

Quoted 2 lines
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
 #define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT                     0x1003009
 #define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE

0x100300a

drivers/media/platform/qcom/venus/hfi_helper.h line 472

Quoted 1 line
drivers/media/platform/qcom/venus/hfi_helper.h +1 -0
+#define

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT \

Quoted 60 lines
drivers/media/platform/qcom/venus/hfi_helper.h +2 -0
+
+0x0100300b
 
 /*
  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
drivers/media/platform/qcom/venus/hfi_msgs.c +10 -2
index df96db3761a7..07ac0fcd2852 100644
@@ -248,9 +248,10 @@ static void hfi_sys_init_done(struct venus_core
 *core, struct venus_inst *inst,  }
 
 static void
-sys_get_prop_image_version(struct device *dev,
+sys_get_prop_image_version(struct venus_core *core,
                           struct hfi_msg_sys_property_info_pkt *pkt)
 {
+       struct device *dev = core->dev;
        u8 *smem_tbl_ptr;
        u8 *img_ver;
        int req_bytes;
@@ -263,6 +264,12 @@ sys_get_prop_image_version(struct device *dev,
                return;
 
        img_ver = pkt->data;
+       if (IS_V4(core))
+               sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor, &core-
 venus_ver.rev);
+       else if (IS_V6(core))
+               sscanf(img_ver, "14:VIDEO.VPU.%u.%u-%u-PROD",
+                      &core->venus_ver.major, &core->venus_ver.minor,
+ &core->venus_ver.rev);
 
        dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);
@@ -286,7 +293,7 @@ static void hfi_sys_property_info(struct
 venus_core *core,
 
        switch (pkt->property) {
        case HFI_PROPERTY_SYS_IMAGE_VERSION:
-               sys_get_prop_image_version(dev, pkt);
+               sys_get_prop_image_version(core, pkt);
                break;
        default:

dev_dbg(dev, VDBGL "unknown property data\n"); diff
--git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ceaba37e2e5..36c88858ea9d 100644

drivers/media/platform/qcom/venus/vdec.c +2 -1
@@ -545,7 +545,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;
-               if (IS_V6(inst->core))
+               if (IS_V6(inst->core) &&
+ is_fw_rev_or_older(inst->core, 1, 0, 87))

drivers/media/platform/qcom/venus/vdec.c vdec_decoder_cmd(struct file *file, void *fh,

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +4 -0
                        fdata.device_addr = 0;
                else
                        fdata.device_addr = 0xdeadb000; @@ -671,6
+671,16 @@ static int vdec_set_properties(struct venus_inst *inst)
                        return ret;
        }
 
+       /* Enabling sufficient sequence change support for VP9 */
+       if (of_device_is_compatible(inst->core->dev->of_node,
+ "qcom,sc7180-venus")) {

Is it really specific just to sc7180 or will it be applicable to any other platform using venus-5.4 firmware?

drivers/media/platform/qcom/venus/vdec.c

Quoted 2 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
+               if (is_fw_rev_or_newer(inst->core, 5, 4, 51)) {
+                       ptype =

HFI_PROPERTY_PARAM_VDEC_ENABLE_SUFFICIENT_SEQCHANGE_EVENT;

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +6 -1
+                       ret = hfi_session_set_property(inst, ptype, &en);
+                       if (ret)
+                               return ret;
+               }
+       }
+
        ptype = HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR;
        conceal = ctr->conceal_color & 0xffff;
        conceal |= ((ctr->conceal_color >> 16) & 0xffff) << 10;
--
Quoted 2 lines

2.17.1

--
With best wishes
Dmitry

#15 lore raw

Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

In reply to [email protected]

drivers/media/platform/qcom/venus/hfi_msgs.c sys_get_prop_image_version(struct device *dev, · line 267

Quoted 1 line · On 16/03/2023 08:15, [email protected] wrote:
drivers/media/platform/qcom/venus/hfi_msgs.c +1 -0
+	if (IS_V4(core))

Hi Viswanath,

Could you please take in the change to base on on IRIS version and rebase your patch on _that_ much at least, not necessarily all of the changes in the series below. Dikshita should be able help.

https://lore.kernel.org/linux-arm-msm/[email protected]/

IRIS version is more granular/accurate than V4/V6 etc.

---
bod

#16 lore raw

RE: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

Hi Bryan,

Quoted 17 lines

-----Original Message-----
From: Bryan O'Donoghue <[email protected]>
Sent: Thursday, March 16, 2023 5:24 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>; [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: Vikash Garodia <[email protected]>; Dikshita Agarwal <[email protected]>
Subject: Re: [PATCH] venus: Enable sufficient sequence change support for sc7180 and fix for Decoder STOP command issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 8 lines
Quoted 1 line · On 16/03/2023 08:15, [email protected] wrote:

+ if (IS_V4(core))

Hi Viswanath,

Could you please take in the change to base on on IRIS version and rebase your patch on _that_ much at least, not necessarily all of the changes in the series below. Dikshita should be able help.

Let have this fix go separately and not tie this with the AR50LT series. This fix is a pending for sometime due to delay in raising the pull request. Working with Stan to get the pull request raised in next couple of days.

Quoted 7 lines

https://lore.kernel.org/linux-arm-msm/c9c324aa-6192-f878-9189-
[email protected]/

IRIS version is more granular/accurate than V4/V6 etc.

---
bod

#17 lore raw
In reply to [email protected]
Quoted 1 line · On 16.03.2023 09:15, [email protected] wrote:

From: Viswanath Boma <[email protected]>

Please fix your git send-email config to include your first and last name in the emails you send.

Please send next versions as a standalone thread, not in reply to the previous ones.

Quoted 3 lines

Fixed indent comments, ensured rebase and checkpatch with --strict. Tested the changes on v5.15 and v5.4 kernels .

You're submitting changes to the mainline kernel, not to v5.15 or v5.4. Please validate it against linux-next/master.

Konrad

Quoted 13 lines

For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
#18 lore raw
In reply to [email protected]
Quoted 4 lines · On 16/03/2023 10:15, [email protected] wrote:

From: Viswanath Boma <[email protected]>

Fixed indent comments, ensured rebase and checkpatch with --strict. Tested the changes on v5.15 and v5.4 kernels .

Was it tested on top of the recent kernels?

Quoted 13 lines

For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

  drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
  drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
  drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
  drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
  drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
  5 files changed, 41 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#19 lore raw

HI Dmirty,

Thanks for Reviews .

Quoted 15 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, March 16, 2023 6:08 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>; [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH V3 0/1] Fix for VP9 DRC and Decoder STOP issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 8 lines
Quoted 4 lines · On 16/03/2023 10:15, [email protected] wrote:

From: Viswanath Boma <[email protected]>

Fixed indent comments, ensured rebase and checkpatch with --strict. Tested the changes on v5.15 and v5.4 kernels .

Was it tested on top of the recent kernels?

Yes, Ensured on the latest .

Quoted 17 lines
Quoted 6 lines

For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

Quoted 7 lines
  drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
  drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
  drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
  drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
  drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
  5 files changed, 41 insertions(+), 3 deletions(-)

--
With best wishes
Dmitry

#20 lore raw
Quoted 19 lines · Viswanath Boma (Temp)

HI Dmirty,

Thanks for Reviews .

Quoted 14 lines

-----Original Message-----
From: Dmitry Baryshkov <[email protected]>
Sent: Thursday, March 16, 2023 6:08 PM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>; [email protected]; Vikash Garodia (QUIC) <[email protected]>; Andy Gross <[email protected]>; [email protected]; Konrad Dybcio <[email protected]>; Mauro Carvalho Chehab <[email protected]>; linux- [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH V3 0/1] Fix for VP9 DRC and Decoder STOP issue.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Can we please get rid of this in the replies? There is no need to duplicate headers.

Quoted 10 lines
Quoted 9 lines · On 16/03/2023 10:15, [email protected] wrote:
Quoted 4 lines

From: Viswanath Boma <[email protected]>

Fixed indent comments, ensured rebase and checkpatch with --strict. Tested the changes on v5.15 and v5.4 kernels .

Was it tested on top of the recent kernels?

Yes, Ensured on the latest .

Then why do you mention old kernels at all? Also the email addresses you have used do not correspond to the latest kernels.

Quoted 19 lines
Quoted 18 lines
Quoted 7 lines

For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

Quoted 7 lines
  drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
  drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
  drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
  drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
  drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
  5 files changed, 41 insertions(+), 3 deletions(-)

--
With best wishes
Dmitry

Signature · 2 lines
With best wishes
Dmitry
#21 lore raw
In reply to [email protected]
Quoted 4 lines · On Thu, 2 Feb 2023 at 08:47, <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

Tested the changes on v5.15 and v5.4 kernels .

Please test your patches properly. It is 6.2-rc already.

Quoted 12 lines

For testing Chrome Utilities were used .

Viswanath Boma (1):
venus: Enable sufficient sequence change support for sc7180 and fix
for Decoder STOP command issue.

 drivers/media/platform/qcom/venus/core.h       | 18 ++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h |  2 ++
 drivers/media/platform/qcom/venus/hfi_msgs.c   | 11 +++++++++--
 drivers/media/platform/qcom/venus/vdec.c       | 12 +++++++++++-
 5 files changed, 41 insertions(+), 3 deletions(-)
Signature · 2 lines
With best wishes
Dmitry