diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2009-06-10 00:38:49 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-14 23:26:21 -0400 |
commit | c204ff65590837e6a9c50ca549497b4682682ec6 (patch) | |
tree | 8ba43efed25b4c7945f5e8e12b684b92e97f1a72 | |
parent | d3352c9f1e8e2f2989d9686c8aa8acb4842fe75e (diff) |
ps3fb: Tear down FB setup during cleanup
During cleanup, use L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE to tear down the setup
done by L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP.
This allows unloading and reloading of ps3fb while the sound driver keeps the
GPU open.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linux-fbdev-devel@lists.sourceforge.net
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/ps3gpu.h | 8 | ||||
-rw-r--r-- | drivers/video/ps3fb.c | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/ps3gpu.h b/arch/powerpc/include/asm/ps3gpu.h index 1037efae4a51..b2b89591907c 100644 --- a/arch/powerpc/include/asm/ps3gpu.h +++ b/arch/powerpc/include/asm/ps3gpu.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 | 31 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 |
32 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 | 32 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 |
33 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 | 33 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 |
34 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE 0x603 | ||
34 | 35 | ||
35 | #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) | 36 | #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) |
36 | 37 | ||
@@ -75,4 +76,11 @@ static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset, | |||
75 | pitch); | 76 | pitch); |
76 | } | 77 | } |
77 | 78 | ||
79 | static inline int lv1_gpu_fb_close(u64 context_handle) | ||
80 | { | ||
81 | return lv1_gpu_context_attribute(context_handle, | ||
82 | L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0, | ||
83 | 0, 0, 0); | ||
84 | } | ||
85 | |||
78 | #endif /* _ASM_POWERPC_PS3GPU_H */ | 86 | #endif /* _ASM_POWERPC_PS3GPU_H */ |
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 13c876c6e32c..1baa1c93a224 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c | |||
@@ -1123,7 +1123,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) | |||
1123 | 1123 | ||
1124 | info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core); | 1124 | info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core); |
1125 | if (!info) | 1125 | if (!info) |
1126 | goto err_context_unmap; | 1126 | goto err_context_fb_close; |
1127 | 1127 | ||
1128 | par = info->par; | 1128 | par = info->par; |
1129 | par->mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */ | 1129 | par->mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */ |
@@ -1188,6 +1188,8 @@ err_fb_dealloc: | |||
1188 | fb_dealloc_cmap(&info->cmap); | 1188 | fb_dealloc_cmap(&info->cmap); |
1189 | err_framebuffer_release: | 1189 | err_framebuffer_release: |
1190 | framebuffer_release(info); | 1190 | framebuffer_release(info); |
1191 | err_context_fb_close: | ||
1192 | lv1_gpu_fb_close(ps3fb.context_handle); | ||
1191 | err_context_unmap: | 1193 | err_context_unmap: |
1192 | lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, | 1194 | lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, |
1193 | ps3fb_videomemory.size, CBE_IOPTE_M); | 1195 | ps3fb_videomemory.size, CBE_IOPTE_M); |
@@ -1233,6 +1235,7 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) | |||
1233 | info = dev->core.driver_data = NULL; | 1235 | info = dev->core.driver_data = NULL; |
1234 | } | 1236 | } |
1235 | iounmap((u8 __force __iomem *)ps3fb.dinfo); | 1237 | iounmap((u8 __force __iomem *)ps3fb.dinfo); |
1238 | lv1_gpu_fb_close(ps3fb.context_handle); | ||
1236 | lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, | 1239 | lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, |
1237 | ps3fb_videomemory.size, CBE_IOPTE_M); | 1240 | ps3fb_videomemory.size, CBE_IOPTE_M); |
1238 | lv1_gpu_context_free(ps3fb.context_handle); | 1241 | lv1_gpu_context_free(ps3fb.context_handle); |