aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/accel.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2010-04-23 12:31:13 -0400
committerJonathan Corbet <corbet@lwn.net>2010-05-07 19:17:38 -0400
commitc2b12cd496bbe5eff6a48bc669fe6b0c56f2b3d9 (patch)
tree06d867d54adad9b8b540d2885a85bb0e3ed6e592 /drivers/video/via/accel.c
parent3d28eb42c52a799c806082e6d856f634ed1db902 (diff)
viafb: Reserve framebuffer memory for the upcoming camera driver
The camera engine captures to framebuffer memory, so we need to set some aside for that purpose. There is no proper memory allocator for fbmem; instead, accel.c just trims some space off the top. Alas, without creating that proper memory allocator, the only way to make this work is to hack it into the same bit of code in accel.c. The allocation must happen *after* the others (some code, including user-space XV stuff, makes assumptions on where the cursor space is), and before the rest of the framebuffer is set up. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/video/via/accel.c')
-rw-r--r--drivers/video/via/accel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c
index e77746857c8f..189aba41f9b9 100644
--- a/drivers/video/via/accel.c
+++ b/drivers/video/via/accel.c
@@ -370,6 +370,22 @@ int viafb_init_engine(struct fb_info *info)
370 viapar->shared->vq_vram_addr = viapar->fbmem_free; 370 viapar->shared->vq_vram_addr = viapar->fbmem_free;
371 viapar->fbmem_used += VQ_SIZE; 371 viapar->fbmem_used += VQ_SIZE;
372 372
373#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
374 /*
375 * Set aside a chunk of framebuffer memory for the camera
376 * driver. Someday this driver probably needs a proper allocator
377 * for fbmem; for now, we just have to do this before the
378 * framebuffer initializes itself.
379 *
380 * As for the size: the engine can handle three frames,
381 * 16 bits deep, up to VGA resolution.
382 */
383 viapar->shared->vdev->camera_fbmem_size = 3*VGA_HEIGHT*VGA_WIDTH*2;
384 viapar->fbmem_free -= viapar->shared->vdev->camera_fbmem_size;
385 viapar->fbmem_used += viapar->shared->vdev->camera_fbmem_size;
386 viapar->shared->vdev->camera_fbmem_offset = viapar->fbmem_free;
387#endif
388
373 /* Init AGP and VQ regs */ 389 /* Init AGP and VQ regs */
374 switch (chip_name) { 390 switch (chip_name) {
375 case UNICHROME_K8M890: 391 case UNICHROME_K8M890: