Re: [Patch 1/5]: DRM/I915: Add the crt save/restore function for VT switch

2009-03-12 Thread Jesse Barnes
On Friday, March 6, 2009 5:55:52 pm Keith Packard wrote:
 On Fri, 2009-03-06 at 15:19 -0800, Eric Anholt wrote:
  Given that these functions aren't actually hooked up to anything, I'm
  not sure if there's any value here.  It sounds like we're going to go to
  using the resume_force_mode function for suspend/resume, which means
  we'd never use these.

 I'm concerned that our mode setting code doesn't hit all of the same
 registers that the suspend/resume code does. There are a pile of
 registers which the BIOS may whack, and which will not be reset
 correctly unless we save their values before the system is suspended the
 first time.

 Otherwise, I love the 'just set the mode' plan. Any chance we can strip
 the suspend/resume code down to registers which our mode setting code
 *doesn't* save/restore? Or merge suitable 'restorish' bits into the mode
 setting path so that the other registers are set in the normal mode
 setting path?

Yeah, I think that's the direction we should be heading.  The top leve 
suspend/resume routines should handle global GPU state (and possibly 
save/restore a GPU context), but beyond that we just set a mode, which should 
take care of the rest.  That means we can get rid of all the output specific 
save/restore routines as a bonus.

-- 
Jesse Barnes, Intel Open Source Technology Center

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Patch 1/5]: DRM/I915: Add the crt save/restore function for VT switch

2009-03-06 Thread Eric Anholt
On Tue, 2009-03-03 at 18:05 +0800, yakui_zhao wrote:
 Subject: Patch DRM/i915: Add the crt save/restore function for VT switch
 From: Zhao Yakui yakui.z...@intel.com
 
 Add the crt save/restore function for VT switch
 
 Signed-off-by: Zhao Yakui yakui.z...@intel.com

Given that these functions aren't actually hooked up to anything, I'm
not sure if there's any value here.  It sounds like we're going to go to
using the resume_force_mode function for suspend/resume, which means
we'd never use these.

jbarnes: do you like the resume_force_mode plan, or do we want to try to
fix the native suspend/resume stuff?  Should resume_force_mode be safe?
(does it turn off things as necessary for reprogramming if they're
currently on at resume time?)

airlied: do you like the resume_force_mode plan, or do you want to hook
up the save/restore functions so you have an easier time at that hack
you were talking about for user-mode backporting last week?

-- 
Eric Anholt
e...@anholt.net eric.anh...@intel.com




signature.asc
Description: This is a digitally signed message part
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Patch 1/5]: DRM/I915: Add the crt save/restore function for VT switch

2009-03-06 Thread Keith Packard
On Fri, 2009-03-06 at 15:19 -0800, Eric Anholt wrote:

 Given that these functions aren't actually hooked up to anything, I'm
 not sure if there's any value here.  It sounds like we're going to go to
 using the resume_force_mode function for suspend/resume, which means
 we'd never use these.

I'm concerned that our mode setting code doesn't hit all of the same
registers that the suspend/resume code does. There are a pile of
registers which the BIOS may whack, and which will not be reset
correctly unless we save their values before the system is suspended the
first time.

Otherwise, I love the 'just set the mode' plan. Any chance we can strip
the suspend/resume code down to registers which our mode setting code
*doesn't* save/restore? Or merge suitable 'restorish' bits into the mode
setting path so that the other registers are set in the normal mode
setting path?

-- 
keith.pack...@intel.com


signature.asc
Description: This is a digitally signed message part
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Patch 1/5]: DRM/I915: Add the crt save/restore function for VT switch

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/i915: Add the crt save/restore function for VT switch
From: Zhao Yakui yakui.z...@intel.com

Add the crt save/restore function for VT switch

Signed-off-by: Zhao Yakui yakui.z...@intel.com

---
 drivers/gpu/drm/i915/intel_crt.c |   22 ++
 1 file changed, 22 insertions(+)

Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-03-03 
11:47:39.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c  2009-03-03 18:00:44.0 
+0800
@@ -61,6 +61,26 @@
I915_WRITE(ADPA, temp);
 }
 
+static void intel_crt_save(struct drm_connector *connector)
+{
+   struct drm_device *dev = connector-dev;
+   struct drm_i915_private *dev_priv = dev-dev_private;
+   u32 temp;
+
+   temp = I915_READ(ADPA);
+   dev_priv-saveADPA = temp;
+}
+
+static void intel_crt_restore(struct drm_connector *connector)
+{
+   struct drm_device *dev = connector-dev;
+   struct drm_i915_private *dev_priv = dev-dev_private;
+   u32 temp;
+
+   temp = dev_priv-saveADPA;
+   I915_WRITE(ADPA, temp);
+}
+
 static int intel_crt_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
 {
@@ -225,6 +245,8 @@
 };
 
 static const struct drm_connector_funcs intel_crt_connector_funcs = {
+   .save = intel_crt_save,
+   .restore = intel_crt_restore,
.detect = intel_crt_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = intel_crt_destroy,






--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel