From patchwork Wed Jun 13 15:07:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 138482 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp847518lji; Wed, 13 Jun 2018 08:09:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJANkjKRnSjlJh6YJQ372IZCkm9l/kVGWuQWIt6HfrqQFa5XbnsDzvGKXOd45dC0RYSO62n X-Received: by 2002:a17:902:42c3:: with SMTP id h61-v6mr5571213pld.319.1528902559930; Wed, 13 Jun 2018 08:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528902559; cv=none; d=google.com; s=arc-20160816; b=vZMO1e4BX+dDvmosrRUoifza93Piq3zPAiwPN2p2OsfbhcRBfzy7KH4IZOMisrsc1M 2xDB19kGu0ladhynsasdF1FSvqbWdJs+4G8D0hjvA+XFze+Y0JFpS2lYTPxmNa3DXWck RUf7LR8Lhar+FhoBnKs9MizCEB80IMFGJybMSSnq8yGcaA3ZGR81Oae8g2ff8ElGDk9B ZpID11xqJNQMsGJew97mvJLwcFWtCVONpEbYN8hpyZXTw899HOuJPaAs89HUMt6NA40t qRLXXUst4l9g/N7mvCE/KIs1MCggvcDWyeGa+IO9rb6wmZQ5XiASIbejx03eVJD5shGj 0zzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=2Rjs/riZGr/2boEAWhRGcdDD/iS7glDtXPe+puCnQcc=; b=pGN89VQ/IExL2+MJn2f/T+e/ynZRBvnusgyyrS47EScOfIC5UbdkD/kc8PWLXgKWAh 2/n1gNqPQjAj7O1iz2mMaANACNXHfe/OzKHEXGe2QXrlXSl/hQMfyhwb7mIAohrJpMif aVumPc5SG/0HjaRmq2aRcXYNULlfvqM03dgSxvoGZPCnOconV26Tq4dXDiLb/s3uihRg 3Dk60IxZp8yT4GpPM2gPNdO4vgA3aDOago4pZX5T3VxblOyIHIwAwomrDE8apekC/1nU BpASXz5te/2LTDRfL5yuasVR0F0d/tzk9vEL4VzYkkpUk12vdEFA+rjDrtdhUYcHvlhR pthw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P52I9hmz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h33-v6si3271727plh.124.2018.06.13.08.09.19; Wed, 13 Jun 2018 08:09:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P52I9hmz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S935979AbeFMPJO (ORCPT + 30 others); Wed, 13 Jun 2018 11:09:14 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54901 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935951AbeFMPJK (ORCPT ); Wed, 13 Jun 2018 11:09:10 -0400 Received: by mail-wm0-f65.google.com with SMTP id o13-v6so5319440wmf.4 for ; Wed, 13 Jun 2018 08:09:09 -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; bh=2Rjs/riZGr/2boEAWhRGcdDD/iS7glDtXPe+puCnQcc=; b=P52I9hmzV8Gy32BanhgHpkACF9LJcaVpD4PCT/uz0pooSvjrazcfMd/QMZYiTKKX0o iVGc4JbO8t9inFar0DA0ZkCTP2yJCiz7ZONgeithmFQySWYdX3SXbi1vwcoCXx4WnVHw xdsMLwu7ksz/HwNdDv2Ea9dwyBJTlGHQjTIWM= 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; bh=2Rjs/riZGr/2boEAWhRGcdDD/iS7glDtXPe+puCnQcc=; b=heRTRDfND1wIepLeckxARQ6wVMz+zS8ST1FiOsQRxDv8gwgiLNMNgHi4P+fJgdDCDl MWAubzB4rnLJhJhM3sKAFmnCMSrGodmakHe3d8Zb7JjievIqEk09U17SLWvSyJfBKGz4 rcYdDLZOjvdIo4gc2gBKz4V2MMVCQPTZc0LWs1HAwIXwAWp+NBNBeyG2NxH6MCmrATrL S08jz664tICcRFxyxyV+r67w+sSaDZqmNc62GEwEswV5spMzdMCVp/bnMJ/H5c5l3S+h LblBlAw7KQm2yUU4z9OE8CpJzb9AWwaLhP5hVzafZkbXrvjmto8AN3dtXtxyiOkx8LqT qi5A== X-Gm-Message-State: APt69E3qN7NEAhW7SfIckt/nEOWSgG71Ti2p1lHRFuiR7PkIXu8cii5F OMA01C6iy9OTpJMA0b5cUY/T0w== X-Received: by 2002:a1c:e618:: with SMTP id d24-v6mr3589303wmh.154.1528902549312; Wed, 13 Jun 2018 08:09:09 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id e13-v6sm2886548wrm.45.2018.06.13.08.09.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 08:09:08 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Stanimir Varbanov Subject: [PATCH v3 04/27] venus: hfi_cmds: add set_properties for 4xx version Date: Wed, 13 Jun 2018 18:07:38 +0300 Message-Id: <20180613150801.11702-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180613150801.11702-1-stanimir.varbanov@linaro.org> References: <20180613150801.11702-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds set_properties method to handle newer 4xx properties and fall-back to 3xx for the rest. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_cmds.c | 62 +++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 1cfeb7743041..e8389d8d8c48 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1166,6 +1166,63 @@ pkt_session_set_property_3xx(struct hfi_session_set_property_pkt *pkt, return ret; } +static int +pkt_session_set_property_4xx(struct hfi_session_set_property_pkt *pkt, + void *cookie, u32 ptype, void *pdata) +{ + void *prop_data; + + if (!pkt || !cookie || !pdata) + return -EINVAL; + + prop_data = &pkt->data[1]; + + pkt->shdr.hdr.size = sizeof(*pkt); + pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_SET_PROPERTY; + pkt->shdr.session_id = hash32_ptr(cookie); + pkt->num_properties = 1; + pkt->data[0] = ptype; + + /* + * Any session set property which is different in 3XX packetization + * should be added as a new case below. All unchanged session set + * properties will be handled in the default case. + */ + switch (ptype) { + case HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL: { + struct hfi_buffer_count_actual *in = pdata; + struct hfi_buffer_count_actual_4xx *count = prop_data; + + count->count_actual = in->count_actual; + count->type = in->type; + count->count_min_host = in->count_actual; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*count); + break; + } + case HFI_PROPERTY_PARAM_WORK_MODE: { + struct hfi_video_work_mode *in = pdata, *wm = prop_data; + + wm->video_work_mode = in->video_work_mode; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*wm); + break; + } + case HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE: { + struct hfi_videocores_usage_type *in = pdata, *cu = prop_data; + + cu->video_core_enable_mask = in->video_core_enable_mask; + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cu); + break; + } + case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE: + /* not implemented on Venus 4xx */ + break; + default: + return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); + } + + return 0; +} + int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt, void *cookie, u32 ptype) { @@ -1181,7 +1238,10 @@ int pkt_session_set_property(struct hfi_session_set_property_pkt *pkt, if (hfi_ver == HFI_VERSION_1XX) return pkt_session_set_property_1x(pkt, cookie, ptype, pdata); - return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); + if (hfi_ver == HFI_VERSION_3XX) + return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); + + return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); } void pkt_set_version(enum hfi_version version)