Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Benjamin Herrenschmidt
c204ff65 d3352c9f

+12 -1
+8
arch/powerpc/include/asm/ps3gpu.h
··· 31 31 #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 32 32 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 33 33 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 34 + #define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE 0x603 34 35 35 36 #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) 36 37 ··· 74 73 L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, 75 74 ddr_offset, ioif_offset, sync_width, 76 75 pitch); 76 + } 77 + 78 + static inline int lv1_gpu_fb_close(u64 context_handle) 79 + { 80 + return lv1_gpu_context_attribute(context_handle, 81 + L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0, 82 + 0, 0, 0); 77 83 } 78 84 79 85 #endif /* _ASM_POWERPC_PS3GPU_H */
+4 -1
drivers/video/ps3fb.c
··· 1123 1123 1124 1124 info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core); 1125 1125 if (!info) 1126 - goto err_context_unmap; 1126 + goto err_context_fb_close; 1127 1127 1128 1128 par = info->par; 1129 1129 par->mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */ ··· 1188 1188 fb_dealloc_cmap(&info->cmap); 1189 1189 err_framebuffer_release: 1190 1190 framebuffer_release(info); 1191 + err_context_fb_close: 1192 + lv1_gpu_fb_close(ps3fb.context_handle); 1191 1193 err_context_unmap: 1192 1194 lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, 1193 1195 ps3fb_videomemory.size, CBE_IOPTE_M); ··· 1235 1233 info = dev->core.driver_data = NULL; 1236 1234 } 1237 1235 iounmap((u8 __force __iomem *)ps3fb.dinfo); 1236 + lv1_gpu_fb_close(ps3fb.context_handle); 1238 1237 lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar, 1239 1238 ps3fb_videomemory.size, CBE_IOPTE_M); 1240 1239 lv1_gpu_context_free(ps3fb.context_handle);