Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1279825pxf; Fri, 9 Apr 2021 04:48:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu7vK8M2llXnr4ivfGZfZ3KBvg0QStz9AZQLcf2Lm4P+xIiz1I7Idi0N9hHnpvq6kCAEdY X-Received: by 2002:a62:ee09:0:b029:247:56aa:dfa6 with SMTP id e9-20020a62ee090000b029024756aadfa6mr2061534pfi.69.1617968888732; Fri, 09 Apr 2021 04:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617968888; cv=none; d=google.com; s=arc-20160816; b=Y57y3DgpHAv2bFu67abWDKAA9TeW+6x/d87Efw5DKnehZSk8BFCoXhTDbWQeDj5O/E w2Ek5PT+eqqB0ruzHcFXCZTjWNFm1ZcM5jY8PssZn77n1YS9GnCcOFfD04nhgpDWq9fF 9l8LZGcN7+y5jZVDxv2ESTcfmiJ0SVdb4mLsuUFKJbSBDbm7BgC9q59Ek/3p2SaDatL5 n5c5jOlAG2CPGgjJr+uZOl6GY281SZXxuXl3uPVMfbnslC4lyurNiOz4JiXV1LiDMM0C 8A08XTU9bz6ubugAz6kAmv7HDSNlrcJHpL64StriBsNCwEPJoQN0vYgD01ep6Hsv+l/Z tjtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=RzYnH5FJXTuQVgNEm/YmanVnGJF6y4RPNW4fy+JoWSU=; b=dJpvMbMxixgZt3sNGsO+CH0aaOrCt6/a9CfU85czrjXvJz8bJ6Slo7mieeX8258/WT wM/naawXAnS88tYuLG7xvDdQCfPfOb/6d6Zyb4QySm+E33tj0X6hCiukW+8k8orpfIDo +Tm/ptCrnNI7euaY/SDaR9Jo5T/peLO2eBBmxVbbsKGKY9EGKXalcaXQQ401wBosWRV7 43bRC3gNzoZzgrMfR604W4au8G6vVTzRosaNsG/bGwQgVnUjgx3Iw2FT7PRWH+nvsiBS YtkoUTNcBFEvAzCLijYit43d8eUn0uFyYBz4Lkw6BGt22AX9YVVpkPTYst7enJYdLsuG 7v0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si2978865pgn.256.2021.04.09.04.47.56; Fri, 09 Apr 2021 04:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233008AbhDILrL (ORCPT + 99 others); Fri, 9 Apr 2021 07:47:11 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:34505 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbhDILrK (ORCPT ); Fri, 9 Apr 2021 07:47:10 -0400 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 09 Apr 2021 04:46:57 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 09 Apr 2021 04:46:55 -0700 X-QCInternal: smtphost Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg02-blr.qualcomm.com with ESMTP; 09 Apr 2021 17:16:33 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 1DEEE217A8; Fri, 9 Apr 2021 17:16:32 +0530 (IST) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, swboyd@chromium.org, bjorn.andersson@linaro.org, Dikshita Agarwal Subject: [PATCH v4] media: venus : hfi: add venus image info into smem Date: Fri, 9 Apr 2021 17:16:19 +0530 Message-Id: <1617968779-28526-1-git-send-email-dikshita@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fill fw version info into smem to be printed as part of soc info. Signed-off-by: Dikshita Agarwal Reported-by: kernel test robot change since v3: added dependency on QCOM_SMEM (Stephen) --- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/qcom/venus/hfi_msgs.c | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index fd1831e..9c75e88 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -543,7 +543,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 diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 06a1908..74cfc4f 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "core.h" @@ -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) { @@ -239,15 +244,27 @@ 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, -- 2.7.4