From patchwork Tue Oct 5 08:10:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 515237 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1794167imy; Tue, 5 Oct 2021 01:11:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+/c/KRAIoUIRIT5SlnnPZ1QImcdmKP8Iiw94ABGBqF7gFzpNAyxg0GgeiQy4FTBEVYGc/ X-Received: by 2002:a17:906:c246:: with SMTP id bl6mr22628988ejb.80.1633421483827; Tue, 05 Oct 2021 01:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633421483; cv=none; d=google.com; s=arc-20160816; b=H+HuRHD/imeeEl81BrP/4VZj9VRqklG59G+vQ4oT+c0wvxRfDNYrgMKv91QBAvr0YK P5rkvou2c22L47z3YnLTpqsxZl5UryVzu3d6ZWrbLK3zAdirjBws5xxCuqWPrTi8CAv6 So1eUagctK6Z8FHlcWCfb1IkWxCanaovdpcXy2YA5yAZt9umPUXreUntSSuLIMy4AaPq ChfgrhZBSUTaUri2nOrNW3zi/c6oLvxS5f2Qr7/5YuLXRosSDHlgDCk0Po8YFrMIk4Cz D0Ks6B6sA/tg1imx9dstVnMc8KDu33h+ubr1sj7/ZcAxiegbEtwbCeFJV0wMKxEVGbrb VkrQ== 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=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=S8l7AYOjatbcVU7M9GG2vc+bRiaFyT3tTOFDxcvnjgKbrRB/ueeB20Cn+eunQCxWMQ /SbIKGtEHZ3/VNtpslgn+G7myi37MHVBlbfqWznlqsEZOid7bUJ0b3EEzv4ZlPDow9hG G2ZUWm5AQVR5FEEyF5Mc1m3Qg+sFHj/Zj7y9lgPHMOIEAkdcOEikvo5IK5WyLxRsMpxe 4rbF8Jw11jUxr2bIO3fiAMpv6Ruih/85lpGL7sfc7qWK4+kFoq7u3nDQTidJmJWbObZ3 KavWXdVzw4mGdjwdeIooSxYKk6LERUHN3V0VrxGbijvjGoADFQBVtvnL9duPxs9x2zu8 +I2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ralaYkL5; 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 ce16si24791463edb.634.2021.10.05.01.11.23; Tue, 05 Oct 2021 01:11:23 -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=ralaYkL5; 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 S232929AbhJEINE (ORCPT + 17 others); Tue, 5 Oct 2021 04:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233357AbhJEINC (ORCPT ); Tue, 5 Oct 2021 04:13:02 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E43C06174E for ; Tue, 5 Oct 2021 01:11:11 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id p13so47102603edw.0 for ; Tue, 05 Oct 2021 01:11:11 -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=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=ralaYkL5Xw7qbWeLgFH9tju3bNrClp1qrs40/XNH+JU1eDpEbbLPT2ItFrp/WwdzY7 X86qpw1ZLWfkBOY0nbQkOvUh+gmdd390wSlCufXebSRTBfI0BXQOcXSzKoyrgD4WOWUw ETvXsXHT2FzybdlBglxdaHCP4Nx6aR1p3CZF9xsL5Ww1Vk0GE4vD3Xj89ZmXVfYg7pdM MPOEvzOkVtIvMzDrml3C1ZXf3VLfb4GQHuK8wCiTp8q6GI7JFEKnUkvio5tXyUdtxT0h rRNqznL4oRzNcNX2RjMlTjr7H4xgRegF5MDf15vLE7k+yt7CjiFJYMm0rBLS3Zv+QWBO OMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F0rxTAIDQUC00gIGQ2hZRmANNTx894FvV5JJnWTgTsY=; b=shGc6y+6ccYImRG+QwzAwdl1jHFBainTaCVtUERmvm1fQPDHSvh7UI0Q+lBtToMT4t LGrCzVz7tWOLKHDxWMVeBGEIVUyx+bQXfwjyLGxFhSvBGwlnrgsBENx7dtiWhmV6p15V +kpH9JMnLv+7J1PrwrlnKl+VcVQManvbWYEP6/Z/G/WTr4cc6pOHWltDHNhT368b93wp 9D1R5XYNqWPnlIQNeB/7NSEdrnAxNdRws9QyFpV/6DsOGI27EzhV8d7zIWrjZFvBun4W lfzivKNFq/ADU72Ivhg5g+8qe1zkczrId6oMe7bwcbJx6HOzIBy7cihXbrurRVGa5iDk oGjg== X-Gm-Message-State: AOAM532/CC+gaNIdj321JZ77x0D6tdKfiIqnoP+YEm7QPz7sTkA/cefs L/6jZhsrzCjJ5wz9pXNsp0D2sw== X-Received: by 2002:a17:906:f2cd:: with SMTP id gz13mr15507022ejb.278.1633421470068; Tue, 05 Oct 2021 01:11:10 -0700 (PDT) Received: from localhost.localdomain ([84.238.208.199]) by smtp.gmail.com with ESMTPSA id f1sm3096258edz.47.2021.10.05.01.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:11:09 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal , Stanimir Varbanov Subject: [PATCH v5 5/7] venus: vdec: set work route to fw Date: Tue, 5 Oct 2021 11:10:46 +0300 Message-Id: <20211005081048.3095252-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> References: <20211005081048.3095252-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Dikshita Agarwal Set work route to FW based on num of vpp pipes. Signed-off-by: Dikshita Agarwal Signed-off-by: Stanimir Varbanov --- Added space after 'if' Return directly hfi_session_set_property drivers/media/platform/qcom/venus/hfi_cmds.c | 7 +++++++ drivers/media/platform/qcom/venus/hfi_helper.h | 5 +++++ drivers/media/platform/qcom/venus/vdec.c | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 60f4b8e4b8d0..5aea07307e02 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1299,6 +1299,13 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt, pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cq); break; } + case HFI_PROPERTY_PARAM_WORK_ROUTE: { + struct hfi_video_work_route *in = pdata, *wr = prop_data; + + wr->video_work_route = in->video_work_route; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*wr); + break; + } default: return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); } diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index bec4feb63ceb..253911272b4c 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -448,6 +448,7 @@ #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT 0x100f #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED 0x1010 #define HFI_PROPERTY_PARAM_WORK_MODE 0x1015 +#define HFI_PROPERTY_PARAM_WORK_ROUTE 0x1017 /* * HFI_PROPERTY_CONFIG_COMMON_START @@ -873,6 +874,10 @@ struct hfi_video_work_mode { u32 video_work_mode; }; +struct hfi_video_work_route { + u32 video_work_route; +}; + struct hfi_h264_vui_timing_info { u32 enable; u32 fixed_framerate; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c129b061a325..88cd9e46c333 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -656,6 +656,19 @@ static int vdec_set_properties(struct venus_inst *inst) return 0; } +static int vdec_set_work_route(struct venus_inst *inst) +{ + u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE; + struct hfi_video_work_route wr; + + if (!IS_V6(inst->core)) + return 0; + + wr.video_work_route = inst->core->res->num_vpp_pipes; + + return hfi_session_set_property(inst, ptype, &wr); +} + #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE)) static int vdec_output_conf(struct venus_inst *inst) @@ -1042,6 +1055,10 @@ static int vdec_start_output(struct venus_inst *inst) if (ret) return ret; + ret = vdec_set_work_route(inst); + if (ret) + return ret; + ret = vdec_output_conf(inst); if (ret) return ret;