* [PATCH] i915: restore only the mode of this driver on lastclose
@ 2011-04-11 5:23 Dave Airlie
2011-04-11 7:21 ` Chris Wilson
2011-04-11 16:06 ` Keith Packard
0 siblings, 2 replies; 5+ messages in thread
From: Dave Airlie @ 2011-04-11 5:23 UTC (permalink / raw)
To: dri-devel
From: Dave Airlie <airlied@redhat.com>
This has always used a big hammer, but that hammer is probably
too big, I'm also not sure its necessary but at least this
should be safe.
Should fix: https://bugzilla.kernel.org/show_bug.cgi?id=23592
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/i915/i915_dma.c | 2 +-
drivers/gpu/drm/i915/intel_drv.h | 1 +
drivers/gpu/drm/i915/intel_fb.c | 16 ++++++++++++++++
3 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 7273037..12876f2 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2207,7 +2207,7 @@ void i915_driver_lastclose(struct drm_device * dev)
drm_i915_private_t *dev_priv = dev->dev_private;
if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
- drm_fb_helper_restore();
+ intel_fb_restore_mode(dev);
vga_switcheroo_process_delayed_switch();
return;
}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index f5b0d83..1d20712 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -338,4 +338,5 @@ extern int intel_overlay_attrs(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern void intel_fb_output_poll_changed(struct drm_device *dev);
+extern void intel_fb_restore_mode(struct drm_device *dev);
#endif /* __INTEL_DRV_H__ */
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 5127827..96a45c4 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -264,3 +264,19 @@ void intel_fb_output_poll_changed(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
}
+
+void intel_fb_restore_mode(struct drm_device *dev)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ int ret, i;
+
+ if (!dev_priv->fbdev)
+ return;
+
+ for (i = 0; i < dev_priv->fbdev->helper.crtc_count; i++) {
+ struct drm_mode_set *mode_set = &dev_priv->fbdev->helper.crtc_info[i].mode_set;
+ ret = drm_crtc_helper_set_config(mode_set);
+ if (ret)
+ DRM_DEBUG("failed to restore crtc mode\n");
+ }
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] i915: restore only the mode of this driver on lastclose
2011-04-11 5:23 [PATCH] i915: restore only the mode of this driver on lastclose Dave Airlie
@ 2011-04-11 7:21 ` Chris Wilson
2011-04-11 16:06 ` Keith Packard
1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2011-04-11 7:21 UTC (permalink / raw)
To: Dave Airlie, dri-devel
On Mon, 11 Apr 2011 15:23:17 +1000, Dave Airlie <airlied@gmail.com> wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> This has always used a big hammer, but that hammer is probably
> too big, I'm also not sure its necessary but at least this
> should be safe.
So the difference appears to be that the patch only restores the fbcon
of a device for the lastclose of that device. That makes sense.
However, would it not be better to make this a generic
drm_fb_helper_restore_mode() as it sounds like something every driver
should consider?
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i915: restore only the mode of this driver on lastclose
2011-04-11 5:23 [PATCH] i915: restore only the mode of this driver on lastclose Dave Airlie
2011-04-11 7:21 ` Chris Wilson
@ 2011-04-11 16:06 ` Keith Packard
2011-04-11 17:31 ` Chris Wilson
1 sibling, 1 reply; 5+ messages in thread
From: Keith Packard @ 2011-04-11 16:06 UTC (permalink / raw)
To: Dave Airlie, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 496 bytes --]
On Mon, 11 Apr 2011 15:23:17 +1000, Dave Airlie <airlied@gmail.com> wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> This has always used a big hammer, but that hammer is probably
> too big, I'm also not sure its necessary but at least this
> should be safe.
Am I correct in reading the drm_fb_helper_restore path as restoring
the mode of each fbdev device in turn? If so, why would that ever be
useful (aside from doing it for each inserted card)?
--
keith.packard@intel.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i915: restore only the mode of this driver on lastclose
2011-04-11 16:06 ` Keith Packard
@ 2011-04-11 17:31 ` Chris Wilson
2011-04-11 17:55 ` Keith Packard
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2011-04-11 17:31 UTC (permalink / raw)
To: Keith Packard, Dave Airlie, dri-devel
On Mon, 11 Apr 2011 09:06:38 -0700, Keith Packard <keithp@keithp.com> wrote:
> On Mon, 11 Apr 2011 15:23:17 +1000, Dave Airlie <airlied@gmail.com> wrote:
> > From: Dave Airlie <airlied@redhat.com>
> >
> > This has always used a big hammer, but that hammer is probably
> > too big, I'm also not sure its necessary but at least this
> > should be safe.
>
> Am I correct in reading the drm_fb_helper_restore path as restoring
> the mode of each fbdev device in turn? If so, why would that ever be
> useful (aside from doing it for each inserted card)?
During panics? Just not lastclose. :)
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-11 17:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-11 5:23 [PATCH] i915: restore only the mode of this driver on lastclose Dave Airlie
2011-04-11 7:21 ` Chris Wilson
2011-04-11 16:06 ` Keith Packard
2011-04-11 17:31 ` Chris Wilson
2011-04-11 17:55 ` Keith Packard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.