Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1428026iob; Thu, 19 May 2022 06:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEgfwbPN7EcNXCvKBZvD1/NO4nS1hKA5tIlYxm/Mh1mxTZvQKvTHJ9iOIPN7EwetBjnHmR X-Received: by 2002:a17:90a:cc6:b0:1d2:9a04:d29e with SMTP id 6-20020a17090a0cc600b001d29a04d29emr5180627pjt.136.1652967075156; Thu, 19 May 2022 06:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652967075; cv=none; d=google.com; s=arc-20160816; b=ILoOtZ+BP7zrbEZYFTaXDV8ceTZ7ExjwG0HBn6Ld93BpeObDqJxXZw+zlyOTrDhUZC TnrzYX2+nkOjTmV4dGVC0+It8swQpgT6h1HgciDdHTUA6p18Qz9NKZCsVNOv9qHLobgx 3cr3el/NaYvqTpXy5Ykj0mh4NYWmxXdM7zXCgV+o+0jrYuJnrXlfTzc4rzPV6hFSKyAb RiYakSDwGR7EyPXyiLRGxs4X7a273Avt62o/wCi4pFwekeLOkmAb1wibgJNOXbzXHzm0 VTkADdTGIuEidna70mNFt4ObGImb+4EXin+Oc9zQqXV/R6rh+uHlYIElI6m6Dl16TgWa wfDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=ffzJdDsrpiOXwHfaBnfKeYfCI/DEp+tB96pIcEPg41s=; b=zhxZ0ZzlBD7hyzlPDStuoynTxEdfEPVurPeE7/QRLhdvZp9iCSk9p7Jzmm36CeWabp 9iJ27thd7SCWEGWDkWuUT8/rocF+4psaFvUWkd/hk4EFTCjYrCa+91c58swSkl9vMn+D FFZSCmhilpiIDVdpc3e0lq782oIA/VLgFgnRIG+2gPEq+ab1PbUZi40iJXdC/Mw5GwOL ejWv7C2NtxEXtUFZ04ZB4K+w/k6qiyIA0egdNQrnScq1+m9g1Djw++P8tkM5p+ZGkqP6 dA4gqUWVAPiyJWJPv7lSl6YG7qGg/P22V/IHKt1phmDfro7oTNeQScvBmQ10Q/AjvjCm wLMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="FxOHe/Dq"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a170902e48200b0016178ad9a19si6090118ple.75.2022.05.19.06.31.01; Thu, 19 May 2022 06:31:15 -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=qcdkim header.b="FxOHe/Dq"; 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 S236161AbiESJbe (ORCPT + 99 others); Thu, 19 May 2022 05:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236155AbiESJbc (ORCPT ); Thu, 19 May 2022 05:31:32 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 526545C858; Thu, 19 May 2022 02:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652952691; x=1684488691; h=from:to:cc:subject:date:message-id:mime-version; bh=ffzJdDsrpiOXwHfaBnfKeYfCI/DEp+tB96pIcEPg41s=; b=FxOHe/DqDJcqI4B7CDKTA7iZ21quTEteaV5OI0yZQ+iiycY6TLV24rNC 4TJG4Om6asnVu/E1Hgwvj+5aN/WqZ0gzThNEoOHsqrx5q7M7MFq+L9APJ cPVvRfm/tR56eDCyoazgUX6BrfeWmKEQ5K+K5dvnUAfDZTxLWToa3LMoh M=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 19 May 2022 02:31:30 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2022 02:31:30 -0700 Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 19 May 2022 02:31:27 -0700 From: Vikash Garodia To: , CC: , , , Subject: [PATCH] media: venus: hfi_platform: Correct supported codecs for sc7280 Date: Thu, 19 May 2022 15:01:18 +0530 Message-ID: <1652952678-14747-1-git-send-email-quic_vgarodia@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 VP8 codec is deprecated for sc7280 SOC. Fix in platform layer to update the supported codecs accordingly. Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/venus/hfi_parser.c | 6 ++++-- drivers/media/platform/qcom/venus/hfi_platform.c | 21 +++++++++++++++++++++ drivers/media/platform/qcom/venus/hfi_platform.h | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index 5b8389b..6cf74b2 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -234,6 +234,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst) const struct hfi_plat_caps *caps = NULL; u32 enc_codecs, dec_codecs, count = 0; unsigned int entries; + int ret; plat = hfi_platform_get(core->res->hfi_version); if (!plat) @@ -242,8 +243,9 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst) if (inst) return 0; - if (plat->codecs) - plat->codecs(&enc_codecs, &dec_codecs, &count); + ret = hfi_platform_get_codecs(core, &enc_codecs, &dec_codecs, &count); + if (ret) + return ret; if (plat->capabilities) caps = plat->capabilities(&entries); diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c index f16f896..bc9b431 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.c +++ b/drivers/media/platform/qcom/venus/hfi_platform.c @@ -2,7 +2,9 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. */ +#include #include "hfi_platform.h" +#include "core.h" const struct hfi_platform *hfi_platform_get(enum hfi_version version) { @@ -66,3 +68,22 @@ hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec, u32 session_ return freq; } +int +hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs, u32 *count) +{ + const struct hfi_platform *plat; + + plat = hfi_platform_get(core->res->hfi_version); + if (!plat) + return -EINVAL; + + plat->codecs(enc_codecs, dec_codecs, count); + + if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) { + *enc_codecs &= ~HFI_VIDEO_CODEC_VP8; + *dec_codecs &= ~HFI_VIDEO_CODEC_VP8; + } + + return 0; +} + diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h index 1dcf408..ec89a90 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.h +++ b/drivers/media/platform/qcom/venus/hfi_platform.h @@ -66,4 +66,6 @@ unsigned long hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 code u32 session_type); unsigned long hfi_platform_get_codec_lp_freq(enum hfi_version version, u32 codec, u32 session_type); +int hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codecs, + u32 *count); #endif -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project