[oe-commits] org.oe.dev xserver-kdrive-imageon X11R7.1-1.1.0 : XV Port changes, cleanups
sirfred commit
openembedded-commits at lists.openembedded.org
Thu Jun 14 20:05:18 UTC 2007
xserver-kdrive-imageon X11R7.1-1.1.0 : XV Port changes, cleanups
* Avoid recalculation of surface boundaries when possible
* Cleanups and optimizations in support functions
* More rational APIs for blitting functions.
* Release bumped up to r2
Author: sirfred at openembedded.org
Branch: org.openembedded.dev
Revision: d1225d783e183bd1d02b0f10680648d7c9cd1934
ViewMTN: http://monotone.openembedded.org/revision.psp?id=d1225d783e183bd1d02b0f10680648d7c9cd1934
Files:
1
packages/xorg-xserver/xserver-kdrive/kdrive-imageon.patch
packages/xorg-xserver/xserver-kdrive-imageon_X11R7.1-1.1.0.bb
Diffs:
#
# mt diff -r758a7fd0d97b1204bb49bd646dc568fc12139878 -rd1225d783e183bd1d02b0f10680648d7c9cd1934
#
#
#
# patch "packages/xorg-xserver/xserver-kdrive/kdrive-imageon.patch"
# from [1b0fbca2bad540773b2b42a116f3965d683edbe1]
# to [5d471a401096c47b2af2cca2b4ae928b4de203da]
#
# patch "packages/xorg-xserver/xserver-kdrive-imageon_X11R7.1-1.1.0.bb"
# from [7ddafee71ad5989ec7718665dcb942c7c92108a5]
# to [e50e21de6bb56a5110430b82427d3b8f908786ef]
#
============================================================
--- packages/xorg-xserver/xserver-kdrive/kdrive-imageon.patch 1b0fbca2bad540773b2b42a116f3965d683edbe1
+++ packages/xorg-xserver/xserver-kdrive/kdrive-imageon.patch 5d471a401096c47b2af2cca2b4ae928b4de203da
@@ -902,7 +902,7 @@
+#endif
--- /dev/null
+++ xorg-server-X11R7.1-1.1.0.work/hw/kdrive/imageon/imageon_cursor.c
-@@ -0,0 +1,566 @@
+@@ -0,0 +1,565 @@
+/*
+ * Copyright © 2007 Manuel Teira
+ *
@@ -934,8 +934,9 @@
+#include "imageon_regs.h"
+
+#define W100_CURSOR_HEIGHT (16)
-+#define W100_CURSOR_PITCH (4)
+#define W100_CURSOR_WIDTH (16)
++#define W100_CURSOR_PITCH (W100_CURSOR_WIDTH / 4)
++
+#define W100_CURSOR_SIZE W100_CURSOR_PITCH * W100_CURSOR_WIDTH
+
+static CARD16 expand2bpp[256];
@@ -968,7 +969,7 @@
+ (((y) * W100_CURSOR_PITCH + ((x) / 4)) >> 2)
+
+#define PixelShift(x, y) \
-+ (2 * ((x) % W100_CURSOR_WIDTH))
++ (2 * ((x) % 16))
+
+#define PixelMask(x, y) \
+ ((0xc0000000) >> PixelShift(x, y))
@@ -1210,7 +1211,7 @@
+ cursor_v_pos_u vpos;
+ graphic_h_disp_u graphic_hdisp;
+ graphic_v_disp_u graphic_vdisp;
-+ int tx, ty, tw, th;
++ BoxRec cursorBox, deviceBox;
+
+
+ if (!pCurPriv->has_cursor) {
@@ -1224,30 +1225,28 @@
+ graphic_vdisp.val = w100c->regs.GRAPHIC_V_DISP;
+ xoffs = 0;
+ yoffs = 0;
-+ x -= pCurPriv->xhot;
-+ y -= pCurPriv->yhot;
-+ tx = W100MapToHWX(w100c, x, y, pCurPriv->width, pCurPriv->height);
-+ ty = W100MapToHWY(w100c, x, y, pCurPriv->width, pCurPriv->height);
-+ tw = W100MapToHWW(w100c, x, y, pCurPriv->width, pCurPriv->height);
-+ th = W100MapToHWH(w100c, x, y, pCurPriv->width, pCurPriv->height);
++ cursorBox.x1 = x - pCurPriv->xhot;
++ cursorBox.y1 = y - pCurPriv->yhot;
++ cursorBox.x2 = cursorBox.x1 + pCurPriv->width - 1;
++ cursorBox.y2 = cursorBox.y1 + pCurPriv->height - 1;
++ W100MapToDevice(w100c, &cursorBox, &deviceBox);
+
-+ if (tx < 0) {
-+ xoffs = -tx;
-+ tw -= xoffs;
-+ tx = 0;
++ if (deviceBox.x1 < 0) {
++ xoffs = -deviceBox.x1;
++ deviceBox.x1 = 0;
+ }
+
-+ if (ty < 0) {
-+ yoffs = -ty;
-+ th -= yoffs;
-+ ty = 0;
++ if (deviceBox.y1 < 0) {
++ yoffs = -deviceBox.y1;
++ deviceBox.y1 = 0;
+ }
-+
-+ hpos.f.cur_h_start = graphic_hdisp.f.graphic_h_start + tx;
-+ hpos.f.cur_h_end = hpos.f.cur_h_start + tw;
++
++ hpos.f.cur_h_start = graphic_hdisp.f.graphic_h_start + deviceBox.x1;
++ hpos.f.cur_h_end = graphic_hdisp.f.graphic_h_start + deviceBox.x2 + 1;
+ hpos.f.cur_en = 1;
-+ vpos.f.cur_v_start = graphic_vdisp.f.graphic_v_start + ty;
-+ vpos.f.cur_v_end = vpos.f.cur_v_start + th;
++ vpos.f.cur_v_start = graphic_vdisp.f.graphic_v_start + deviceBox.y1;
++ vpos.f.cur_v_end = graphic_vdisp.f.graphic_v_start + deviceBox.y2 + 1;
++
+ cursor_offset.f.cur_x_offset = xoffs;
+ cursor_offset.f.cur_y_offset = yoffs;
+ cursor_offset.f.cur_offset = (CARD32)
@@ -1255,7 +1254,7 @@
+ + pCurPriv->area->offset);
+ DBG_IMAGEON(("W100MoveCursor dst(x:%d,y:%d),"
+ "mapped(x:%d,y:%d,xoffs:%d,yoffs:%d)\n",
-+ x, y, tx, ty, xoffs, yoffs));
++ x, y, deviceBox.x1, deviceBox.y1, xoffs, yoffs));
+
+ W100DisableDisplayUpdate(w100c);
+ MMIO_OUT32(mmCURSOR1_OFFSET, cursor_offset.val);
@@ -1471,7 +1470,7 @@
+}
--- /dev/null
+++ xorg-server-X11R7.1-1.1.0.work/hw/kdrive/imageon/imageon_draw.c
-@@ -0,0 +1,237 @@
+@@ -0,0 +1,238 @@
+/*
+ * Copyright © 2007 Manuel Teira
+ *
@@ -1520,6 +1519,7 @@
+ KdScreenPriv(pPix->drawable.pScreen);
+ W100ScreenInfo(pScreenPriv);
+ W100CardInfo(pScreenPriv);
++ W100PortPrivPtr pPortPriv = w100s->pAdaptor->pPortPrivates[0].ptr;
+ int fifoEntries = 4;
+
+ DBG_IMAGEON(("W100PrepareSolid(alu:%d, pm:0x%08x, fg:%d)\n",
@@ -1711,7 +1711,7 @@
+}
--- /dev/null
+++ xorg-server-X11R7.1-1.1.0.work/hw/kdrive/imageon/imageon.h
-@@ -0,0 +1,261 @@
+@@ -0,0 +1,284 @@
+/*
+ * Copyright © 2007 Manuel Teira
+ *
@@ -1822,6 +1822,13 @@
+ Bool supported;
+} W100ModeSpec;
+
++typedef struct _W100BoxRec {
++ CARD16 x;
++ CARD16 y;
++ CARD16 w;
++ CARD16 h;
++} W100BoxRec, *W100BoxPtr;
++
+typedef struct _W100Mode {
+ CARD16 width;
+ CARD16 height;
@@ -1929,23 +1936,39 @@
+ CARD32 videoStatus;
+ CARD32 videoCtrl;
+ RegionRec clip;
-+ KdOffscreenArea *offSurface;
-+ CARD32 offSize;
-+ KdOffscreenArea *ovlSurface;
-+ CARD32 ovlSize;
-+ CARD32 YPlaneOffset;
-+ CARD32 UPlaneOffset;
-+ CARD32 VPlaneOffset;
-+ CARD32 colorKey;
-+ CARD8 brightness;
-+ CARD32 maxOverlaySize;
-+ CARD16 ovlX;
-+ CARD16 ovlY;
-+ CARD16 ovlWidth;
-+ CARD16 ovlHeight;
-+ CARD8 videoHorExp;
-+ CARD8 videoVerExp;
-+ int id;
++ struct {
++ int width; /* Source width */
++ int height; /* Source height */
++ unsigned char *buffer; /* Source buffer */
++ int id; /* Source FOURCC */
++ int size; /* Size of source rect (bytes) */
++ KdOffscreenArea *surface; /* Source surface (on card memory) */
++ BoxRec box; /* Source rect boundaries */
++ } src;
++ struct {
++ BoxRec box; /* Screen rectangle */
++ } dst;
++ struct {
++ int size; /* Size of the overlay surface (bytes) */
++ KdOffscreenArea *surface; /* Overlay surface (on card memory) */
++ BoxRec box; /* Overlay box (util size) */
++ BoxRec frame; /* Overlay box (plus corrections) */
++ Bool changed; /* To avoid recalculations */
++ int horExp; /* Horizontal expansion */
++ int verExp; /* Vertical expansion */
++ int maxSize; /* Maximum allowed surface size (bytes) */
++ int colorKey; /* Colour to replace with overlay */
++ int brightness; /* Brigthness */
++ } ovl;
++ struct {
++ int size; /* Number of planes */
++ int bpp; /* bpp of the planes */
++ int offset[3]; /* Planes offsets */
++ CARD32 yplane; /* Offset (card) of Y plane */
++ CARD32 uplane; /* Offset (card) of U plane */
++ CARD32 vplane; /* Offset (card) of V plane */
++ } planes;
++ Bool changed; /* To track changes and avoid recalculations */
+} W100PortPrivRec, *W100PortPrivPtr;
+
+extern KdCardFuncs W100Funcs;
@@ -6231,7 +6254,7 @@
+}
--- /dev/null
+++ xorg-server-X11R7.1-1.1.0.work/hw/kdrive/imageon/imageon_support.c
-@@ -0,0 +1,1438 @@
+@@ -0,0 +1,1474 @@
+/*
+ * Copyright © 2007 Manuel Teira
+ *
@@ -6856,7 +6879,6 @@
+ } else {
+ w100c->ctx.mask.enable = FALSE;
+ }
-+
+}
+
+Bool W100SetSource(KdScreenInfo *screen,
@@ -6962,184 +6984,140 @@
+ pPix->drawable.bitsPerPixel);
+}
+
-+int W100MapToHWX(W100CardInfo *w100c,
-+ int x, int y, int w, int h)
++void W100MapToDevice(W100CardInfo *w100c, BoxPtr src, BoxPtr dst)
+{
-+ int tx;
+ switch (w100c->hw_window.randr & RR_Rotate_All) {
+ case RR_Rotate_0:
-+ tx = x;
++ dst->x1 = src->x1;
++ dst->y1 = src->y1;
++ dst->x2 = src->x2;
++ dst->y2 = src->y2;
+ break;
+ case RR_Rotate_90:
-+ tx = w100c->hw_window.height - (y + h);
++ dst->x1 = w100c->hw_window.height - src->y2 - 1;
++ dst->y1 = src->x1;
++ dst->x2 = w100c->hw_window.height - src->y1 - 1;
++ dst->y2 = src->x2;
+ break;
+ case RR_Rotate_180:
-+ tx = w100c->hw_window.width - (x + w);
++ dst->x1 = w100c->hw_window.width - src->x2 - 1;
++ dst->y1 = w100c->hw_window.height - src->y2 - 1;
++ dst->x2 = w100c->hw_window.width - src->x1 - 1;
++ dst->y2 = w100c->hw_window.height - src->y1 - 1;
+ break;
+ case RR_Rotate_270:
-+ tx = y;
++ dst->x1 = src->y1;
++ dst->y1 = w100c->hw_window.width - src->x2 - 1;
++ dst->x2 = src->y2;
++ dst->y2 = w100c->hw_window.height - src->x1 - 1;
+ break;
-+ default:
-+ tx = x;
+ }
-+ return tx;
++ DBG_IMAGEON(("MapToDevice (x1:%d,y1:%d,x2:%d,y2:%d)->(x1:%d,y1:%d,x2:%d,y2:%d)\n",
++ src->x1, src->y1, src->x2, src->y2,
++ dst->x1, dst->y1, dst->x2, dst->y2));
+}
+
-+int W100MapToHWY(W100CardInfo *w100c,
-+ int x, int y, int w, int h)
++void W100MapFromDevice(W100CardInfo *w100c, BoxPtr src, BoxPtr dst)
+{
-+ int ty;
+ switch (w100c->hw_window.randr & RR_Rotate_All) {
+ case RR_Rotate_0:
-+ ty = y;
++ dst->x1 = src->x1;
++ dst->y1 = src->y1;
++ dst->x2 = src->x2;
++ dst->y2 = src->y2;
+ break;
+ case RR_Rotate_90:
-+ ty = x;
++ dst->x1 = src->y1;
++ dst->y1 = w100c->hw_window.height - src->x2 - 1;
++ dst->x2 = src->y2;
++ dst->y2 = w100c->hw_window.height - src->x1 - 1;
+ break;
+ case RR_Rotate_180:
-+ ty = w100c->hw_window.height - (y + h);
++ dst->x1 = w100c->hw_window.width - src->x2 - 1;
++ dst->y1 = w100c->hw_window.height - src->y2 - 1;
++ dst->x2 = w100c->hw_window.width - src->x1 - 1;
++ dst->y2 = w100c->hw_window.height - src->y1 - 1;
+ break;
+ case RR_Rotate_270:
-+ ty = w100c->hw_window.width - (x + w);
++ dst->x1 = w100c->hw_window.height - src->y2 - 1;
++ dst->y1 = src->x1;
++ dst->x2 = w100c->hw_window.width - src->y1 - 1;
++ dst->y2 = src->x2;
+ break;
-+ default:
-+ ty = y;
+ }
-+ return ty;
++ DBG_IMAGEON(("MapFromDevice (x1:%d,y1:%d,x2:%d,y2:%d)->(x1:%d,y1:%d,x2:%d,y2:%d)\n",
++ src->x1, src->y1, src->x2, src->y2,
++ dst->x1, dst->y1, dst->x2, dst->y2));
+}
+
-+int W100MapToHWW(W100CardInfo *w100c,
-+ int x, int y, int w, int h)
++void W100MoveTo(BoxPtr src, int x, int y)
+{
-+ int tw;
-+ switch (w100c->hw_window.randr & RR_Rotate_All) {
-+ case RR_Rotate_0:
-+ case RR_Rotate_180:
-+ tw = w;
-+ break;
-+ case RR_Rotate_90:
-+ case RR_Rotate_270:
-+ tw = h;
-+ break;
-+ }
-+ return tw;
++ src->x1 += x;
++ src->y1 += y;
++ src->x2 += x;
++ src->y2 += y;
+}
+
-+int W100MapToHWH(W100CardInfo *w100c,
-+ int x, int y, int w, int h)
++void W100ChangeOrigin(BoxPtr src, int x, int y)
+{
-+ int th;
-+ switch (w100c->hw_window.randr & RR_Rotate_All) {
-+ case RR_Rotate_0:
-+ case RR_Rotate_180:
-+ th = h;
-+ break;
-+ case RR_Rotate_90:
-+ case RR_Rotate_270:
-+ th = w;
-+ break;
++ src->x1 -= x;
++ src->y1 -= y;
++ src->x2 -= x;
++ src->y2 -= y;
++}
++
++void W100ScaleBox(BoxPtr src, BoxPtr dst, int scale)
++{
++ if (scale >= 0) {
++ dst->x1 = src->x1 << scale;
++ dst->x2 = src->x2 << scale;
++ dst->y1 = src->y1 << scale;
++ dst->y2 = src->y2 << scale;
++ } else {
++ dst->x1 = src->x1 >> -scale;
++ dst->x2 = src->x2 >> -scale;
++ dst->y1 = src->y1 >> -scale;
++ dst->y2 = src->y2 >> -scale;
+ }
-+ return th;
+}
+
-+CARD16 W100XformX(W100CardInfo *w100c,
-+ CARD16 x, CARD16 y, CARD16 w, CARD16 h)
++void W100TrajectoryOrigin(W100CardInfo *w100c, BoxPtr box, short *x, short *y)
+{
-+ CARD16 tx;
+ switch (w100c->ctx.xform.randr & RR_Rotate_All) {
+ case RR_Rotate_0:
+ if (w100c->ctx.xform.mirror) {
-+ tx = x + w - 1;
++ *x = box->x2;
+ } else {
-+ tx = x;
++ *x = box->x1;
+ }
++ *y = box->y1;
+ break;
+ case RR_Rotate_90:
-+ tx = x + h - 1;
-+ break;
-+ case RR_Rotate_180:
++ *x = box->x2;
+ if (w100c->ctx.xform.mirror) {
-+ tx = x;
++ *y = box->y2;
+ } else {
-+ tx = x + w - 1;
++ *y = box->y1;
+ }
+ break;
-+ case RR_Rotate_270:
-+ default:
-+ tx = x;
-+ break;
-+ }
-+ return tx;
-+}
-+
-+CARD16 W100XformY(W100CardInfo *w100c,
-+ CARD16 x, CARD16 y, CARD16 w, CARD16 h)
-+{
-+ CARD16 ty;
-+ switch (w100c->ctx.xform.randr & RR_Rotate_All) {
-+ case RR_Rotate_0:
-+ ty = y;
-+ break;
-+ case RR_Rotate_90:
++ case RR_Rotate_180:
+ if (w100c->ctx.xform.mirror) {
-+ ty = y + w - 1;
++ *x = box->x1;
+ } else {
-+ ty = y;
++ *x = box->x2;
+ }
++ *y = box->y2;
+ break;
-+ case RR_Rotate_180:
-+ ty = y + h - 1;
-+ break;
+ case RR_Rotate_270:
-+ default:
++ *x = box->x1;
+ if (w100c->ctx.xform.mirror) {
-+ ty = y;
++ *y = box->y1;
+ } else {
-+ ty = y + w - 1;
++ *y = box->y2;
+ }
-+ break;
+ }
-+ return ty;
+}
-+
-+CARD16 W100XformW(W100CardInfo *w100c,
-+ CARD16 x, CARD16 y, CARD16 w, CARD16 h)
-+{
-+ CARD16 tw;
-+
-+ switch (w100c->ctx.xform.randr & RR_Rotate_All) {
-+ case RR_Rotate_0:
-+ case RR_Rotate_180:
-+ default:
-+ tw = w;
-+ break;
-+ case RR_Rotate_90:
-+ case RR_Rotate_270:
-+ tw = h;
-+ break;
-+ }
-+ return tw;
-+}
-+
-+CARD16 W100XformH(W100CardInfo *w100c,
-+ CARD16 x, CARD16 y, CARD16 w, CARD16 h)
-+{
-+ CARD16 th;
-+
-+ switch (w100c->ctx.xform.randr & RR_Rotate_All) {
-+ case RR_Rotate_0:
-+ case RR_Rotate_180:
-+ default:
-+ th = h;
-+ break;
-+ case RR_Rotate_90:
-+ case RR_Rotate_270:
-+ th = w;
-+ break;
-+ }
-+ return th;
-+}
-+
++
+CARD8 W100GetScaler(CARD16 dstsize, CARD16 srcsize)
+{
+ return W100_MAX(1, W100_MIN(31, ((16 * srcsize) + dstsize - 1) / dstsize));
@@ -7152,22 +7130,18 @@
+}
+
+
-+static void W100Blt(KdScreenInfo *screen,
-+ int randr,
-+ int bpp,
++static void W100Blt(KdScreenInfo *screen,
++ int randr, int bpp,
+ CARD32 srcOffset,
-+ CARD16 srcW,
-+ CARD16 srcH,
+ CARD16 srcPitch,
++ BoxPtr srcBox,
+ CARD32 dstOffset,
+ CARD16 dstPitch,
-+ CARD16 dstX,
-+ CARD16 dstY)
++ BoxPtr dstBox)
+{
+ ScreenPtr pScreen = screen->pScreen;
+ KdScreenPriv(pScreen);
+ W100CardInfo(pScreenPriv);
-+ CARD16 x, y, w, h;
+ int fifoEntries = 9;
+ Bool hasXForm = FALSE;
+ eng_cntl_u eng_cntl;
@@ -7176,13 +7150,9 @@
+ src_width_u src_width;
+ src_height_u src_height;
+ dst_width_height_u dst_width_height;
++ CARD16 dstX;
++ CARD16 dstY;
+
-+ DBG_IMAGEON(("W100Blt(randr:%d,bpp:%d,srcOffset:0x%08x,"
-+ "srcW:%d,srcH:%d,srcPitch:%d,dstOffset:0x%08x,"
-+ "dstPitch:%d,dstX:%d,dstY:%d)\n",
-+ randr, bpp, srcOffset, srcW, srcH,
-+ srcPitch, dstOffset, dstPitch, dstX, dstY));
-+
+ if (randr & (RR_Rotate_90|RR_Rotate_270)) {
+ hasXForm = TRUE;
+ eng_cntl.val = w100c->regs.ENG_CNTL;
@@ -7195,21 +7165,28 @@
+ W100SetRotation(w100c, randr, FALSE);
+ W100SetSource(screen, srcPitch, srcOffset, bpp);
+ W100SetDestination(screen, dstPitch, dstOffset, bpp);
++ W100TrajectoryOrigin(w100c, dstBo%s
>>> DIFF TRUNCATED @ 16K
More information about the Openembedded-commits
mailing list