diff options
author | Luc Verhaegen <libv@skynet.be> | 2005-09-30 04:11:31 +0000 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2005-09-30 04:11:31 +0000 |
commit | 4b1eb56e8b1ed4518bc7f295a569e7c3c34a869d (patch) | |
tree | 4d028d20a20ff601bb7eac5e44508b6cb92dfaff | |
parent | 9de82d2dda1e15ccd89975f9ef3a518133ba9ee8 (diff) |
[devel-swov_SurfaceCreate_return]
- Make the FALSE returns of ViaSwovSurfaceCreate more verbose.
-rw-r--r-- | src/via_video.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/via_video.c b/src/via_video.c index 23b32c6..a5037d9 100644 --- a/src/via_video.c +++ b/src/via_video.c @@ -212,8 +212,11 @@ ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, CARD32 FourCC, CARD16 Width, CARD16 Heig __FUNCTION__, FourCC, Width, Height); if ((FourCC == FOURCC_YV12) || (FourCC == FOURCC_I420)) { - if (Width != ALIGN_TO(Width, VIA_PITCH_ALIGN_YUV420)) + if (Width != ALIGN_TO(Width, VIA_PITCH_ALIGN_YUV420)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: wrong Xv image width for" + " YUV420.\n", __FUNCTION__); return FALSE; + } if (FourCC == FOURCC_I420) { /* YUV */ Port->CbOffset = Width * Height; @@ -225,15 +228,21 @@ ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, CARD32 FourCC, CARD16 Width, CARD16 Heig size = (Width * Height * 3) >> 1; } else if (FourCC == FOURCC_YUY2) { - if (Width != ALIGN_TO(Width, VIA_PITCH_ALIGN_YUV422)) + if (Width != ALIGN_TO(Width, VIA_PITCH_ALIGN_YUV422)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: wrong Xv image width for" + " YUV422.\n", __FUNCTION__); return FALSE; + } Port->CrOffset = 0; Port->CbOffset = 0; size = Width * Height * 2; - } else + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: unhandled FourCC: 0x%08X\n", + __FUNCTION__, FourCC); return FALSE; + } Port->FourCC = FourCC; Port->Width = Width; @@ -1349,8 +1358,12 @@ static XF86AttributeRec AttributesG[NUM_ATTRIBUTES_G] = {XvSettable | XvGettable, 0, 0x0F, "XV_OPACITY"} }; +/* + * I'm unable to set the ordering of packed YUV, so only YUY2 is possible. + * A conversion routine could be implemented, but it is more efficient + * to let the client ignore/convert it. -- Luc. + */ #define NUM_IMAGES_G 3 - static XF86ImageRec ImagesG[NUM_IMAGES_G] = { XVIMAGE_YUY2, |