Commit graph

31 commits

Author SHA1 Message Date
chiachih
da45594c5e amd/vpelib: Bypass de/regam on HLG
- Bypass de/regam on HLG

Reviewed-by: Jesse Agate <jesse.agate@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
88b43f7174 amd/vpelib: Fix blndgam bypass flag assignment
- Fix blndgam bypass flag assignment

Reviewed-by: Tiberiu Visan <Tiberiu.Visan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
921f0afe42 amd/vpelib: Fix Color Adjustment Failing Test Cases
[Why]
test cases are failing

[How]
Fixed hue range calclation error and add brightness limit like in shader

---------

Co-authored-by: Tiberiu Visan <tiberiu.visan@amd.com>
Reviewed-by: Tiberiu Visan <Tiberiu.Visan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Ali <nawwar.ali@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
5027ba64a1 amd/vpelib: Remove checks for pitch alignment
[Why]
Pitch alignment checks are inaccurate, alignment is based on elements
instead of bytes, and byte alignment is assured by addrlib. Results in
failed checks that should pass.

[How]
Remove checks.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Brendan Leder <breleder@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
0df1054d06 amd/vpelib: adding blend gamma bypass
- added bypass blend
- bypass blnd

Reviewed-by: Jesse Agate <jesse.agate@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Tiberiu Visan <tvisan@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
0e6df4d458 amd/vpelib: Remove support for non-linear FP16
- Remove support for non-linear FP16

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
acad1328a1 amd/vpelib: Remove gamma cached table
- Remove degam/regam cached tables
- Calculate degam/regam parameters on the fly
- Remove force_tf_calculation debug flag

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
7a41fb59d3 amd/vpelib: Remove linear_0_125 TF
- Remove TRANSFER_FUNC_LINEAR_0_125 transfer function
- Rename TRANSFER_FUNC_LINEAR_0_1 to TRANSFER_FUNC_LINEAR

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
chiachih
39b08da80a amd/vpelib: Resolve mismatch with shader
Shader in SDR mode with NV12 input bypasses both primary and gamma
conversions. Since in this case for RGB output p601 primary can be
set for the output primary, vpe should be able to set that primary for
output as well.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Jack Chih <chiachih@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
---

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28972>
2024-05-07 20:43:02 +00:00
Alan Liu
f351e4be11 radeonsi/vpe: support vpe 1.1
update radeonsi and vpelib to support vpe 1.1

Co-authored-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Peyton Lee <peytolee@amd.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28239>
2024-03-25 00:59:02 +00:00
Hsieh, Mike
33d88f797b amd/vpelib: Add UID for 3d Lut and control logic
[WHY]
3D lut generation takes time, we need to cache it and identify it as it
updated.

[HOW]
Add unique id when new 3d lut is generated.
Add control logic with UID.

Reviewed-by: Jesse Agate <jesse.agate@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Mike Hsieh <Mike.Hsieh@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Agate, Jesse
039b1e0a1e amd/vpelib: Refactor norm factor logic
Moved norm factor logic out of moveable CM.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Shih, Jude
e0863dbb74 amd/vpelib: Solve link error due to missing static for one function
is_target_rect_equal_to_dest_rect is used in color_bg.c only. Therefore,
it needs keyword as static in front of it. This issue is reported from
diag team.

Reviewed-by: Bichao Wang <bichao.wang@amd.com>
Reviewed-by: Tomson Chang <tomson.chang@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Agate, Jesse
2d02c75324 amd/vpelib: Add PQ Norm to VPE interface
Rename the variable and add PQ Norm to VPE interaface.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Agate, Jesse
1dd28d6766 amd/vpelib: VPE integration for HLG
Added external and internal enums for HLG and some related house keeping.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Hsieh, Mike
5fd59c83ef amd/vpelib: geometric scaling fix
[WHY & HOW]
Color adjustment needs to be controled by user.
Remove blending check if target rect equeal to dest rect for 1st stream.

Reviewed-by: Tomson Chang <tomson.chang@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Mike Hsieh <Mike.Hsieh@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Hsieh, Mike
c8b2e28b66 amd/vpelib: skip gamma remap and cs conversion when geometric scaling
[WHY]
When geomtric scaling is enabled, many color features will be skipped.

[HOW]
Skip gamma remap, gamut conversion, blending, tone mapping and color adjustment.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Mike Hsieh <Mike.Hsieh@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Mike Hsieh
cb6d928327 amd/vpelib: Add param check for geometric scaling and refactor
[WHY]
Param check for geometric scaling is required.
3dlut for geometric scaling case is too complicate.

