diff options
author | Eric Miao <ycmiao@ycmiao-hp520.(none)> | 2008-12-23 04:49:43 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-29 05:00:04 -0500 |
commit | 198fc108ee4c2cd3f08954eae6a819c81c03214b (patch) | |
tree | 153fdb793142ef5ee8e0ab6198dcde32866b062c /drivers/video/pxafb.h | |
parent | 3f16ff608a75c8bf28c8cafed12e076d67a3602a (diff) |
[ARM] pxafb: add support for overlay1 and overlay2 as framebuffer devices
PXA27x and later processors support overlay1 and overlay2 on-top of the
base framebuffer (although under-neath the base is also possible). They
support palette and no-palette RGB formats, as well as YUV formats (only
available on overlay2). These overlays have dedicated DMA channels and
behave in a similar way as a framebuffer.
This heavily simplified and re-structured work is based on the original
pxafb_overlay.c (which is pending for mainline merge for a long time).
The major problems with this pxafb_overlay.c are (if you are interested
in the history):
1. heavily redundant (the control logics for overlay1 and overlay2 are
actually identical except for some small operations, which are now
abstracted into a 'pxafb_layer_ops' structure)
2. a lot of useless and un-tested code (two workarounds which are now
fixed on mature silicons)
3. cursorfb is actually useless, hardware cursor should not be used
this way, and the code was actually un-tested for a long time.
The code in this patch should be self-explanatory, I tried to add minimum
comments. As said, this is basically simplified, there are several things
still on the pending list:
1. palette mode is un-supported and un-tested (although re-using the
palette code of the base framebuffer is actually very easy now with
previous clean-up patches)
2. fb_pan_display for overlay(s) is un-supported
3. the base framebuffer can actually be abstracted by 'pxafb_layer' as
well, which will help further re-use of the code and keep a better
and consistent structure. (This is the reason I named it 'pxafb_layer'
instead of 'pxafb_overlay' or something alike)
See Documentation/fb/pxafb.txt for additional usage information.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Eric Miao <ycmiao@ycmiao-hp520.(none)>
Diffstat (limited to 'drivers/video/pxafb.h')
-rw-r--r-- | drivers/video/pxafb.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h index ae3cbc1ca64f..2353521c5c8c 100644 --- a/drivers/video/pxafb.h +++ b/drivers/video/pxafb.h | |||
@@ -64,6 +64,47 @@ struct pxafb_dma_buff { | |||
64 | struct pxafb_dma_descriptor dma_desc[DMA_MAX * 2]; | 64 | struct pxafb_dma_descriptor dma_desc[DMA_MAX * 2]; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | enum { | ||
68 | OVERLAY1, | ||
69 | OVERLAY2, | ||
70 | }; | ||
71 | |||
72 | enum { | ||
73 | OVERLAY_FORMAT_RGB = 0, | ||
74 | OVERLAY_FORMAT_YUV444_PACKED, | ||
75 | OVERLAY_FORMAT_YUV444_PLANAR, | ||
76 | OVERLAY_FORMAT_YUV422_PLANAR, | ||
77 | OVERLAY_FORMAT_YUV420_PLANAR, | ||
78 | }; | ||
79 | |||
80 | #define NONSTD_TO_XPOS(x) (((x) >> 0) & 0x3ff) | ||
81 | #define NONSTD_TO_YPOS(x) (((x) >> 10) & 0x3ff) | ||
82 | #define NONSTD_TO_PFOR(x) (((x) >> 20) & 0x7) | ||
83 | |||
84 | struct pxafb_layer; | ||
85 | |||
86 | struct pxafb_layer_ops { | ||
87 | void (*enable)(struct pxafb_layer *); | ||
88 | void (*disable)(struct pxafb_layer *); | ||
89 | void (*setup)(struct pxafb_layer *); | ||
90 | }; | ||
91 | |||
92 | struct pxafb_layer { | ||
93 | struct fb_info fb; | ||
94 | int id; | ||
95 | atomic_t usage; | ||
96 | uint32_t control[2]; | ||
97 | |||
98 | struct pxafb_layer_ops *ops; | ||
99 | |||
100 | void __iomem *video_mem; | ||
101 | unsigned long video_mem_phys; | ||
102 | size_t video_mem_size; | ||
103 | struct completion branch_done; | ||
104 | |||
105 | struct pxafb_info *fbi; | ||
106 | }; | ||
107 | |||
67 | struct pxafb_info { | 108 | struct pxafb_info { |
68 | struct fb_info fb; | 109 | struct fb_info fb; |
69 | struct device *dev; | 110 | struct device *dev; |
@@ -114,6 +155,10 @@ struct pxafb_info { | |||
114 | struct task_struct *smart_thread; | 155 | struct task_struct *smart_thread; |
115 | #endif | 156 | #endif |
116 | 157 | ||
158 | #ifdef CONFIG_FB_PXA_OVERLAY | ||
159 | struct pxafb_layer overlay[2]; | ||
160 | #endif | ||
161 | |||
117 | #ifdef CONFIG_CPU_FREQ | 162 | #ifdef CONFIG_CPU_FREQ |
118 | struct notifier_block freq_transition; | 163 | struct notifier_block freq_transition; |
119 | struct notifier_block freq_policy; | 164 | struct notifier_block freq_policy; |