Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1981988iob; Thu, 19 May 2022 21:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylsajM/zkgfi6mTuQyWvb5PLiHN0DV0HN2rmE9WPImxLC3Vt7xfh7eF1ajR/GmG5bCym62 X-Received: by 2002:a05:6402:2937:b0:42a:b442:95f with SMTP id ee55-20020a056402293700b0042ab442095fmr8883278edb.12.1653021415897; Thu, 19 May 2022 21:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653021415; cv=none; d=google.com; s=arc-20160816; b=MqpAFSOa4Vhe3RHKt7JwOekY02bV5oCexiz/lZM4T0EwTuB1fWSuUqjSA4ZbM+uNmU 6zE2syuJxQDGzJLliyxMGRRF+VatkRRAXR8ov7VISWq6CwdX6/VRWZXKcRqGWm9HnPf2 unPyyTo9rLhMVKPptuHrfTicW4ryqtcRpvS486VxgNm9tHkouHt4ckom7a2Z1Dr8esua m65ACfJ03cRGK/iKLkmD/ayoPlDLpiPTmSL5zigSW1pGcZ3Bz0Pgw9J6bETJnMADQVjD FzIzBvxl5aKBdBL9gUG1ZApn6dj77vu/TXb7CuDQHuJRJxwe+2tM+dXt/PXOk1GKhx7N NTQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kk+3RWtEnWLHYV4TCesNJ2Di/nKpfHOUcfcAM49IYBo=; b=jPaosiuHjOanGwkrbLh9s7Ch46L3tdMEqncdU9KgZovfBlcFxn8Vg6YWR7vAKE13z8 5q4eZKg3p7wfIx1av52Psur6hw4bk+koURNlxnbCX8yzUAnYQq4b6U6BrbULr2MKTBa/ m6K45AdIIy0F3Xsp6ry64pPzqW+vtRPf7n/GdJFVJGl46gtcbTQzwEhBpN51VkpY/cap 99WfcaWZ2oeWpAizVvTUh2ADSRwVhKL/esRRFqmiUK22TDtlRMxeDb+eQU8BBURDhbpi LEKzS0+b0OfPulFMoXFO1HZMSVpjFpzUKlJSYFt7QcOWvJCv28qhVL6iL4a4Ab054h10 HOKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GocAhr9e; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn1-20020a1709070d0100b006f3b92b634fsi8367255ejc.963.2022.05.19.21.36.30; Thu, 19 May 2022 21:36:55 -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=@linaro.org header.s=google header.b=GocAhr9e; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240215AbiESPD1 (ORCPT + 99 others); Thu, 19 May 2022 11:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240429AbiESPCp (ORCPT ); Thu, 19 May 2022 11:02:45 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D66123DDDC for ; Thu, 19 May 2022 08:01:01 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id r30so7539235wra.13 for ; Thu, 19 May 2022 08:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=kk+3RWtEnWLHYV4TCesNJ2Di/nKpfHOUcfcAM49IYBo=; b=GocAhr9e187YQKtgNkdpHhdUDju/RzbLC60GmlECdUgxlL9I3gef4M7pfbSDxlIaIp v62nz9WQT97MIzuGBXzwXaJI6rFKb+lnMmoOJ8fvNlg7pMkL4m6swQOMzRYsys2E2oJD H3IRH0JxDx9SIfvZgOqQWmTF+Oa6ZyWrzq4dASmiYpDFLTC8y1QfoqkmHNAuDSQREAuQ 0U/tVJv770uvuxvjLfvVNuwaDlunG7nqzURMPGudL6oymsTG1sWZvVDkSGtnSCei1Skt SB1yPXw+ZGv89/VgytknCkzbZ4CZsI4+0loNWdEc8qssSvMV+4pw612yNGwpUqIvhMpK mjAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=kk+3RWtEnWLHYV4TCesNJ2Di/nKpfHOUcfcAM49IYBo=; b=TzPM1Ew847EULdWeT2ifGEj9MhTpBFd6hFJN4XbzrNjT+qwvdrJhcrRx+Sn6Dgh7dW lq8mpcKnsX8k+hVSyo559FSWFbpnlPG7ARk7xXjgZKA+NsyszdzyX+XvIxzt9RckQCpk OAIpQwzBF4TX+IgePIzCFAWrV3KuLuqZkoLB32+0aOtUMGCAAf5hrQafNfHGvHuUFqt4 2lT11NtwBPSbzL2NkEwF/osu5S1lXdKEEq/UzebeldsPE2Y2+Bnhj0BGJ9t01rnMMK2W i4PMw5FG+p1IJ7Wob8zTLeqQOHkHbYjxK0eb72SA88vzIAnukppxz/A9Xz1w0iQIw1yp kjeA== X-Gm-Message-State: AOAM530zqTIUyc1CpX2hrFWM6btYqj/YW90NRVARpgUmktmzJTTMEoA2 Haeh5xvCsdK2jaS2orokiNJ6tA== X-Received: by 2002:a5d:4112:0:b0:20d:b5e:e9bb with SMTP id l18-20020a5d4112000000b0020d0b5ee9bbmr4434628wrp.655.1652972460359; Thu, 19 May 2022 08:01:00 -0700 (PDT) Received: from [192.168.1.17] ([84.238.208.203]) by smtp.googlemail.com with ESMTPSA id f21-20020a7bcd15000000b003942a244f30sm8373216wmj.9.2022.05.19.08.00.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 08:00:59 -0700 (PDT) Message-ID: <270cf1d2-fd41-d206-06b6-78442641ba66@linaro.org> Date: Thu, 19 May 2022 18:00:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] media: venus: hfi_platform: Correct supported codecs for sc7280 Content-Language: en-US To: Vikash Garodia , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vboma@qti.qualcomm.com References: <1652952678-14747-1-git-send-email-quic_vgarodia@quicinc.com> From: Stanimir Varbanov In-Reply-To: <1652952678-14747-1-git-send-email-quic_vgarodia@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 On 5/19/22 12:31, Vikash Garodia wrote: > 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); I guess some of the static code analyzers could complain, so please check plat->codecs for NULL: if (!plat->codecs) return -EINVAL; Otherwise look good to me: Acked-by: Stanimir Varbanov > + > + 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 -- regards, Stan