aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-11-28 19:21:11 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-29 12:24:51 -0500
commitee592a5bd5180cc1ffaf5acd7bf1e91e0d854a08 (patch)
tree8387d440d834db1fc995b376b1f1f209b18a67c4 /drivers/video
parent248285501ea251379dd449316bf5af78362ae638 (diff)
ps3fb: video memory size cleanups
- Limit video memory size to avoid crossing a 256 MiB boundary in IOIF space. - Pass the actual amount of video memory used to lv1_gpu_memory_allocate(). Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/ps3fb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 75836aa83191..9c56c492a693 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -51,7 +51,6 @@
51#define L1GPU_DISPLAY_SYNC_HSYNC 1 51#define L1GPU_DISPLAY_SYNC_HSYNC 1
52#define L1GPU_DISPLAY_SYNC_VSYNC 2 52#define L1GPU_DISPLAY_SYNC_VSYNC 2
53 53
54#define DDR_SIZE (0) /* used no ddr */
55#define GPU_CMD_BUF_SIZE (64 * 1024) 54#define GPU_CMD_BUF_SIZE (64 * 1024)
56#define GPU_IOIF (0x0d000000UL) 55#define GPU_IOIF (0x0d000000UL)
57#define GPU_ALIGN_UP(x) _ALIGN_UP((x), 64) 56#define GPU_ALIGN_UP(x) _ALIGN_UP((x), 64)
@@ -1060,6 +1059,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
1060 u64 xdr_lpar; 1059 u64 xdr_lpar;
1061 int status, res_index; 1060 int status, res_index;
1062 struct task_struct *task; 1061 struct task_struct *task;
1062 unsigned long max_ps3fb_size;
1063 1063
1064 status = ps3_open_hv_device(dev); 1064 status = ps3_open_hv_device(dev);
1065 if (status) { 1065 if (status) {
@@ -1085,8 +1085,15 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
1085 1085
1086 ps3fb_set_sync(&dev->core); 1086 ps3fb_set_sync(&dev->core);
1087 1087
1088 max_ps3fb_size = _ALIGN_UP(GPU_IOIF, 256*1024*1024) - GPU_IOIF;
1089 if (ps3fb_videomemory.size > max_ps3fb_size) {
1090 dev_info(&dev->core, "Limiting ps3fb mem size to %lu bytes\n",
1091 max_ps3fb_size);
1092 ps3fb_videomemory.size = max_ps3fb_size;
1093 }
1094
1088 /* get gpu context handle */ 1095 /* get gpu context handle */
1089 status = lv1_gpu_memory_allocate(DDR_SIZE, 0, 0, 0, 0, 1096 status = lv1_gpu_memory_allocate(ps3fb_videomemory.size, 0, 0, 0, 0,
1090 &ps3fb.memory_handle, &ddr_lpar); 1097 &ps3fb.memory_handle, &ddr_lpar);
1091 if (status) { 1098 if (status) {
1092 dev_err(&dev->core, "%s: lv1_gpu_memory_allocate failed: %d\n", 1099 dev_err(&dev->core, "%s: lv1_gpu_memory_allocate failed: %d\n",