Skip to contentSkip to conversation

drm/amdgpu: Remove default best_encoder hook from DC

PATCH New Daniel Vetter 2 participants 9 messages Sep 5, 2018 – Sep 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Remove default best_encoder hook from DC

For atomic driver this is the default, no need to reimplement it. We still need to keep the copypasta for not-atomic drivers though, since no one polished the legacy crtc helpers as much as the atomic ones.

Cc Alex Deucher <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Andrey Grodzovsky <[email protected]>
Cc Tony Cheng <[email protected]>
Cc "Leo (Sunpeng) Li" <[email protected]>
Cc Shirish S <[email protected]>

---
Stand-alone submission because our CI says this kills kbl-g somewhere in the amdgpu.ko load path, and I just don't see why.
-Daniel

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 -------------------
 1 file changed, 23 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -23
index af6adffba788..333f9904f135 100644
@@ -2794,28 +2794,6 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
 	.atomic_get_property = amdgpu_dm_connector_atomic_get_property
 };
 
-static struct drm_encoder *best_encoder(struct drm_connector *connector)
-{
-	int enc_id = connector->encoder_ids[0];
-	struct drm_mode_object *obj;
-	struct drm_encoder *encoder;
-
-	DRM_DEBUG_DRIVER("Finding the best encoder\n");
-
-	/* pick the encoder ids */
-	if (enc_id) {
-		obj = drm_mode_object_find(connector->dev, NULL, enc_id, DRM_MODE_OBJECT_ENCODER);
-		if (!obj) {
-			DRM_ERROR("Couldn't find a matching encoder for our connector\n");
-			return NULL;
-		}
-		encoder = obj_to_encoder(obj);
-		return encoder;
-	}
-	DRM_ERROR("No encoder id\n");
-	return NULL;
-}
-
 static int get_modes(struct drm_connector *connector)
 {
 	return amdgpu_dm_connector_get_modes(connector);
@@ -2934,7 +2912,6 @@ amdgpu_dm_connector_helper_funcs = {
 	 */
 	.get_modes = get_modes,
 	.mode_valid = amdgpu_dm_connector_mode_valid,
-	.best_encoder = best_encoder
 };
 
 static void dm_crtc_helper_disable(struct drm_crtc *crtc)
Signature · 6 lines
2.19.0.rc1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/amdgpu: Remove default best_encoder hook from DC

== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC
URL : https://patchwork.freedesktop.org/series/49194/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
0e61c0665c52 drm/amdgpu: Remove default best_encoder hook from DC
-:58: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <[email protected]>'

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.SPARSE: warning for drm/amdgpu: Remove default best_encoder hook from DC

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC
URL : https://patchwork.freedesktop.org/series/49194/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Commit: drm/amdgpu: Remove default best_encoder hook from DC
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3035:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static?
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3830:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3830:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3937:58: warning: Using plain integer as NULL pointer
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3012:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static?
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3803:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3803:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3807:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3807:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3914:58: warning: Using plain integer as NULL pointer

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✗ Fi.CI.BAT: failure for drm/amdgpu: Remove default best_encoder hook from DC

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC
URL : https://patchwork.freedesktop.org/series/49194/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4772 -> Patchwork_10096 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_10096 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_10096, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

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

== Possible new issues ==

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

=== IGT changes ===

    ==== Possible regressions ====

    igt@core_auth@basic-auth:
      fi-kbl-8809g:       PASS -> INCOMPLETE

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

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

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

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cnl-psr:         PASS -> DMESG-WARN (fdo#104951)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#105128, fdo#107139) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-ilk-650:         DMESG-WARN (fdo#106387) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     FAIL (fdo#103191, fdo#107362) -> PASS

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#106387 https://bugs.freedesktop.org/show_bug.cgi?id=106387
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362

== Participating hosts (54 -> 48) ==

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

== Build changes ==

* Linux: CI_DRM_4772 -> Patchwork_10096

CI_DRM_4772: 1351ee8f3aacdb8f4a71cd17a7035556065c59a9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4629: c3b6d69aa3dd2d1a6c1f2e787670a0aef78f2ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10096: 0e61c0665c5237599b0b1ee41b0ff6a54033c2ec @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

0e61c0665c52 drm/amdgpu: Remove default best_encoder hook from DC

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10096/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH 1/1 drm/amdgpu: Remove default best_encoder hook from DC

In reply to Daniel Vetter

For atomic driver this is the default, no need to reimplement it. We still need to keep the copypasta for not-atomic drivers though, since no one polished the legacy crtc helpers as much as the atomic ones.

v2: amdgpu uses ->best_encoder internally, give it a local copy. It might be a good idea to merge the connector and encoder into one amdgpu_dm_sink structure, that might match DC internals better. At least for non-DPMST outputs. Kudos to Ville for spotting this.

Cc Ville Syrjälä <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Andrey Grodzovsky <[email protected]>
Cc Tony Cheng <[email protected]>
Cc "Leo (Sunpeng) Li" <[email protected]>
Cc Shirish S <[email protected]>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 ++++---------------
 1 file changed, 7 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -29
index af6adffba788..cbc84b7469eb 100644
@@ -2794,28 +2794,6 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
 	.atomic_get_property = amdgpu_dm_connector_atomic_get_property
 };
 
-static struct drm_encoder *best_encoder(struct drm_connector *connector)
-{
-	int enc_id = connector->encoder_ids[0];
-	struct drm_mode_object *obj;
-	struct drm_encoder *encoder;
-
-	DRM_DEBUG_DRIVER("Finding the best encoder\n");
-
-	/* pick the encoder ids */
-	if (enc_id) {
-		obj = drm_mode_object_find(connector->dev, NULL, enc_id, DRM_MODE_OBJECT_ENCODER);
-		if (!obj) {
-			DRM_ERROR("Couldn't find a matching encoder for our connector\n");
-			return NULL;
-		}
-		encoder = obj_to_encoder(obj);
-		return encoder;
-	}
-	DRM_ERROR("No encoder id\n");
-	return NULL;
-}
-
 static int get_modes(struct drm_connector *connector)
 {
 	return amdgpu_dm_connector_get_modes(connector);
@@ -2934,7 +2912,6 @@ amdgpu_dm_connector_helper_funcs = {
 	 */
 	.get_modes = get_modes,
 	.mode_valid = amdgpu_dm_connector_mode_valid,
-	.best_encoder = best_encoder
 };
 
 static void dm_crtc_helper_disable(struct drm_crtc *crtc)
@@ -3332,14 +3309,17 @@ static int to_drm_connector_type(enum signal_type st)
 	}
 }
 
+static struct drm_encoder *amdgpu_dm_connector_to_encoder(struct drm_connector *connector)
+{
+	return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
+}
+
 static void amdgpu_dm_get_native_mode(struct drm_connector *connector)
 {
-	const struct drm_connector_helper_funcs *helper =
-		connector->helper_private;
 	struct drm_encoder *encoder;
 	struct amdgpu_encoder *amdgpu_encoder;
 
-	encoder = helper->best_encoder(connector);
+	encoder = amdgpu_dm_connector_to_encoder(connector);
 
 	if (encoder == NULL)
 		return;
@@ -3466,14 +3446,12 @@ static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,
 
 static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
 {
-	const struct drm_connector_helper_funcs *helper =
-			connector->helper_private;
 	struct amdgpu_dm_connector *amdgpu_dm_connector =
 			to_amdgpu_dm_connector(connector);
 	struct drm_encoder *encoder;
 	struct edid *edid = amdgpu_dm_connector->edid;
 
-	encoder = helper->best_encoder(connector);
+	encoder = amdgpu_dm_connector_to_encoder(connector);
 
 	if (!edid || !drm_edid_is_valid(edid)) {
 		drm_add_modes_noedid(connector, 640, 480);
Signature · 6 lines
2.19.0.rc1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/amdgpu: Remove default best_encoder hook from DC (rev2)

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC (rev2)
URL : https://patchwork.freedesktop.org/series/49194/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
8405889a997b drm/amdgpu: Remove default best_encoder hook from DC
-:104: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Daniel Vetter <[email protected]>'

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✗ Fi.CI.SPARSE: warning for drm/amdgpu: Remove default best_encoder hook from DC (rev2)

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC (rev2)
URL : https://patchwork.freedesktop.org/series/49194/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Commit: drm/amdgpu: Remove default best_encoder hook from DC
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3035:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static?
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3826:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3830:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3830:27: warning: expression using sizeof(void)
-drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3937:58: warning: Using plain integer as NULL pointer
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3012:6: warning: symbol 'dm_drm_plane_destroy_state' was not declared. Should it be static?
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3804:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3804:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3808:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3808:27: warning: expression using sizeof(void)
+drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3915:58: warning: Using plain integer as NULL pointer

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

✓ Fi.CI.BAT: success for drm/amdgpu: Remove default best_encoder hook from DC (rev2)

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC (rev2)
URL : https://patchwork.freedesktop.org/series/49194/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4773 -> Patchwork_10100 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/49194/revisions/2/mbox/

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       NOTRUN -> INCOMPLETE (fdo#107718)

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

    igt@kms_psr@primary_page_flip:
      fi-cnl-psr:         PASS -> FAIL (fdo#107336)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         FAIL (fdo#104008) -> PASS

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718

== Participating hosts (54 -> 49) ==

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

== Build changes ==

* Linux: CI_DRM_4773 -> Patchwork_10100

CI_DRM_4773: fb94a684a02a423798c1c773cf2ca9d5a7a94fb7 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4630: 86686c6e2f7c6f0944bced11550e06d20bc6957f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10100: 8405889a997b3d86b7453a7f4b0c7e2f2813af8b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

8405889a997b drm/amdgpu: Remove default best_encoder hook from DC

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10100/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

✗ Fi.CI.IGT: failure for drm/amdgpu: Remove default best_encoder hook from DC (rev2)

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm/amdgpu: Remove default best_encoder hook from DC (rev2)
URL : https://patchwork.freedesktop.org/series/49194/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4773_full -> Patchwork_10100_full =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_10100_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_10100_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_10100_full:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_eio@in-flight-1us:
      shard-glk:          PASS -> FAIL

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@drv_suspend@shrink:
      shard-glk:          FAIL (fdo#106886) -> PASS

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-apl:          INCOMPLETE (fdo#103927) -> PASS

    igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
      shard-hsw:          FAIL (fdo#105767) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#102887, fdo#105363) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105767 https://bugs.freedesktop.org/show_bug.cgi?id=105767
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4773 -> Patchwork_10100

CI_DRM_4773: fb94a684a02a423798c1c773cf2ca9d5a7a94fb7 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4630: 86686c6e2f7c6f0944bced11550e06d20bc6957f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10100: 8405889a997b3d86b7453a7f4b0c7e2f2813af8b @ 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_10100/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx