@@ -8008,6 +8008,9 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
/* TODO need to check ASICs */
drm_plane_create_3d_lut_properties(plane->dev, plane, 1);
+ res = drm_plane_color_add_3dlut_mode(plane, "3dlut_17_12bit", &lut_3d_mode_17_12bit, sizeof(lut_3d_mode_17_12bit));
+ if (res)
+ return res;
drm_plane_attach_3dlut_properties(plane);
/* Create (reset) the plane state */
@@ -743,6 +743,37 @@ void drm_plane_attach_3dlut_properties(struct drm_plane *plane)
}
EXPORT_SYMBOL(drm_plane_attach_3dlut_properties);
+int drm_plane_color_add_3dlut_mode(struct drm_plane *plane,
+ const char *name,
+ const struct drm_mode_3dlut_mode *mode_3dlut,
+ size_t length)
+{
+ struct drm_property_blob *blob;
+ struct drm_property *prop = NULL;
+ int ret;
+
+ prop = plane->lut_3d_mode_property;
+
+ if (!prop)
+ return -EINVAL;
+
+ if (length == 0 && name)
+ return drm_property_add_enum(prop, 0, name);
+
+ blob = drm_property_create_blob(plane->dev, length, mode_3dlut);
+ if (IS_ERR(blob))
+ return PTR_ERR(blob);
+
+ ret = drm_property_add_enum(prop, blob->base.id, name);
+ if (ret) {
+ drm_property_blob_put(blob);
+ return ret;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_plane_color_add_3dlut_mode);
+
int drm_plane_color_add_gamma_degamma_mode_range(struct drm_plane *plane,
const char *name,
const struct drm_color_lut_range *ranges,
@@ -946,6 +946,8 @@ int drm_plane_create_3d_lut_properties(struct drm_device *dev,
struct drm_plane *plane,
int num_values);
void drm_plane_attach_3dlut_properties(struct drm_plane *plane);
+int drm_plane_color_add_3dlut_mode(struct drm_plane *plane, const char *name,
+ const struct drm_mode_3dlut_mode *mode_3dlut, size_t length);
int drm_plane_color_add_gamma_degamma_mode_range(struct drm_plane *plane,
const char *name,
const struct drm_color_lut_range *ranges,
Enable the 3D LUT mode supported by amdgpu. Note: A patchset "IGT tests for pre-blending 3D LUT interfaces" for this proposal is sent to IGT mailing list. Signed-off-by: Alex Hung <alex.hung@amd.com> --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++ drivers/gpu/drm/drm_color_mgmt.c | 31 +++++++++++++++++++ include/drm/drm_plane.h | 2 ++ 3 files changed, 36 insertions(+)