mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
drm/i915: fbdev restore mode needs to invalidate frontbuffer
This fbdev restore mode was another corner case that was now calling frontbuffer flip and flush and making we miss screen updates with PSR enabled. So let's also add the invalidate hack here while we don't have a reliable dirty fbdev op. v2: As pointed by Paulo: removed seg fault risk, used fb_helper when possible and put brackets on if. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Testcase: igt/kms_fbcon_fbt/psr Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
aba6da3e61
commit
d04df7325a
1 changed files with 12 additions and 3 deletions
|
@ -824,11 +824,20 @@ void intel_fbdev_restore_mode(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||||
|
struct intel_fbdev *ifbdev = dev_priv->fbdev;
|
||||||
|
struct drm_fb_helper *fb_helper;
|
||||||
|
|
||||||
if (!dev_priv->fbdev)
|
if (!ifbdev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret = drm_fb_helper_restore_fbdev_mode_unlocked(&dev_priv->fbdev->helper);
|
fb_helper = &ifbdev->helper;
|
||||||
if (ret)
|
|
||||||
|
ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
|
||||||
|
if (ret) {
|
||||||
DRM_DEBUG("failed to restore crtc mode\n");
|
DRM_DEBUG("failed to restore crtc mode\n");
|
||||||
|
} else {
|
||||||
|
mutex_lock(&fb_helper->dev->struct_mutex);
|
||||||
|
intel_fb_obj_invalidate(ifbdev->fb->obj, ORIGIN_GTT);
|
||||||
|
mutex_unlock(&fb_helper->dev->struct_mutex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue