Skip to contentSkip to conversation

nvidiafb: Add suspend and resume hooks

PATCH New Antonino A. Daplas 1 participant 1 message Feb 8, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 nvidiafb: Add suspend and resume hooks

Add suspend and resume hooks to make software suspend more reliable. Resuming from standby should generally work. Resuming from mem and from disk requires that the GPU is disabled. Adding these to the suspend script...

fbset -accel false -a
/* suspend here */
fbset -accel true -a

... should generally work. In addition, resuming from mem requires that the video card has to be POSTed by the BIOS or some other utility.

---

 drivers/video/nvidia/nv_accel.c |   12 ++++
 drivers/video/nvidia/nv_type.h  |    1 
 drivers/video/nvidia/nvidia.c   |  110 ++++++++++++++++++++++++++++-----------
 3 files changed, 92 insertions(+), 31 deletions(-)
drivers/video/nvidia/nv_accel.c +12 -0
index f377a29..4aefb8f 100644
@@ -300,6 +300,9 @@ int nvidiafb_sync(struct fb_info *info)
 {
 	struct nvidia_par *par = info->par;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return 0;
+
 	if (!par->lockup)
 		NVFlush(par);
 
@@ -313,6 +316,9 @@ void nvidiafb_copyarea(struct fb_info *i
 {
 	struct nvidia_par *par = info->par;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+
 	if (par->lockup)
 		return cfb_copyarea(info, region);
 
@@ -329,6 +335,9 @@ void nvidiafb_fillrect(struct fb_info *i
 	struct nvidia_par *par = info->par;
 	u32 color;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+
 	if (par->lockup)
 		return cfb_fillrect(info, rect);
 
@@ -412,6 +421,9 @@ void nvidiafb_imageblit(struct fb_info *
 {
 	struct nvidia_par *par = info->par;
 
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+
 	if (image->depth == 1 && !par->lockup)
 		nvidiafb_mono_color_expand(info, image);
 	else
drivers/video/nvidia/nv_type.h +1 -0
index e4a5b1d..acdc266 100644
@@ -129,6 +129,7 @@ struct nvidia_par {
 	int fpHeight;
 	int PanelTweak;
 	int paneltweak;
+	int pm_state;
 	u32 crtcSync_read;
 	u32 fpSyncs;
 	u32 dmaPut;
drivers/video/nvidia/nvidia.c +79 -31

153 lines not on this page · raw message

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642