.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. |
---|
3 | 4 | * Copyright (C) 2017 Linaro Ltd. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License version 2 and |
---|
7 | | - * only version 2 as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, |
---|
10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | | - * GNU General Public License for more details. |
---|
13 | | - * |
---|
14 | 5 | */ |
---|
15 | 6 | #include <linux/errno.h> |
---|
16 | 7 | #include <linux/hash.h> |
---|
.. | .. |
---|
649 | 640 | case HFI_RATE_CONTROL_CBR_VFR: |
---|
650 | 641 | case HFI_RATE_CONTROL_VBR_CFR: |
---|
651 | 642 | case HFI_RATE_CONTROL_VBR_VFR: |
---|
| 643 | + case HFI_RATE_CONTROL_CQ: |
---|
652 | 644 | break; |
---|
653 | 645 | default: |
---|
654 | 646 | ret = -EINVAL; |
---|
.. | .. |
---|
1214 | 1206 | break; |
---|
1215 | 1207 | } |
---|
1216 | 1208 | case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE: |
---|
| 1209 | + case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER: |
---|
| 1210 | + case HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE: |
---|
| 1211 | + case HFI_PROPERTY_PARAM_VENC_SESSION_QP: |
---|
| 1212 | + case HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE: |
---|
1217 | 1213 | /* not implemented on Venus 4xx */ |
---|
1218 | | - break; |
---|
| 1214 | + return -ENOTSUPP; |
---|
1219 | 1215 | default: |
---|
1220 | 1216 | return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); |
---|
| 1217 | + } |
---|
| 1218 | + |
---|
| 1219 | + return 0; |
---|
| 1220 | +} |
---|
| 1221 | + |
---|
| 1222 | +static int |
---|
| 1223 | +pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt, |
---|
| 1224 | + void *cookie, u32 ptype, void *pdata) |
---|
| 1225 | +{ |
---|
| 1226 | + void *prop_data; |
---|
| 1227 | + |
---|
| 1228 | + if (!pkt || !cookie || !pdata) |
---|
| 1229 | + return -EINVAL; |
---|
| 1230 | + |
---|
| 1231 | + prop_data = &pkt->data[1]; |
---|
| 1232 | + |
---|
| 1233 | + pkt->shdr.hdr.size = sizeof(*pkt); |
---|
| 1234 | + pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_SET_PROPERTY; |
---|
| 1235 | + pkt->shdr.session_id = hash32_ptr(cookie); |
---|
| 1236 | + pkt->num_properties = 1; |
---|
| 1237 | + pkt->data[0] = ptype; |
---|
| 1238 | + |
---|
| 1239 | + switch (ptype) { |
---|
| 1240 | + case HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY: { |
---|
| 1241 | + struct hfi_heic_frame_quality *in = pdata, *cq = prop_data; |
---|
| 1242 | + |
---|
| 1243 | + cq->frame_quality = in->frame_quality; |
---|
| 1244 | + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cq); |
---|
| 1245 | + break; |
---|
| 1246 | + } default: |
---|
| 1247 | + return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); |
---|
1221 | 1248 | } |
---|
1222 | 1249 | |
---|
1223 | 1250 | return 0; |
---|
.. | .. |
---|
1241 | 1268 | if (hfi_ver == HFI_VERSION_3XX) |
---|
1242 | 1269 | return pkt_session_set_property_3xx(pkt, cookie, ptype, pdata); |
---|
1243 | 1270 | |
---|
1244 | | - return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); |
---|
| 1271 | + if (hfi_ver == HFI_VERSION_4XX) |
---|
| 1272 | + return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata); |
---|
| 1273 | + |
---|
| 1274 | + return pkt_session_set_property_6xx(pkt, cookie, ptype, pdata); |
---|
1245 | 1275 | } |
---|
1246 | 1276 | |
---|
1247 | 1277 | void pkt_set_version(enum hfi_version version) |
---|