aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/via/accel.c16
-rw-r--r--drivers/video/via/via-core.h10
2 files changed, 26 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:
diff --git a/drivers/video/via/via-core.h b/drivers/video/via/via-core.h
index 3d03141d6074..087c562abaec 100644
--- a/drivers/video/via/via-core.h
+++ b/drivers/video/via/via-core.h
@@ -78,6 +78,10 @@ struct viafb_dev {
78 unsigned long fbmem_start; 78 unsigned long fbmem_start;
79 long fbmem_len; 79 long fbmem_len;
80 void __iomem *fbmem; 80 void __iomem *fbmem;
81#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
82 long camera_fbmem_offset;
83 long camera_fbmem_size;
84#endif
81 /* 85 /*
82 * The MMIO region for device registers. 86 * The MMIO region for device registers.
83 */ 87 */
@@ -160,4 +164,10 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);
160#define VDMA_DPRH0 0xe38 164#define VDMA_DPRH0 0xe38
161#define VDMA_PMR0 (0xe00 + 0x134) /* Pitch mode */ 165#define VDMA_PMR0 (0xe00 + 0x134) /* Pitch mode */
162 166
167/*
168 * Useful stuff that probably belongs somewhere global.
169 */
170#define VGA_WIDTH 640
171#define VGA_HEIGHT 480
172
163#endif /* __VIA_CORE_H__ */ 173#endif /* __VIA_CORE_H__ */