summaryrefslogtreecommitdiff
path: root/src/sna/sna_video.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-17 23:33:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-17 23:34:46 +0100
commitdb41bec0fd4dc8eec1f44a988f1c5a531594604f (patch)
tree367d853bad702393e066dabbb98aa426fa7f0f85 /src/sna/sna_video.c
parentfed9ca236a0b5bbd7f1d137aa4ef9c2caf26719c (diff)
sna/video: Return the planar offset calculations to the planar branch
They where accidentally move the packed branch in commit 85e89f2121bad96d34ff8df9456e2fbaa9ff7881 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Aug 16 21:11:33 2013 +0100 sna/video: YUV420 is not supported by sprites, replace it with a RGB passthrough Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video.c')
-rw-r--r--src/sna/sna_video.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index 2f4a7e4f..9f41edd9 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -225,6 +225,16 @@ sna_video_frame_init(struct sna_video *video,
frame->size = height;
}
frame->size *= frame->pitch[0] + frame->pitch[1];
+
+ if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
+ frame->UBufOffset = (int)frame->pitch[1] * width;
+ frame->VBufOffset =
+ frame->UBufOffset + (int)frame->pitch[0] * width / 2;
+ } else {
+ frame->UBufOffset = (int)frame->pitch[1] * height;
+ frame->VBufOffset =
+ frame->UBufOffset + (int)frame->pitch[0] * height / 2;
+ }
} else {
switch (frame->id) {
case FOURCC_RGB888:
@@ -256,15 +266,6 @@ sna_video_frame_init(struct sna_video *video,
frame->pitch[0] = ALIGN((width << 1), align);
frame->size = (int)frame->pitch[0] * height;
}
- if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
- frame->UBufOffset = (int)frame->pitch[1] * width;
- frame->VBufOffset =
- frame->UBufOffset + (int)frame->pitch[0] * width / 2;
- } else {
- frame->UBufOffset = (int)frame->pitch[1] * height;
- frame->VBufOffset =
- frame->UBufOffset + (int)frame->pitch[0] * height / 2;
- }
break;
}
frame->pitch[1] = 0;