From patchwork Tue Apr 24 12:44:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 134079 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2190239lji; Tue, 24 Apr 2018 05:45:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48r6FDp+NKAhGICnNZ4c3b25Vdp3p4jmpu7LNek8fEknf3ufZEMZxHKRA8UI2Giqq9EkQlp X-Received: by 2002:a17:902:8488:: with SMTP id c8-v6mr24868470plo.357.1524573920660; Tue, 24 Apr 2018 05:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524573920; cv=none; d=google.com; s=arc-20160816; b=1JBn1LNkGNgAgAg4ffzCgbDpbBklZS8tjBjC2vLFiQSHM0B/1s2hs+2bGRYGzN80q0 gLbJwRtm2hG7tx1XOHdWYyxsdNNbQmnrA13YoOOPHNhM6rnbZB57JV4Tw/jU9WAp3WJ8 CXa2zDoKkS/Gl/HC0rfEOSIksyEwD79Q1vNpHX2yjhXf+bIp8GPMF+Aeo4M0oYFJvdZ1 4oCyu6x+3sRwfOa5A2aL+PrK9MUPUk7TPKPgzhooyrWENDDKCO5W7KxIAI1TGz7ZtkCq X1arAZNp2VTrKnNfQUien4YiuLPvFASXnMwYolct/xzCFx6KTmS+fg/sgxkHFoPcPKPE yF/A== 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=y9cBhTi9twYBRH8ovOvooJ8uIrDamLv1hzaB2RNI8tU=; b=r+khk1Q1Xd8zhMlfAsT5h/lLZFCzRNI3dYcHn9GE3EudLrrLdTKg37CNQkXuYATx6o xPo57MNrS++fxxuSrFUA03+zdADL/EV0AWfrYHwXyWqqfG5ejBD06571MpqpHLNMq2WZ VuA0HWwd8slz1/JLRuEQHNfV2JxbIpYYTxtoBaaVUEy5AOJQgURMKXwgFsKzNOZQYy+E 1lFaW4c9HrDxkduP8laAz0r8tMYk+Z8V1DUPgP4P9PLl/pgO/S0TaKOJcHSkwqhETDfI CteaIyzPfUbS3GaHl18Sa61DXIiCr122/aHmSOGRjwMkwiiiuXBMz0PsOBiXb+EfcebT RX0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dceRlkYI; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 b3-v6si1574380pli.0.2018.04.24.05.45.20; Tue, 24 Apr 2018 05:45:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dceRlkYI; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757828AbeDXMpS (ORCPT + 12 others); Tue, 24 Apr 2018 08:45:18 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35559 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932125AbeDXMpL (ORCPT ); Tue, 24 Apr 2018 08:45:11 -0400 Received: by mail-wm0-f66.google.com with SMTP id o78so610586wmg.0 for ; Tue, 24 Apr 2018 05:45:10 -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=dihCKrpTwMryu1Tp9ISl68rVO7mV7cRP6PZqJIU3Z/M=; b=dceRlkYIPwqm9VEjyo3hBvNzMJoPaC776a9fzu0NZJG7rCY38rLmMqEydYcStN6Dge WrJI/6nz/RCOkLZs2UnLTuWYt7Aa+kq/frmjKTKoUrbgM3VGKztzHhszCtp/+re7RGB+ AWizvWW+1ncJzFs7aqOf+XVKriKIeQjcj80AI= 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=dihCKrpTwMryu1Tp9ISl68rVO7mV7cRP6PZqJIU3Z/M=; b=cD+82Y0NylkkIgfgSyFeefHswnGa9aJCl9oXnE/ktE43Hn/ROMS/AuBeCcsi4et9w4 TwRH9qJwtx1QNHvME7wUP5Tc7we40kH/m0GJBegbfQWcN/f2FLB6AhRQz/58qds3ZcXe 9FLmAuDP+otbpGUmZ5xutDgvCBwETC6CRvPsOHz1H2cCt9Hsw9d4dZrc1hAV5+jzB/lv 1uGGpglDbhEjx1w1j4TFz4aOeBQRXlrTfeWkZ/BTkDtBLqhP4LVMaD/xbo8ift5mhBU9 oJKBOdDlce4fO8oU44/sqRrr5kpgduHw8kMKo2iHoas2v3w+LnTw/VlYMSqqB3z1o8zK QYyw== X-Gm-Message-State: ALQs6tAMnYpUhjcUPwCZVkW00GfNbu/EMCXy/YZ7SLbFwe0CogDkMXJm d1Q5eBEBBog2xq2e2Be7CFoIcQ== X-Received: by 10.28.32.132 with SMTP id g126mr13307651wmg.52.1524573910361; Tue, 24 Apr 2018 05:45:10 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id n49-v6sm22666013wrn.50.2018.04.24.05.45.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:09 -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 , Stanimir Varbanov Subject: [PATCH 04/28] venus: hfi_cmds: add set_properties for 4xx version Date: Tue, 24 Apr 2018 15:44:12 +0300 Message-Id: <20180424124436.26955-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180424124436.26955-1-stanimir.varbanov@linaro.org> References: <20180424124436.26955-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 | 64 +++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 1cfeb7743041..6bd287154796 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1166,6 +1166,65 @@ 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; + int ret = 0; + + 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: + ret = pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); + break; + } + + return ret; +} + int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt, void *cookie, u32 ptype) { @@ -1181,7 +1240,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)