All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction
@ 2018-11-28 10:07 Daniel Vetter
  2018-11-28 10:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Daniel Vetter @ 2018-11-28 10:07 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

I've misplaced two functions by accident:
- drm_atomic_helper_duplicate_state is really part of the
  resume/suspend/shutdown device-wide helpers.
- drm_atomic_helper_legacy_gamma_set is part of the legacy ioctl
  compat helpers.

Move them both back.

Fixes: 9ef8a9dc4b21 ("drm: Extract drm_atomic_state_helper.[hc]")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c       | 157 ++++++++++++++++++++++
 drivers/gpu/drm/drm_atomic_state_helper.c | 157 ----------------------
 include/drm/drm_atomic_helper.h           |   7 +
 include/drm/drm_atomic_state_helper.h     |   7 -
 4 files changed, 164 insertions(+), 164 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9b22774a9867..de7d872f9f1a 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3135,6 +3135,93 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_atomic_helper_shutdown);
 
+/**
+ * drm_atomic_helper_duplicate_state - duplicate an atomic state object
+ * @dev: DRM device
+ * @ctx: lock acquisition context
+ *
+ * Makes a copy of the current atomic state by looping over all objects and
+ * duplicating their respective states. This is used for example by suspend/
+ * resume support code to save the state prior to suspend such that it can
+ * be restored upon resume.
+ *
+ * Note that this treats atomic state as persistent between save and restore.
+ * Drivers must make sure that this is possible and won't result in confusion
+ * or erroneous behaviour.
+ *
+ * Note that if callers haven't already acquired all modeset locks this might
+ * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
+ *
+ * Returns:
+ * A pointer to the copy of the atomic state object on success or an
+ * ERR_PTR()-encoded error code on failure.
+ *
+ * See also:
+ * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
+ */
+struct drm_atomic_state *
+drm_atomic_helper_duplicate_state(struct drm_device *dev,
+				  struct drm_modeset_acquire_ctx *ctx)
+{
+	struct drm_atomic_state *state;
+	struct drm_connector *conn;
+	struct drm_connector_list_iter conn_iter;
+	struct drm_plane *plane;
+	struct drm_crtc *crtc;
+	int err = 0;
+
+	state = drm_atomic_state_alloc(dev);
+	if (!state)
+		return ERR_PTR(-ENOMEM);
+
+	state->acquire_ctx = ctx;
+
+	drm_for_each_crtc(crtc, dev) {
+		struct drm_crtc_state *crtc_state;
+
+		crtc_state = drm_atomic_get_crtc_state(state, crtc);
+		if (IS_ERR(crtc_state)) {
+			err = PTR_ERR(crtc_state);
+			goto free;
+		}
+	}
+
+	drm_for_each_plane(plane, dev) {
+		struct drm_plane_state *plane_state;
+
+		plane_state = drm_atomic_get_plane_state(state, plane);
+		if (IS_ERR(plane_state)) {
+			err = PTR_ERR(plane_state);
+			goto free;
+		}
+	}
+
+	drm_connector_list_iter_begin(dev, &conn_iter);
+	drm_for_each_connector_iter(conn, &conn_iter) {
+		struct drm_connector_state *conn_state;
+
+		conn_state = drm_atomic_get_connector_state(state, conn);
+		if (IS_ERR(conn_state)) {
+			err = PTR_ERR(conn_state);
+			drm_connector_list_iter_end(&conn_iter);
+			goto free;
+		}
+	}
+	drm_connector_list_iter_end(&conn_iter);
+
+	/* clear the acquire context so that it isn't accidentally reused */
+	state->acquire_ctx = NULL;
+
+free:
+	if (err < 0) {
+		drm_atomic_state_put(state);
+		state = ERR_PTR(err);
+	}
+
+	return state;
+}
+EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
+
 /**
  * drm_atomic_helper_suspend - subsystem-level suspend helper
  * @dev: DRM device
@@ -3418,3 +3505,73 @@ int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc,
 	return ret;
 }
 EXPORT_SYMBOL(drm_atomic_helper_page_flip_target);
+
+/**
+ * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
+ * @crtc: CRTC object
+ * @red: red correction table
+ * @green: green correction table
+ * @blue: green correction table
+ * @size: size of the tables
+ * @ctx: lock acquire context
+ *
+ * Implements support for legacy gamma correction table for drivers
+ * that support color management through the DEGAMMA_LUT/GAMMA_LUT
+ * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
+ * how the atomic color management and gamma tables work.
+ */
+int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
+				       u16 *red, u16 *green, u16 *blue,
+				       uint32_t size,
+				       struct drm_modeset_acquire_ctx *ctx)
+{
+	struct drm_device *dev = crtc->dev;
+	struct drm_atomic_state *state;
+	struct drm_crtc_state *crtc_state;
+	struct drm_property_blob *blob = NULL;
+	struct drm_color_lut *blob_data;
+	int i, ret = 0;
+	bool replaced;
+
+	state = drm_atomic_state_alloc(crtc->dev);
+	if (!state)
+		return -ENOMEM;
+
+	blob = drm_property_create_blob(dev,
+					sizeof(struct drm_color_lut) * size,
+					NULL);
+	if (IS_ERR(blob)) {
+		ret = PTR_ERR(blob);
+		blob = NULL;
+		goto fail;
+	}
+
+	/* Prepare GAMMA_LUT with the legacy values. */
+	blob_data = blob->data;
+	for (i = 0; i < size; i++) {
+		blob_data[i].red = red[i];
+		blob_data[i].green = green[i];
+		blob_data[i].blue = blue[i];
+	}
+
+	state->acquire_ctx = ctx;
+	crtc_state = drm_atomic_get_crtc_state(state, crtc);
+	if (IS_ERR(crtc_state)) {
+		ret = PTR_ERR(crtc_state);
+		goto fail;
+	}
+
+	/* Reset DEGAMMA_LUT and CTM properties. */
+	replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
+	replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
+	replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
+	crtc_state->color_mgmt_changed |= replaced;
+
+	ret = drm_atomic_commit(state);
+
+fail:
+	drm_atomic_state_put(state);
+	drm_property_blob_put(blob);
+	return ret;
+}
+EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index 3ba996069d69..60bd7d708e35 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -393,93 +393,6 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector)
 }
 EXPORT_SYMBOL(drm_atomic_helper_connector_duplicate_state);
 
