From patchwork Thu May 4 09:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp180769vqo; Thu, 4 May 2023 02:49:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UyLoi2/hxfk9rVtUJWjW8tBiQI0qpm6Dy1o/Gj7E/pe4NInE+N/W98c0Q3MBtjzWy4p8T X-Received: by 2002:a05:6a21:2d85:b0:f2:aa3c:fc6e with SMTP id ty5-20020a056a212d8500b000f2aa3cfc6emr1707872pzb.43.1683193762641; Thu, 04 May 2023 02:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683193762; cv=none; d=google.com; s=arc-20160816; b=la9TyYe9N6tBaxYKePBaaGCnCm0CqIpVjX76LqiJKnirWCwJjIQfvwdG54o6RFiJU7 0IcK1MzGMIkYCfzqa8Ks4rX0ZXmBFtMcbwIHJhS8VR1L+w6LDOHaO2sNzZlTLPYABx++ NEeOXIYBRnkxLRT9ZQ/sIC2i9iVh1svi2riuYLREHgkwg63p97YCBdCByTnsxtlrFxEe PkN9+ewZ2h1CwHcne9+E+BQsn9g7H+pBVLsKHvCQNYiC1qxGgUE5bblKe3GCmiXOngcj 27q/pzTeDDOFB+6k1RNAx8yLfb2jvAIt+BcaKR97BphWurhcEM5ePuxSnFwJjss8v+JB X5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=gyE76KAVVxtC2ZYI2xWbVFQqw8nDbeeuFh1hMTGYRhc=; b=xC5ZizW4G5vNO5vCGQ4LPuFLvJDa5YaE6wp73uVMl5YMuaSomGc4r54UAvrI1lOS2U 73IgNCGtI95sjW7XROERKGT91COoG3yujeSNmN0UETPRx9HfulJ4fYK6bGEVov93DxB2 iHfHo13+snImPfgUD3CEoNW1o8658VxwNMk7VFvKzP4nVAv8NxaE5dP61o2jtOJ8SzZz 6dZahp58cZL5YKquOK5mP0lLAtz3jbE7uf39HQOrvF4o+EXG26kSHFv5xDkzrniBNTyR avbTI+qc/aT+8/4GFpkq0QDI5y8rBPfZJWS60IpYvszGgvP4h5EXWje6Ez5SDoSEIQpD 3zQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bkcYHKun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a654847000000b0051b1542d6efsi33604572pgs.213.2023.05.04.02.49.07; Thu, 04 May 2023 02:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bkcYHKun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjEDJjm (ORCPT + 99 others); Thu, 4 May 2023 05:39:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbjEDJjg (ORCPT ); Thu, 4 May 2023 05:39:36 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2209149DC; Thu, 4 May 2023 02:39:35 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3448F4ZU023960; Thu, 4 May 2023 09:39:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=gyE76KAVVxtC2ZYI2xWbVFQqw8nDbeeuFh1hMTGYRhc=; b=bkcYHKunRA8kcFag57KxrDu8z900oHzDegTck12+dVgUE7znJ1LhW9F+qm7VjWY5riEP ryd7Es1yZuQUkxL++CJkeYutaikNAGfwUFqFM26vShXM9wElotvdtfQAX5haveCQkUwU z2eAl0oAus1TBALnr8ZPEQww5ps0jvKL4slGLzuu7Y5CNpwcSa2XZZW2o6yTb9juq+t1 tVNELBb2wcXyWwTXTj+lvhEZZgRijlhVeVzzZZMLqtebgritSQl/u6PAVVJGebAeGdgK IBqvfIymoKPoKvDMpTq5smqTqEN6qqoE9hBRXvm6DVH/gUFPnX14aZgM/uqwpEGip1cs qQ== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qbn0aak4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 09:39:31 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3449dRPn014323; Thu, 4 May 2023 09:39:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vaksvr7-1; Thu, 04 May 2023 09:39:27 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3449dRsT014317; Thu, 4 May 2023 09:39:27 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-dikshita-hyd.qualcomm.com [10.213.110.13]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3449dRiP014316; Thu, 04 May 2023 09:39:27 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id B926236CA; Thu, 4 May 2023 15:09:26 +0530 (+0530) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dikshita Agarwal , Viswanath Boma Subject: [PATCH v3 1/3] venus: add firmware version based check Date: Thu, 4 May 2023 15:09:10 +0530 Message-Id: <1683193152-5808-2-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> References: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: l5MvXY7wtNgdVypWyT--NgfkyO4S0v8O X-Proofpoint-ORIG-GUID: l5MvXY7wtNgdVypWyT--NgfkyO4S0v8O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-04_06,2023-05-03_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 mlxlogscore=732 mlxscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040079 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764956506632814034?= X-GMAIL-MSGID: =?utf-8?q?1764956582974994910?= Add firmware version based checks to enable/disable features for different SOCs. Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Tested-by: Nathan Hebert --- drivers/media/platform/qcom/venus/core.h | 20 ++++++++++++++++++++ drivers/media/platform/qcom/venus/hfi_msgs.c | 27 +++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 32551c2..2f2176f 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -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,19 @@ venus_caps_by_codec(struct venus_core *core, u32 codec, u32 domain) return NULL; } +static inline bool +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 bool +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 diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index df96db3..4854863 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -248,13 +248,16 @@ 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; size_t smem_blk_sz; + int ret; + u8 *ver_str; req_bytes = pkt->hdr.size - sizeof(*pkt); @@ -263,6 +266,26 @@ sys_get_prop_image_version(struct device *dev, return; img_ver = pkt->data; + if (IS_V6(core) && core->res->num_vpp_pipes == 1) { + ret = sscanf(img_ver, "14:video-firmware.%u.%u-%u", + &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev); + if (ret != 2) { + dev_dbg(dev, VDBGL "error reading F/W version\n"); + return; + } + } else { + if (IS_V6(core)) + ver_str = "14:VIDEO.VPU.%u.%u-%u"; + else + ver_str = "14:VIDEO.VE.%u.%u-%u"; + + ret = sscanf(img_ver, "14:VIDEO.VE.%u.%u-%u", + &core->venus_ver.major, &core->venus_ver.minor, &core->venus_ver.rev); + if (ret != 3) { + dev_dbg(dev, VDBGL "error reading F/W version\n"); + return; + } + } dev_dbg(dev, VDBGL "F/W version: %s\n", img_ver); @@ -286,7 +309,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"); From patchwork Thu May 4 09:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp180795vqo; Thu, 4 May 2023 02:49:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4oWSALY5bqL2HWpTu/C5oCSV4Be004JqrancCHI4Ww8P2xDshxTJCHaIcI6YJxUShavI8D X-Received: by 2002:a17:902:8683:b0:1a6:84be:a097 with SMTP id g3-20020a170902868300b001a684bea097mr2605016plo.63.1683193766838; Thu, 04 May 2023 02:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683193766; cv=none; d=google.com; s=arc-20160816; b=Tmkr7EJb/Q3zVFn3nRKb+KDP6gsJoGj4z3sQIfefCCXv07/YRE978dxSushZUBG0Wa WN+P8ZyfNCP18br7h10pjtOG1MFmF9tJikOcBPEJyQsrBJxzA7Qlnz5UIMYfcj8xi1+M sus0jVha/8/XzXLXvu6Ep0XHP/meqMu5uyv9pD8fWBIffkEMfP9hNQ8d/TfWQSEq9FOX SXFkYlBU6C61p2CxIaSHjmooDEAGQcXqLmYeMOS/yP5k56SsBQwBiMOyxqIvIkER1qiv dbdUUam2XHu6NasJzr6/P0dYZgrPXQQjgYxQwLlGza4eC/3RO1y7oV6s2xos5lyA2B8v nHOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=LyQSYCNjRKReWAAcEI2z/ca56QcNkiq+9YhTD1jSC+w=; b=Aw8XPX1ERpPaIN7jBuJeSJOey0Nb0O7qEnJxPVnfbAIlurV+klKvNMd4/himXVhtG5 hzEG96D3f47W3MOb2tvfUY0lAHG1QqKkxFd46MIhCzDaFeJJ0eBMc/JRYD0LaTLmH6nK ZnG5WPI3Out5m9EFLmtFFthK0IvAJmpKqaxOP4vDOJPVPcY8+pWYc1eYtBOCpr0k1l68 NGlehJv2gInSxAZA3MUyr6eq41rn30t513ezFz6JlfzKI4o799URwHdjdB9m2PXnc+Mi /cb8PlpVDoU9uZJuoPg+uNAveBA5+qxTc4nU7c1fMwjdpdXSCIhRBLFhXvrD271WfeDA 3/Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JeeUvYCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a170902f60300b001a64e866c8csi37092775plg.374.2023.05.04.02.49.11; Thu, 04 May 2023 02:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JeeUvYCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbjEDJji (ORCPT + 99 others); Thu, 4 May 2023 05:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbjEDJjg (ORCPT ); Thu, 4 May 2023 05:39:36 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D304C12; Thu, 4 May 2023 02:39:35 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3448I8NA008958; Thu, 4 May 2023 09:39:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=LyQSYCNjRKReWAAcEI2z/ca56QcNkiq+9YhTD1jSC+w=; b=JeeUvYCeXFvc2chvtn7cyBRKc748cxXnQSZB8zpYF0YHQOriiUEGZfjxLfhZkAn+tMGp YvwBGbLtpmJ3a7EXCTtcXjTr0VdtCk94t1G4ALBJMYsPFvuyAru5hEJCwwnpAnXgWy3M mYkqgMSePY3M7N2dGf5iDImakPOCoEQBGbo5Rg2Rm9JgULpVLQUjIoNDoEkCHsDeu59i W3zd+aoYKIPq6x75TvMWPzZmRxAuElglZSUnSBIpk145i9N2ssi/aVpgLNg3jw/BLr0I DAYt4Uuv+yGmk5ARM0Fo02q+N/tRnvd99h7ZoZtq9UM/MUm2R0x8MWawsuIWlV2x4LfM +A== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qc5bn0k7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 09:39:31 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3449dS0E014336; Thu, 4 May 2023 09:39:28 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vaksvrc-1; Thu, 04 May 2023 09:39:28 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3449dSOs014329; Thu, 4 May 2023 09:39:28 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-dikshita-hyd.qualcomm.com [10.213.110.13]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3449dSDv014328; Thu, 04 May 2023 09:39:28 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 89C5B37B0; Thu, 4 May 2023 15:09:27 +0530 (+0530) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dikshita Agarwal , Viswanath Boma Subject: [PATCH v3 2/3] venus: enable sufficient sequence change support for vp9 Date: Thu, 4 May 2023 15:09:11 +0530 Message-Id: <1683193152-5808-3-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> References: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: a6hNVfWVfVlCaBLBM8MJ1wL2Hgu24zxR X-Proofpoint-GUID: a6hNVfWVfVlCaBLBM8MJ1wL2Hgu24zxR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-04_06,2023-05-03_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 suspectscore=0 mlxlogscore=906 clxscore=1015 priorityscore=1501 malwarescore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040079 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764956587225312996?= X-GMAIL-MSGID: =?utf-8?q?1764956587225312996?= VP9 supports resolution change at interframe. Currenlty, if sequence change is detected at interframe and resources are sufficient, sequence change event is not raised by firmware to driver until the next keyframe. This change add the HFI to notify the sequence change in this case to driver. Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Tested-by: Nathan Hebert Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/hfi_cmds.c | 1 + drivers/media/platform/qcom/venus/hfi_helper.h | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 930b743..e2539b5 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -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 d2d6719..2e03b6e 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -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 \ + 0x100300b /* * HFI_PROPERTY_CONFIG_VDEC_COMMON_START diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 4ceaba3..f0394b9 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -671,6 +671,14 @@ static int vdec_set_properties(struct venus_inst *inst) return ret; } + /* Enabling sufficient sequence change support for VP9 */ + 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; From patchwork Thu May 4 09:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp178710vqo; Thu, 4 May 2023 02:44:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uMmPo43cAHK0pZ41bcWm/xtacdR0l3RbbEfkTQX4R/iYamh+FFroR1KcIjJJySG/RyVFB X-Received: by 2002:a05:6a20:8e2a:b0:fc:8e7e:92ce with SMTP id y42-20020a056a208e2a00b000fc8e7e92cemr2000932pzj.47.1683193474920; Thu, 04 May 2023 02:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683193474; cv=none; d=google.com; s=arc-20160816; b=tOD4l537wtKHoCB1wYC08MMkaWsYbvi5yhXFJFaTN7FU0hyHgrvgG2J5drRVuAnlZq kriFNqFrqSpiF99dCF0TsC/2OE6oYlCQNIJV92bpp4SD3hDUzLqKfhUQChXTKfUum1Iv b25ml6eEcfnwKzbqobilfQqk5WozL+1+UrNmav9SV76NxdpfF1jseMANZO20X0RWtz6a XT7a7tCrwLdh7+4YKBATeT/k67nFakeD2TVmD3eT2EYIn8VXNtHJ5/0gZT0637V/2f4v 0Sts5My72s/6Ke7BRqzQdaUDY1DBnim1aMUxEoyhO47AEcb5C/AqqVlqEgy0VtOU3bpI J4sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=C9wzoPtLCU63h+rhywL+/1qenadUnZlqR9zI3riRUpY=; b=NWwrNJe9WyGZDySyMvsKLoQDrZVCA1QHiV2BCQLYharZJdc4oiz/SPc3oR/TQOFhSN h0Lqr1Di/mGmjC0banjk57SWrrUKO7M0ja2FNQA/Lx7Ql0fho2Cy7SHtE2KwWsBvmGGF BJU+E3GwmYyYqImwuFmdWX8RccKlqC4S6xzP7R/656kTZLwXT4iRSyOGHrI2N6FqiG1h vwwnrvvSvHHNWjXJZAO8Xhfi0Hfee7FkEI8FWdhK2JFKGh3JKcHENyFBHTuO0I6X4pfJ POK06phYL3dLaO54lM/0AhSnVvRgne9tYQS9fEz/CHJiygwOxfPfNExlQX1ee/7OFo9+ V5yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="SpXHo2x/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0051b603fe4f9si33806709pgb.876.2023.05.04.02.44.21; Thu, 04 May 2023 02:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="SpXHo2x/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbjEDJjq (ORCPT + 99 others); Thu, 4 May 2023 05:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjEDJjg (ORCPT ); Thu, 4 May 2023 05:39:36 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055CE4C18; Thu, 4 May 2023 02:39:36 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3449KORb028223; Thu, 4 May 2023 09:39:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=C9wzoPtLCU63h+rhywL+/1qenadUnZlqR9zI3riRUpY=; b=SpXHo2x/CsytC4Tj5i1u+ZQGkXW8zTZ6K+NXvHjvN2PBEx/eDCu1UV6krbVDLC1vxO8O rzaw2MxcPhp9xHhlEEJrE9HgCwqqWwHNmrAaS59rMkszS0jEAAaKkau/YxYi2be+etDh kPczNNGeZBubsMSaEJu0jUbJCPEwuHRB559TGRanuUEjHB1W3e5VXK74uNt3e1+fwIbA yju+G1GcYysC+fluzcwyqRiQ1akCrQ1LjOxBttSeK2HTdfIv9ulZDQ3J+edEJPvHAtFN 1U7XvNYSDatfXvakZvMbPtoOkWepRyGjfmhGRXiCiz5JCq02jX1qRqthlTEfuuldewcU Fg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qbvghhgka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 09:39:32 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3449dRPo014323; Thu, 4 May 2023 09:39:29 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vaksvrk-1; Thu, 04 May 2023 09:39:29 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3449dTZX014345; Thu, 4 May 2023 09:39:29 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-dikshita-hyd.qualcomm.com [10.213.110.13]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3449dTtl014343; Thu, 04 May 2023 09:39:29 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 63B5936CA; Thu, 4 May 2023 15:09:28 +0530 (+0530) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dikshita Agarwal , Viswanath Boma Subject: [PATCH v3 3/3] venus: fix EOS handling in decoder stop command Date: Thu, 4 May 2023 15:09:12 +0530 Message-Id: <1683193152-5808-4-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> References: <1683193152-5808-1-git-send-email-quic_dikshita@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 0bAQjLzvxSEJopj3bsHuNit8Ls5CAuU4 X-Proofpoint-GUID: 0bAQjLzvxSEJopj3bsHuNit8Ls5CAuU4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-04_06,2023-05-03_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 suspectscore=0 malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 spamscore=0 adultscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040079 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764956281052680770?= X-GMAIL-MSGID: =?utf-8?q?1764956281052680770?= Use firmware version based check to assign correct device address for EOS buffer to fix the EOS handling with different firmware version. Signed-off-by: Vikash Garodia Signed-off-by: Viswanath Boma Signed-off-by: Dikshita Agarwal Tested-by: Nathan Hebert Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index f0394b9..c59b34f 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -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;