Skip to content

Commit

Permalink
media: venus : hfi: add venus image info into smem
Browse files Browse the repository at this point in the history
Fill fw version info into smem to be printed as part of
soc info.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Dikshita Agarwal authored and mchehab committed Apr 15, 2021
1 parent e75b756 commit d566e78
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/media/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ config VIDEO_TI_VPE_DEBUG

config VIDEO_QCOM_VENUS
tristate "Qualcomm Venus V4L2 encoder/decoder driver"
depends on VIDEO_DEV && VIDEO_V4L2
depends on VIDEO_DEV && VIDEO_V4L2 && QCOM_SMEM
depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST
select QCOM_MDT_LOADER if ARCH_QCOM
select QCOM_SCM if ARCH_QCOM
Expand Down
20 changes: 18 additions & 2 deletions drivers/media/platform/qcom/venus/hfi_msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/hash.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/soc/qcom/smem.h>
#include <media/videobuf2-v4l2.h>

#include "core.h"
Expand All @@ -14,6 +15,10 @@
#include "hfi_msgs.h"
#include "hfi_parser.h"

#define SMEM_IMG_VER_TBL 469
#define VER_STR_SZ 128
#define SMEM_IMG_OFFSET_VENUS (14 * 128)

static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
struct hfi_msg_event_notify_pkt *pkt)
{
Expand Down Expand Up @@ -239,15 +244,26 @@ static void
sys_get_prop_image_version(struct device *dev,
struct hfi_msg_sys_property_info_pkt *pkt)
{
u8 *smem_tbl_ptr;
u8 *img_ver;
int req_bytes;
size_t smem_blk_sz;

req_bytes = pkt->hdr.size - sizeof(*pkt);

if (req_bytes < 128 || !pkt->data[1] || pkt->num_properties > 1)
if (req_bytes < VER_STR_SZ || !pkt->data[1] || pkt->num_properties > 1)
/* bad packet */
return;

dev_dbg(dev, VDBGL "F/W version: %s\n", (u8 *)&pkt->data[1]);
img_ver = (u8 *)&pkt->data[1];

dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver);

smem_tbl_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY,
SMEM_IMG_VER_TBL, &smem_blk_sz);
if (smem_tbl_ptr && smem_blk_sz >= SMEM_IMG_OFFSET_VENUS + VER_STR_SZ)
memcpy(smem_tbl_ptr + SMEM_IMG_OFFSET_VENUS,
img_ver, VER_STR_SZ);
}

static void hfi_sys_property_info(struct venus_core *core,
Expand Down

0 comments on commit d566e78

Please sign in to comment.