[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230109143846.1966301-18-mwen@igalia.com>
Date: Mon, 9 Jan 2023 13:38:45 -0100
From: Melissa Wen <mwen@...lia.com>
To: harry.wentland@....com, sunpeng.li@....com,
Rodrigo.Siqueira@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com, airlied@...il.com,
daniel@...ll.ch
Cc: Joshua Ashton <joshua@...ggi.es>, alex.hung@....com,
nicholas.kazlauskas@....com, sungjoon.kim@....com,
seanpaul@...omium.org, bhawanpreet.lakha@....com,
Shashank Sharma <shashank.sharma@....com>,
ville.syrjala@...ux.intel.com, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, kernel-dev@...lia.com,
laurent.pinchart+renesas@...asonboard.com,
Melissa Wen <mwen@...lia.com>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH v2 17/18] drm/amd/display: decouple steps to reuse in shaper LUT support
Decouple steps of shaper LUT setup and LUT size validation according to
HW caps as a preparation for shaper LUT support.
Signed-off-by: Melissa Wen <mwen@...lia.com>
---
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index 0fb1244c8aef..8a930f9bce60 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -497,6 +497,19 @@ static void amdgpu_dm_atomic_lut3d(struct dc_stream_state *stream,
stream->lut3d_func = lut;
}
+static int amdgpu_dm_atomic_shaper_lut(struct dc_stream_state *stream,
+ struct dc_transfer_func *func_shaper_new)
+{
+ /* We don't get DRM shaper LUT yet. We assume the input color space is already
+ * delinearized, so we don't need a shaper LUT and we can just BYPASS
+ */
+ func_shaper_new->type = TF_TYPE_BYPASS;
+ func_shaper_new->tf = TRANSFER_FUNCTION_LINEAR;
+ stream->func_shaper = func_shaper_new;
+
+ return 0;
+}
+
/* amdgpu_dm_atomic_shaper_lut3d - set DRM CRTC shaper LUT and 3D LUT to DC
* interface
* @dc: Display Core control structure
@@ -519,18 +532,11 @@ static int amdgpu_dm_atomic_shaper_lut3d(struct dc *dc,
lut3d_func_new = (struct dc_3dlut *) stream->lut3d_func;
func_shaper_new = (struct dc_transfer_func *) stream->func_shaper;
- /* We don't get DRM shaper LUT yet. We assume the input color space is
- * already delinearized, so we don't need a shaper LUT and we can just
- * BYPASS.
- */
- func_shaper_new->type = TF_TYPE_BYPASS;
- func_shaper_new->tf = TRANSFER_FUNCTION_LINEAR;
- stream->func_shaper = func_shaper_new;
amdgpu_dm_atomic_lut3d(stream, drm_lut3d, drm_lut3d_size,
mode, lut3d_func_new);
- return 0;
+ return amdgpu_dm_atomic_shaper_lut(stream, func_shaper_new);
}
static const struct drm_mode_lut3d_mode *
--
2.35.1
Powered by blists - more mailing lists