1 From a107c9c4bd642fd5044275ffcb00a8e20da481c7 Mon Sep 17 00:00:00 2001
2 From: Vaibhav Hiremath <hvaibhav@ti.com>
3 Date: Tue, 10 Aug 2010 20:05:51 +0530
4 Subject: [PATCH 5/9] Revert "Revert "OMAP: DSS2: FIFI UNDERFLOW issue fixed""
6 This reverts commit b2c74dc43741d8d824e5439f6a82c0a5aa5d1c80.
8 There was small bug in the GFX UNDERFLOW patch, so I had reverted it and now
9 since I have fix for the same so I am again commiting the fix which reverts the
10 original patch with fix.
12 Original commit - 4b58d194fd8f5a1c68803eb326e9a71621571696.
13 Revert commit - b2c74dc43741d8d824e5439f6a82c0a5aa5d1c80
15 drivers/video/omap2/omapfb/omapfb-main.c | 83 ++++++++++++++++++++----------
16 1 files changed, 55 insertions(+), 28 deletions(-)
18 diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
19 index ef29983..7f47a34 100644
20 --- a/drivers/video/omap2/omapfb/omapfb-main.c
21 +++ b/drivers/video/omap2/omapfb/omapfb-main.c
22 @@ -182,6 +182,11 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
23 static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi, int rot)
25 if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
26 + if (rot == FB_ROTATE_CW)
27 + rot = FB_ROTATE_CCW;
28 + else if (rot == FB_ROTATE_CCW)
31 return ofbi->region.vrfb.paddr[rot]
32 + omapfb_get_vrfb_offset(ofbi, rot);
34 @@ -189,20 +194,32 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi, int rot)
38 -static u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
39 +static u32 omapfb_get_region_paddr(struct omapfb_info *ofbi, int rot)
41 - if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
42 - return ofbi->region.vrfb.paddr[0];
44 + if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
45 + if (rot == FB_ROTATE_CW)
46 + rot = FB_ROTATE_CCW;
47 + else if (rot == FB_ROTATE_CCW)
50 + return ofbi->region.vrfb.paddr[rot];
52 return ofbi->region.paddr;
56 -static void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
57 +static void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi, int rot)
59 - if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
60 - return ofbi->region.vrfb.vaddr[0];
62 + if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
63 + if (rot == FB_ROTATE_CW)
64 + rot = FB_ROTATE_CCW;
65 + else if (rot == FB_ROTATE_CCW)
68 + return ofbi->region.vrfb.vaddr[rot];
70 return ofbi->region.vaddr;
74 static struct omapfb_colormode omapfb_colormodes[] = {
75 @@ -501,7 +518,7 @@ static int setup_vrfb_rotation(struct fb_info *fbi)
78 enum omap_color_mode mode;
80 + int r, rotation = var->rotate;
83 if (!rg->size || ofbi->rotation_type != OMAP_DSS_ROT_VRFB)
84 @@ -509,6 +526,11 @@ static int setup_vrfb_rotation(struct fb_info *fbi)
86 DBG("setup_vrfb_rotation\n");
88 + if (rotation == FB_ROTATE_CW)
89 + rotation = FB_ROTATE_CCW;
90 + else if (rotation == FB_ROTATE_CCW)
91 + rotation = FB_ROTATE_CW;
93 r = fb_mode_to_dss_mode(var, &mode);
96 @@ -532,32 +554,35 @@ static int setup_vrfb_rotation(struct fb_info *fbi)
97 vrfb->yres != var->yres_virtual)
100 - if (vrfb->vaddr[0] && reconf) {
101 + if (vrfb->vaddr[rotation] && reconf) {
102 fbi->screen_base = NULL;
105 - iounmap(vrfb->vaddr[0]);
106 - vrfb->vaddr[0] = NULL;
107 + iounmap(vrfb->vaddr[rotation]);
108 + vrfb->vaddr[rotation] = NULL;
109 DBG("setup_vrfb_rotation: reset fb\n");
112 - if (vrfb->vaddr[0])
113 + if (vrfb->vaddr[rotation])
116 - omap_vrfb_setup(&rg->vrfb, rg->paddr,
119 - bytespp, yuv_mode);
120 + if (rotation == FB_ROTATE_CW || rotation == FB_ROTATE_CCW)
121 + omap_vrfb_setup(&rg->vrfb, rg->paddr,
122 + var->yres_virtual, var->xres_virtual,
123 + bytespp, yuv_mode);
125 + omap_vrfb_setup(&rg->vrfb, rg->paddr,
126 + var->xres_virtual, var->yres_virtual,
127 + bytespp, yuv_mode);
129 - /* Now one can ioremap the 0 angle view */
130 - r = omap_vrfb_map_angle(vrfb, var->yres_virtual, 0);
131 + /* Now one can ioremap the rotation angle view */
132 + r = omap_vrfb_map_angle(vrfb, var->yres_virtual, rotation);
136 /* used by open/write in fbmem.c */
137 - fbi->screen_base = ofbi->region.vrfb.vaddr[0];
138 + fbi->screen_base = ofbi->region.vrfb.vaddr[rotation];
140 - fix->smem_start = ofbi->region.vrfb.paddr[0];
141 + fix->smem_start = ofbi->region.vrfb.paddr[rotation];
143 switch (var->nonstd) {
144 case OMAPFB_COLOR_YUV422:
145 @@ -601,7 +626,8 @@ void set_fb_fix(struct fb_info *fbi)
148 /* used by open/write in fbmem.c */
149 - fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
150 + fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi,
153 /* used by mmap in fbmem.c */
154 if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
155 @@ -624,7 +650,7 @@ void set_fb_fix(struct fb_info *fbi)
156 fix->smem_len = rg->size;
159 - fix->smem_start = omapfb_get_region_paddr(ofbi);
160 + fix->smem_start = omapfb_get_region_paddr(ofbi, var->rotate);
162 fix->type = FB_TYPE_PACKED_PIXELS;
164 @@ -860,11 +886,11 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
167 if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
168 - data_start_p = omapfb_get_region_rot_paddr(ofbi, rotation);
169 + data_start_p = omapfb_get_region_rot_paddr(ofbi, 0);
172 - data_start_p = omapfb_get_region_paddr(ofbi);
173 - data_start_v = omapfb_get_region_vaddr(ofbi);
174 + data_start_p = omapfb_get_region_paddr(ofbi, 0);
175 + data_start_v = omapfb_get_region_vaddr(ofbi, 0);
178 if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
179 @@ -1076,6 +1102,7 @@ static struct vm_operations_struct mmap_user_ops = {
180 static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
182 struct omapfb_info *ofbi = FB2OFB(fbi);
183 + struct fb_var_screeninfo *var = &fbi->var;
184 struct fb_fix_screeninfo *fix = &fbi->fix;
187 @@ -1087,7 +1114,7 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
189 off = vma->vm_pgoff << PAGE_SHIFT;
191 - start = omapfb_get_region_paddr(ofbi);
192 + start = omapfb_get_region_paddr(ofbi, var->rotate);