diff options
Diffstat (limited to 'meta-emenlow/packages/libva/libva-0.31.0/037_g45_add_vaPutImage.patch')
-rw-r--r-- | meta-emenlow/packages/libva/libva-0.31.0/037_g45_add_vaPutImage.patch | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/meta-emenlow/packages/libva/libva-0.31.0/037_g45_add_vaPutImage.patch b/meta-emenlow/packages/libva/libva-0.31.0/037_g45_add_vaPutImage.patch new file mode 100644 index 0000000000..ce638cce52 --- /dev/null +++ b/meta-emenlow/packages/libva/libva-0.31.0/037_g45_add_vaPutImage.patch | |||
@@ -0,0 +1,111 @@ | |||
1 | From 000807cfbd8bcbc9cd4bf28a066087fee43396b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com> | ||
3 | Date: Wed, 4 Nov 2009 13:36:39 +0000 | ||
4 | Subject: [PATCH] =?utf-8?q?[G45]=C2=A0Implement=20vaPutImage()=20for=20full-sized=20surface=20uploads.?= | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=utf-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | --- | ||
10 | i965_drv_video/i965_drv_video.c | 78 +++++++++++++++++++++++++++++++-------- | ||
11 | 1 files changed, 62 insertions(+), 16 deletions(-) | ||
12 | |||
13 | diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c | ||
14 | index d8a7bd1..e8f638c 100644 | ||
15 | --- a/i965_drv_video/i965_drv_video.c | ||
16 | +++ b/i965_drv_video/i965_drv_video.c | ||
17 | @@ -443,22 +443,6 @@ i965_QueryImageFormats(VADriverContextP ctx, | ||
18 | } | ||
19 | |||
20 | VAStatus | ||
21 | -i965_PutImage(VADriverContextP ctx, | ||
22 | - VASurfaceID surface, | ||
23 | - VAImageID image, | ||
24 | - int src_x, | ||
25 | - int src_y, | ||
26 | - unsigned int src_width, | ||
27 | - unsigned int src_height, | ||
28 | - int dest_x, | ||
29 | - int dest_y, | ||
30 | - unsigned int dest_width, | ||
31 | - unsigned int dest_height) | ||
32 | -{ | ||
33 | - return VA_STATUS_SUCCESS; | ||
34 | -} | ||
35 | - | ||
36 | -VAStatus | ||
37 | i965_QuerySubpictureFormats(VADriverContextP ctx, | ||
38 | VAImageFormat *format_list, /* out */ | ||
39 | unsigned int *flags, /* out */ | ||
40 | @@ -1439,6 +1423,68 @@ i965_GetImage(VADriverContextP ctx, | ||
41 | } | ||
42 | |||
43 | VAStatus | ||
44 | +i965_PutImage(VADriverContextP ctx, | ||
45 | + VASurfaceID surface, | ||
46 | + VAImageID image, | ||
47 | + int src_x, | ||
48 | + int src_y, | ||
49 | + unsigned int src_width, | ||
50 | + unsigned int src_height, | ||
51 | + int dest_x, | ||
52 | + int dest_y, | ||
53 | + unsigned int dest_width, | ||
54 | + unsigned int dest_height) | ||
55 | +{ | ||
56 | + struct i965_driver_data *i965 = i965_driver_data(ctx); | ||
57 | + | ||
58 | + struct object_surface *obj_surface = SURFACE(surface); | ||
59 | + if (!obj_surface) | ||
60 | + return VA_STATUS_ERROR_INVALID_SURFACE; | ||
61 | + | ||
62 | + struct object_image *obj_image = IMAGE(image); | ||
63 | + if (!obj_image) | ||
64 | + return VA_STATUS_ERROR_INVALID_IMAGE; | ||
65 | + | ||
66 | + /* XXX: we don't support partial video surface updates */ | ||
67 | + if (src_x != 0 || | ||
68 | + src_y != 0 || | ||
69 | + src_width != obj_image->image.width || | ||
70 | + src_height != obj_image->image.height) | ||
71 | + return VA_STATUS_ERROR_OPERATION_FAILED; | ||
72 | + if (dest_x != 0 || | ||
73 | + dest_y != 0 || | ||
74 | + dest_width != obj_surface->width || | ||
75 | + dest_height != obj_surface->height) | ||
76 | + return VA_STATUS_ERROR_OPERATION_FAILED; | ||
77 | + if (src_width != dest_width || | ||
78 | + src_height != dest_height) | ||
79 | + return VA_STATUS_ERROR_OPERATION_FAILED; | ||
80 | + | ||
81 | + VAStatus va_status; | ||
82 | + void *image_data = NULL; | ||
83 | + | ||
84 | + va_status = i965_MapBuffer(ctx, obj_image->image.buf, &image_data); | ||
85 | + if (va_status != VA_STATUS_SUCCESS) | ||
86 | + return va_status; | ||
87 | + | ||
88 | + dri_bo_map(obj_surface->bo, 1); | ||
89 | + | ||
90 | + switch (obj_image->image.format.fourcc) { | ||
91 | + case VA_FOURCC('Y','V','1','2'): /* YV12 is native format here */ | ||
92 | + memcpy(obj_surface->bo->virtual, image_data, obj_surface->bo->size); | ||
93 | + break; | ||
94 | + default: | ||
95 | + va_status = VA_STATUS_ERROR_OPERATION_FAILED; | ||
96 | + break; | ||
97 | + } | ||
98 | + | ||
99 | + dri_bo_unmap(obj_surface->bo); | ||
100 | + | ||
101 | + i965_UnmapBuffer(ctx, obj_image->image.buf); | ||
102 | + return va_status; | ||
103 | +} | ||
104 | + | ||
105 | +VAStatus | ||
106 | i965_PutSurface(VADriverContextP ctx, | ||
107 | VASurfaceID surface, | ||
108 | Drawable draw, /* X Drawable */ | ||
109 | -- | ||
110 | 1.5.4.3 | ||
111 | |||