--- xserver-xorg-video-openchrome-0.2.906/src/via_swov.c 2012-05-15 23:57:45.000000000 +0300 +++ xserver-xorg-video-openchrome-0.2.906-new/src/via_swov.c 2013-07-15 01:02:59.986107527 +0300 @@ -1231,18 +1231,35 @@ pVia->swov.SWDevice.lpSWOverlaySurface[0] + fbsize; if (isplanar) { - pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] = - pVia->swov.SWDevice.dwSWPhysicalAddr[0] + - (pitch * Height); - pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] = - pVia->swov.SWDevice.dwSWPhysicalAddr[1] + - (pitch * Height); - pVia->swov.SWDevice.dwSWCbPhysicalAddr[0] = - pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] + - ((pitch >> 1) * (Height >> 1)); - pVia->swov.SWDevice.dwSWCbPhysicalAddr[1] = - pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] + - ((pitch >> 1) * (Height >> 1)); + switch (FourCC) { + case FOURCC_I420: + pVia->swov.SWDevice.dwSWCbPhysicalAddr[0] = + pVia->swov.SWDevice.dwSWPhysicalAddr[0] + + (pitch * Height); + pVia->swov.SWDevice.dwSWCbPhysicalAddr[1] = + pVia->swov.SWDevice.dwSWPhysicalAddr[1] + + (pitch * Height); + pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] = + pVia->swov.SWDevice.dwSWCbPhysicalAddr[0] + + ((pitch >> 1) * (Height >> 1)); + pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] = + pVia->swov.SWDevice.dwSWCbPhysicalAddr[1] + + ((pitch >> 1) * (Height >> 1)); + break; + default: // FOURCC_YV12 or FOURCC_XVMC + pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] = + pVia->swov.SWDevice.dwSWPhysicalAddr[0] + + (pitch * Height); + pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] = + pVia->swov.SWDevice.dwSWPhysicalAddr[1] + + (pitch * Height); + pVia->swov.SWDevice.dwSWCbPhysicalAddr[0] = + pVia->swov.SWDevice.dwSWCrPhysicalAddr[0] + + ((pitch >> 1) * (Height >> 1)); + pVia->swov.SWDevice.dwSWCbPhysicalAddr[1] = + pVia->swov.SWDevice.dwSWCrPhysicalAddr[1] + + ((pitch >> 1) * (Height >> 1)); + } } }