drm/fbdev: Fallback to non tiled mode if all tiles not present
Subsystems (2)
PATCH v2 1/1 drm/fbdev: Fallback to non tiled mode if all tiles not present
In case of tiled displays, if we hotplug just one connector, fbcon currently just selects the preferred mode and if it is tiled mode then that becomes a problem if rest of the tiles are not present.
So in the fbdev driver on hotplug when we probe the client modeset, if we dont find all the connectors for all tiles, then on a connector with one tile, just fallback to the first available non tiled mode to display over a single connector.
On the hotplug of the consecutive tiled connectors, if the tiled mode no longer exists because of fbcon size limitation, then return no modes for consecutive tiles but retain the non tiled mode on the 0th tile.
Use the same logic in case of connected boot case as well. This has been tested with Dell UP328K tiled monitor.
v2:
* Set the modes on consecutive hotplugged tiles to no mode if tiled mode is pruned (Dave)
v1:
* Just handle the 1st connector hotplug case
* v1 Reviewed-by: Dave Airlie <[email protected]>
--- drivers/gpu/drm/drm_client_modeset.c | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)
drivers/gpu/drm/drm_client_modeset.c +70 -0
@@ -114,6 +114,33 @@ drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc)return NULL ; } +static struct drm_display_mode * +drm_connector_get_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +return mode; + } +return NULL ; +} + +static struct drm_display_mode * +drm_connector_fallback_non_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +continue ; +return mode; + } +return NULL ; +} +static struct drm_display_mode *drm_connector_has_preferred_mode (struct drm_connector *connector,int width,int height) {
@@ -348,8 +375,14 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,struct drm_connector *connector;u64 conn_configured =0 ;int tile_pass =0 ; +int num_tiled_conns =0 ;int i; +for (i =0 ; i < connector_count; i++) { +if (connectors[i]->has_tile) + num_tiled_conns++; + } + retry:for (i =0 ; i < connector_count; i++) { connector = connectors[i];
@@ -399,6 +432,28 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,list_for_each_entry (modes[i], &connector->modes, head)break ; } +/* +* In case of tiled mode if all tiles not present fallback to +* first available non tiled mode. +* After all tiles are present, try to find the tiled mode +* for all and if tiled mode not present due to fbcon size +* limitations, use first non tiled mode only for +* tile 0,0 and set to no mode for all other tiles. +*/ +if (connector->has_tile) { +if (num_tiled_conns < + connector->num_h_tile * connector->num_v_tile || + (connector->tile_h_loc ==0 && + connector->tile_v_loc ==0 && + !drm_connector_get_tiled_mode (connector))) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + }else { + modes[i] =drm_connector_get_tiled_mode (connector); + } + } +DRM_DEBUG_KMS ("found mode %s\n" , modes[i] ? modes[i]->name :"none" ); conn_configured |=BIT_ULL (i);
@@ -515,6 +570,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,bool fallback = true, ret = true;int num_connectors_enabled =0 ;int num_connectors_detected =0 ; +int num_tiled_conns =0 ;struct drm_modeset_acquire_ctx ctx;if (!drm_drv_uses_atomic_modeset (dev))
@@ -532,6 +588,10 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,memcpy (save_enabled, enabled, count); mask =GENMASK (count -1 ,0 ); conn_configured =0 ; +for (i =0 ; i < count; i++) { +if (connectors[i]->has_tile) + num_tiled_conns++; + } retry: conn_seq = conn_configured;for (i =0 ; i < count; i++) {
@@ -631,6 +691,16 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, connector->name); modes[i] = &connector->state->crtc->mode; } +/* +* In case of tiled modes, if all tiles are not present +* then fallback to a non tiled mode. +*/ +if (connector->has_tile && + num_tiled_conns < connector->num_h_tile * connector->num_v_tile) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + } crtcs[i] = new_crtc; DRM_DEBUG_KMS("connector %s on [CRTC:%d:%s]: %dx%d%s\n",
Signature · 6 lines
2.19.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/fbdev: Fallback to non tiled mode if all tiles not present (rev2)
== Series Details ==
== Series Details ==
Series: drm/fbdev: Fallback to non tiled mode if all tiles not present (rev2)
URL : https://patchwork.freedesktop.org/series/68838/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7299 -> Patchwork_15202
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15202 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15202, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15202:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live_gem_contexts:
- fi-bwr-2160: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7299/fi-bwr-2160/igt@i915_selftest@live_gem_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/fi-bwr-2160/igt@i915_selftest@live_gem_contexts.html
Known issues
------------
Here are the changes found in Patchwork_15202 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-cml-s: [PASS][3] -> [DMESG-WARN][4] ([fdo#111764])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7299/fi-cml-s/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/fi-cml-s/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [PASS][5] -> [DMESG-WARN][6] ([fdo#102614])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7299/fi-hsw-peppy/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/fi-hsw-peppy/igt@[email protected]
#### Possible fixes ####
* igt@i915_selftest@live_blt:
- fi-hsw-peppy: [DMESG-FAIL][7] ([fdo#112147]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7299/fi-hsw-peppy/igt@i915_selftest@live_blt.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/fi-hsw-peppy/igt@i915_selftest@live_blt.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][9] ([fdo#111407]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7299/fi-kbl-7500u/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/fi-kbl-7500u/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[fdo#111736]: https://bugs.freedesktop.org/show_bug.cgi?id=111736
[fdo#111764]: https://bugs.freedesktop.org/show_bug.cgi?id=111764
[fdo#112147]: https://bugs.freedesktop.org/show_bug.cgi?id=112147
Participating hosts (51 -> 44)
------------------------------
Missing (7): fi-icl-u4 fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7299 -> Patchwork_15202
CI-20190529: 20190529
CI_DRM_7299: e7de48a8b1161a99f4b8e4483bc1bb85f5d31039 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5268: c94958b8f7caefcda72392417ae6f3a98e36a48b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15202: 3902d9a7966ee091b7451723078192e20ac86297 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
3902d9a7966e drm/fbdev: Fallback to non tiled mode if all tiles not present
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15202/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
LGTM, thanks,
Quoted 153 lines · Manasi Navare
In case of tiled displays, if we hotplug just one connector, fbcon currently just selects the preferred mode and if it is tiled mode then that becomes a problem if rest of the tiles are not present.
So in the fbdev driver on hotplug when we probe the client modeset, if we dont find all the connectors for all tiles, then on a connector with one tile, just fallback to the first available non tiled mode to display over a single connector.
On the hotplug of the consecutive tiled connectors, if the tiled mode no longer exists because of fbcon size limitation, then return no modes for consecutive tiles but retain the non tiled mode on the 0th tile.
Use the same logic in case of connected boot case as well. This has been tested with Dell UP328K tiled monitor.v2:
* Set the modes on consecutive hotplugged tiles to no mode if tiled mode is pruned (Dave)
v1:
* Just handle the 1st connector hotplug case
* v1 Reviewed-by: Dave Airlie <[email protected]>Suggested-by Ville Syrjälä <[email protected]>Suggested-by Dave Airlie <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- drivers/gpu/drm/drm_client_modeset.c | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)drivers/gpu/drm/drm_client_modeset.c +70
-1@@ -114,6 +114,33 @@ drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc)return NULL ; } +static struct drm_display_mode * +drm_connector_get_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +return mode; + } +return NULL ; +} + +static struct drm_display_mode * +drm_connector_fallback_non_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +continue ; +return mode; + } +return NULL ; +} +static struct drm_display_mode *drm_connector_has_preferred_mode (struct drm_connector *connector,int width,int height) {@@ -348,8 +375,14 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,struct drm_connector *connector;u64 conn_configured =0 ;int tile_pass =0 ; +int num_tiled_conns =0 ;int i; +for (i =0 ; i < connector_count; i++) { +if (connectors[i]->has_tile) + num_tiled_conns++; + } + retry:for (i =0 ; i < connector_count; i++) { connector = connectors[i];@@ -399,6 +432,28 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,list_for_each_entry (modes[i], &connector->modes, head)break ; } +/* +* In case of tiled mode if all tiles not present fallback to +* first available non tiled mode. +* After all tiles are present, try to find the tiled mode +* for all and if tiled mode not present due to fbcon size +* limitations, use first non tiled mode only for +* tile 0,0 and set to no mode for all other tiles. +*/ +if (connector->has_tile) { +if (num_tiled_conns < + connector->num_h_tile * connector->num_v_tile || + (connector->tile_h_loc ==0 && + connector->tile_v_loc ==0 && + !drm_connector_get_tiled_mode (connector))) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + }else { + modes[i] =drm_connector_get_tiled_mode (connector); + } + } +DRM_DEBUG_KMS ("found mode %s\n" , modes[i] ? modes[i]->name :"none" ); conn_configured |=BIT_ULL (i);@@ -515,6 +570,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,bool fallback = true, ret = true;int num_connectors_enabled =0 ;int num_connectors_detected =0 ; +int num_tiled_conns =0 ;struct drm_modeset_acquire_ctx ctx;if (!drm_drv_uses_atomic_modeset (dev))@@ -532,6 +588,10 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,memcpy (save_enabled, enabled, count); mask =GENMASK (count -1 ,0 ); conn_configured =0 ; +for (i =0 ; i < count; i++) { +if (connectors[i]->has_tile) + num_tiled_conns++; + } retry: conn_seq = conn_configured;for (i =0 ; i < count; i++) {@@ -631,6 +691,16 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, connector->name); modes[i] = &connector->state->crtc->mode; } +/* +* In case of tiled modes, if all tiles are not present +* then fallback to a non tiled mode. +*/ +if (connector->has_tile && + num_tiled_conns < connector->num_h_tile * connector->num_v_tile) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + } crtcs[i] = new_crtc; DRM_DEBUG_KMS("connector %s on [CRTC:%d:%s]: %dx%d%s\n", --2.19.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx