diff options
author | eric miao <eric.miao@marvell.com> | 2008-04-30 03:52:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:31 -0400 |
commit | 2c42dd8ebdd92ad59d9a68f88f0e20ad9f45270a (patch) | |
tree | 1013b04a3543aa1f1e1c9a2472ba15eb2e8f0cd9 /drivers/video/pxafb.h | |
parent | ce4fb7b892a6d6c6a0f87366b26fd834d2923dd7 (diff) |
pxafb: introduce "struct pxafb_dma_buff" for palette and dma descriptors
Use structure and array for palette buffer and dma descriptors to:
1. better organize code for future expansion like overlays
2. separate palette and dma descriptors from frame buffer
Signed-off-by: eric miao <eric.miao@marvell.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/pxafb.h')
-rw-r--r-- | drivers/video/pxafb.h | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h index c7c561df3b68..b777641c5e70 100644 --- a/drivers/video/pxafb.h +++ b/drivers/video/pxafb.h | |||
@@ -37,6 +37,36 @@ struct pxafb_dma_descriptor { | |||
37 | unsigned int ldcmd; | 37 | unsigned int ldcmd; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | enum { | ||
41 | PAL_NONE = -1, | ||
42 | PAL_BASE = 0, | ||
43 | PAL_OV1 = 1, | ||
44 | PAL_OV2 = 2, | ||
45 | PAL_MAX, | ||
46 | }; | ||
47 | |||
48 | enum { | ||
49 | DMA_BASE = 0, | ||
50 | DMA_UPPER = 0, | ||
51 | DMA_LOWER = 1, | ||
52 | DMA_OV1 = 1, | ||
53 | DMA_OV2_Y = 2, | ||
54 | DMA_OV2_Cb = 3, | ||
55 | DMA_OV2_Cr = 4, | ||
56 | DMA_CURSOR = 5, | ||
57 | DMA_CMD = 6, | ||
58 | DMA_MAX, | ||
59 | }; | ||
60 | |||
61 | /* maximum palette size - 256 entries, each 4 bytes long */ | ||
62 | #define PALETTE_SIZE (256 * 4) | ||
63 | |||
64 | struct pxafb_dma_buff { | ||
65 | unsigned char palette[PAL_MAX * PALETTE_SIZE]; | ||
66 | struct pxafb_dma_descriptor pal_desc[PAL_MAX]; | ||
67 | struct pxafb_dma_descriptor dma_desc[DMA_MAX]; | ||
68 | }; | ||
69 | |||
40 | struct pxafb_info { | 70 | struct pxafb_info { |
41 | struct fb_info fb; | 71 | struct fb_info fb; |
42 | struct device *dev; | 72 | struct device *dev; |
@@ -44,6 +74,10 @@ struct pxafb_info { | |||
44 | 74 | ||
45 | void __iomem *mmio_base; | 75 | void __iomem *mmio_base; |
46 | 76 | ||
77 | struct pxafb_dma_buff *dma_buff; | ||
78 | dma_addr_t dma_buff_phys; | ||
79 | dma_addr_t fdadr[DMA_MAX]; | ||
80 | |||
47 | /* | 81 | /* |
48 | * These are the addresses we mapped | 82 | * These are the addresses we mapped |
49 | * the framebuffer memory region to. | 83 | * the framebuffer memory region to. |
@@ -57,20 +91,8 @@ struct pxafb_info { | |||
57 | u_char * screen_cpu; /* virtual address of frame buffer */ | 91 | u_char * screen_cpu; /* virtual address of frame buffer */ |
58 | dma_addr_t screen_dma; /* physical address of frame buffer */ | 92 | dma_addr_t screen_dma; /* physical address of frame buffer */ |
59 | u16 * palette_cpu; /* virtual address of palette memory */ | 93 | u16 * palette_cpu; /* virtual address of palette memory */ |
60 | dma_addr_t palette_dma; /* physical address of palette memory */ | ||
61 | u_int palette_size; | 94 | u_int palette_size; |
62 | 95 | ||
63 | /* DMA descriptors */ | ||
64 | struct pxafb_dma_descriptor * dmadesc_fblow_cpu; | ||
65 | dma_addr_t dmadesc_fblow_dma; | ||
66 | struct pxafb_dma_descriptor * dmadesc_fbhigh_cpu; | ||
67 | dma_addr_t dmadesc_fbhigh_dma; | ||
68 | struct pxafb_dma_descriptor * dmadesc_palette_cpu; | ||
69 | dma_addr_t dmadesc_palette_dma; | ||
70 | |||
71 | dma_addr_t fdadr0; | ||
72 | dma_addr_t fdadr1; | ||
73 | |||
74 | u_int lccr0; | 96 | u_int lccr0; |
75 | u_int lccr3; | 97 | u_int lccr3; |
76 | u_int lccr4; | 98 | u_int lccr4; |