@@ -334,6 +334,9 @@ int intel_crtc_atomic_set_property(struct drm_crtc *crtc,
if (property == config->cm_palette_before_ctm_property)
return intel_color_manager_set_pipe_degamma(dev, state,
&crtc->base, val);
+ if (property == config->cm_ctm_property)
+ return intel_color_manager_set_pipe_csc(dev, state,
+ &crtc->base, val);
DRM_DEBUG_KMS("Unknown crtc property '%s'\n", property->name);
return -EINVAL;
@@ -353,6 +356,8 @@ int intel_crtc_atomic_get_property(struct drm_crtc *crtc,
if (property == config->cm_palette_before_ctm_property)
*val = (state->palette_before_ctm_blob) ?
state->palette_before_ctm_blob->base.id : 0;
+ if (property == config->cm_ctm_property)
+ *val = (state->ctm_blob) ? state->ctm_blob->base.id : 0;
return 0;
}
@@ -287,6 +287,25 @@ void intel_color_manager_crtc_commit(struct drm_device *dev,
}
}
+int intel_color_manager_set_pipe_csc(struct drm_device *dev,
+ struct drm_crtc_state *crtc_state,
+ struct drm_mode_object *obj, uint32_t blob_id)
+{
+ struct drm_property_blob *blob;
+
+ blob = drm_property_lookup_blob(dev, blob_id);
+ if (!blob) {
+ DRM_ERROR("Invalid Blob ID\n");
+ return -EINVAL;
+ }
+
+ if (crtc_state->ctm_blob)
+ drm_property_unreference_blob(crtc_state->ctm_blob);
+
+ crtc_state->ctm_blob = blob;
+ return 0;
+}
+
int intel_color_manager_set_pipe_degamma(struct drm_device *dev,
struct drm_crtc_state *crtc_state,
struct drm_mode_object *obj, uint32_t blob_id)
@@ -1447,6 +1447,9 @@ int intel_color_manager_set_pipe_gamma(struct drm_device *dev,
int intel_color_manager_set_pipe_degamma(struct drm_device *dev,
struct drm_crtc_state *crtc_state,
struct drm_mode_object *obj, uint32_t blob_id);
+int intel_color_manager_set_pipe_csc(struct drm_device *dev,
+ struct drm_crtc_state *crtc_state,
+ struct drm_mode_object *obj, uint32_t blob_id);
void intel_color_manager_crtc_commit(struct drm_device *dev,
struct drm_crtc_state *crtc_state);