drm/i915: Split icl_color_commit_noarm() from skl_color_commit_noarm()
authorjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:38:17 +0000 (05:38 +0000)
committerjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:38:17 +0000 (05:38 +0000)
From Ville Syrjala
726825297dd6aaa2d91daf7c1c2fd030859cc6cb in linux-6.1.y/6.1.24
76b767d4d1cd052e455cf18e06929e8b2b70101d in mainline linux

sys/dev/pci/drm/i915/display/intel_color.c

index c85757f..78211e5 100644 (file)
@@ -2098,6 +2098,25 @@ static void glk_read_luts(struct intel_crtc_state *crtc_state)
        }
 }
 
+static void icl_color_commit_arm(const struct intel_crtc_state *crtc_state)
+{
+       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+       struct drm_i915_private *i915 = to_i915(crtc->base.dev);
+       enum pipe pipe = crtc->pipe;
+
+       /*
+        * We don't (yet) allow userspace to control the pipe background color,
+        * so force it to black.
+        */
+       intel_de_write(i915, SKL_BOTTOM_COLOR(pipe), 0);
+
+       intel_de_write(i915, GAMMA_MODE(crtc->pipe),
+                      crtc_state->gamma_mode);
+
+       intel_de_write_fw(i915, PIPE_CSC_MODE(crtc->pipe),
+                         crtc_state->csc_mode);
+}
+
 static struct drm_property_blob *
 icl_read_lut_multi_segment(struct intel_crtc *crtc)
 {
@@ -2183,7 +2202,7 @@ static const struct intel_color_funcs i9xx_color_funcs = {
 static const struct intel_color_funcs icl_color_funcs = {
        .color_check = icl_color_check,
        .color_commit_noarm = icl_color_commit_noarm,
-       .color_commit_arm = skl_color_commit_arm,
+       .color_commit_arm = icl_color_commit_arm,
        .load_luts = icl_load_luts,
        .read_luts = icl_read_luts,
 };