Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp620659imm; Thu, 5 Jul 2018 06:15:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpetgDLvi8CBG0WlrEHNgx5JcYOIz7ji8cie4nwJoNApMt+7qAx7zUOWyGUb3Akx0ANAUGkA X-Received: by 2002:a62:f587:: with SMTP id b7-v6mr6424556pfm.158.1530796546909; Thu, 05 Jul 2018 06:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796546; cv=none; d=google.com; s=arc-20160816; b=LXlJKNYOxsJrueXUppXdTAxOfu8XpPgD/94OUw0gx89FtOvs9+Ht1tG46/rfAyO7wB E7+dvMqSYvABjro2gQJW/Fnx5B3s5nWGSlWiPTcEfPgc+XR47c7Xlk8ETgdZvGPxZau/ 5BHHoEBkkW8QvWggu1bp6OEqhQS1gmNER20+CEG2Qjsq/VUBc/FeJy0M2/znLiSyPq8m Q6S5RH024eqSKQVkjzi2zTJeIPcG+ZR3hV12P3X6RCXBHKw6Dt/+iX9PqBn5cj2d/EcK o50oOsfKeGsGZDJiuNx1ul9ZS01ivGjGd6f0oHDjTFR8NExn3fj0+FFzYD1pYed530cB P92w== 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=w9PJ+ePhBg/OuVZmrpL9h6bGUaANpeXaCPpNA8MaIrauEPAF9Y8x97RrgAbQG876/y qQTqmVfHI4+/wMAr7CRVrGWWh8J8wwh1ohvDrC7MbhGc0dsFdZOTRPwB7t//0+wTMDHo 0KlLud/M5R2sY/7wgANqWo3fyDQzhQ/Mb+DEn0Uqs26nDrEjL7UicU5/aBtnZJG10ACy YF21Npn7YmI84KjHorLE0moCD7LQUn3WFlNPe6E8rzYnV8Ws7fhyd2XMKGLuccOTruW7 Z+T05baHCMnMJlmMxH+IGTevoeOF4QVULuIO8Tpx3oeK+rEZ5VN9k7FG33vHm4a6VNSq RJGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fI6QMaSX; 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 n9-v6si5392354pgp.558.2018.07.05.06.15.31; Thu, 05 Jul 2018 06:15:46 -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=fI6QMaSX; 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 S1754583AbeGENOl (ORCPT + 99 others); Thu, 5 Jul 2018 09:14:41 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36617 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754195AbeGENFM (ORCPT ); Thu, 5 Jul 2018 09:05:12 -0400 Received: by mail-wm0-f68.google.com with SMTP id s14-v6so10732505wmc.1 for ; Thu, 05 Jul 2018 06:05: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; bh=2Rjs/riZGr/2boEAWhRGcdDD/iS7glDtXPe+puCnQcc=; b=fI6QMaSXVEUj4pi6HST0HtUEy1jU0Txb1l5V5fwAz8pLb+woTfyCHWnmENfX1NYNvS lRFY4DiR0CEB7uGtkBCpErNYQT04hL02RausIn8D4eBw2M2z+d0hzvChjLjILl9XcRx+ z0rjn2B1OQ5XP5vXgyQR1qVR3ryXZJthAwB38= 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=fwqbRDphDwn1UXBjY8m7uoQ+Qlk/mZQBq40KRUOTR1pJH0K4k3ZCccxzW2Vi9U5s6l W40XTw/oG+OercOYbg03PYSWwzHVeVzyL/IVgFRetZFogH8Tr0DCHote7RrgjuyUsC6N h1jsAUBz0tcjfLn19RsVAfD5hEVrxYWyRQwVN9vsqUka//6XEFVZAJuJNwIlO1KzrHyi ohXs8GOezEsvCExgj45HwfCZ3l/Oc/R5bvfonBo0cuS+eFZSWdIKl6mqFFq897dG02Wt TIVWCJQ4oxpqfgvDz62OkBwtaAJ8R1QRUJQ/CjK6rYDaBpoOQsprctfzqNK9kSLp6A+Y qfGA== X-Gm-Message-State: APt69E3qNoqw8MZg9a5Ow867byve9zU1kAFfUJ+M2YSZ+H4g7zQ8qJfW 7+6cFwrXxaoqoH1KpCae666+TA== X-Received: by 2002:a1c:aacf:: with SMTP id t198-v6mr3838721wme.109.1530795910894; Thu, 05 Jul 2018 06:05:10 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:10 -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 , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 04/27] venus: hfi_cmds: add set_properties for 4xx version Date: Thu, 5 Jul 2018 16:03:38 +0300 Message-Id: <20180705130401.24315-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-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(-) 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) -- 2.14.1