summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch41
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch32
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch31
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch33
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch325
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch272
-rw-r--r--meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb33
7 files changed, 767 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
new file mode 100644
index 0000000000..9fb01d438a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
@@ -0,0 +1,41 @@
1From 8fb7d0f99d4afbb574b30cb4f1e66a8f89d94ad5 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 26 Jan 2011 12:04:36 +0100
4Subject: [PATCH 1/6] Revert "Set a large CRTC upper limit to not prune larger
5 resolutions"
6
7Picture is garbled after switching resolutions, so revert it.
8Virtual size too big, revert the commit 9c4d7592dcb7dc20a48a6f941d9d94bd73d34153.
9
10Upstream-Status: Pending
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 src/omapfb-crtc.c | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
16
17diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
18index 9aaa52f..cbeff35 100644
19--- a/src/omapfb-crtc.c
20+++ b/src/omapfb-crtc.c
21@@ -190,13 +190,13 @@ OMAPFBCRTCInit(ScrnInfoPtr pScrn)
22 * In practise, this doesn't seem to be supported.
23 * (no way to setup the overlay offset/base address)
24 */
25- /* FIXME: figure out what makes sense here. A known max resolution?
26- * framebuffer size?
27- */
28 xf86CrtcSetSizeRange(pScrn,
29- 8, 8, 2048, 2048);
30+ 8, 8,
31+ ofb->state_info.xres_virtual,
32+ ofb->state_info.yres_virtual);
33
34 ofb->crtc = xf86CrtcCreate(pScrn, &OMAPFBCrtcFuncs);
35+
36 }
37
38
39--
401.8.0
41
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
new file mode 100644
index 0000000000..683a989832
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
@@ -0,0 +1,32 @@
1From 855c333ac0d16350f895f1d1b9391e9cbb0b6db4 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 26 Jan 2011 13:27:20 +0100
4Subject: [PATCH 2/6] Revert "Set virtual size when configuring framebuffer"
5
6Virtual size too big, so revert it.
7
8This reverts commit 2653ef07883fbd1a5e7025f9300cf89b79ba429a.
9
10Upstream-Status: Pending
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 src/omapfb-crtc.c | 2 --
15 1 file changed, 2 deletions(-)
16
17diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
18index cbeff35..9655db2 100644
19--- a/src/omapfb-crtc.c
20+++ b/src/omapfb-crtc.c
21@@ -98,8 +98,6 @@ OMAPFBCrtcCommitChangeMode (xf86CrtcPtr crtc)
22 v = ofb->state_info;
23 v.xres = mode->HDisplay;
24 v.yres = mode->VDisplay;
25- v.xres_virtual = crtc->scrn->virtualX;
26- v.yres_virtual = crtc->scrn->virtualY;
27 v.activate = FB_ACTIVATE_NOW;
28 v.pixclock = KHZ2PICOS(mode->Clock ? mode->Clock : 56000);
29 v.left_margin = mode->HTotal - mode->HSyncEnd;
30--
311.8.0
32
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
new file mode 100644
index 0000000000..67ea7c1a5f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
@@ -0,0 +1,31 @@
1From 252f44c072d3447a32127fc9afe5d0d40f3c510e Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 26 Jan 2011 13:20:20 +0100
4Subject: [PATCH 3/6] force 'plain' mode
5
6The new DSS mode breaks XV, so force plain mode
7
8Upstream-Status: Pending
9
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12---
13 src/omapfb-driver.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
17index 018e040..48aa09c 100644
18--- a/src/omapfb-driver.c
19+++ b/src/omapfb-driver.c
20@@ -326,7 +326,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
21 OMAPFBProbeController(ofb->ctrl_name);
22
23 /* Do we have the DSS kernel API? */
24- if (stat(SYSFS_DSS_DIR, &st) == 0) {
25+ if (0) { //stat(SYSFS_DSS_DIR, &st) == 0) {
26 ofb->dss = TRUE;
27 } else {
28 ofb->dss = FALSE;
29--
301.8.0
31
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
new file mode 100644
index 0000000000..b0ac9a44c8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
@@ -0,0 +1,33 @@
1From cfa46b67f59115f6d8ef9414af60380749ff3eb3 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 26 Jan 2011 13:21:12 +0100
4Subject: [PATCH 4/6] blacklist tv out
5
6The tv-out gets added last and the driver tries to reconfigure dvi to TV resolutions, which fails. so blacklist it
7
8Upstream-Status: Pending
9
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12---
13 src/omapfb-output-dss.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/omapfb-output-dss.c b/src/omapfb-output-dss.c
17index 6cc52de..83cb711 100644
18--- a/src/omapfb-output-dss.c
19+++ b/src/omapfb-output-dss.c
20@@ -205,6 +205,10 @@ OMAPFBDSSOutputDetect (xf86OutputPtr output)
21 if(ofb->timings[idx][0] == '\0')
22 return XF86OutputStatusDisconnected;
23
24+ // Hack to disable the tv out
25+ if (strncmp(output->name, "tv", 2) == 0)
26+ return XF86OutputStatusDisconnected;
27+
28 return XF86OutputStatusConnected;
29 }
30
31--
321.8.0
33
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
new file mode 100644
index 0000000000..67b284023d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
@@ -0,0 +1,325 @@
1From 8b1f697a60e35ab82fffdabfaefdb45e9a9df379 Mon Sep 17 00:00:00 2001
2From: Eino-Ville Talvala <talvala@stanford.edu>
3Date: Tue, 23 Aug 2011 18:37:01 +0200
4Subject: [PATCH 5/6] Attempt to fix VRFB
5
6Upstream-Status: Pending
7
8http://dominion.thruhere.net/git/cgit.cgi/xf86-video-omapfb/commit/?h=koen/fixups&id=6833fc9f795265e4943d248103fbaf3463b515d6
9
10Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12---
13 src/image-format-conversions.c | 4 +--
14 src/image-format-conversions.h | 2 +-
15 src/omapfb-driver.c | 28 +++++++++++++---
16 src/omapfb-xv-blizzard.c | 1 +
17 src/omapfb-xv-generic.c | 72 +++++++++++++++++++++++++++++++++---------
18 src/omapfb-xv.c | 3 ++
19 6 files changed, 88 insertions(+), 22 deletions(-)
20
21diff --git a/src/image-format-conversions.c b/src/image-format-conversions.c
22index dcefa9b..d43427d 100644
23--- a/src/image-format-conversions.c
24+++ b/src/image-format-conversions.c
25@@ -38,13 +38,13 @@
26 #include "image-format-conversions.h"
27
28 /* Basic line-based copy for packed formats */
29-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest)
30+void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest)
31 {
32 int i;
33 int len = w * 2;
34 for (i = 0; i < h; i++)
35 {
36- memcpy(dest + i * len, src + i * stride, len);
37+ memcpy(dest + i * dst_stride, src + i * src_stride, len);
38 }
39 }
40
41diff --git a/src/image-format-conversions.h b/src/image-format-conversions.h
42index 584896a..ba7caf2 100644
43--- a/src/image-format-conversions.h
44+++ b/src/image-format-conversions.h
45@@ -27,7 +27,7 @@
46 #include <stdint.h>
47
48 /* Basic line-based copy for packed formats */
49-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest);
50+void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest);
51
52 /* Basic C implementation of YV12/I420 to UYVY conversion */
53 void uv12_to_uyvy(int w, int h, int y_pitch, int uv_pitch, uint8_t *y_p, uint8_t *u_p, uint8_t *v_p, uint8_t *dest);
54diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
55index 48aa09c..07989f5 100644
56--- a/src/omapfb-driver.c
57+++ b/src/omapfb-driver.c
58@@ -66,6 +66,7 @@
59 #define OMAPFB_VERSION 1000
60 #define OMAPFB_DRIVER_NAME "OMAPFB"
61 #define OMAPFB_NAME "omapfb"
62+#define ENFORCE_MODES
63
64 static Bool OMAPFBProbe(DriverPtr drv, int flags);
65 static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
66@@ -105,11 +106,13 @@ static SymTabRec OMAPFBChipsets[] = {
67 typedef enum {
68 OPTION_ACCELMETHOD,
69 OPTION_FB,
70+ OPTION_ROTATE,
71 } FBDevOpts;
72
73 static const OptionInfoRec OMAPFBOptions[] = {
74 { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
75 { OPTION_FB, "fb", OPTV_STRING, {0}, FALSE },
76+ { OPTION_ROTATE, "rotation", OPTV_STRING, {0}, FALSE },
77 { -1, NULL, OPTV_NONE, {0}, FALSE }
78 };
79
80@@ -286,6 +289,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
81 {
82 OMAPFBPtr ofb;
83 EntityInfoPtr pEnt;
84+ char *rotate;
85 rgb zeros = { 0, 0, 0 };
86 struct stat st;
87
88@@ -379,6 +383,8 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
89 pScrn->progClock = TRUE;
90 pScrn->chipset = "omapfb";
91
92+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Rotate test version 0.02\n");
93+
94 /* Start with configured virtual size */
95 pScrn->virtualX = pScrn->display->virtualX;
96 pScrn->virtualY = pScrn->display->virtualY;
97@@ -496,12 +502,21 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
98 ofb->CloseScreen = pScreen->CloseScreen;
99 pScreen->CloseScreen = OMAPFBCloseScreen;
100
101+ /* Enforce the default mode (this is silly I guess) */
102+#ifdef ENFORCE_MODES
103+ //xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enforcing modes\n");
104+ //set_mode(ofb, &ofb->default_mode);
105+ //pScrn->displayWidth = ofb->fixed_info.line_length /
106+ // (ofb->state_info.bits_per_pixel>>3); //ofb->state_info.xres;
107+#endif
108+
109 /* Map our framebuffer memory */
110+ ofb->mem_info.size = ofb->fixed_info.line_length * ofb->state_info.yres;
111 ofb->fb = mmap (NULL, ofb->mem_info.size,
112 PROT_READ | PROT_WRITE, MAP_SHARED,
113 ofb->fd, 0);
114- if (ofb->fb == NULL) {
115- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed\n");
116+ if (ofb->fb == MAP_FAILED) {
117+ xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
118 return FALSE;
119 }
120
121@@ -578,8 +593,13 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
122 } else if (!ofb->dss) {
123
124 ofb->plane_info.enabled = 1;
125- ofb->plane_info.out_width = ofb->state_info.xres;
126- ofb->plane_info.out_height = ofb->state_info.yres;
127+ if (ofb->state_info.rotate == 0 || ofb->state_info.rotate == 2) {
128+ ofb->plane_info.out_width = ofb->state_info.xres;
129+ ofb->plane_info.out_height = ofb->state_info.yres;
130+ } else {
131+ ofb->plane_info.out_width = ofb->state_info.yres;
132+ ofb->plane_info.out_height = ofb->state_info.xres;
133+ }
134
135 if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
136 xf86DrvMsg(scrnIndex, X_ERROR,
137diff --git a/src/omapfb-xv-blizzard.c b/src/omapfb-xv-blizzard.c
138index 406ffc6..b71d2aa 100644
139--- a/src/omapfb-xv-blizzard.c
140+++ b/src/omapfb-xv-blizzard.c
141@@ -220,6 +220,7 @@ int OMAPFBXVPutImageBlizzard (ScrnInfoPtr pScrn,
142 packed_line_copy(src_w & ~3,
143 src_h & ~3,
144 ((src_w + 1) & ~1) * 2,
145+ ofb->port->fixed_info.line_length,
146 (uint8_t*)buf,
147 (uint8_t*)ofb->port->fb);
148 break;
149diff --git a/src/omapfb-xv-generic.c b/src/omapfb-xv-generic.c
150index e6f89fe..b33f344 100644
151--- a/src/omapfb-xv-generic.c
152+++ b/src/omapfb-xv-generic.c
153@@ -62,7 +62,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
154 {
155 OMAPFBPtr ofb = OMAPFB(pScrn);
156
157- /* The memory size is already set in OMAPFBXVQueryImageAttributes */
158+ /* The memory size is already set before we get here */
159 if (ioctl(ofb->port->fd, OMAPFB_SETUP_MEM, &ofb->port->mem_info) != 0) {
160 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
161 "Failed to allocate video plane memory\n");
162@@ -73,19 +73,20 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
163 ofb->port->fb = mmap (NULL, ofb->port->mem_info.size,
164 PROT_READ | PROT_WRITE, MAP_SHARED,
165 ofb->port->fd, 0);
166- if (ofb->port->fb == NULL) {
167+ if (ofb->port->fb == MAP_FAILED) {
168 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
169 "Mapping video memory failed\n");
170 return XvBadAlloc;
171 }
172
173 /* Update the state info */
174+ /* Let's not - it's bad
175 if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
176 {
177 xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
178 return XvBadAlloc;
179 }
180-
181+ */
182 return Success;
183 }
184
185@@ -93,6 +94,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
186 int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
187 {
188 OMAPFBPtr ofb = OMAPFB(pScrn);
189+ int ret;
190
191 if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
192 {
193@@ -104,6 +106,31 @@ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
194 xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
195 return XvBadAlloc;
196 }
197+ /* Changing rotation/nonstd flags can change the fixed info! */
198+ if (ioctl (ofb->port->fd, FBIOGET_FSCREENINFO, &ofb->port->fixed_info))
199+ {
200+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
201+ return XvBadAlloc;
202+ }
203+ /* Correct fixed info requires recalculation of needed memory */
204+ ofb->port->mem_info.size = ofb->port->fixed_info.line_length * ofb->port->state_info.yres;
205+
206+ /* Allocate buffer memory */
207+ ret = OMAPXVAllocPlane(pScrn);
208+ if (ret != Success)
209+ return ret;
210+
211+ /* Workaround for reset of mode after memory allo */
212+ if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
213+ {
214+ xf86Msg(X_ERROR, "%s: setting state info failed\n", __FUNCTION__);
215+ return XvBadAlloc;
216+ }
217+ if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
218+ {
219+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
220+ return XvBadAlloc;
221+ }
222
223 if(ioctl(ofb->port->fd, OMAPFB_SETUP_PLANE,
224 &ofb->port->plane_info) != 0) {
225@@ -124,6 +151,8 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
226 DrawablePtr pDraw)
227 {
228 OMAPFBPtr ofb = OMAPFB(pScrn);
229+ short drw_temp;
230+ short rot_xres, rot_yres;
231
232 if (!ofb->port->plane_info.enabled
233 || ofb->port->update_window.x != src_x
234@@ -163,13 +192,6 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
235 return Success;
236 }
237
238- /* If we don't have the plane running, enable it */
239- if (!ofb->port->plane_info.enabled) {
240- ret = OMAPXVAllocPlane(pScrn);
241- if (ret != Success)
242- return ret;
243- }
244-
245 /* Set up the state info, xres and yres will be used for
246 * scaling to the values in the plane info struct
247 */
248@@ -179,12 +201,31 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
249 ofb->port->state_info.yres_virtual = 0;
250 ofb->port->state_info.xoffset = 0;
251 ofb->port->state_info.yoffset = 0;
252- ofb->port->state_info.rotate = 0;
253+ //ofb->port->state_info.rotate = 0;
254 ofb->port->state_info.grayscale = 0;
255 ofb->port->state_info.activate = FB_ACTIVATE_NOW;
256 ofb->port->state_info.bits_per_pixel = 0;
257 ofb->port->state_info.nonstd = xv_to_omapfb_format(image);
258
259+ /* Plane info does not rotate with state_info */
260+ if (ofb->port->state_info.rotate == 1 ||
261+ ofb->port->state_info.rotate == 3) {
262+ drw_temp = drw_x;
263+ drw_x = drw_y;
264+ drw_y = drw_temp;
265+
266+ drw_temp = drw_w;
267+ drw_w = drw_h;
268+ drw_h = drw_temp;
269+
270+ rot_xres = ofb->port->state_info.yres;
271+ rot_yres = ofb->port->state_info.xres;
272+ } else {
273+ rot_xres = ofb->port->state_info.xres;
274+ rot_yres = ofb->port->state_info.yres;
275+ }
276+
277+
278 /* Set up the video plane info */
279 ofb->port->plane_info.enabled = 1;
280 ofb->port->plane_info.pos_x = drw_x;
281@@ -193,13 +234,13 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
282 ofb->port->plane_info.out_height = drw_h & ~15;
283
284 /* Cap output to screen size */
285- if (ofb->port->plane_info.out_width > ofb->state_info.xres) {
286+ if (ofb->port->plane_info.out_width > rot_xres) {
287 ofb->port->plane_info.pos_x = 0;
288- ofb->port->plane_info.out_width = ofb->state_info.xres;
289+ ofb->port->plane_info.out_width = rot_xres;
290 }
291- if (ofb->port->plane_info.out_height > ofb->state_info.yres) {
292+ if (ofb->port->plane_info.out_height > rot_yres) {
293 ofb->port->plane_info.pos_y = 0;
294- ofb->port->plane_info.out_height = ofb->state_info.yres;
295+ ofb->port->plane_info.out_height = rot_yres;
296 }
297
298 ret = OMAPXVSetupVideoPlane(pScrn);
299@@ -223,6 +264,7 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
300 packed_line_copy(src_w & ~15,
301 src_h & ~15,
302 ((src_w + 1) & ~1) * 2,
303+ ofb->port->fixed_info.line_length,
304 (uint8_t*)buf,
305 (uint8_t*)ofb->port->fb);
306 break;
307diff --git a/src/omapfb-xv.c b/src/omapfb-xv.c
308index 1df651e..0fee2c6 100644
309--- a/src/omapfb-xv.c
310+++ b/src/omapfb-xv.c
311@@ -169,8 +169,11 @@ static int OMAPFBXVQueryImageAttributes (ScrnInfoPtr pScrn,
312 h = *height;
313
314 w = (w + 1) & ~1;
315+
316+ /* Can't calculate these here - don't know line length
317 ofb->port->mem_info.size = w << 1;
318 ofb->port->mem_info.size *= h;
319+ */
320
321 return size;
322 }
323--
3241.8.0
325
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
new file mode 100644
index 0000000000..d56729987c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
@@ -0,0 +1,272 @@
1From 803ecf2909949e6152f4a81b6cbb92a4430679ac Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 23 Nov 2012 00:31:06 +0100
4Subject: [PATCH 6/6] omapfb: port to new xserver video API
5
6Upstream-Status: Pending
7
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
9---
10 src/compat-api.h | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
11 src/omapfb-driver.c | 41 ++++++++++++-----------
12 2 files changed, 118 insertions(+), 19 deletions(-)
13 create mode 100644 src/compat-api.h
14
15diff --git a/src/compat-api.h b/src/compat-api.h
16new file mode 100644
17index 0000000..b1591b1
18--- /dev/null
19+++ b/src/compat-api.h
20@@ -0,0 +1,96 @@
21+/*
22+ * Copyright 2012 Red Hat, Inc.
23+ *
24+ * Permission is hereby granted, free of charge, to any person obtaining a
25+ * copy of this software and associated documentation files (the "Software"),
26+ * to deal in the Software without restriction, including without limitation
27+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28+ * and/or sell copies of the Software, and to permit persons to whom the
29+ * Software is furnished to do so, subject to the following conditions:
30+ *
31+ * The above copyright notice and this permission notice (including the next
32+ * paragraph) shall be included in all copies or substantial portions of the
33+ * Software.
34+ *
35+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
38+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41+ * DEALINGS IN THE SOFTWARE.
42+ *
43+ * Author: Dave Airlie <airlied@redhat.com>
44+ */
45+
46+/* this file provides API compat between server post 1.13 and pre it,
47+ it should be reused inside as many drivers as possible */
48+#ifndef COMPAT_API_H
49+#define COMPAT_API_H
50+
51+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
52+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
53+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
54+#endif
55+
56+#ifndef XF86_HAS_SCRN_CONV
57+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
58+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
59+#endif
60+
61+#ifndef XF86_SCRN_INTERFACE
62+
63+#define SCRN_ARG_TYPE int
64+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
65+
66+#define SCREEN_ARG_TYPE int
67+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
68+
69+#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
70+
71+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
72+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
73+
74+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
75+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
76+
77+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
78+
79+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
80+
81+#define FREE_SCREEN_ARGS_DECL int arg, int flags
82+#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
83+
84+#define VT_FUNC_ARGS_DECL int arg, int flags
85+#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
86+
87+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
88+#else
89+#define SCRN_ARG_TYPE ScrnInfoPtr
90+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
91+
92+#define SCREEN_ARG_TYPE ScreenPtr
93+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
94+
95+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
96+
97+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
98+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
99+
100+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
101+#define CLOSE_SCREEN_ARGS pScreen
102+
103+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
104+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
105+
106+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
107+#define FREE_SCREEN_ARGS(x) (x)
108+
109+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
110+#define VT_FUNC_ARGS(flags) pScrn
111+
112+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
113+
114+#endif
115+
116+#endif
117diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
118index 07989f5..486ffa4 100644
119--- a/src/omapfb-driver.c
120+++ b/src/omapfb-driver.c
121@@ -44,6 +44,8 @@
122
123 #include "exa.h"
124
125+#include "compat-api.h"
126+
127 #ifdef HAVE_XEXTPROTO_71
128 #include <X11/extensions/dpmsconst.h>
129 #else
130@@ -70,10 +72,10 @@
131
132 static Bool OMAPFBProbe(DriverPtr drv, int flags);
133 static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
134-static Bool OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
135-static Bool OMAPFBEnterVT(int scrnIndex, int flags);
136-static void OMAPFBLeaveVT(int scrnIndex, int flags);
137-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
138+static Bool OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL);
139+static Bool OMAPFBEnterVT(VT_FUNC_ARGS_DECL);
140+static void OMAPFBLeaveVT(VT_FUNC_ARGS_DECL);
141+static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL);
142
143 static Bool
144 OMAPFBEnsureRec(ScrnInfoPtr pScrn)
145@@ -481,7 +483,7 @@ OMAPFBXvScreenInit(ScreenPtr pScreen)
146 }
147
148 static Bool
149-OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
150+OMAPFBCloseScreen(CLOSE_SCREEN_ARGS_DECL)
151 {
152 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
153 OMAPFBPtr ofb = OMAPFB(pScrn);
154@@ -490,11 +492,11 @@ OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
155
156 pScreen->CloseScreen = ofb->CloseScreen;
157
158- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
159+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
160 }
161
162 static Bool
163-OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
164+OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL)
165 {
166 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
167 OMAPFBPtr ofb = OMAPFB(pScrn);
168@@ -516,7 +518,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
169 PROT_READ | PROT_WRITE, MAP_SHARED,
170 ofb->fd, 0);
171 if (ofb->fb == MAP_FAILED) {
172- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
173+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
174 return FALSE;
175 }
176
177@@ -526,7 +528,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
178 /* Only support TrueColor for now */
179 if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
180 pScrn->rgbBits, pScrn->defaultVisual)) {
181- xf86DrvMsg(scrnIndex, X_ERROR, "visual type setup failed"
182+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "visual type setup failed"
183 " for %d bits per pixel [1]\n",
184 pScrn->bitsPerPixel);
185 return FALSE;
186@@ -534,7 +536,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
187
188 /* Set up pixmap depth information */
189 if (!miSetPixmapDepths()) {
190- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
191+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
192 return FALSE;
193 }
194
195@@ -546,7 +548,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
196 pScrn->virtualY, pScrn->xDpi,
197 pScrn->yDpi, pScrn->displayWidth,
198 pScrn->bitsPerPixel)) {
199- xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
200+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
201 return FALSE;
202 }
203
204@@ -567,7 +569,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
205
206 /* Initialize XRender fallbacks */
207 if (!fbPictureInit(pScreen, NULL, 0)) {
208- xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
209+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
210 return FALSE;
211 }
212
213@@ -579,7 +581,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
214
215 /* Initialize default colormap */
216 if (!miCreateDefColormap(pScreen)) {
217- xf86DrvMsg(scrnIndex, X_ERROR,
218+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
219 "creating default colormap failed\n");
220 return FALSE;
221 }
222@@ -589,7 +591,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
223 /* This is non-fatal since we might be running against older
224 * kernel driver in which case we only do basic 2D stuff...
225 */
226- xf86DrvMsg(scrnIndex, X_ERROR, "Reading plane info failed\n");
227+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reading plane info failed\n");
228 } else if (!ofb->dss) {
229
230 ofb->plane_info.enabled = 1;
231@@ -602,7 +604,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
232 }
233
234 if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
235- xf86DrvMsg(scrnIndex, X_ERROR,
236+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
237 "%s: Plane setup failed: %s\n",
238 __FUNCTION__, strerror(errno));
239 return FALSE;
240@@ -645,9 +647,10 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
241 return TRUE;
242 }
243
244-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
245+static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL)
246 {
247- return xf86SetSingleMode (xf86Screens[scrnIndex], mode, RR_Rotate_0);
248+ SCRN_INFO_PTR(arg);
249+ return xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
250 }
251
252 void
253@@ -699,14 +702,14 @@ OMAPFBPrintCapabilities(ScrnInfoPtr pScrn,
254 /*** Unimplemented: */
255
256 static Bool
257-OMAPFBEnterVT(int scrnIndex, int flags)
258+OMAPFBEnterVT(VT_FUNC_ARGS_DECL)
259 {
260 xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
261 return TRUE;
262 }
263
264 static void
265-OMAPFBLeaveVT(int scrnIndex, int flags)
266+OMAPFBLeaveVT(VT_FUNC_ARGS_DECL)
267 {
268 xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
269 }
270--
2711.8.0
272
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
new file mode 100644
index 0000000000..50ce4c2f9c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
@@ -0,0 +1,33 @@
1require xorg-driver-video.inc
2
3SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
4
5DESCRIPTION = "omapfb driver supports the basic Texas Instruments OMAP \
6framebuffer."
7
8LICENSE = "MIT-X & GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=63e2cbac53863f60e2f43343fb34367f"
10DEPENDS += "virtual/libx11"
11
12SRCREV = "28c006c94e57ea71df11ec4fff79d7ffcfc4860f"
13PR = "${INC_PR}.7"
14PV = "0.1.1+gitr${SRCPV}"
15
16SRC_URI = "git://git.pingu.fi/xf86-video-omapfb;protocol=http \
17 file://0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch \
18 file://0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch \
19 file://0003-force-plain-mode.patch \
20 file://0004-blacklist-tv-out.patch \
21 file://0005-Attempt-to-fix-VRFB.patch \
22 file://0006-omapfb-port-to-new-xserver-video-API.patch \
23"
24
25S = "${WORKDIR}/git"
26
27EXTRA_OECONF_armv7a = " --enable-neon "
28CFLAGS += " -I${STAGING_INCDIR}/xorg "
29
30# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
31do_compile_prepend_armv7a () {
32 sed -i -e s:fb1:fb2:g ${S}/src/omapfb-xv.c
33}