Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1061979pxf; Thu, 25 Mar 2021 23:35:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzen9WDr6CaHoGaTA8a2y7uepMkmATeUJPvQ9mbmqLmXyuk0Au1JyPA6klv87wiv6Z+5C8O X-Received: by 2002:a17:906:3f87:: with SMTP id b7mr13545216ejj.139.1616740534953; Thu, 25 Mar 2021 23:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616740534; cv=none; d=google.com; s=arc-20160816; b=yPLAMS8RTa/S/aUageD/eE03DXyn7uZU94Tu6+tCdZP+gaEYhfA7l1GayaxF8OU8x+ W6dhO3YyMT2r7u5AYDH9pAMmZ2CkZFDXcuSUk3FGUcYs2TO9La/r6ssFgfwj7WQIStZr 0yPgGLrM9nU/hRAJR/0xjO5gfTCXxjGKEgMFIYaON4Ubh9LZ7GOnkzHdnS4Fb69Ip8f0 UG3CNXUU9MEFQGh1/riL1XpIcRIZHwD0yJZGBZ3ZasKDF/bQep+pT70YgU7SHXmO7AlU KRdqt7T4lK4yRGxP5gb/QOl8o4nqFw8II0TrVJz9XyiFPHF7ZqZBudW/pQgLqwI+gphg HRzw== 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=mmGuztiR6IRAIoKX6/QQStSGqKoz6kMMsQELFWrZq4E=; b=pDYApjJMmp2RvvyIwPoHl0sC2q3JWdVaEi2PDXxMH56SjGoOMtchSWzqUHopBBzgPz TybzQr2q66oxk0+eubKTQP2xBhS38G+5Gsn6GRgZPv9kJ1ZqtdczuH6EDzOecsTZObOX +uwqCToU0euxEHY7xQVKOQG60J0xnFvLpVkdbSnIKMCUyCyhqb5oZ975kflIad+csQCT tEnGB2LqkHILyvW0Ldr34P1+xNQSg9WtRAyX6hN+ZtXPh6fve2WR9MzQ4pQxfwKto7rq rWF3abArasItG5ON4es/EjZvReQkxa6iHmLMWKUQ2w/4eY/uJAgptf08VPnNClclhC6z /H0g== 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 b16si6196345eds.502.2021.03.25.23.35.12; Thu, 25 Mar 2021 23:35:34 -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 S229969AbhCZGeO (ORCPT + 99 others); Fri, 26 Mar 2021 02:34:14 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:32782 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbhCZGdw (ORCPT ); Fri, 26 Mar 2021 02:33:52 -0400 Received: from ironmsg07-lv.qualcomm.com (HELO ironmsg07-lv.qulacomm.com) ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 25 Mar 2021 23:33:53 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg07-lv.qulacomm.com with ESMTP/TLS/AES256-SHA; 25 Mar 2021 23:33:50 -0700 X-QCInternal: smtphost Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg02-blr.qualcomm.com with ESMTP; 26 Mar 2021 12:03:34 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 78EC3218B5; Fri, 26 Mar 2021 12:03:33 +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, Dikshita Agarwal Subject: [PATCH v2] media: venus : hfi: add venus image info into smem Date: Fri, 26 Mar 2021 12:03:25 +0530 Message-Id: <1616740405-5085-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 Changes since v1: adressed comments from stephen. removed unwanted code. --- drivers/media/platform/qcom/venus/hfi_msgs.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 06a1908..6b6d33c9 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_INDEX_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) { + size_t smem_blk_sz = 0; + u8 *smem_tbl_ptr; + u8 *img_ver; int req_bytes; 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_IMG_INDEX_VENUS + VER_STR_SZ) <= smem_blk_sz && + smem_tbl_ptr) + memcpy(smem_tbl_ptr + SMEM_IMG_INDEX_VENUS, + img_ver, VER_STR_SZ); } static void hfi_sys_property_info(struct venus_core *core, -- 2.7.4