summaryrefslogtreecommitdiffstats
path: root/meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch')
-rw-r--r--meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch
new file mode 100644
index 00000000..dc25d9f9
--- /dev/null
+++ b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/036_g45_add_vaGetImage.patch
@@ -0,0 +1,71 @@
1From 37f40c0cdc9667907dfb784874b42fb16c2c9bde Mon Sep 17 00:00:00 2001
2From: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
3Date: Wed, 4 Nov 2009 13:16:34 +0000
4Subject: [PATCH] =?utf-8?q?[G45]=C2=A0Implement=20vaGetImage()=20for=20full-sized=20surface=20readback.?=
5MIME-Version: 1.0
6Content-Type: text/plain; charset=utf-8
7Content-Transfer-Encoding: 8bit
8
9---
10 i965_drv_video/i965_drv_video.c | 45 ++++++++++++++++++++++++++++++++++++++-
11 1 files changed, 44 insertions(+), 1 deletions(-)
12
13diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c
14index 8558d0e..10baffb 100644
15--- a/i965_drv_video/i965_drv_video.c
16+++ b/i965_drv_video/i965_drv_video.c
17@@ -1388,7 +1388,50 @@ i965_GetImage(VADriverContextP ctx,
18 unsigned int height,
19 VAImageID image)
20 {
21- return VA_STATUS_SUCCESS;
22+ struct i965_driver_data *i965 = i965_driver_data(ctx);
23+
24+ struct object_surface *obj_surface = SURFACE(surface);
25+ if (!obj_surface)
26+ return VA_STATUS_ERROR_INVALID_SURFACE;
27+
28+ struct object_image *obj_image = IMAGE(image);
29+ if (!obj_image)
30+ return VA_STATUS_ERROR_INVALID_IMAGE;
31+
32+ /* XXX: we only support full-size surface readback */
33+ if (x != 0 ||
34+ y != 0 ||
35+ width != obj_surface->width ||
36+ height != obj_surface->height)
37+ return VA_STATUS_ERROR_INVALID_PARAMETER;
38+
39+ /* XXX: we only support 1:1 image copies */
40+ if (width != obj_image->image.width ||
41+ height != obj_image->image.height)
42+ return VA_STATUS_ERROR_INVALID_PARAMETER;
43+
44+ VAStatus va_status;
45+ void *image_data = NULL;
46+
47+ va_status = i965_MapBuffer(ctx, obj_image->image.buf, &image_data);
48+ if (va_status != VA_STATUS_SUCCESS)
49+ return va_status;
50+
51+ dri_bo_map(obj_surface->bo, 0);
52+
53+ switch (obj_image->image.format.fourcc) {
54+ case VA_FOURCC('Y','V','1','2'): /* YV12 is native format here */
55+ memcpy(image_data, obj_surface->bo->virtual, obj_surface->bo->size);
56+ break;
57+ default:
58+ va_status = VA_STATUS_ERROR_OPERATION_FAILED;
59+ break;
60+ }
61+
62+ dri_bo_unmap(obj_surface->bo);
63+
64+ i965_UnmapBuffer(ctx, obj_image->image.buf);
65+ return va_status;
66 }
67
68 VAStatus
69--
701.5.4.3
71