Skip to contentSkip to conversation

gxfb: add power management functionality

PATCH New Andres Salomon 1 participant 2 messages Mar 11, 2008 – Mar 25, 2008 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 5/6 gxfb: add power management functionality

This adds the ability to suspend/resume the gxfb driver, which includes:
- The addition of a Graphics Processor register table in gxfb.h, and associated GP handling.
- Register and palette saving code; registers are stored in gxfb_par. A few MSR values are saved as well.
- gx_powerup and gx_powerdown functions which restore/save registers and enable/disable graphic engines.
- gxfb_suspend/gxfb_resume

Originally based on a patch by Jordan Crouse.

---
 drivers/video/geode/Makefile     |    2 +-
 drivers/video/geode/gxfb.h       |   72 ++++++++++-
 drivers/video/geode/gxfb_core.c  |   63 +++++++++
 drivers/video/geode/suspend_gx.c |  267 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 402 insertions(+), 2 deletions(-)
 create mode 100644 drivers/video/geode/suspend_gx.c
drivers/video/geode/Makefile +1 -1
index 957304b..5c98da1 100644
@@ -5,5 +5,5 @@ obj-$(CONFIG_FB_GEODE_GX)  += gxfb.o
 obj-$(CONFIG_FB_GEODE_LX)  += lxfb.o
 
 gx1fb-objs := gx1fb_core.o display_gx1.o video_cs5530.o
-gxfb-objs  := gxfb_core.o display_gx.o video_gx.o
+gxfb-objs  := gxfb_core.o display_gx.o video_gx.o suspend_gx.o
 lxfb-objs  := lxfb_core.o lxfb_ops.o
drivers/video/geode/gxfb.h +71 -1

100 lines not on this page · raw message

drivers/video/geode/gxfb_core.c +63 -0

99 lines not on this page · raw message

drivers/video/geode/suspend_gx.c new file +267 -0

267 lines not on this page · raw message

Signature · 7 lines
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#1 lore raw

PATCH 1/1 gxfb: two suspend/resume fixes

Hi Andrew,

Can you please also add/merge this patch as well? It fixes bugs in gxfb-add-power-management-functionality.patch (currently in your tree).

Two suspend/resume fixes:
- we weren't saving/restoring the palette correctly; I wasn't setting PAL_ADDRESS correctly.
- the original GP restore code had an off-by-one bug that I happily reproduced in this code. This fixes that, which fixes the RASTER_MODE register not getting set.

And drop an unnecessary comment.

---
 drivers/video/geode/suspend_gx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/video/geode/suspend_gx.c +4 -4
index bc1f2b9..9aff32e 100644
@@ -39,7 +39,7 @@ static void gx_save_regs(struct gxfb_par *par)
 	memcpy(par->fp, par->vid_regs + VP_FP_START, sizeof(par->fp));
 
 	/* save the palette */
-	write_gp(par, DC_PAL_ADDRESS, 0);
+	write_dc(par, DC_PAL_ADDRESS, 0);
 	for (i = 0; i < ARRAY_SIZE(par->pal); i++)
 		par->pal[i] = read_dc(par, DC_PAL_DATA);
 }
@@ -73,10 +73,10 @@ static void gx_restore_gfx_proc(struct gxfb_par *par)
 
 	for (i = 0; i < ARRAY_SIZE(par->gp); i++) {
 		switch (i) {
-		case GP_RASTER_MODE:
 		case GP_VECTOR_MODE:
 		case GP_BLT_MODE:
 		case GP_BLT_STATUS:
+		case GP_HST_SRC:
 			/* don't restore these registers */
 			break;
 		default:
@@ -130,7 +130,7 @@ static void gx_restore_display_ctlr(struct gxfb_par *par)
 	}
 
 	/* restore the palette */
-	write_gp(par, DC_PAL_ADDRESS, 0);
+	write_dc(par, DC_PAL_ADDRESS, 0);
 	for (i = 0; i < ARRAY_SIZE(par->pal); i++)
 		write_dc(par, DC_PAL_DATA, par->pal[i]);
 }
@@ -163,7 +163,7 @@ static void gx_restore_video_proc(struct gxfb_par *par)
 		case VP_RSVD_3:
 		case VP_CRC32:
 		case VP_AWT:
-		case VP_VTM:    /* this is r/w, shouldn't we restore?  -dil */
+		case VP_VTM:
 			/* don't restore these registers */
 			break;
 		default:
Signature · 7 lines
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/