Skip to content

Commit

Permalink
drm/fbdev-helper: don't force restores
Browse files Browse the repository at this point in the history
Instead check for master status, in case we've raced.

This is the last exception to the general rule that we restore fbcon
only when there's no master active. Compositors are supposed to drop
their master status before they switch to a different console back to
text mode (or just switch to text mode directly, without a vt switch).

This is known to break some subtests of kms_fbcon_fbt in igt, but they're
just wrong - it does a graphics/text mode switch for the vt without
updating the master status.

Also add a comment to the drm_client->restore hook that this is expected
going forward from all clients (there's currently just one).

v2: Also drop the force in pan_display

v3: Restore the _force to pan_display, this actually means _locked in that
path. Spotted by Noralf.

Cc: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200204150146.2006481-3-daniel.vetter@ffwll.ch
  • Loading branch information
Daniel Vetter committed Feb 11, 2020
1 parent e81a255 commit 64914da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,7 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
return 0;

mutex_lock(&fb_helper->lock);
/*
* TODO:
* We should bail out here if there is a master by dropping _force.
* Currently these igt tests fail if we do that:
* - kms_fbcon_fbt@psr
* - kms_fbcon_fbt@psr-suspend
*
* So first these tests need to be fixed so they drop master or don't
* have an fd open.
*/
ret = drm_client_modeset_commit_force(&fb_helper->client);
ret = drm_client_modeset_commit(&fb_helper->client);

do_delayed = fb_helper->delayed_hotplug;
if (do_delayed)
Expand Down
5 changes: 5 additions & 0 deletions include/drm/drm_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ struct drm_client_funcs {
* returns zero gets the privilege to restore and no more clients are
* called. This callback is not called after @unregister has been called.
*
* Note that the core does not guarantee exclusion against concurrent
* drm_open(). Clients need to ensure this themselves, for example by
* using drm_master_internal_acquire() and
* drm_master_internal_release().
*
* This callback is optional.
*/
int (*restore)(struct drm_client_dev *client);
Expand Down

0 comments on commit 64914da

Please sign in to comment.