-/**
- * drm_atomic_helper_duplicate_state - duplicate an atomic state object
- * @dev: DRM device
- * @ctx: lock acquisition context
- *
- * Makes a copy of the current atomic state by looping over all objects and
- * duplicating their respective states. This is used for example by suspend/
- * resume support code to save the state prior to suspend such that it can
- * be restored upon resume.
- *
- * Note that this treats atomic state as persistent between save and restore.
- * Drivers must make sure that this is possible and won't result in confusion
- * or erroneous behaviour.
- *
- * Note that if callers haven't already acquired all modeset locks this might
- * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
- *
- * Returns:
- * A pointer to the copy of the atomic state object on success or an
- * ERR_PTR()-encoded error code on failure.
- *
- * See also:
- * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
- */
-struct drm_atomic_state *
-drm_atomic_helper_duplicate_state(struct drm_device *dev,
-				  struct drm_modeset_acquire_ctx *ctx)
-{
-	struct drm_atomic_state *state;
-	struct drm_connector *conn;
-	struct drm_connector_list_iter conn_iter;
-	struct drm_plane *plane;
-	struct drm_crtc *crtc;
-	int err = 0;
-
-	state = drm_atomic_state_alloc(dev);
-	if (!state)
-		return ERR_PTR(-ENOMEM);
-
-	state->acquire_ctx = ctx;
-
-	drm_for_each_crtc(crtc, dev) {
-		struct drm_crtc_state *crtc_state;
-
-		crtc_state = drm_atomic_get_crtc_state(state, crtc);
-		if (IS_ERR(crtc_state)) {
-			err = PTR_ERR(crtc_state);
-			goto free;
-		}
-	}
-
-	drm_for_each_plane(plane, dev) {
-		struct drm_plane_state *plane_state;
-
-		plane_state = drm_atomic_get_plane_state(state, plane);
-		if (IS_ERR(plane_state)) {
-			err = PTR_ERR(plane_state);
-			goto free;
-		}
-	}
-
-	drm_connector_list_iter_begin(dev, &conn_iter);
-	drm_for_each_connector_iter(conn, &conn_iter) {
-		struct drm_connector_state *conn_state;
-
-		conn_state = drm_atomic_get_connector_state(state, conn);
-		if (IS_ERR(conn_state)) {
-			err = PTR_ERR(conn_state);
-			drm_connector_list_iter_end(&conn_iter);
-			goto free;
-		}
-	}
-	drm_connector_list_iter_end(&conn_iter);
-
-	/* clear the acquire context so that it isn't accidentally reused */
-	state->acquire_ctx = NULL;
-
-free:
-	if (err < 0) {
-		drm_atomic_state_put(state);
-		state = ERR_PTR(err);
-	}
-
-	return state;
-}
-EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
-
 /**
  * __drm_atomic_helper_connector_destroy_state - release connector state
  * @state: connector state object to release
@@ -515,76 +428,6 @@ void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
 
-/**
- * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
- * @crtc: CRTC object
- * @red: red correction table
- * @green: green correction table
- * @blue: green correction table
- * @size: size of the tables
- * @ctx: lock acquire context
- *
- * Implements support for legacy gamma correction table for drivers
- * that support color management through the DEGAMMA_LUT/GAMMA_LUT
- * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
- * how the atomic color management and gamma tables work.
- */
-int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
-				       u16 *red, u16 *green, u16 *blue,
-				       uint32_t size,
-				       struct drm_modeset_acquire_ctx *ctx)
-{
-	struct drm_device *dev = crtc->dev;
-	struct drm_atomic_state *state;
-	struct drm_crtc_state *crtc_state;
-	struct drm_property_blob *blob = NULL;
-	struct drm_color_lut *blob_data;
-	int i, ret = 0;
-	bool replaced;
-
-	state = drm_atomic_state_alloc(crtc->dev);
-	if (!state)
-		return -ENOMEM;
-
-	blob = drm_property_create_blob(dev,
-					sizeof(struct drm_color_lut) * size,
-					NULL);
-	if (IS_ERR(blob)) {
-		ret = PTR_ERR(blob);
-		blob = NULL;
-		goto fail;
-	}
-
-	/* Prepare GAMMA_LUT with the legacy values. */
-	blob_data = blob->data;
-	for (i = 0; i < size; i++) {
-		blob_data[i].red = red[i];
-		blob_data[i].green = green[i];
-		blob_data[i].blue = blue[i];
-	}
-
-	state->acquire_ctx = ctx;
-	crtc_state = drm_atomic_get_crtc_state(state, crtc);
-	if (IS_ERR(crtc_state)) {
-		ret = PTR_ERR(crtc_state);
-		goto fail;
-	}
-
-	/* Reset DEGAMMA_LUT and CTM properties. */
-	replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
-	replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
-	replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
-	crtc_state->color_mgmt_changed |= replaced;
-
-	ret = drm_atomic_commit(state);
-
-fail:
-	drm_atomic_state_put(state);
-	drm_property_blob_put(blob);
-	return ret;
-}
-EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
-
 /**
  * __drm_atomic_helper_private_duplicate_state - copy atomic private state
  * @obj: CRTC object
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 25ca0097563e..58214be3bf3d 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -127,6 +127,9 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
 int drm_atomic_helper_disable_all(struct drm_device *dev,
 				  struct drm_modeset_acquire_ctx *ctx);
 void drm_atomic_helper_shutdown(struct drm_device *dev);
+struct drm_atomic_state *
+drm_atomic_helper_duplicate_state(struct drm_device *dev,
+				  struct drm_modeset_acquire_ctx *ctx);
 struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev);
 int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
 					      struct drm_modeset_acquire_ctx *ctx);
@@ -145,6 +148,10 @@ int drm_atomic_helper_page_flip_target(
 				uint32_t flags,
 				uint32_t target,
 				struct drm_modeset_acquire_ctx *ctx);
+int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
+				       u16 *red, u16 *green, u16 *blue,
+				       uint32_t size,
+				       struct drm_modeset_acquire_ctx *ctx);
 
 /**
  * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 5b82ccfdb502..66c92cbd8e16 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -65,16 +65,9 @@ __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
 					   struct drm_connector_state *state);
 struct drm_connector_state *
 drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector);
-struct drm_atomic_state *
-drm_atomic_helper_duplicate_state(struct drm_device *dev,
-				  struct drm_modeset_acquire_ctx *ctx);
 void
 __drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state);
 void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
 					  struct drm_connector_state *state);
-int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
-				       u16 *red, u16 *green, u16 *blue,
-				       uint32_t size,
-				       struct drm_modeset_acquire_ctx *ctx);
 void __drm_atomic_helper_private_obj_duplicate_state(struct drm_private_obj *obj,
 						     struct drm_private_state *state);
-- 
2.19.1

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

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

* ✗ Fi.CI.CHECKPATCH: warning for drm: Fix up drm_atomic_state_helper.[hc] extraction
  2018-11-28 10:07 [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction Daniel Vetter
@ 2018-11-28 10:36 ` Patchwork
  2018-11-28 10:57 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-11-28 10:36 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: drm: Fix up drm_atomic_state_helper.[hc] extraction
URL   : https://patchwork.freedesktop.org/series/53148/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
9288282eb7cc drm: Fix up drm_atomic_state_helper.[hc] extraction
-:413: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <daniel.vetter@ffwll.ch>'

total: 0 errors, 1 warnings, 0 checks, 370 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm: Fix up drm_atomic_state_helper.[hc] extraction
  2018-11-28 10:07 [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction Daniel Vetter
  2018-11-28 10:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-11-28 10:57 ` Patchwork
  2018-11-28 17:57 ` ✗ Fi.CI.IGT: failure " Patchwork
  2018-11-29 15:36 ` [PATCH] " Sean Paul
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-11-28 10:57 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: drm: Fix up drm_atomic_state_helper.[hc] extraction
URL   : https://patchwork.freedesktop.org/series/53148/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_5213 -> Patchwork_10925 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/53148/revisions/1/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-blb-e6850:       PASS -> INCOMPLETE ([fdo#107718])

    igt@i915_selftest@live_contexts:
      fi-bsw-kefka:       PASS -> DMESG-FAIL ([fdo#108656])

    igt@i915_selftest@live_hangcheck:
      fi-cfl-8109u:       PASS -> DMESG-FAIL ([fdo#108795])

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cfl-8109u:       PASS -> DMESG-WARN ([fdo#106107])

    {igt@runner@aborted}:
      fi-cfl-8109u:       NOTRUN -> FAIL ([fdo#108315])
      fi-bsw-n3050:       NOTRUN -> FAIL ([fdo#108656])

    
    ==== Possible fixes ====

    igt@gem_basic@create-fd-close:
      fi-kbl-7560u:       INCOMPLETE -> PASS

    igt@gem_exec_suspend@basic-s4-devices:
      fi-ivb-3520m:       FAIL ([fdo#108880]) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL ([fdo#103167]) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
      fi-byt-clapper:     FAIL ([fdo#103191], [fdo#107362]) -> PASS

    igt@prime_vgem@basic-fence-flip:
      fi-gdg-551:         FAIL ([fdo#103182]) -> PASS

    
    ==== Warnings ====

    igt@gem_ctx_create@basic-files:
      fi-bsw-n3050:       FAIL ([fdo#108656]) -> DMESG-FAIL ([fdo#108656])

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

  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103182 https://bugs.freedesktop.org/show_bug.cgi?id=103182
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#106107 https://bugs.freedesktop.org/show_bug.cgi?id=106107
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
  fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315
  fdo#108656 https://bugs.freedesktop.org/show_bug.cgi?id=108656
  fdo#108795 https://bugs.freedesktop.org/show_bug.cgi?id=108795
  fdo#108880 https://bugs.freedesktop.org/show_bug.cgi?id=108880


== Participating hosts (51 -> 45) ==

  Missing    (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 


== Build changes ==

    * Linux: CI_DRM_5213 -> Patchwork_10925

  CI_DRM_5213: 5912c54d9804fb15d6a9fa2798bfef1e837c8938 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10925: 9288282eb7cc7001f4131951edd8b880c3dde637 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

9288282eb7cc drm: Fix up drm_atomic_state_helper.[hc] extraction

== Logs ==

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

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

* ✗ Fi.CI.IGT: failure for drm: Fix up drm_atomic_state_helper.[hc] extraction
  2018-11-28 10:07 [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction Daniel Vetter
  2018-11-28 10:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-11-28 10:57 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-11-28 17:57 ` Patchwork
  2018-11-29 15:36 ` [PATCH] " Sean Paul
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-11-28 17:57 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: drm: Fix up drm_atomic_state_helper.[hc] extraction
URL   : https://patchwork.freedesktop.org/series/53148/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5213_full -> Patchwork_10925_full
====================================================

Summary
-------

  **FAILURE**

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

  

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_userptr_blits@readonly-unsync:
    - shard-glk:          PASS -> TIMEOUT

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_eio@in-flight-1us:
    - shard-glk:          PASS -> INCOMPLETE [fdo#103359] / [k.org#198133]

  * igt@gem_exec_schedule@pi-ringfull-blt:
    - shard-skl:          NOTRUN -> FAIL [fdo#103158]

  * igt@gem_ppgtt@blt-vs-render-ctxn:
    - shard-skl:          NOTRUN -> INCOMPLETE [fdo#106887]

  * igt@i915_suspend@shrink:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#108784]

  * igt@kms_available_modes_crc@available_mode_test_crc:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#106641]

  * igt@kms_busy@extended-modeset-hang-newfb-render-a:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-snb:          NOTRUN -> DMESG-WARN [fdo#107956]
    - {shard-iclb}:       NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-c-crc-primary-basic:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#107725]

  * igt@kms_color@pipe-a-gamma:
    - shard-skl:          NOTRUN -> FAIL [fdo#104782]

  * igt@kms_cursor_crc@cursor-128x128-offscreen:
    - shard-glk:          PASS -> DMESG-WARN [fdo#105763] / [fdo#106538] +2

  * igt@kms_cursor_crc@cursor-128x128-random:
    - shard-apl:          PASS -> FAIL [fdo#103232] +4

  * igt@kms_cursor_crc@cursor-256x256-offscreen:
    - shard-skl:          PASS -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-256x85-onscreen:
    - shard-glk:          PASS -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-dpms:
    - {shard-iclb}:       NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-snb:          NOTRUN -> INCOMPLETE [fdo#105411]

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
    - shard-glk:          PASS -> FAIL [fdo#104873]

  * igt@kms_flip@busy-flip-interruptible:
    - shard-skl:          PASS -> FAIL [fdo#103257]

  * igt@kms_flip_tiling@flip-to-y-tiled:
    - shard-skl:          PASS -> FAIL [fdo#107931]
    - {shard-iclb}:       PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +1

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - {shard-iclb}:       PASS -> FAIL [fdo#103167] +1

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          PASS -> FAIL [fdo#103167] +1

  * igt@kms_frontbuffer_tracking@fbc-shrfb-scaledprimary:
    - shard-skl:          NOTRUN -> FAIL [fdo#105682] +2

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-indfb-plflip-blt:
    - {shard-iclb}:       PASS -> DMESG-FAIL [fdo#107724]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-render:
    - shard-skl:          NOTRUN -> FAIL [fdo#103167] +3

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - shard-skl:          PASS -> FAIL [fdo#103191] / [fdo#107362]

  * igt@kms_plane@pixel-format-pipe-c-planes:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#106885]

  * igt@kms_plane@plane-position-covered-pipe-b-planes:
    - shard-glk:          PASS -> FAIL [fdo#103166]

  * igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
    - shard-skl:          NOTRUN -> FAIL [fdo#107815] / [fdo#108145]

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          PASS -> FAIL [fdo#107815]

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-apl:          PASS -> FAIL [fdo#103166]

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
    - {shard-iclb}:       PASS -> FAIL [fdo#103166]

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
    - shard-kbl:          NOTRUN -> FAIL [fdo#103166]
    - shard-skl:          NOTRUN -> FAIL [fdo#103166] / [fdo#107815]

  * igt@kms_plane_scaling@pipe-c-scaler-with-rotation:
    - {shard-iclb}:       NOTRUN -> DMESG-WARN [fdo#107724]

  * igt@kms_rotation_crc@primary-rotation-180:
    - shard-snb:          NOTRUN -> FAIL [fdo#103925]

  * igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
    - {shard-iclb}:       PASS -> INCOMPLETE [fdo#107713]

  * igt@pm_rpm@cursor-dpms:
    - {shard-iclb}:       PASS -> DMESG-WARN [fdo#107724] +8

  * igt@pm_rpm@dpms-non-lpsp:
    - shard-skl:          SKIP -> INCOMPLETE [fdo#107807]

  * igt@pm_rpm@i2c:
    - shard-skl:          PASS -> INCOMPLETE [fdo#107807] +1

  
#### Possible fixes ####

  * igt@drm_import_export@import-close-race-flink:
    - shard-skl:          TIMEOUT [fdo#108667] -> PASS

  * igt@gem_ctx_isolation@vecs0-s3:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@kms_atomic_transition@plane-use-after-nonblocking-unbind-fencing:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS +1

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_color@pipe-b-degamma:
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-128x128-sliding:
    - shard-apl:          FAIL [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-dpms:
    - shard-glk:          FAIL [fdo#103232] -> PASS +2

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-skl:          FAIL [fdo#105363] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-apl:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - {shard-iclb}:       FAIL [fdo#103167] -> PASS +3

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-glk:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_frontbuffer_tracking@fbc-stridechange:
    - {shard-iclb}:       FAIL [fdo#105683] -> PASS +1

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - shard-apl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +27

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-yf:
    - shard-apl:          FAIL [fdo#103166] -> PASS

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
    - shard-glk:          FAIL [fdo#103166] -> PASS +1

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
    - shard-kbl:          DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +13

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
    - {shard-iclb}:       FAIL [fdo#103166] -> PASS

  * igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
    - {shard-iclb}:       DMESG-WARN [fdo#107724] -> PASS

  * igt@kms_setmode@basic:
    - shard-kbl:          FAIL [fdo#99912] -> PASS

  * igt@perf@blocking:
    - shard-hsw:          FAIL [fdo#102252] -> PASS

  * igt@pm_rpm@modeset-non-lpsp:
    - shard-skl:          INCOMPLETE [fdo#107807] -> SKIP

  * igt@pm_rpm@universal-planes-dpms:
    - shard-skl:          INCOMPLETE [fdo#107807] -> PASS

  * igt@syncobj_wait@multi-wait-for-submit-unsubmitted-signaled:
    - shard-snb:          INCOMPLETE [fdo#105411] -> PASS

  
#### Warnings ####

  * igt@i915_suspend@shrink:
    - shard-kbl:          INCOMPLETE [fdo#103665] / [fdo#106886] -> DMESG-WARN [fdo#108784]

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

  [fdo#102252]: https://bugs.freedesktop.org/show_bug.cgi?id=102252
  [fdo#103158]: https://bugs.freedesktop.org/show_bug.cgi?id=103158
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103257]: https://bugs.freedesktop.org/show_bug.cgi?id=103257
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103925]: https://bugs.freedesktop.org/show_bug.cgi?id=103925
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
  [fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
  [fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
  [fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
  [fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
  [fdo#106887]: https://bugs.freedesktop.org/show_bug.cgi?id=106887
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
  [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
  [fdo#107931]: https://bugs.freedesktop.org/show_bug.cgi?id=107931
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
  [fdo#108667]: https://bugs.freedesktop.org/show_bug.cgi?id=108667
  [fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts


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

    * Linux: CI_DRM_5213 -> Patchwork_10925

  CI_DRM_5213: 5912c54d9804fb15d6a9fa2798bfef1e837c8938 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4735: b05c028ccdb6ac8e8d8499a041bb14dfe358ee26 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10925: 9288282eb7cc7001f4131951edd8b880c3dde637 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction
  2018-11-28 10:07 [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction Daniel Vetter
                   ` (2 preceding siblings ...)
  2018-11-28 17:57 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-11-29 15:36 ` Sean Paul
  2018-11-30 15:38   ` [Intel-gfx] " Daniel Vetter
  3 siblings, 1 reply; 6+ messages in thread
From: Sean Paul @ 2018-11-29 15:36 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, dri-devel

On Wed, Nov 28, 2018 at 5:07 AM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> I've misplaced two functions by accident:
> - drm_atomic_helper_duplicate_state is really part of the
>   resume/suspend/shutdown device-wide helpers.
> - drm_atomic_helper_legacy_gamma_set is part of the legacy ioctl
>   compat helpers.
>
> Move them both back.
>
> Fixes: 9ef8a9dc4b21 ("drm: Extract drm_atomic_state_helper.[hc]")
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/drm_atomic_helper.c       | 157 ++++++++++++++++++++++
>  drivers/gpu/drm/drm_atomic_state_helper.c | 157 ----------------------
>  include/drm/drm_atomic_helper.h           |   7 +
>  include/drm/drm_atomic_state_helper.h     |   7 -
>  4 files changed, 164 insertions(+), 164 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 9b22774a9867..de7d872f9f1a 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3135,6 +3135,93 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_shutdown);
>
> +/**
> + * drm_atomic_helper_duplicate_state - duplicate an atomic state object
> + * @dev: DRM device
> + * @ctx: lock acquisition context
> + *
> + * Makes a copy of the current atomic state by looping over all objects and
> + * duplicating their respective states. This is used for example by suspend/
> + * resume support code to save the state prior to suspend such that it can
> + * be restored upon resume.
> + *
> + * Note that this treats atomic state as persistent between save and restore.
> + * Drivers must make sure that this is possible and won't result in confusion
> + * or erroneous behaviour.
> + *
> + * Note that if callers haven't already acquired all modeset locks this might
> + * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
> + *
> + * Returns:
> + * A pointer to the copy of the atomic state object on success or an
> + * ERR_PTR()-encoded error code on failure.
> + *
> + * See also:
> + * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
> + */
> +struct drm_atomic_state *
> +drm_atomic_helper_duplicate_state(struct drm_device *dev,
> +                                 struct drm_modeset_acquire_ctx *ctx)
> +{
> +       struct drm_atomic_state *state;
> +       struct drm_connector *conn;
> +       struct drm_connector_list_iter conn_iter;
> +       struct drm_plane *plane;
> +       struct drm_crtc *crtc;
> +       int err = 0;
> +
> +       state = drm_atomic_state_alloc(dev);
> +       if (!state)
> +               return ERR_PTR(-ENOMEM);
> +
> +       state->acquire_ctx = ctx;
> +
> +       drm_for_each_crtc(crtc, dev) {
> +               struct drm_crtc_state *crtc_state;
> +
> +               crtc_state = drm_atomic_get_crtc_state(state, crtc);
> +               if (IS_ERR(crtc_state)) {
> +                       err = PTR_ERR(crtc_state);
> +                       goto free;
> +               }
> +       }
> +
> +       drm_for_each_plane(plane, dev) {
> +               struct drm_plane_state *plane_state;
> +
> +               plane_state = drm_atomic_get_plane_state(state, plane);
> +               if (IS_ERR(plane_state)) {
> +                       err = PTR_ERR(plane_state);
> +                       goto free;
> +               }
> +       }
> +
> +       drm_connector_list_iter_begin(dev, &conn_iter);
> +       drm_for_each_connector_iter(conn, &conn_iter) {
> +               struct drm_connector_state *conn_state;
> +
> +               conn_state = drm_atomic_get_connector_state(state, conn);
> +               if (IS_ERR(conn_state)) {
> +                       err = PTR_ERR(conn_state);
> +                       drm_connector_list_iter_end(&conn_iter);
> +                       goto free;
> +               }
> +       }
> +       drm_connector_list_iter_end(&conn_iter);
> +
> +       /* clear the acquire context so that it isn't accidentally reused */
> +       state->acquire_ctx = NULL;
> +
> +free:
> +       if (err < 0) {
> +               drm_atomic_state_put(state);
> +               state = ERR_PTR(err);
> +       }
> +
> +       return state;
> +}
> +EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
> +
>  /**
>   * drm_atomic_helper_suspend - subsystem-level suspend helper
>   * @dev: DRM device
> @@ -3418,3 +3505,73 @@ int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc,
>         return ret;
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_page_flip_target);
> +
> +/**
> + * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
> + * @crtc: CRTC object
> + * @red: red correction table
> + * @green: green correction table
> + * @blue: green correction table
> + * @size: size of the tables
> + * @ctx: lock acquire context
> + *
> + * Implements support for legacy gamma correction table for drivers
> + * that support color management through the DEGAMMA_LUT/GAMMA_LUT
> + * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
> + * how the atomic color management and gamma tables work.
> + */
> +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> +                                      u16 *red, u16 *green, u16 *blue,
> +                                      uint32_t size,
> +                                      struct drm_modeset_acquire_ctx *ctx)
> +{
> +       struct drm_device *dev = crtc->dev;
> +       struct drm_atomic_state *state;
> +       struct drm_crtc_state *crtc_state;
> +       struct drm_property_blob *blob = NULL;
> +       struct drm_color_lut *blob_data;
> +       int i, ret = 0;
> +       bool replaced;
> +
> +       state = drm_atomic_state_alloc(crtc->dev);
> +       if (!state)
> +               return -ENOMEM;
> +
> +       blob = drm_property_create_blob(dev,
> +                                       sizeof(struct drm_color_lut) * size,
> +                                       NULL);
> +       if (IS_ERR(blob)) {
> +               ret = PTR_ERR(blob);
> +               blob = NULL;
> +               goto fail;
> +       }
> +
> +       /* Prepare GAMMA_LUT with the legacy values. */
> +       blob_data = blob->data;
> +       for (i = 0; i < size; i++) {
> +               blob_data[i].red = red[i];
> +               blob_data[i].green = green[i];
> +               blob_data[i].blue = blue[i];
> +       }
> +
> +       state->acquire_ctx = ctx;
> +       crtc_state = drm_atomic_get_crtc_state(state, crtc);
> +       if (IS_ERR(crtc_state)) {
> +               ret = PTR_ERR(crtc_state);
> +               goto fail;
> +       }
> +
> +       /* Reset DEGAMMA_LUT and CTM properties. */
> +       replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> +       replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> +       replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
> +       crtc_state->color_mgmt_changed |= replaced;
> +
> +       ret = drm_atomic_commit(state);
> +
> +fail:
> +       drm_atomic_state_put(state);
> +       drm_property_blob_put(blob);
> +       return ret;
> +}
> +EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
> diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
> index 3ba996069d69..60bd7d708e35 100644
> --- a/drivers/gpu/drm/drm_atomic_state_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_state_helper.c
> @@ -393,93 +393,6 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector)
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_connector_duplicate_state);
>
> -/**
> - * drm_atomic_helper_duplicate_state - duplicate an atomic state object
> - * @dev: DRM device
> - * @ctx: lock acquisition context
> - *
> - * Makes a copy of the current atomic state by looping over all objects and
> - * duplicating their respective states. This is used for example by suspend/
> - * resume support code to save the state prior to suspend such that it can
> - * be restored upon resume.
> - *
> - * Note that this treats atomic state as persistent between save and restore.
> - * Drivers must make sure that this is possible and won't result in confusion
> - * or erroneous behaviour.
> - *
> - * Note that if callers haven't already acquired all modeset locks this might
> - * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
> - *
> - * Returns:
> - * A pointer to the copy of the atomic state object on success or an
> - * ERR_PTR()-encoded error code on failure.
> - *
> - * See also:
> - * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
> - */
> -struct drm_atomic_state *
> -drm_atomic_helper_duplicate_state(struct drm_device *dev,
> -                                 struct drm_modeset_acquire_ctx *ctx)
> -{
> -       struct drm_atomic_state *state;
> -       struct drm_connector *conn;
> -       struct drm_connector_list_iter conn_iter;
> -       struct drm_plane *plane;
> -       struct drm_crtc *crtc;
> -       int err = 0;
> -
> -       state = drm_atomic_state_alloc(dev);
> -       if (!state)
> -               return ERR_PTR(-ENOMEM);
> -
> -       state->acquire_ctx = ctx;
> -
> -       drm_for_each_crtc(crtc, dev) {
> -               struct drm_crtc_state *crtc_state;
> -
> -               crtc_state = drm_atomic_get_crtc_state(state, crtc);
> -               if (IS_ERR(crtc_state)) {
> -                       err = PTR_ERR(crtc_state);
> -                       goto free;
> -               }
> -       }
> -
> -       drm_for_each_plane(plane, dev) {
> -               struct drm_plane_state *plane_state;
> -
> -               plane_state = drm_atomic_get_plane_state(state, plane);
> -               if (IS_ERR(plane_state)) {
> -                       err = PTR_ERR(plane_state);
> -                       goto free;
> -               }
> -       }
> -
> -       drm_connector_list_iter_begin(dev, &conn_iter);
> -       drm_for_each_connector_iter(conn, &conn_iter) {
> -               struct drm_connector_state *conn_state;
> -
> -               conn_state = drm_atomic_get_connector_state(state, conn);
> -               if (IS_ERR(conn_state)) {
> -                       err = PTR_ERR(conn_state);
> -                       drm_connector_list_iter_end(&conn_iter);
> -                       goto free;
> -               }
> -       }
> -       drm_connector_list_iter_end(&conn_iter);
> -
> -       /* clear the acquire context so that it isn't accidentally reused */
> -       state->acquire_ctx = NULL;
> -
> -free:
> -       if (err < 0) {
> -               drm_atomic_state_put(state);
> -               state = ERR_PTR(err);
> -       }
> -
> -       return state;
> -}
> -EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
> -
>  /**
>   * __drm_atomic_helper_connector_destroy_state - release connector state
>   * @state: connector state object to release
> @@ -515,76 +428,6 @@ void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
>
> -/**
> - * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
> - * @crtc: CRTC object
> - * @red: red correction table
> - * @green: green correction table
> - * @blue: green correction table
> - * @size: size of the tables
> - * @ctx: lock acquire context
> - *
> - * Implements support for legacy gamma correction table for drivers
> - * that support color management through the DEGAMMA_LUT/GAMMA_LUT
> - * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
> - * how the atomic color management and gamma tables work.
> - */
> -int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> -                                      u16 *red, u16 *green, u16 *blue,
> -                                      uint32_t size,
> -                                      struct drm_modeset_acquire_ctx *ctx)
> -{
> -       struct drm_device *dev = crtc->dev;
> -       struct drm_atomic_state *state;
> -       struct drm_crtc_state *crtc_state;
> -       struct drm_property_blob *blob = NULL;
> -       struct drm_color_lut *blob_data;
> -       int i, ret = 0;
> -       bool replaced;
> -
> -       state = drm_atomic_state_alloc(crtc->dev);
> -       if (!state)
> -               return -ENOMEM;
> -
> -       blob = drm_property_create_blob(dev,
> -                                       sizeof(struct drm_color_lut) * size,
> -                                       NULL);
> -       if (IS_ERR(blob)) {
> -               ret = PTR_ERR(blob);
> -               blob = NULL;
> -               goto fail;
> -       }
> -
> -       /* Prepare GAMMA_LUT with the legacy values. */
> -       blob_data = blob->data;
> -       for (i = 0; i < size; i++) {
> -               blob_data[i].red = red[i];
> -               blob_data[i].green = green[i];
> -               blob_data[i].blue = blue[i];
> -       }
> -
> -       state->acquire_ctx = ctx;
> -       crtc_state = drm_atomic_get_crtc_state(state, crtc);
> -       if (IS_ERR(crtc_state)) {
> -               ret = PTR_ERR(crtc_state);
> -               goto fail;
> -       }
> -
> -       /* Reset DEGAMMA_LUT and CTM properties. */
> -       replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> -       replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> -       replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
> -       crtc_state->color_mgmt_changed |= replaced;
> -
> -       ret = drm_atomic_commit(state);
> -
> -fail:
> -       drm_atomic_state_put(state);
> -       drm_property_blob_put(blob);
> -       return ret;
> -}
> -EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
> -
>  /**
>   * __drm_atomic_helper_private_duplicate_state - copy atomic private state
>   * @obj: CRTC object
> diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
> index 25ca0097563e..58214be3bf3d 100644
> --- a/include/drm/drm_atomic_helper.h
> +++ b/include/drm/drm_atomic_helper.h
> @@ -127,6 +127,9 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
>  int drm_atomic_helper_disable_all(struct drm_device *dev,
>                                   struct drm_modeset_acquire_ctx *ctx);
>  void drm_atomic_helper_shutdown(struct drm_device *dev);
> +struct drm_atomic_state *
> +drm_atomic_helper_duplicate_state(struct drm_device *dev,
> +                                 struct drm_modeset_acquire_ctx *ctx);
>  struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev);
>  int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
>                                               struct drm_modeset_acquire_ctx *ctx);
> @@ -145,6 +148,10 @@ int drm_atomic_helper_page_flip_target(
>                                 uint32_t flags,
>                                 uint32_t target,
>                                 struct drm_modeset_acquire_ctx *ctx);
> +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> +                                      u16 *red, u16 *green, u16 *blue,
> +                                      uint32_t size,
> +                                      struct drm_modeset_acquire_ctx *ctx);
>
>  /**
>   * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC
> diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
> index 5b82ccfdb502..66c92cbd8e16 100644
> --- a/include/drm/drm_atomic_state_helper.h
> +++ b/include/drm/drm_atomic_state_helper.h
> @@ -65,16 +65,9 @@ __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
>                                            struct drm_connector_state *state);
>  struct drm_connector_state *
>  drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector);
> -struct drm_atomic_state *
> -drm_atomic_helper_duplicate_state(struct drm_device *dev,
> -                                 struct drm_modeset_acquire_ctx *ctx);
>  void
>  __drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state);
>  void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
>                                           struct drm_connector_state *state);
> -int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> -                                      u16 *red, u16 *green, u16 *blue,
> -                                      uint32_t size,
> -                                      struct drm_modeset_acquire_ctx *ctx);
>  void __drm_atomic_helper_private_obj_duplicate_state(struct drm_private_obj *obj,
>                                                      struct drm_private_state *state);
> --
> 2.19.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction
  2018-11-29 15:36 ` [PATCH] " Sean Paul
@ 2018-11-30 15:38   ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2018-11-30 15:38 UTC (permalink / raw)
  To: Sean Paul
  Cc: Daniel Vetter, Intel Graphics Development, dri-devel, Daniel Vetter

On Thu, Nov 29, 2018 at 10:36:13AM -0500, Sean Paul wrote:
> On Wed, Nov 28, 2018 at 5:07 AM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > I've misplaced two functions by accident:
> > - drm_atomic_helper_duplicate_state is really part of the
> >   resume/suspend/shutdown device-wide helpers.
> > - drm_atomic_helper_legacy_gamma_set is part of the legacy ioctl
> >   compat helpers.
> >
> > Move them both back.
> >
> > Fixes: 9ef8a9dc4b21 ("drm: Extract drm_atomic_state_helper.[hc]")
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Reviewed-by: Sean Paul <sean@poorly.run>

Applied, thanks for reviewing.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c       | 157 ++++++++++++++++++++++
> >  drivers/gpu/drm/drm_atomic_state_helper.c | 157 ----------------------
> >  include/drm/drm_atomic_helper.h           |   7 +
> >  include/drm/drm_atomic_state_helper.h     |   7 -
> >  4 files changed, 164 insertions(+), 164 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index 9b22774a9867..de7d872f9f1a 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -3135,6 +3135,93 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
> >  }
> >  EXPORT_SYMBOL(drm_atomic_helper_shutdown);
> >
> > +/**
> > + * drm_atomic_helper_duplicate_state - duplicate an atomic state object
> > + * @dev: DRM device
> > + * @ctx: lock acquisition context
> > + *
> > + * Makes a copy of the current atomic state by looping over all objects and
> > + * duplicating their respective states. This is used for example by suspend/
> > + * resume support code to save the state prior to suspend such that it can
> > + * be restored upon resume.
> > + *
> > + * Note that this treats atomic state as persistent between save and restore.
> > + * Drivers must make sure that this is possible and won't result in confusion
> > + * or erroneous behaviour.
> > + *
> > + * Note that if callers haven't already acquired all modeset locks this might
> > + * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
> > + *
> > + * Returns:
> > + * A pointer to the copy of the atomic state object on success or an
> > + * ERR_PTR()-encoded error code on failure.
> > + *
> > + * See also:
> > + * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
> > + */
> > +struct drm_atomic_state *
> > +drm_atomic_helper_duplicate_state(struct drm_device *dev,
> > +                                 struct drm_modeset_acquire_ctx *ctx)
> > +{
> > +       struct drm_atomic_state *state;
> > +       struct drm_connector *conn;
> > +       struct drm_connector_list_iter conn_iter;
> > +       struct drm_plane *plane;
> > +       struct drm_crtc *crtc;
> > +       int err = 0;
> > +
> > +       state = drm_atomic_state_alloc(dev);
> > +       if (!state)
> > +               return ERR_PTR(-ENOMEM);
> > +
> > +       state->acquire_ctx = ctx;
> > +
> > +       drm_for_each_crtc(crtc, dev) {
> > +               struct drm_crtc_state *crtc_state;
> > +
> > +               crtc_state = drm_atomic_get_crtc_state(state, crtc);
> > +               if (IS_ERR(crtc_state)) {
> > +                       err = PTR_ERR(crtc_state);
> > +                       goto free;
> > +               }
> > +       }
> > +
> > +       drm_for_each_plane(plane, dev) {
> > +               struct drm_plane_state *plane_state;
> > +
> > +               plane_state = drm_atomic_get_plane_state(state, plane);
> > +               if (IS_ERR(plane_state)) {
> > +                       err = PTR_ERR(plane_state);
> > +                       goto free;
> > +               }
> > +       }
> > +
> > +       drm_connector_list_iter_begin(dev, &conn_iter);
> > +       drm_for_each_connector_iter(conn, &conn_iter) {
> > +               struct drm_connector_state *conn_state;
> > +
> > +               conn_state = drm_atomic_get_connector_state(state, conn);
> > +               if (IS_ERR(conn_state)) {
> > +                       err = PTR_ERR(conn_state);
> > +                       drm_connector_list_iter_end(&conn_iter);
> > +                       goto free;
> > +               }
> > +       }
> > +       drm_connector_list_iter_end(&conn_iter);
> > +
> > +       /* clear the acquire context so that it isn't accidentally reused */
> > +       state->acquire_ctx = NULL;
> > +
> > +free:
> > +       if (err < 0) {
> > +               drm_atomic_state_put(state);
> > +               state = ERR_PTR(err);
> > +       }
> > +
> > +       return state;
> > +}
> > +EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
> > +
> >  /**
> >   * drm_atomic_helper_suspend - subsystem-level suspend helper
> >   * @dev: DRM device
> > @@ -3418,3 +3505,73 @@ int drm_atomic_helper_page_flip_target(struct drm_crtc *crtc,
> >         return ret;
> >  }
> >  EXPORT_SYMBOL(drm_atomic_helper_page_flip_target);
> > +
> > +/**
> > + * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
> > + * @crtc: CRTC object
> > + * @red: red correction table
> > + * @green: green correction table
> > + * @blue: green correction table
> > + * @size: size of the tables
> > + * @ctx: lock acquire context
> > + *
> > + * Implements support for legacy gamma correction table for drivers
> > + * that support color management through the DEGAMMA_LUT/GAMMA_LUT
> > + * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
> > + * how the atomic color management and gamma tables work.
> > + */
> > +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> > +                                      u16 *red, u16 *green, u16 *blue,
> > +                                      uint32_t size,
> > +                                      struct drm_modeset_acquire_ctx *ctx)
> > +{
> > +       struct drm_device *dev = crtc->dev;
> > +       struct drm_atomic_state *state;
> > +       struct drm_crtc_state *crtc_state;
> > +       struct drm_property_blob *blob = NULL;
> > +       struct drm_color_lut *blob_data;
> > +       int i, ret = 0;
> > +       bool replaced;
> > +
> > +       state = drm_atomic_state_alloc(crtc->dev);
> > +       if (!state)
> > +               return -ENOMEM;
> > +
> > +       blob = drm_property_create_blob(dev,
> > +                                       sizeof(struct drm_color_lut) * size,
> > +                                       NULL);
> > +       if (IS_ERR(blob)) {
> > +               ret = PTR_ERR(blob);
> > +               blob = NULL;
> > +               goto fail;
> > +       }
> > +
> > +       /* Prepare GAMMA_LUT with the legacy values. */
> > +       blob_data = blob->data;
> > +       for (i = 0; i < size; i++) {
> > +               blob_data[i].red = red[i];
> > +               blob_data[i].green = green[i];
> > +               blob_data[i].blue = blue[i];
> > +       }
> > +
> > +       state->acquire_ctx = ctx;
> > +       crtc_state = drm_atomic_get_crtc_state(state, crtc);
> > +       if (IS_ERR(crtc_state)) {
> > +               ret = PTR_ERR(crtc_state);
> > +               goto fail;
> > +       }
> > +
> > +       /* Reset DEGAMMA_LUT and CTM properties. */
> > +       replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> > +       replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> > +       replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
> > +       crtc_state->color_mgmt_changed |= replaced;
> > +
> > +       ret = drm_atomic_commit(state);
> > +
> > +fail:
> > +       drm_atomic_state_put(state);
> > +       drm_property_blob_put(blob);
> > +       return ret;
> > +}
> > +EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
> > diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
> > index 3ba996069d69..60bd7d708e35 100644
> > --- a/drivers/gpu/drm/drm_atomic_state_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_state_helper.c
> > @@ -393,93 +393,6 @@ drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector)
> >  }
> >  EXPORT_SYMBOL(drm_atomic_helper_connector_duplicate_state);
> >
> > -/**
> > - * drm_atomic_helper_duplicate_state - duplicate an atomic state object
> > - * @dev: DRM device
> > - * @ctx: lock acquisition context
> > - *
> > - * Makes a copy of the current atomic state by looping over all objects and
> > - * duplicating their respective states. This is used for example by suspend/
> > - * resume support code to save the state prior to suspend such that it can
> > - * be restored upon resume.
> > - *
> > - * Note that this treats atomic state as persistent between save and restore.
> > - * Drivers must make sure that this is possible and won't result in confusion
> > - * or erroneous behaviour.
> > - *
> > - * Note that if callers haven't already acquired all modeset locks this might
> > - * return -EDEADLK, which must be handled by calling drm_modeset_backoff().
> > - *
> > - * Returns:
> > - * A pointer to the copy of the atomic state object on success or an
> > - * ERR_PTR()-encoded error code on failure.
> > - *
> > - * See also:
> > - * drm_atomic_helper_suspend(), drm_atomic_helper_resume()
> > - */
> > -struct drm_atomic_state *
> > -drm_atomic_helper_duplicate_state(struct drm_device *dev,
> > -                                 struct drm_modeset_acquire_ctx *ctx)
> > -{
> > -       struct drm_atomic_state *state;
> > -       struct drm_connector *conn;
> > -       struct drm_connector_list_iter conn_iter;
> > -       struct drm_plane *plane;
> > -       struct drm_crtc *crtc;
> > -       int err = 0;
> > -
> > -       state = drm_atomic_state_alloc(dev);
> > -       if (!state)
> > -               return ERR_PTR(-ENOMEM);
> > -
> > -       state->acquire_ctx = ctx;
> > -
> > -       drm_for_each_crtc(crtc, dev) {
> > -               struct drm_crtc_state *crtc_state;
> > -
> > -               crtc_state = drm_atomic_get_crtc_state(state, crtc);
> > -               if (IS_ERR(crtc_state)) {
> > -                       err = PTR_ERR(crtc_state);
> > -                       goto free;
> > -               }
> > -       }
> > -
> > -       drm_for_each_plane(plane, dev) {
> > -               struct drm_plane_state *plane_state;
> > -
> > -               plane_state = drm_atomic_get_plane_state(state, plane);
> > -               if (IS_ERR(plane_state)) {
> > -                       err = PTR_ERR(plane_state);
> > -                       goto free;
> > -               }
> > -       }
> > -
> > -       drm_connector_list_iter_begin(dev, &conn_iter);
> > -       drm_for_each_connector_iter(conn, &conn_iter) {
> > -               struct drm_connector_state *conn_state;
> > -
> > -               conn_state = drm_atomic_get_connector_state(state, conn);
> > -               if (IS_ERR(conn_state)) {
> > -                       err = PTR_ERR(conn_state);
> > -                       drm_connector_list_iter_end(&conn_iter);
> > -                       goto free;
> > -               }
> > -       }
> > -       drm_connector_list_iter_end(&conn_iter);
> > -
> > -       /* clear the acquire context so that it isn't accidentally reused */
> > -       state->acquire_ctx = NULL;
> > -
> > -free:
> > -       if (err < 0) {
> > -               drm_atomic_state_put(state);
> > -               state = ERR_PTR(err);
> > -       }
> > -
> > -       return state;
> > -}
> > -EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
> > -
> >  /**
> >   * __drm_atomic_helper_connector_destroy_state - release connector state
> >   * @state: connector state object to release
> > @@ -515,76 +428,6 @@ void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
> >  }
> >  EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
> >
> > -/**
> > - * drm_atomic_helper_legacy_gamma_set - set the legacy gamma correction table
> > - * @crtc: CRTC object
> > - * @red: red correction table
> > - * @green: green correction table
> > - * @blue: green correction table
> > - * @size: size of the tables
> > - * @ctx: lock acquire context
> > - *
> > - * Implements support for legacy gamma correction table for drivers
> > - * that support color management through the DEGAMMA_LUT/GAMMA_LUT
> > - * properties. See drm_crtc_enable_color_mgmt() and the containing chapter for
> > - * how the atomic color management and gamma tables work.
> > - */
> > -int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> > -                                      u16 *red, u16 *green, u16 *blue,
> > -                                      uint32_t size,
> > -                                      struct drm_modeset_acquire_ctx *ctx)
> > -{
> > -       struct drm_device *dev = crtc->dev;
> > -       struct drm_atomic_state *state;
> > -       struct drm_crtc_state *crtc_state;
> > -       struct drm_property_blob *blob = NULL;
> > -       struct drm_color_lut *blob_data;
> > -       int i, ret = 0;
> > -       bool replaced;
> > -
> > -       state = drm_atomic_state_alloc(crtc->dev);
> > -       if (!state)
> > -               return -ENOMEM;
> > -
> > -       blob = drm_property_create_blob(dev,
> > -                                       sizeof(struct drm_color_lut) * size,
> > -                                       NULL);
> > -       if (IS_ERR(blob)) {
> > -               ret = PTR_ERR(blob);
> > -               blob = NULL;
> > -               goto fail;
> > -       }
> > -
> > -       /* Prepare GAMMA_LUT with the legacy values. */
> > -       blob_data = blob->data;
> > -       for (i = 0; i < size; i++) {
> > -               blob_data[i].red = red[i];
> > -               blob_data[i].green = green[i];
> > -               blob_data[i].blue = blue[i];
> > -       }
> > -
> > -       state->acquire_ctx = ctx;
> > -       crtc_state = drm_atomic_get_crtc_state(state, crtc);
> > -       if (IS_ERR(crtc_state)) {
> > -               ret = PTR_ERR(crtc_state);
> > -               goto fail;
> > -       }
> > -
> > -       /* Reset DEGAMMA_LUT and CTM properties. */
> > -       replaced  = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> > -       replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> > -       replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
> > -       crtc_state->color_mgmt_changed |= replaced;
> > -
> > -       ret = drm_atomic_commit(state);
> > -
> > -fail:
> > -       drm_atomic_state_put(state);
> > -       drm_property_blob_put(blob);
> > -       return ret;
> > -}
> > -EXPORT_SYMBOL(drm_atomic_helper_legacy_gamma_set);
> > -
> >  /**
> >   * __drm_atomic_helper_private_duplicate_state - copy atomic private state
> >   * @obj: CRTC object
> > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
> > index 25ca0097563e..58214be3bf3d 100644
> > --- a/include/drm/drm_atomic_helper.h
> > +++ b/include/drm/drm_atomic_helper.h
> > @@ -127,6 +127,9 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
> >  int drm_atomic_helper_disable_all(struct drm_device *dev,
> >                                   struct drm_modeset_acquire_ctx *ctx);
> >  void drm_atomic_helper_shutdown(struct drm_device *dev);
> > +struct drm_atomic_state *
> > +drm_atomic_helper_duplicate_state(struct drm_device *dev,
> > +                                 struct drm_modeset_acquire_ctx *ctx);
> >  struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev);
> >  int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
> >                                               struct drm_modeset_acquire_ctx *ctx);
> > @@ -145,6 +148,10 @@ int drm_atomic_helper_page_flip_target(
> >                                 uint32_t flags,
> >                                 uint32_t target,
> >                                 struct drm_modeset_acquire_ctx *ctx);
> > +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> > +                                      u16 *red, u16 *green, u16 *blue,
> > +                                      uint32_t size,
> > +                                      struct drm_modeset_acquire_ctx *ctx);
> >
> >  /**
> >   * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC
> > diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
> > index 5b82ccfdb502..66c92cbd8e16 100644
> > --- a/include/drm/drm_atomic_state_helper.h
> > +++ b/include/drm/drm_atomic_state_helper.h
> > @@ -65,16 +65,9 @@ __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
> >                                            struct drm_connector_state *state);
> >  struct drm_connector_state *
> >  drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector);
> > -struct drm_atomic_state *
> > -drm_atomic_helper_duplicate_state(struct drm_device *dev,
> > -                                 struct drm_modeset_acquire_ctx *ctx);
> >  void
> >  __drm_atomic_helper_connector_destroy_state(struct drm_connector_state *state);
> >  void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
> >                                           struct drm_connector_state *state);
> > -int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
> > -                                      u16 *red, u16 *green, u16 *blue,
> > -                                      uint32_t size,
> > -                                      struct drm_modeset_acquire_ctx *ctx);
> >  void __drm_atomic_helper_private_obj_duplicate_state(struct drm_private_obj *obj,
> >                                                      struct drm_private_state *state);
> > --
> > 2.19.1
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-11-30 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 10:07 [PATCH] drm: Fix up drm_atomic_state_helper.[hc] extraction Daniel Vetter
2018-11-28 10:36 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-11-28 10:57 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-28 17:57 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-29 15:36 ` [PATCH] " Sean Paul
2018-11-30 15:38   ` [Intel-gfx] " Daniel Vetter

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.