@@ -1479,17 +1479,6 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
if (ret)
return ret;
- /* 3x4 matrix */
- colorop = colorop->next;
- if (!colorop) {
- drm_dbg(dev, "no 3x4 matrix colorop found\n");
- return -EINVAL;
- }
-
- ret = __set_dm_plane_colorop_3x4_matrix(plane_state, dc_plane_state, colorop);
- if (ret)
- return ret;
-
/* Multiplier */
colorop = colorop->next;
if (!colorop) {
@@ -1501,6 +1490,17 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
if (ret)
return ret;
+ /* 3x4 matrix */
+ colorop = colorop->next;
+ if (!colorop) {
+ drm_dbg(dev, "no 3x4 matrix colorop found\n");
+ return -EINVAL;
+ }
+
+ ret = __set_dm_plane_colorop_3x4_matrix(plane_state, dc_plane_state, colorop);
+ if (ret)
+ return ret;
+
/* 1D Curve & LUT - SHAPER TF & LUT */
colorop = colorop->next;
if (!colorop) {
@@ -69,21 +69,6 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
prev_op = op;
- /* 3x4 matrix */
- op = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
- if (!op) {
- DRM_ERROR("KMS: Failed to allocate colorop\n");
- return -ENOMEM;
- }
-
- ret = drm_colorop_ctm_3x4_init(dev, op, plane);
- if (ret)
- return ret;
-
- drm_colorop_set_next_property(prev_op, op);
-
- prev_op = op;
-
/* Multiplier */
op = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
if (!op) {
@@ -99,6 +84,21 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
prev_op = op;
+ /* 3x4 matrix */
+ op = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
+ if (!op) {
+ DRM_ERROR("KMS: Failed to allocate colorop\n");
+ return -ENOMEM;
+ }
+
+ ret = drm_colorop_ctm_3x4_init(dev, op, plane);
+ if (ret)
+ return ret;
+
+ drm_colorop_set_next_property(prev_op, op);
+
+ prev_op = op;
+
/* 1D curve - SHAPER TF */
op = kzalloc(sizeof(struct drm_colorop), GFP_KERNEL);
if (!op) {