Skip to contentSkip to conversation

drm/i915: Do intel_panel_destroy_backlight() later

PATCH In review Ville Syrjala 3 participants 8 messages Oct 8, 2018 – Oct 9, 2018

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

PATCH 1/2 drm/i915: Do intel_panel_destroy_backlight() later

From: Ville Syrjälä <[email protected]>

Currently we destroy the backlight during connector unregistration. That means the final modeset performed by drm_atomic_helper_shutdown() will leave the backlight on. We don't want that so let's just move intel_panel_destroy_backlight() into intel_panel_fini() which gets called during connector destuction.

We still unregister the user visible backlight device during connector unregistration.

Cc Jani Nikula <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 1 -
 drivers/gpu/drm/i915/intel_drv.h     | 1 -
 drivers/gpu/drm/i915/intel_panel.c   | 7 +++----
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -1
index 741fc5b4f9d9..6a7fe89f3145 100644
@@ -15860,7 +15860,6 @@ void intel_connector_unregister(struct drm_connector *connector)
 	struct intel_connector *intel_connector = to_intel_connector(connector);
 
 	intel_backlight_device_unregister(intel_connector);
-	intel_panel_destroy_backlight(connector);
 }
 
 static void intel_hpd_poll_fini(struct drm_device *dev)
drivers/gpu/drm/i915/intel_drv.h +0 -1
index 7a9f5ee4604f..8050d06c722a 100644
@@ -1904,7 +1904,6 @@ int intel_panel_setup_backlight(struct drm_connector *connector,
 void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
 				  const struct drm_connector_state *conn_state);
 void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
-void intel_panel_destroy_backlight(struct drm_connector *connector);
 extern struct drm_display_mode *intel_find_panel_downclock(
 				struct drm_i915_private *dev_priv,
 				struct drm_display_mode *fixed_mode,
drivers/gpu/drm/i915/intel_panel.c +3 -4
index 4a9f139e7b73..7df9bcd2bb20 100644
@@ -1814,11 +1814,8 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
 	return 0;
 }
 
-void intel_panel_destroy_backlight(struct drm_connector *connector)
+static void intel_panel_destroy_backlight(struct intel_panel *panel)
 {
-	struct intel_connector *intel_connector = to_intel_connector(connector);
-	struct intel_panel *panel = &intel_connector->panel;
-
 	/* dispose of the pwm */
 	if (panel->backlight.pwm)
 		pwm_put(panel->backlight.pwm);
@@ -1923,6 +1920,8 @@ void intel_panel_fini(struct intel_panel *panel)
 	struct intel_connector *intel_connector =
 		container_of(panel, struct intel_connector, panel);
 
+	intel_panel_destroy_backlight(panel);
+
 	if (panel->fixed_mode)
 		drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode);
 
Signature · 6 lines
2.16.4

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

PATCH 2/2 drm/i915: Drop the eDP check from intel_dp_connector_destroy()

From: Ville Syrjälä <[email protected]>

As long as the connector was zeroed during allocation calling intel_panel_fini() is safe even if we haven't initialized the panel struct explicitly. So let's drop the useless eDP check from dp connector destruction.

---
 drivers/gpu/drm/i915/intel_dp.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -6
index 19f0c3f59cbe..d12f987a6c43 100644
@@ -5261,12 +5261,7 @@ intel_dp_connector_destroy(struct drm_connector *connector)
 	if (!IS_ERR_OR_NULL(intel_connector->edid))
 		kfree(intel_connector->edid);
 
-	/*
-	 * Can't call intel_dp_is_edp() since the encoder may have been
-	 * destroyed already.
-	 */
-	if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
-		intel_panel_fini(&intel_connector->panel);
+	intel_panel_fini(&intel_connector->panel);
 
 	drm_connector_cleanup(connector);
 	kfree(connector);
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: Drop the eDP check from intel_dp_connector_destroy()

Quoting Ville Syrjala (2018-10-08 14:46:41)

Quoted 8 lines

From: Ville Syrjälä <[email protected]>

As long as the connector was zeroed during allocation calling intel_panel_fini() is safe even if we haven't initialized the panel struct explicitly. So let's drop the useless eDP check from dp connector destruction.

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

#3 lore raw

✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Do intel_panel_destroy_backlight() later

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Do intel_panel_destroy_backlight() later
URL : https://patchwork.freedesktop.org/series/50691/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4950 -> Patchwork_10389 =

== Summary - SUCCESS ==

No regressions found.

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

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-kbl-7560u:       PASS -> INCOMPLETE (fdo#108044)

    
    ==== Possible fixes ====

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

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

    igt@kms_flip@basic-flip-vs-modeset:
      fi-hsw-4770r:       DMESG-WARN (fdo#105602) -> PASS

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       DMESG-WARN (fdo#107603, fdo#106386) -> PASS

fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#108044 https://bugs.freedesktop.org/show_bug.cgi?id=108044

== Participating hosts (50 -> 42) ==

Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-skl-iommu

== Build changes ==

* Linux: CI_DRM_4950 -> Patchwork_10389

CI_DRM_4950: a9abc43bebfb6de62c2c3747a22fadfa17b61d8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4671: b121f7d42c260ae3a050c3f440d1c11f7cff7d1a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10389: 83ace5cf94e8a618cea7003b80492a13ae207af0 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

83ace5cf94e8 drm/i915: Drop the eDP check from intel_dp_connector_destroy() b9cdf0fd30aa drm/i915: Do intel_panel_destroy_backlight() later

== Logs ==

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

Reviewed-by on v1 1/2
#4 lore raw
In reply to Ville Syrjala

Quoting Ville Syrjala (2018-10-08 14:46:40)

Quoted 8 lines

From: Ville Syrjälä <[email protected]>

Currently we destroy the backlight during connector unregistration. That means the final modeset performed by drm_atomic_helper_shutdown() will leave the backlight on. We don't want that so let's just move intel_panel_destroy_backlight() into intel_panel_fini() which gets called during connector destuction.

Quoted 7 lines

We still unregister the user visible backlight device during connector unregistration.

Cc Jani Nikula <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>

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

#5 lore raw
In reply to Ville Syrjala

Quoting Ville Syrjala (2018-10-08 14:46:40)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

Currently we destroy the backlight during connector unregistration. That means the final modeset performed by drm_atomic_helper_shutdown() will leave the backlight on. We don't want that so let's just move intel_panel_destroy_backlight() into intel_panel_fini() which gets called during connector destuction.

We still unregister the user visible backlight device during connector unregistration.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106386

Quoted 4 lines
Cc Jani Nikula <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>

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

#6 lore raw
Quoted 9 lines · Chris Wilson

Quoting Ville Syrjala (2018-10-08 14:46:40)

Quoted 8 lines

From: Ville Syrjälä <[email protected]>

Currently we destroy the backlight during connector unregistration. That means the final modeset performed by drm_atomic_helper_shutdown() will leave the backlight on. We don't want that so let's just move intel_panel_destroy_backlight() into intel_panel_fini() which gets called during connector destuction.

Quoted 5 lines
Quoted 3 lines

We still unregister the user visible backlight device during connector unregistration.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106386

Thanks for digging that up for me, and for the review.

Series pushed to dinq.

Quoted 5 lines
Quoted 5 lines
Cc Jani Nikula <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Daniel Vetter <[email protected]>
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Do intel_panel_destroy_backlight() later

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Do intel_panel_destroy_backlight() later
URL : https://patchwork.freedesktop.org/series/50691/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4950_full -> Patchwork_10389_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_10389_full need to be verified manually.

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

=== IGT changes ===

    ==== Warnings ====

    igt@kms_cursor_legacy@cursora-vs-flipa-atomic-transitions-varying-size:
      shard-snb:          PASS -> SKIP +6

== Known issues ==

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

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_cpu_reloc@full:
      shard-skl:          NOTRUN -> INCOMPLETE (fdo#108073)

    igt@kms_atomic@atomic_invalid_params:
      shard-apl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +4

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-apl:          PASS -> FAIL (fdo#106641)

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-skl:          NOTRUN -> FAIL (fdo#105458)

    igt@kms_color@pipe-c-legacy-gamma:
      shard-skl:          NOTRUN -> FAIL (fdo#104782)

    igt@kms_cursor_crc@cursor-256x256-random:
      shard-glk:          PASS -> FAIL (fdo#103232)
      shard-apl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
      shard-glk:          PASS -> DMESG-WARN (fdo#105763, fdo#106538)

    igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
      shard-glk:          PASS -> DMESG-FAIL (fdo#103167, fdo#106538)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
      shard-apl:          PASS -> FAIL (fdo#103167) +3

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
      shard-glk:          PASS -> FAIL (fdo#103167) +2

    {igt@kms_plane_alpha_blend@pipe-a-coverage-7efc}:
      shard-glk:          PASS -> DMESG-FAIL (fdo#106538)

    {igt@kms_plane_alpha_blend@pipe-c-alpha-basic}:
      shard-skl:          NOTRUN -> FAIL (fdo#108145)

    igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
      shard-apl:          PASS -> FAIL (fdo#103166)

    igt@kms_rotation_crc@exhaust-fences:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#105748)

    igt@pm_rpm@system-suspend:
      shard-skl:          NOTRUN -> INCOMPLETE (fdo#104108, fdo#107773, fdo#107807)

    
    ==== Possible fixes ====

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
      shard-hsw:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_ccs@pipe-a-crc-primary-rotation-180:
      shard-skl:          FAIL (fdo#107725) -> PASS

    igt@kms_color@pipe-a-legacy-gamma:
      shard-apl:          FAIL (fdo#104782, fdo#108145) -> PASS

    igt@kms_color@pipe-b-legacy-gamma:
      shard-apl:          FAIL (fdo#104782) -> PASS

    igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-xtiled:
      shard-skl:          FAIL (fdo#103184) -> PASS

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

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-skl:          FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
      shard-apl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

    igt@kms_plane@plane-position-covered-pipe-a-planes:
      shard-apl:          FAIL (fdo#103166) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-glk:          FAIL (fdo#103166) -> PASS +2

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

    
    ==== Warnings ====

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          FAIL (fdo#103167, fdo#105682) -> DMESG-WARN (fdo#108131, fdo#105602, fdo#103558)

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

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105458 https://bugs.freedesktop.org/show_bug.cgi?id=105458
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
fdo#105748 https://bugs.freedesktop.org/show_bug.cgi?id=105748
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#107725 https://bugs.freedesktop.org/show_bug.cgi?id=107725
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108073 https://bugs.freedesktop.org/show_bug.cgi?id=108073
fdo#108131 https://bugs.freedesktop.org/show_bug.cgi?id=108131
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
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 (6 -> 6) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4950 -> Patchwork_10389

CI_DRM_4950: a9abc43bebfb6de62c2c3747a22fadfa17b61d8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4671: b121f7d42c260ae3a050c3f440d1c11f7cff7d1a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10389: 83ace5cf94e8a618cea7003b80492a13ae207af0 @ 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_10389/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx