1 /* Copyright 2022 Advanced Micro Devices, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom thesrc/core/color.c
8 * Software is furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 * OTHER DEALINGS IN THE SOFTWARE.
20 *
21 * Authors: AMD
22 *
23 */
24
25 #include "geometric_scaling.h"
26
27 /*
28 * Geometric scaling is to support multiple pass resizing to achieve larger resize ratio.
29 * User will need to set stream.flags.geometric_scaling = 1
30 * With the gs flag set to true, VPE will disable following feature
31 * 1. gamma remapping, the input tf will be used for output tf.
32 * 2. gamut remapping, the input primiaries/range will be used for output.
33 * 3. tone mapping, tone mapping will be disabled.
34 * 4. blending, blending will be disabled.
35 *
36 */
37
geometric_scaling_feature_skip(struct vpe_priv * vpe_priv,const struct vpe_build_param * param)38 void geometric_scaling_feature_skip(struct vpe_priv *vpe_priv, const struct vpe_build_param *param)
39 {
40 /* copy input cs to output for skiping gamut and gamma conversion */
41 vpe_priv->output_ctx.surface.cs.primaries = param->streams[0].surface_info.cs.primaries;
42 vpe_priv->output_ctx.surface.cs.range = param->streams[0].surface_info.cs.range;
43 vpe_priv->output_ctx.surface.cs.tf = param->streams[0].surface_info.cs.tf;
44
45 /* skip tone mapping */
46 vpe_priv->stream_ctx[0].stream.tm_params.UID = 0;
47 vpe_priv->stream_ctx[0].stream.tm_params.enable_3dlut = false;
48
49 /* disable blending */
50 vpe_priv->stream_ctx[0].stream.blend_info.blending = false;
51
52 }
53