From patchwork Fri Apr 2 10:06:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 414340 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1285169jai; Fri, 2 Apr 2021 03:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjJ/A3t1LvjQ5KUyPo53WLZxgHCWzl+6//dYFfRPKThwgODFUQLhySIcoQo8unEgC66UNI X-Received: by 2002:a92:dc83:: with SMTP id c3mr10955017iln.167.1617358076767; Fri, 02 Apr 2021 03:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617358076; cv=none; d=google.com; s=arc-20160816; b=Aruzx8z8big32HfIxWMqsaXFeJpUvU742C9jUFRkqODLRO6rNn9UtsGYpdARciyjlL FmYChmCEipilgVvzw+iMngsGk6cJksdG9F6WOvzLeVjY0zc8PDqIVFFrKH5RAKoDz7Gj Bg/7iLI6HNzzDUlnrrP4Uxy7fa9rdcGVrV+aJgpD1jCFcps0Jy7xKRCXqvJOaoRCx2m+ /IfaJrjh16MGfPc/zi+j+nsrGKWm390KvLiWarwI6PFg3VeQMZ0zq5gDQel5xOxykO2R DUfmLscuxmW6Canw0IIthr69kBR0YdkBkyEuoJV9mb/Tj9Y73yfdb7uNKWIeJ1ba2xDR L6Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BBliiiy6w7709FtBAKPmWC2L64XC00IR7DOPG3X207w=; b=MaknYqXtwe2XNUId30+03Y6za5ArOhfAUqTB89NkNl1oF9LErMkjnLX5RrVWZ2d1Cd npWKEV49tqJv1eggi0xQsQdtY10wSihg8/OeHvL8jjLcdzKqZGoE3ZJau6NJbYV8Pe5E 0E83uZIgNf5UfuB8pmWeSiL6bQn+b1ULgBRjBOawFUmX/SjkRZ9ZOubWrmMfLGG/Nhpc +LB2bbytyx+IVJ4cwFQ1uHGCdsfG1kUUZtHh+/YQPOcCYNcobVfpi+5NDEYrsKngqk0V hGMBlApg076mPPhopMTGEpjv6szmAOBYMEkii4RYuJnQ4D0KTrGRqrl0NzhNp3dDzool P2Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KG0MSbpv; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si6942838ile.30.2021.04.02.03.07.56; Fri, 02 Apr 2021 03:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KG0MSbpv; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S234856AbhDBKFm (ORCPT + 17 others); Fri, 2 Apr 2021 06:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234888AbhDBKFg (ORCPT ); Fri, 2 Apr 2021 06:05:36 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75854C0617A7 for ; Fri, 2 Apr 2021 03:05:33 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id i18so845083wrm.5 for ; Fri, 02 Apr 2021 03:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BBliiiy6w7709FtBAKPmWC2L64XC00IR7DOPG3X207w=; b=KG0MSbpvHxIrbY8EA1yY8buEVvgrlrGyIs4CiBQaFpFCsWG+u9U9U7yAmNv129NLcD cNwHMh64MoPgmobr+poynU16c680ESRcmbm5LQOQCuX1UUPSp1/eRC/Ll6Dv1RmTYjBF qCO3He1a3yYE1WJy+7SeejmIvcc2UvMWxCziYcbt9MokKBb7BrWPyjaF4x3ANn+U+xu8 mtFd3vuy55d5cIVdcOpy7Db5spndhuMvwJIOSaKTQZodOXXbfk3q6+Ybsx0LGm1Nv2jG 5k3e+YBOK8uHtQHiV+MUaohAB89veDvUI96i4Axwq4vMR0TXI2Hkd5ksSo61JOiaaKxe 1ISw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BBliiiy6w7709FtBAKPmWC2L64XC00IR7DOPG3X207w=; b=f36mktgGIWed6LroljorB1bpA4nVefSPiEhGXN8+KrNlvgoH6OxuuYbnVLlwyCyVMr qy3gnYBHiB+3ifrnoY7pBImG1PpZxGX94lCBEmNickH4J+JDw2V9Chtdx4owBbaUxrRK 0dRX1ukXavDF78oaTNuBBK8+GeqAJsi++eiJ01U6HOIJk4Bc4EnbnRynlsmSMHw9vW9I v9qrvXDO32Vmr6jy5BTjkDa7MRoRnaxCpq934LSqHG9lZUED7y1SDy83MDZFFu8aqrF4 5GCt+NVtXrchVnmEtEP6VXbteIeU5zWp8Xp82MST4VmfKrHZpeMLV5W816JBt+MXZ/jK ieVA== X-Gm-Message-State: AOAM5330rFJqbq/+x1cRM7PtrVS00FmSv0l6PzpKVP9pyWnd42XeE1Rv d3aI7lOR4mDLjk1zjspSZfKWoA== X-Received: by 2002:a5d:6dcc:: with SMTP id d12mr14096588wrz.136.1617357932182; Fri, 02 Apr 2021 03:05:32 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id v18sm15466618wrf.41.2021.04.02.03.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 03:05:31 -0700 (PDT) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH v3 15/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Date: Fri, 2 Apr 2021 11:06:38 +0100 Message-Id: <20210402100648.1815854-16-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210402100648.1815854-1-bryan.odonoghue@linaro.org> References: <20210402100648.1815854-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In various places in the venus codebase we have if (IS_V4()) which takes the code down paths for 4xx silicon. This logic is broadly applicable to 6xx silicon also. In this patch we add IS_V6() to various IS_V4() decision locations. Co-developed-by: Dikshita Agarwal Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 5 ++--- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 76ece2ff8d39..2515a2225614 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -488,7 +488,7 @@ static bool is_dynamic_bufmode(struct venus_inst *inst) * v4 doesn't send BUFFER_ALLOC_MODE_SUPPORTED property and supports * dynamic buffer mode by default for HFI_BUFFER_OUTPUT/OUTPUT2. */ - if (IS_V4(core)) + if (IS_V4(core) || IS_V6(core)) return true; caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type); @@ -1084,11 +1084,10 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode) const u32 ptype = HFI_PROPERTY_PARAM_WORK_MODE; struct hfi_video_work_mode wm; - if (!IS_V4(inst->core)) + if (!IS_V4(inst->core) && !IS_V6(inst->core)) return 0; wm.video_work_mode = mode; - return hfi_session_set_property(inst, ptype, &wm); } EXPORT_SYMBOL_GPL(venus_helper_set_work_mode); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index dabff8654f97..24cf20f76e7f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -897,7 +897,7 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) * enable it explicitly in order to make suspend functional by checking * WFI (wait-for-interrupt) bit. */ - if (IS_V4(hdev->core)) + if (IS_V4(hdev->core) || IS_V6(hdev->core)) venus_sys_idle_indicator = true; ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); @@ -1577,7 +1577,7 @@ static int venus_suspend_3xx(struct venus_core *core) static int venus_suspend(struct venus_core *core) { - if (IS_V3(core) || IS_V4(core)) + if (IS_V3(core) || IS_V4(core) || IS_V6(core)) return venus_suspend_3xx(core); return venus_suspend_1xx(core); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c20496a14a55..5cefa396f2b5 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -670,8 +670,8 @@ static int vdec_output_conf(struct venus_inst *inst) if (width > 1920 && height > ALIGN(1080, 32)) ubwc = true; - /* For Venus v4 UBWC format is mandatory */ - if (IS_V4(core)) + /* For Venus v4/v6 UBWC format is mandatory */ + if (IS_V4(core) || IS_V6(core)) ubwc = true; ret = venus_helper_get_out_fmts(inst, inst->fmt_cap->pixfmt, &out_fmt, @@ -722,7 +722,7 @@ static int vdec_output_conf(struct venus_inst *inst) return ret; } - if (IS_V3(core) || IS_V4(core)) { + if (IS_V3(core) || IS_V4(core) || IS_V6(core)) { ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret;