Bug 91138 - [atomic mst regression] Unable to configure 2nd CRTC
Summary: [atomic mst regression] Unable to configure 2nd CRTC
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: Other All
: high blocker
Assignee: Maarten Lankhorst
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-28 20:35 UTC by Chris Wilson
Modified: 2017-07-24 22:46 UTC (History)
2 users (show)

See Also:
i915 platform: BDW
i915 features: display/DP MST


Attachments
Match best_encoder with funcs->best_encoder() (6.66 KB, patch)
2015-06-29 07:16 UTC, Chris Wilson
no flags Details | Splinter Review
Match best_encoder with funcs->best_encoder() (6.71 KB, patch)
2015-06-29 07:17 UTC, Chris Wilson
no flags Details | Splinter Review

Description Chris Wilson 2015-06-28 20:35:36 UTC
[ 4154.512489] [drm:drm_mode_setcrtc] [CRTC:25]
[ 4154.512493] [drm:drm_mode_setcrtc] [CONNECTOR:44:DP-2]
[ 4154.512496] [drm:intel_crtc_set_config] [CRTC:25] [FB:94] #connectors=1 (x y) (0 0)
[ 4154.512499] [drm:drm_atomic_state_init] Allocated atomic state ffff88040a80f600
[ 4154.512503] [drm:drm_atomic_get_connector_state] Added [CONNECTOR:44] ffff8803f6f01bc0 state to ffff88040a80f600
[ 4154.512506] [drm:drm_atomic_get_crtc_state] Added [CRTC:25] ffff88040360b000 state to ffff88040a80f600
[ 4154.512508] [drm:drm_atomic_set_crtc_for_connector] Link connector state ffff8803f6f01bc0 to [CRTC:25]
[ 4154.512510] [drm:intel_modeset_stage_output_state] [CONNECTOR:44:DP-2] to [CRTC:25]
[ 4154.512512] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:25] to ffff88040a80f600
[ 4154.512514] [drm:drm_atomic_connectors_for_crtc] State ffff88040a80f600 has 1 connectors for [CRTC:25]
[ 4154.512517] [drm:drm_atomic_get_plane_state] Added [PLANE:23] ffff8803f6e98d80 state to ffff88040a80f600
[ 4154.512519] [drm:drm_atomic_set_crtc_for_plane] Link plane state ffff8803f6e98d80 to [CRTC:25]
[ 4154.512520] [drm:drm_framebuffer_reference] ffff880403674540: FB ID: 94 (4)
[ 4154.512522] [drm:drm_atomic_set_fb_for_plane] Set [FB:94] for plane state ffff8803f6e98d80
[ 4154.512525] [drm:drm_atomic_set_mode_for_crtc] Set [MODE:] for CRTC state ffff88040360b000
[ 4154.512527] [drm:drm_atomic_helper_check_modeset] [CRTC:25] mode changed
[ 4154.512528] [drm:drm_atomic_helper_check_modeset] [CRTC:25] enable changed
[ 4154.512530] [drm:update_connector_routing] Updating routing for [CONNECTOR:44:DP-2]
[ 4154.512533] [drm:steal_encoder] [ENCODER:38:DP MST-38] in use on [CRTC:21], stealing it
[ 4154.512536] [drm:drm_property_reference_blob] ffff88002d7a2d80: blob ID: 55 (1)
[ 4154.512537] [drm:drm_atomic_get_crtc_state] Added [CRTC:21] ffff88040b010800 state to ffff88040a80f600
[ 4154.512539] [drm:steal_encoder] Stealing encoder from [CONNECTOR:46:DP-3]
[ 4154.512541] [drm:drm_atomic_get_connector_state] Added [CONNECTOR:46] ffff8803f6f01be0 state to ffff88040a80f600
[ 4154.512543] [drm:drm_atomic_set_crtc_for_connector] Link connector state ffff8803f6f01be0 to [NOCRTC]
[ 4154.512545] [drm:update_connector_routing] [CONNECTOR:44:DP-2] using [ENCODER:38:DP MST-38] on [CRTC:25]
[ 4154.512546] [drm:update_connector_routing] Updating routing for [CONNECTOR:46:DP-3]
[ 4154.512548] [drm:update_connector_routing] Disabling [CONNECTOR:46:DP-3]
[ 4154.512550] [drm:drm_atomic_helper_check_modeset] [CRTC:21] needs all connectors, enable: y, active: y
[ 4154.512552] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:21] to ffff88040a80f600
[ 4154.512554] [drm:drm_framebuffer_reference] ffff880403674540: FB ID: 94 (5)
[ 4154.512556] [drm:drm_atomic_get_plane_state] Added [PLANE:18] ffff8803f6e98f00 state to ffff88040a80f600
[ 4154.512558] [drm:drm_atomic_connectors_for_crtc] State ffff88040a80f600 has 0 connectors for [CRTC:21]
[ 4154.512560] [drm:drm_atomic_helper_check_modeset] [CRTC:21] enabled/connectors mismatch
[ 4154.512562] [drm:drm_atomic_state_default_clear] Clearing atomic state ffff88040a80f600
[ 4154.512564] [drm:drm_property_unreference_blob] ffff88002d7a2d80: blob ID: 55 (2)
[ 4154.512566] [drm:drm_property_unreference_blob] ffff8803f6e98240: blob ID: 80 (1)
[ 4154.512568] [drm:drm_framebuffer_unreference] ffff880403674540: FB ID: 94 (6)
[ 4154.512570] [drm:drm_framebuffer_unreference] ffff880403674540: FB ID: 94 (5)
[ 4154.512571] [drm:drm_atomic_state_free] Freeing atomic state ffff88040a80f600
[ 4154.512573] [drm:drm_framebuffer_reference] ffff880403674540: FB ID: 94 (4)
[ 4154.512575] [drm:drm_framebuffer_unreference] ffff880403674540: FB ID: 94 (5)
[ 4154.512576] [drm:drm_framebuffer_unreference] ffff880403674540: FB ID: 94 (4)
[ 4154.512579] [drm:drm_ioctl] ret = -22

* best encoder seems to be a regression, it steals an active encoder rather than using an alternate

* having stolen the encoder, the other connector is no longer attached to its CRTC causing the failure
Comment 1 Chris Wilson 2015-06-29 07:16:26 UTC
Created attachment 116779 [details] [review]
Match best_encoder with funcs->best_encoder()

First problem is that atomic recomputes state->best_encoder and that was not matching what it was told to use by intel. The attached patch at least allows intel_dp_mst_best_encoder() to return the right encoder consistently.

It's a highly desirable band-aid.


Despite SETCRTC now working I only have output on pipe 0.
Comment 2 Chris Wilson 2015-06-29 07:17:28 UTC
Created attachment 116780 [details] [review]
Match best_encoder with funcs->best_encoder()
Comment 3 cprigent 2015-07-28 17:01:15 UTC
Bug scrub:
Assigned to Chris Wilson.
Comment 4 Chris Wilson 2015-07-28 17:06:18 UTC
Having filed the and written a demonstration patch, I suggest you nominate someone familiar with the code and responsible for writing it in the first place...
Comment 5 Maarten Lankhorst 2015-08-04 20:36:51 UTC
There is a better fix for posted on dri-devel.

http://lists.freedesktop.org/archives/dri-devel/2015-August/087575.html

But there are still some open corner cases that need to be addressed.
Comment 6 cprigent 2015-10-08 16:42:46 UTC
Bug scrub:
Maarten what the status on this?
Comment 7 Maarten Lankhorst 2015-10-12 10:46:06 UTC
Fix is upstream as commit 3b8a684bd6cbc13dfd21ca41814c304e9f27ec7f and commit 459485ad3513bce12a3773f801e4647445062d9e

drm/atomic-helper: Add an atomice best_encoder callback
drm/i915: Fixup dp mst encoder selection


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.