All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2
@ 2019-10-28 18:58 ` Hans de Goede
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2019-10-28 18:58 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ville Syrjälä
  Cc: Hans de Goede, intel-gfx, dri-devel

Since commit 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after
vblank waits"), I am seeing an ugly colored flash of the first few display
lines on 2 Cherry Trail devices when the gamma table gets set for the first
time. A blue flash on a GPD win and a yellow flash on an Asus T100HA.

The problem is that since this change, the LUT is programmed after the
write *and latching* of the double-buffered register which causes the LUT
to be used starting at the next frame. This means that the old LUT is still
used for the first couple of lines of the display. If no LUT was in use
before then the LUT registers may contain bogus values. This leads to
messed up colors until the new LUT values are written. At least on CHT DSI
panels this causes messed up colors on the first few lines.

This commit fixes this by adding a load_lut_before_commit boolean,
modifying commit_pipe_config() to load the luts earlier if this is set.
and setting this from intel_color_check when enabling gamma (rather then
updating an existing gamma table).

Changes in v2:
-Simply check for setting load_lut_before_commit to:
 if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)

Fixes: 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after vblank waits")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/i915/display/intel_color.c         | 14 ++++++++++++++
 drivers/gpu/drm/i915/display/intel_display.c       |  6 +++++-
 drivers/gpu/drm/i915/display/intel_display_types.h |  3 +++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index fa44eb73d088..954a232c15d1 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -1063,6 +1063,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
 		intel_atomic_get_old_crtc_state(state, crtc);
 	struct intel_plane *plane;
 
+	new_crtc_state->load_lut_before_commit = false;
+
 	if (!new_crtc_state->base.active ||
 	    drm_atomic_crtc_needs_modeset(&new_crtc_state->base))
 		return 0;
@@ -1071,6 +1073,18 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
 	    new_crtc_state->csc_enable == old_crtc_state->csc_enable)
 		return 0;
 
+	/*
+	 * Normally we load the LUTs after vblank / after the double-buffer
+	 * registers written by commit have been latched, this avoids a
+	 * gamma change mid-way the screen. This does mean that the first
+	 * few lines of the display will (sometimes) still use the old
+	 * table. This is fine when changing an existing LUT, but if this
+	 * is the first time the LUT gets loaded, then the hw may contain
+	 * random values, causing the first lines to have funky colors.
+	 */
+	if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
+		new_crtc_state->load_lut_before_commit = true;
+
 	for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
 		struct intel_plane_state *plane_state;
 
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index cbf9cf30050c..6b1dc5a5aeb1 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14168,8 +14168,11 @@ static void commit_pipe_config(struct intel_atomic_state *state,
 	 */
 	if (!modeset) {
 		if (new_crtc_state->base.color_mgmt_changed ||
-		    new_crtc_state->update_pipe)
+		    new_crtc_state->update_pipe) {
+			if (new_crtc_state->load_lut_before_commit)
+				intel_color_load_luts(new_crtc_state);
 			intel_color_commit(new_crtc_state);
+		}
 
 		if (INTEL_GEN(dev_priv) >= 9)
 			skl_detach_scalers(new_crtc_state);
@@ -14717,6 +14720,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
 		if (new_crtc_state->base.active &&
 		    !needs_modeset(new_crtc_state) &&
+		    !new_crtc_state->load_lut_before_commit &&
 		    (new_crtc_state->base.color_mgmt_changed ||
 		     new_crtc_state->update_pipe))
 			intel_color_load_luts(new_crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 40184e823c84..6bcc997b7ecb 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -990,6 +990,9 @@ struct intel_crtc_state {
 	/* enable pipe csc? */
 	bool csc_enable;
 
+	/* load luts before color settings commit */
+	bool load_lut_before_commit;
+
 	/* Display Stream compression state */
 	struct {
 		bool compression_enable;
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2
@ 2019-10-28 18:58 ` Hans de Goede
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2019-10-28 18:58 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ville Syrjälä
  Cc: intel-gfx, dri-devel

Since commit 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after
vblank waits"), I am seeing an ugly colored flash of the first few display
lines on 2 Cherry Trail devices when the gamma table gets set for the first
time. A blue flash on a GPD win and a yellow flash on an Asus T100HA.

The problem is that since this change, the LUT is programmed after the
write *and latching* of the double-buffered register which causes the LUT
to be used starting at the next frame. This means that the old LUT is still
used for the first couple of lines of the display. If no LUT was in use
before then the LUT registers may contain bogus values. This leads to
messed up colors until the new LUT values are written. At least on CHT DSI
panels this causes messed up colors on the first few lines.

This commit fixes this by adding a load_lut_before_commit boolean,
modifying commit_pipe_config() to load the luts earlier if this is set.
and setting this from intel_color_check when enabling gamma (rather then
updating an existing gamma table).

Changes in v2:
-Simply check for setting load_lut_before_commit to:
 if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)

Fixes: 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after vblank waits")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/i915/display/intel_color.c         | 14 ++++++++++++++
 drivers/gpu/drm/i915/display/intel_display.c       |  6 +++++-
 drivers/gpu/drm/i915/display/intel_display_types.h |  3 +++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index fa44eb73d088..954a232c15d1 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -1063,6 +1063,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
 		intel_atomic_get_old_crtc_state(state, crtc);
 	struct intel_plane *plane;
 
+	new_crtc_state->load_lut_before_commit = false;
+
 	if (!new_crtc_state->base.active ||
 	    drm_atomic_crtc_needs_modeset(&new_crtc_state->base))
 		return 0;
@@ -1071,6 +1073,18 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
 	    new_crtc_state->csc_enable == old_crtc_state->csc_enable)
 		return 0;
 
+	/*
+	 * Normally we load the LUTs after vblank / after the double-buffer
+	 * registers written by commit have been latched, this avoids a
+	 * gamma change mid-way the screen. This does mean that the first
+	 * few lines of the display will (sometimes) still use the old
+	 * table. This is fine when changing an existing LUT, but if this
+	 * is the first time the LUT gets loaded, then the hw may contain
+	 * random values, causing the first lines to have funky colors.
+	 */
+	if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
+		new_crtc_state->load_lut_before_commit = true;
+
 	for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
 		struct intel_plane_state *plane_state;
 
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index cbf9cf30050c..6b1dc5a5aeb1 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14168,8 +14168,11 @@ static void commit_pipe_config(struct intel_atomic_state *state,
 	 */
 	if (!modeset) {
 		if (new_crtc_state->base.color_mgmt_changed ||
-		    new_crtc_state->update_pipe)
+		    new_crtc_state->update_pipe) {
+			if (new_crtc_state->load_lut_before_commit)
+				intel_color_load_luts(new_crtc_state);
 			intel_color_commit(new_crtc_state);
+		}
 
 		if (INTEL_GEN(dev_priv) >= 9)
 			skl_detach_scalers(new_crtc_state);
@@ -14717,6 +14720,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
 		if (new_crtc_state->base.active &&
 		    !needs_modeset(new_crtc_state) &&
+		    !new_crtc_state->load_lut_before_commit &&
 		    (new_crtc_state->base.color_mgmt_changed ||
 		     new_crtc_state->update_pipe))
 			intel_color_load_luts(new_crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 40184e823c84..6bcc997b7ecb 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -990,6 +990,9 @@ struct intel_crtc_state {
 	/* enable pipe csc? */
 	bool csc_enable;
 
+	/* load luts before color settings commit */
+	bool load_lut_before_commit;
+
 	/* Display Stream compression state */
 	struct {
 		bool compression_enable;
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: Program LUT before intel_color_commit() if LUT was not previously set (rev2)
@ 2019-10-28 22:38   ` Patchwork
  0 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-10-28 22:38 UTC (permalink / raw)
  To: Hans de Goede; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Program LUT before intel_color_commit() if LUT was not previously set (rev2)
URL   : https://patchwork.freedesktop.org/series/68278/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7205 -> Patchwork_15032
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_15032 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_15032, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_15032:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_blt:
    - fi-kbl-soraka:      [PASS][1] -> [TIMEOUT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-kbl-soraka/igt@i915_selftest@live_blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-soraka/igt@i915_selftest@live_blt.html
    - fi-kbl-8809g:       [PASS][3] -> [TIMEOUT][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-kbl-8809g/igt@i915_selftest@live_blt.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-8809g/igt@i915_selftest@live_blt.html
    - fi-apl-guc:         [PASS][5] -> [TIMEOUT][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-apl-guc/igt@i915_selftest@live_blt.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-apl-guc/igt@i915_selftest@live_blt.html
    - fi-skl-6770hq:      [PASS][7] -> [TIMEOUT][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-6770hq/igt@i915_selftest@live_blt.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-6770hq/igt@i915_selftest@live_blt.html
    - fi-cfl-8109u:       [PASS][9] -> [TIMEOUT][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-cfl-8109u/igt@i915_selftest@live_blt.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-8109u/igt@i915_selftest@live_blt.html
    - fi-skl-guc:         [PASS][11] -> [TIMEOUT][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-guc/igt@i915_selftest@live_blt.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-guc/igt@i915_selftest@live_blt.html
    - fi-cfl-guc:         [PASS][13] -> [TIMEOUT][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-cfl-guc/igt@i915_selftest@live_blt.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-guc/igt@i915_selftest@live_blt.html

  * igt@runner@aborted:
    - fi-cfl-8109u:       NOTRUN -> [FAIL][15]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-8109u/igt@runner@aborted.html
    - fi-kbl-soraka:      NOTRUN -> [FAIL][16]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-soraka/igt@runner@aborted.html
    - fi-kbl-8809g:       NOTRUN -> [FAIL][17]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-8809g/igt@runner@aborted.html

  
Known issues
------------

  Here are the changes found in Patchwork_15032 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_switch@legacy-render:
    - fi-icl-u2:          [PASS][18] -> [INCOMPLETE][19] ([fdo#107713] / [fdo#111381])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       [PASS][20] -> [DMESG-WARN][21] ([fdo#102614])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html

  * igt@vgem_basic@setversion:
    - fi-icl-u3:          [PASS][22] -> [DMESG-WARN][23] ([fdo#107724]) +1 similar issue
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u3/igt@vgem_basic@setversion.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u3/igt@vgem_basic@setversion.html

  
#### Possible fixes ####

  * igt@gem_ctx_switch@legacy-render:
    - fi-bxt-dsi:         [INCOMPLETE][24] ([fdo#103927] / [fdo#111381]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-bxt-dsi/igt@gem_ctx_switch@legacy-render.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-bxt-dsi/igt@gem_ctx_switch@legacy-render.html

  * igt@gem_exec_reloc@basic-gtt-read:
    - fi-icl-u3:          [DMESG-WARN][26] ([fdo#107724]) -> [PASS][27] +1 similar issue
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u3/igt@gem_exec_reloc@basic-gtt-read.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u3/igt@gem_exec_reloc@basic-gtt-read.html

  * igt@i915_selftest@live_blt:
    - fi-glk-dsi:         [TIMEOUT][28] -> [PASS][29]
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-glk-dsi/igt@i915_selftest@live_blt.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-glk-dsi/igt@i915_selftest@live_blt.html
    - fi-skl-iommu:       [TIMEOUT][30] -> [PASS][31]
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-iommu/igt@i915_selftest@live_blt.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-iommu/igt@i915_selftest@live_blt.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381


Participating hosts (49 -> 43)
------------------------------

  Additional (1): fi-kbl-r 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-icl-y fi-tgl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_7205 -> Patchwork_15032

  CI-20190529: 20190529
  CI_DRM_7205: b584710d3ea551d555a6de8470cb6da8cab6fd6f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5248: 81e55f1f97d73e48f00caa7e4fb98295023c5afa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_15032: 7535083f5be8723c36f5a7b6bb0003563aec4434 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

7535083f5be8 drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Program LUT before intel_color_commit() if LUT was not previously set (rev2)
@ 2019-10-28 22:38   ` Patchwork
  0 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-10-28 22:38 UTC (permalink / raw)
  To: Hans de Goede; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Program LUT before intel_color_commit() if LUT was not previously set (rev2)
URL   : https://patchwork.freedesktop.org/series/68278/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7205 -> Patchwork_15032
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_15032 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_15032, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_15032:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live_blt:
    - fi-kbl-soraka:      [PASS][1] -> [TIMEOUT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-kbl-soraka/igt@i915_selftest@live_blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-soraka/igt@i915_selftest@live_blt.html
    - fi-kbl-8809g:       [PASS][3] -> [TIMEOUT][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-kbl-8809g/igt@i915_selftest@live_blt.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-8809g/igt@i915_selftest@live_blt.html
    - fi-apl-guc:         [PASS][5] -> [TIMEOUT][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-apl-guc/igt@i915_selftest@live_blt.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-apl-guc/igt@i915_selftest@live_blt.html
    - fi-skl-6770hq:      [PASS][7] -> [TIMEOUT][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-6770hq/igt@i915_selftest@live_blt.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-6770hq/igt@i915_selftest@live_blt.html
    - fi-cfl-8109u:       [PASS][9] -> [TIMEOUT][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-cfl-8109u/igt@i915_selftest@live_blt.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-8109u/igt@i915_selftest@live_blt.html
    - fi-skl-guc:         [PASS][11] -> [TIMEOUT][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-guc/igt@i915_selftest@live_blt.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-guc/igt@i915_selftest@live_blt.html
    - fi-cfl-guc:         [PASS][13] -> [TIMEOUT][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-cfl-guc/igt@i915_selftest@live_blt.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-guc/igt@i915_selftest@live_blt.html

  * igt@runner@aborted:
    - fi-cfl-8109u:       NOTRUN -> [FAIL][15]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-cfl-8109u/igt@runner@aborted.html
    - fi-kbl-soraka:      NOTRUN -> [FAIL][16]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-soraka/igt@runner@aborted.html
    - fi-kbl-8809g:       NOTRUN -> [FAIL][17]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-kbl-8809g/igt@runner@aborted.html

  
Known issues
------------

  Here are the changes found in Patchwork_15032 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_switch@legacy-render:
    - fi-icl-u2:          [PASS][18] -> [INCOMPLETE][19] ([fdo#107713] / [fdo#111381])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u2/igt@gem_ctx_switch@legacy-render.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-hsw-peppy:       [PASS][20] -> [DMESG-WARN][21] ([fdo#102614])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-hsw-peppy/igt@kms_frontbuffer_tracking@basic.html

  * igt@vgem_basic@setversion:
    - fi-icl-u3:          [PASS][22] -> [DMESG-WARN][23] ([fdo#107724]) +1 similar issue
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u3/igt@vgem_basic@setversion.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u3/igt@vgem_basic@setversion.html

  
#### Possible fixes ####

  * igt@gem_ctx_switch@legacy-render:
    - fi-bxt-dsi:         [INCOMPLETE][24] ([fdo#103927] / [fdo#111381]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-bxt-dsi/igt@gem_ctx_switch@legacy-render.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-bxt-dsi/igt@gem_ctx_switch@legacy-render.html

  * igt@gem_exec_reloc@basic-gtt-read:
    - fi-icl-u3:          [DMESG-WARN][26] ([fdo#107724]) -> [PASS][27] +1 similar issue
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-icl-u3/igt@gem_exec_reloc@basic-gtt-read.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-icl-u3/igt@gem_exec_reloc@basic-gtt-read.html

  * igt@i915_selftest@live_blt:
    - fi-glk-dsi:         [TIMEOUT][28] -> [PASS][29]
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-glk-dsi/igt@i915_selftest@live_blt.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-glk-dsi/igt@i915_selftest@live_blt.html
    - fi-skl-iommu:       [TIMEOUT][30] -> [PASS][31]
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7205/fi-skl-iommu/igt@i915_selftest@live_blt.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/fi-skl-iommu/igt@i915_selftest@live_blt.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381


Participating hosts (49 -> 43)
------------------------------

  Additional (1): fi-kbl-r 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-icl-y fi-tgl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_7205 -> Patchwork_15032

  CI-20190529: 20190529
  CI_DRM_7205: b584710d3ea551d555a6de8470cb6da8cab6fd6f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5248: 81e55f1f97d73e48f00caa7e4fb98295023c5afa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_15032: 7535083f5be8723c36f5a7b6bb0003563aec4434 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

7535083f5be8 drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15032/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2
@ 2019-10-30 17:35   ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2019-10-30 17:35 UTC (permalink / raw)
  To: Hans de Goede; +Cc: intel-gfx, dri-devel

On Mon, Oct 28, 2019 at 07:58:51PM +0100, Hans de Goede wrote:
> Since commit 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after
> vblank waits"), I am seeing an ugly colored flash of the first few display
> lines on 2 Cherry Trail devices when the gamma table gets set for the first
> time. A blue flash on a GPD win and a yellow flash on an Asus T100HA.
> 
> The problem is that since this change, the LUT is programmed after the
> write *and latching* of the double-buffered register which causes the LUT
> to be used starting at the next frame. This means that the old LUT is still
> used for the first couple of lines of the display. If no LUT was in use
> before then the LUT registers may contain bogus values. This leads to
> messed up colors until the new LUT values are written. At least on CHT DSI
> panels this causes messed up colors on the first few lines.
> 
> This commit fixes this by adding a load_lut_before_commit boolean,
> modifying commit_pipe_config() to load the luts earlier if this is set.
> and setting this from intel_color_check when enabling gamma (rather then
> updating an existing gamma table).
> 
> Changes in v2:
> -Simply check for setting load_lut_before_commit to:
>  if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> 
> Fixes: 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after vblank waits")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c         | 14 ++++++++++++++
>  drivers/gpu/drm/i915/display/intel_display.c       |  6 +++++-
>  drivers/gpu/drm/i915/display/intel_display_types.h |  3 +++
>  3 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index fa44eb73d088..954a232c15d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -1063,6 +1063,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct intel_plane *plane;
>  
> +	new_crtc_state->load_lut_before_commit = false;
> +
>  	if (!new_crtc_state->base.active ||
>  	    drm_atomic_crtc_needs_modeset(&new_crtc_state->base))
>  		return 0;
> @@ -1071,6 +1073,18 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  	    new_crtc_state->csc_enable == old_crtc_state->csc_enable)
>  		return 0;
>  
> +	/*
> +	 * Normally we load the LUTs after vblank / after the double-buffer
> +	 * registers written by commit have been latched, this avoids a
> +	 * gamma change mid-way the screen. This does mean that the first
> +	 * few lines of the display will (sometimes) still use the old
> +	 * table. This is fine when changing an existing LUT, but if this
> +	 * is the first time the LUT gets loaded, then the hw may contain
> +	 * random values, causing the first lines to have funky colors.
> +	 */
> +	if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> +		new_crtc_state->load_lut_before_commit = true;

Unfortunately gamma_enable is not abstract enough to cover all
platforms.

> +
>  	for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
>  		struct intel_plane_state *plane_state;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index cbf9cf30050c..6b1dc5a5aeb1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -14168,8 +14168,11 @@ static void commit_pipe_config(struct intel_atomic_state *state,
>  	 */
>  	if (!modeset) {
>  		if (new_crtc_state->base.color_mgmt_changed ||
> -		    new_crtc_state->update_pipe)
> +		    new_crtc_state->update_pipe) {
> +			if (new_crtc_state->load_lut_before_commit)
> +				intel_color_load_luts(new_crtc_state);

We don't want to do this from within the vblank evade critical
section, so needs to be moved earlier.

Lemme try to cook up something...

>  			intel_color_commit(new_crtc_state);
> +		}
>  
>  		if (INTEL_GEN(dev_priv) >= 9)
>  			skl_detach_scalers(new_crtc_state);
> @@ -14717,6 +14720,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
>  	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
>  		if (new_crtc_state->base.active &&
>  		    !needs_modeset(new_crtc_state) &&
> +		    !new_crtc_state->load_lut_before_commit &&
>  		    (new_crtc_state->base.color_mgmt_changed ||
>  		     new_crtc_state->update_pipe))
>  			intel_color_load_luts(new_crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 40184e823c84..6bcc997b7ecb 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -990,6 +990,9 @@ struct intel_crtc_state {
>  	/* enable pipe csc? */
>  	bool csc_enable;
>  
> +	/* load luts before color settings commit */
> +	bool load_lut_before_commit;
> +
>  	/* Display Stream compression state */
>  	struct {
>  		bool compression_enable;
> -- 
> 2.23.0

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2
@ 2019-10-30 17:35   ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2019-10-30 17:35 UTC (permalink / raw)
  To: Hans de Goede; +Cc: intel-gfx, dri-devel, Rodrigo Vivi

On Mon, Oct 28, 2019 at 07:58:51PM +0100, Hans de Goede wrote:
> Since commit 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after
> vblank waits"), I am seeing an ugly colored flash of the first few display
> lines on 2 Cherry Trail devices when the gamma table gets set for the first
> time. A blue flash on a GPD win and a yellow flash on an Asus T100HA.
> 
> The problem is that since this change, the LUT is programmed after the
> write *and latching* of the double-buffered register which causes the LUT
> to be used starting at the next frame. This means that the old LUT is still
> used for the first couple of lines of the display. If no LUT was in use
> before then the LUT registers may contain bogus values. This leads to
> messed up colors until the new LUT values are written. At least on CHT DSI
> panels this causes messed up colors on the first few lines.
> 
> This commit fixes this by adding a load_lut_before_commit boolean,
> modifying commit_pipe_config() to load the luts earlier if this is set.
> and setting this from intel_color_check when enabling gamma (rather then
> updating an existing gamma table).
> 
> Changes in v2:
> -Simply check for setting load_lut_before_commit to:
>  if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> 
> Fixes: 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after vblank waits")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c         | 14 ++++++++++++++
>  drivers/gpu/drm/i915/display/intel_display.c       |  6 +++++-
>  drivers/gpu/drm/i915/display/intel_display_types.h |  3 +++
>  3 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index fa44eb73d088..954a232c15d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -1063,6 +1063,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct intel_plane *plane;
>  
> +	new_crtc_state->load_lut_before_commit = false;
> +
>  	if (!new_crtc_state->base.active ||
>  	    drm_atomic_crtc_needs_modeset(&new_crtc_state->base))
>  		return 0;
> @@ -1071,6 +1073,18 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  	    new_crtc_state->csc_enable == old_crtc_state->csc_enable)
>  		return 0;
>  
> +	/*
> +	 * Normally we load the LUTs after vblank / after the double-buffer
> +	 * registers written by commit have been latched, this avoids a
> +	 * gamma change mid-way the screen. This does mean that the first
> +	 * few lines of the display will (sometimes) still use the old
> +	 * table. This is fine when changing an existing LUT, but if this
> +	 * is the first time the LUT gets loaded, then the hw may contain
> +	 * random values, causing the first lines to have funky colors.
> +	 */
> +	if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> +		new_crtc_state->load_lut_before_commit = true;

Unfortunately gamma_enable is not abstract enough to cover all
platforms.

> +
>  	for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
>  		struct intel_plane_state *plane_state;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index cbf9cf30050c..6b1dc5a5aeb1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -14168,8 +14168,11 @@ static void commit_pipe_config(struct intel_atomic_state *state,
>  	 */
>  	if (!modeset) {
>  		if (new_crtc_state->base.color_mgmt_changed ||
> -		    new_crtc_state->update_pipe)
> +		    new_crtc_state->update_pipe) {
> +			if (new_crtc_state->load_lut_before_commit)
> +				intel_color_load_luts(new_crtc_state);

We don't want to do this from within the vblank evade critical
section, so needs to be moved earlier.

Lemme try to cook up something...

>  			intel_color_commit(new_crtc_state);
> +		}
>  
>  		if (INTEL_GEN(dev_priv) >= 9)
>  			skl_detach_scalers(new_crtc_state);
> @@ -14717,6 +14720,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
>  	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
>  		if (new_crtc_state->base.active &&
>  		    !needs_modeset(new_crtc_state) &&
> +		    !new_crtc_state->load_lut_before_commit &&
>  		    (new_crtc_state->base.color_mgmt_changed ||
>  		     new_crtc_state->update_pipe))
>  			intel_color_load_luts(new_crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 40184e823c84..6bcc997b7ecb 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -990,6 +990,9 @@ struct intel_crtc_state {
>  	/* enable pipe csc? */
>  	bool csc_enable;
>  
> +	/* load luts before color settings commit */
> +	bool load_lut_before_commit;
> +
>  	/* Display Stream compression state */
>  	struct {
>  		bool compression_enable;
> -- 
> 2.23.0

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2
@ 2019-10-30 17:35   ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2019-10-30 17:35 UTC (permalink / raw)
  To: Hans de Goede; +Cc: intel-gfx, dri-devel

On Mon, Oct 28, 2019 at 07:58:51PM +0100, Hans de Goede wrote:
> Since commit 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after
> vblank waits"), I am seeing an ugly colored flash of the first few display
> lines on 2 Cherry Trail devices when the gamma table gets set for the first
> time. A blue flash on a GPD win and a yellow flash on an Asus T100HA.
> 
> The problem is that since this change, the LUT is programmed after the
> write *and latching* of the double-buffered register which causes the LUT
> to be used starting at the next frame. This means that the old LUT is still
> used for the first couple of lines of the display. If no LUT was in use
> before then the LUT registers may contain bogus values. This leads to
> messed up colors until the new LUT values are written. At least on CHT DSI
> panels this causes messed up colors on the first few lines.
> 
> This commit fixes this by adding a load_lut_before_commit boolean,
> modifying commit_pipe_config() to load the luts earlier if this is set.
> and setting this from intel_color_check when enabling gamma (rather then
> updating an existing gamma table).
> 
> Changes in v2:
> -Simply check for setting load_lut_before_commit to:
>  if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> 
> Fixes: 051a6d8d3ca0 ("drm/i915: Move LUT programming to happen after vblank waits")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c         | 14 ++++++++++++++
>  drivers/gpu/drm/i915/display/intel_display.c       |  6 +++++-
>  drivers/gpu/drm/i915/display/intel_display_types.h |  3 +++
>  3 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index fa44eb73d088..954a232c15d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -1063,6 +1063,8 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct intel_plane *plane;
>  
> +	new_crtc_state->load_lut_before_commit = false;
> +
>  	if (!new_crtc_state->base.active ||
>  	    drm_atomic_crtc_needs_modeset(&new_crtc_state->base))
>  		return 0;
> @@ -1071,6 +1073,18 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
>  	    new_crtc_state->csc_enable == old_crtc_state->csc_enable)
>  		return 0;
>  
> +	/*
> +	 * Normally we load the LUTs after vblank / after the double-buffer
> +	 * registers written by commit have been latched, this avoids a
> +	 * gamma change mid-way the screen. This does mean that the first
> +	 * few lines of the display will (sometimes) still use the old
> +	 * table. This is fine when changing an existing LUT, but if this
> +	 * is the first time the LUT gets loaded, then the hw may contain
> +	 * random values, causing the first lines to have funky colors.
> +	 */
> +	if (!old_crtc_state->gamma_enable && new_crtc_state->gamma_enable)
> +		new_crtc_state->load_lut_before_commit = true;

Unfortunately gamma_enable is not abstract enough to cover all
platforms.

> +
>  	for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
>  		struct intel_plane_state *plane_state;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index cbf9cf30050c..6b1dc5a5aeb1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -14168,8 +14168,11 @@ static void commit_pipe_config(struct intel_atomic_state *state,
>  	 */
>  	if (!modeset) {
>  		if (new_crtc_state->base.color_mgmt_changed ||
> -		    new_crtc_state->update_pipe)
> +		    new_crtc_state->update_pipe) {
> +			if (new_crtc_state->load_lut_before_commit)
> +				intel_color_load_luts(new_crtc_state);

We don't want to do this from within the vblank evade critical
section, so needs to be moved earlier.

Lemme try to cook up something...

>  			intel_color_commit(new_crtc_state);
> +		}
>  
>  		if (INTEL_GEN(dev_priv) >= 9)
>  			skl_detach_scalers(new_crtc_state);
> @@ -14717,6 +14720,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
>  	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
>  		if (new_crtc_state->base.active &&
>  		    !needs_modeset(new_crtc_state) &&
> +		    !new_crtc_state->load_lut_before_commit &&
>  		    (new_crtc_state->base.color_mgmt_changed ||
>  		     new_crtc_state->update_pipe))
>  			intel_color_load_luts(new_crtc_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 40184e823c84..6bcc997b7ecb 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -990,6 +990,9 @@ struct intel_crtc_state {
>  	/* enable pipe csc? */
>  	bool csc_enable;
>  
> +	/* load luts before color settings commit */
> +	bool load_lut_before_commit;
> +
>  	/* Display Stream compression state */
>  	struct {
>  		bool compression_enable;
> -- 
> 2.23.0

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-30 17:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 18:58 [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2 Hans de Goede
2019-10-28 18:58 ` [Intel-gfx] " Hans de Goede
2019-10-28 22:38 ` ✗ Fi.CI.BAT: failure for drm/i915: Program LUT before intel_color_commit() if LUT was not previously set (rev2) Patchwork
2019-10-28 22:38   ` [Intel-gfx] " Patchwork
2019-10-30 17:35 ` [PATCH] drm/i915: Program LUT before intel_color_commit() if LUT was not previously set v2 Ville Syrjälä
2019-10-30 17:35   ` [Intel-gfx] " Ville Syrjälä
2019-10-30 17:35   ` Ville Syrjälä

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.