[HOW]
Add Param check for geometric scaling.
Refactor 3dlut for geometric scaling case.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Mike Hsieh <Mike.Hsieh@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Hsieh, Mike
4893afd427 amd/vpelib: add new tf enum and add flag for geometric scaling
[WHY] 1. Need tf enum for SRGB and BT709
      2. Add required flag and logic for geometric scaling

[HOW] Add new enum, skip tone mapping when geometric scaling is enabled

Reviewed-by: Jesse Agate <jesse.agate@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Mike Hsieh <Mike.Hsieh@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27239>
2024-02-06 14:55:02 +00:00
Shih, Jude
7e4d95c271 amd/vpelib: Solve the downscaling problem for 2 tap
We should set default value of tap if we enable the
skip_optimal_tap_check flag for 2 tap case.

Reviewed-by: Tomson Chang <tomson.chang@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Shih, Jude
25d0384df8 amd/vpelib: Add VPE prefix on API to avoid naming conflict
We need to add vpe prefix on some API such as convert_to_tetrahedral
to avoid naming conflict.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Agate, Jesse
16c1628f73 amd/vpelib: VPT Failing Test Cases
Fix failing studio range test cases.
- Cause of issue was negative values being mirrored in the pipe by
  studio range gamma conversion were getting clipped at the end of the
  pipeline. Fix is to move bias outside of the gamma lut and into the
  gamma bias.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Assadian, Navid
b354ceebaa amd/vpelib: Use uint64 for buffer size
Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Agate, Jesse
4a48896a0d amd/vpelib: White Screen Fix
- Observed white screen after changing edp display brightness and
  resizing video.
- Root cause: ogam sequence was not being updated when 3dlut
  transition from disabled->enabled.

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Shih, Jude
28b7c1e611 amd/vpelib: Need a debug flag to support 2tap downscaling
Add flag to support 2tap downscaling.

Reviewed-by: Tomson Chang <tomson.chang@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jude Shih <shenshih@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Assadian, Navid
ee20be9b07 amd/vpelib: Apply inverse gamut remap to background
The inverse of gamut remap is applied to background color when the tone-mapping
is enabled and the output is fp16 linear, in order to reverse the effect of gamut remap
on the background color to preserve the given background color.

Reviewed-by: Jesse Agate <Jesse.Agate@amd.com>>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Navid Assadian <navid.assadian@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Agate, Jesse
73713f837b amd/vpelib: Studio Range Handling
The purpose of this change is to support bg color fill + studio range
output. Now, studio range conversion will be done in the gamma block
before bg color fill. That is for all studio range outputs adn SDR
outputs we will be in NL before blend block.  For full range HDR (full
range PQ of FP16 only), we will be linear before blend block.

- Added linear_0_1 gamma function
- Consolidated x_scale and y_scale
- Refactor Regam/Degam Funcs
- Add y bias to regam and degam
- Pull memory allocation for cm into a different function to make it
  more readable
- Added logic to degamma/regamma to re-calculate instead of using table
  if the scale factors are not one and the bias is not zero.
- Changing output gamma programming sequence in sw layer
- Fixes in hw layer for interpolation error assocaites with studio
  range transformation in gamma.
- Disabling ocsc
- PQ studio will still be 'blended' in NL. But A check was added
  to reject the job if it is not opaque

Reviewed-by: Roy Chan <Roy.Chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Jesse Agate <Jesse.Agate@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Lin, Ricky
e18761001e amd/vpelib: Rename the parameters of init vpe function
Rename the following parameters for better description.
- mj to major
- ni to minor
- rv to rev_id

Reviewed-by: Tomson Chang <tomson.chang@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: rickylin <ricky.lin@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Visan, Tiberiu
258acf0227 amd/vpelib: revert SRGB to 709
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Tiberiu Visan <Tiberiu.Visan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Alan Liu
6d19aca144 amd/vpelib: remove unused header file
Remove unused header file diag_reg_helper.h

Signed-off-by: Alan Liu <haoping.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26841>
2024-01-11 19:21:17 +00:00
Peyton Lee
17c20ceda7 amd,radeonsi: add libvpe
Signed-off-by: Peyton Lee <peytolee@amd.com>
Signed-off-by: Alan Liu <haoping.liu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00