SVGA_VIDEO_FORMAT,
SVGA_VIDEO_COLORKEY,
SVGA_VIDEO_SIZE,
- SVGA_VIDEO_X,
- SVGA_VIDEO_Y,
+ SVGA_VIDEO_WIDTH,
+ SVGA_VIDEO_HEIGHT,
+ SVGA_VIDEO_SRC_X,
+ SVGA_VIDEO_SRC_Y,
SVGA_VIDEO_SRC_WIDTH,
SVGA_VIDEO_SRC_HEIGHT,
+ SVGA_VIDEO_DST_X,
+ SVGA_VIDEO_DST_Y,
SVGA_VIDEO_DST_WIDTH,
SVGA_VIDEO_DST_HEIGHT,
SVGA_VIDEO_PITCH_1,
/*
* SVGA Overlay Units
+ *
+ * width and height relate to the entire source video frame.
+ * srcX, srcY, srcWidth and srcHeight represent subset of the source
+ * video frame to be displayed.
*/
typedef struct SVGAOverlayUnit {
uint32 enabled;
uint32 flags;
- uint32 dataOffset;
+ uint32 dataOffset;
uint32 format;
uint32 colorKey;
uint32 size;
- uint32 x;
- uint32 y;
+ uint32 width;
+ uint32 height;
+ uint32 srcX;
+ uint32 srcY;
uint32 srcWidth;
uint32 srcHeight;
+ uint32 dstX;
+ uint32 dstY;
uint32 dstWidth;
uint32 dstHeight;
uint32 pitches[3];
#define SVGA_CMD_VIDEO_PLAY_OBSOLETE 31
/* Obsolete; do not use. */
-
+
#define SVGA_CMD_VIDEO_END_OBSOLETE 32
/* Obsolete; do not use. */
};
struct _cmdSetRegs cmdSetRegs;
+ struct _item *items;
memcpy(pVid->bufs[pVid->currBuf].data, buf, pVid->size);
cmdSetRegs.body.escape = SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS;
cmdSetRegs.body.streamId = pVid->streamId;
+ items = cmdSetRegs.body.items;
for (i = SVGA_VIDEO_ENABLED; i < SVGA_VIDEO_NUM_REGS; i++) {
- cmdSetRegs.body.items[i].regId = i;
+ items[i].regId = i;
}
- cmdSetRegs.body.items[SVGA_VIDEO_ENABLED].value = TRUE;
- cmdSetRegs.body.items[SVGA_VIDEO_DATA_OFFSET].value =
+ items[SVGA_VIDEO_ENABLED].value = TRUE;
+ items[SVGA_VIDEO_DATA_OFFSET].value =
pVid->bufs[pVid->currBuf].dataOffset;
- cmdSetRegs.body.items[SVGA_VIDEO_SIZE].value = pVid->size;
- cmdSetRegs.body.items[SVGA_VIDEO_FORMAT].value = format;
- cmdSetRegs.body.items[SVGA_VIDEO_X].value = drw_x;
- cmdSetRegs.body.items[SVGA_VIDEO_Y].value = drw_y;
- cmdSetRegs.body.items[SVGA_VIDEO_SRC_WIDTH].value = width;
- cmdSetRegs.body.items[SVGA_VIDEO_SRC_HEIGHT].value = height;
- cmdSetRegs.body.items[SVGA_VIDEO_DST_WIDTH]. value = drw_w;
- cmdSetRegs.body.items[SVGA_VIDEO_DST_HEIGHT].value = drw_h;
- cmdSetRegs.body.items[SVGA_VIDEO_COLORKEY].value = pVid->colorKey;
- cmdSetRegs.body.items[SVGA_VIDEO_FLAGS].value = pVid->flags;
+ items[SVGA_VIDEO_SIZE].value = pVid->size;
+ items[SVGA_VIDEO_FORMAT].value = format;
+ items[SVGA_VIDEO_WIDTH].value = width;
+ items[SVGA_VIDEO_HEIGHT].value = height;
+ items[SVGA_VIDEO_SRC_X].value = src_x;
+ items[SVGA_VIDEO_SRC_Y].value = src_y;
+ items[SVGA_VIDEO_SRC_WIDTH].value = src_w;
+ items[SVGA_VIDEO_SRC_HEIGHT].value = src_h;
+ items[SVGA_VIDEO_DST_X].value = drw_x;
+ items[SVGA_VIDEO_DST_Y].value = drw_y;
+ items[SVGA_VIDEO_DST_WIDTH]. value = drw_w;
+ items[SVGA_VIDEO_DST_HEIGHT].value = drw_h;
+ items[SVGA_VIDEO_COLORKEY].value = pVid->colorKey;
+ items[SVGA_VIDEO_FLAGS].value = pVid->flags;
for (i = 0, regId = SVGA_VIDEO_PITCH_1; i < 3; i++, regId++) {
- cmdSetRegs.body.items[regId].value = pVid->fmt_priv->pitches[i];
+ items[regId].value = pVid->fmt_priv->pitches[i];
}
fifoItem = (uint32 *) &cmdSetRegs;
* If sync is TRUE the driver should not return from this
* function until it is through reading the data from buf.
*
- * XXX: src_x, src_y, src_w and src_h are used to denote that only
- * part of the source image is to be displayed. We ignore as didn't
- * find applications that use them.
- *
* There are two function prototypes to cope with the API change in X.org
* 7.1
*