Received: by 10.192.165.148 with SMTP id m20csp4732546imm; Tue, 24 Apr 2018 07:34:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx49qmqZC9QLlr9ClGo/bp6Uz73cNsFF4WXvAKvlT8FagtXpbE2KrjYKYYrA1Km4KLjWlx8Nn X-Received: by 2002:a17:902:2c83:: with SMTP id n3-v6mr25610295plb.317.1524580485904; Tue, 24 Apr 2018 07:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524580485; cv=none; d=google.com; s=arc-20160816; b=cU4GkLrYzQwegIvQfyI46PmTGiqFtX4aTjT1pXnE/MXVtqxydtSEbN7ZXJSq4uXypr S+7lKZeyCOJn3QaFRSXGgfHG0dMQWrsYcO8Ev4I7JzBJbg68Nk5PM1/b6q6lJe3niD9v zECoq9Nw9JyeMTSYVyKWRyq2wHcGEg0C22hQYwOc/kGOKA6FTfbe/gGDr2TgldXfZsFj 1p5D3EtHk3E9firIXvX1SIMMGcuTl1VcBmlo2cY00pkYdbEekiiG0FcDSNtY8a8KsfaH JWmWu5Y8Rk2yBPaJZYDhQa/ZkEcMMhjJILNfEHROcskcP1gIDNb5pKh/dPPFCZNMhOHi ZR4Q== 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=dihCKrpTwMryu1Tp9ISl68rVO7mV7cRP6PZqJIU3Z/M=; b=j3/CBtEaxXcsuDOIZTlEkF75xRmRyY5NRZyS/EHWIxdzwGmHhyg7onG1YM/UbQU+0a NtcCu6jJ4MuM971GCGpcVgKhPjgJfnrerntodAKFT8JqwF/33IRWwF7Bc7A7zP/hdbu9 ffWwxqr3/zars50xTafZFkSyaap7l88j+achq3RPWohTDC2ylfv9H79MnWOA+EoGQHco 6yZ8VCyitxqRH2ZIWjgfvwryTkQaE5tXBtahIyEMNu7RoAWkp9FhucRtJyXfNf+dwVwU l+wUVYbMb1vDvURPWPKSJGEqrsialLkXvSvsFFVxFz894Cy0C8bIziB2fpBiPbKeAFD9 YDDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dceRlkYI; 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 a5-v6si1373922pll.123.2018.04.24.07.34.31; Tue, 24 Apr 2018 07:34:45 -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=dceRlkYI; 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 S932812AbeDXMpV (ORCPT + 99 others); Tue, 24 Apr 2018 08:45:21 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50935 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbeDXMpL (ORCPT ); Tue, 24 Apr 2018 08:45:11 -0400 Received: by mail-wm0-f65.google.com with SMTP id t67so689397wmt.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=aOHvgufhhQkNk8J2ne+vX6snkMcerUKrpWS9fR2HrSXrBmNacSNYrsKLPiCKI6SAf2 q4BC1c+ciVVJ5mlMSfK0rBVj1sMuHhpV5bFSu+YnHhagzC7TIEkzkW+hhoGL1CE61uVu 61466tQhwbTWjilEyIESuVGbOVhD4t5LPzKg1Yfqb7wQfqn26x/B4HdtmZ7qK7e0mOk/ yjbQMyD2lxuTDkhrDLAkpFAf7wG2Q6/JC/aNyZCmgfT0wLEjl/h+gW03r3+uIHGYy6VW eQ+NiANpvs2YcQC2Ojggbb4hpAIITX4eqMnALyoXq+lmn0a7ZZocBDidYzDLGiY3pUaB B0Bw== X-Gm-Message-State: ALQs6tBdX5Jq44y+0izlcCk4D0yzEmzi8gm3/BLMqHE0s5BQt22WJLFV 6bzSdiqyH08jjCAYSt2A5xJ/Ow== 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-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 | 64 +++++++++++++++++++++++++++- 1 file changed, 63 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..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) -- 2.14.1