diff options
author | Tom Zanussi <tom.zanussi@intel.com> | 2010-12-27 16:32:21 -0600 |
---|---|---|
committer | Tom Zanussi <tom.zanussi@intel.com> | 2010-12-27 16:32:21 -0600 |
commit | af40e14ce335fa689d1a989feba3c02a8c71b7a7 (patch) | |
tree | 90ce1d53eb63627d90ec7f081b680a66c92e8705 /meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch | |
parent | ba8b8a99fd1598d0ce2cbaa69e9d16358d1ff5db (diff) | |
download | meta-intel-af40e14ce335fa689d1a989feba3c02a8c71b7a7.tar.gz |
meta-emenlow: move to meta-intel repo from poky repo
This is the meta-emenlow layer, moved from the poky repo in order to
keep all the meta-intel BSPs together.
This version builds against laverne (0.90) - detailed build
instruction can be found in the README file.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Diffstat (limited to 'meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch')
-rw-r--r-- | meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch new file mode 100644 index 00000000..92d814c1 --- /dev/null +++ b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/035_g45_add_yv12_image_format.patch | |||
@@ -0,0 +1,102 @@ | |||
1 | From 23b23e8d65551779f10aedddee7882c2e71ac162 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com> | ||
3 | Date: Wed, 4 Nov 2009 13:01:44 +0000 | ||
4 | Subject: [PATCH] [G45] Add YV12 image format. | ||
5 | |||
6 | --- | ||
7 | i965_drv_video/i965_drv_video.c | 50 ++++++++++++++++++++++++++++++++++++++- | ||
8 | i965_drv_video/i965_drv_video.h | 2 +- | ||
9 | 2 files changed, 50 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/i965_drv_video/i965_drv_video.c b/i965_drv_video/i965_drv_video.c | ||
12 | index 1f026bc..8558d0e 100644 | ||
13 | --- a/i965_drv_video/i965_drv_video.c | ||
14 | +++ b/i965_drv_video/i965_drv_video.c | ||
15 | @@ -54,6 +54,36 @@ enum { | ||
16 | I965_SURFACETYPE_INDEXED | ||
17 | }; | ||
18 | |||
19 | +/* List of supported image formats */ | ||
20 | +typedef struct { | ||
21 | + unsigned int type; | ||
22 | + VAImageFormat va_format; | ||
23 | +} i965_image_format_map_t; | ||
24 | + | ||
25 | +static const i965_image_format_map_t | ||
26 | +i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = { | ||
27 | + { I965_SURFACETYPE_YUV, | ||
28 | + { VA_FOURCC('Y','V','1','2'), VA_LSB_FIRST, 12, } }, | ||
29 | +}; | ||
30 | + | ||
31 | +static const i965_image_format_map_t * | ||
32 | +get_image_format(const VAImageFormat *va_format) | ||
33 | +{ | ||
34 | + unsigned int i; | ||
35 | + for (i = 0; i965_image_formats_map[i].type != 0; i++) { | ||
36 | + const i965_image_format_map_t * const m = &i965_image_formats_map[i]; | ||
37 | + if (m->va_format.fourcc == va_format->fourcc && | ||
38 | + (m->type == I965_SURFACETYPE_RGBA ? | ||
39 | + (m->va_format.byte_order == va_format->byte_order && | ||
40 | + m->va_format.red_mask == va_format->red_mask && | ||
41 | + m->va_format.green_mask == va_format->green_mask && | ||
42 | + m->va_format.blue_mask == va_format->blue_mask && | ||
43 | + m->va_format.alpha_mask == va_format->alpha_mask) : 1)) | ||
44 | + return m; | ||
45 | + } | ||
46 | + return NULL; | ||
47 | +} | ||
48 | + | ||
49 | /* List of supported subpicture formats */ | ||
50 | typedef struct { | ||
51 | unsigned int type; | ||
52 | @@ -398,8 +428,16 @@ i965_QueryImageFormats(VADriverContextP ctx, | ||
53 | VAImageFormat *format_list, /* out */ | ||
54 | int *num_formats) /* out */ | ||
55 | { | ||
56 | + int n; | ||
57 | + | ||
58 | + for (n = 0; i965_image_formats_map[n].va_format.fourcc != 0; n++) { | ||
59 | + const i965_image_format_map_t * const m = &i965_image_formats_map[n]; | ||
60 | + if (format_list) | ||
61 | + format_list[n] = m->va_format; | ||
62 | + } | ||
63 | + | ||
64 | if (num_formats) | ||
65 | - *num_formats = 0; | ||
66 | + *num_formats = n; | ||
67 | |||
68 | return VA_STATUS_SUCCESS; | ||
69 | } | ||
70 | @@ -1236,6 +1274,16 @@ i965_CreateImage(VADriverContextP ctx, | ||
71 | image->offsets[0] = 0; | ||
72 | image->data_size = image->offsets[0] + image->pitches[0] * height; | ||
73 | break; | ||
74 | + case VA_FOURCC('Y','V','1','2'): | ||
75 | + image->num_planes = 3; | ||
76 | + image->pitches[0] = width; | ||
77 | + image->offsets[0] = 0; | ||
78 | + image->pitches[1] = width2; | ||
79 | + image->offsets[1] = size; | ||
80 | + image->pitches[2] = width2; | ||
81 | + image->offsets[2] = size + size2; | ||
82 | + image->data_size = size + 2 * size2; | ||
83 | + break; | ||
84 | default: | ||
85 | goto error; | ||
86 | } | ||
87 | diff --git a/i965_drv_video/i965_drv_video.h b/i965_drv_video/i965_drv_video.h | ||
88 | index 4d775da..f512793 100644 | ||
89 | --- a/i965_drv_video/i965_drv_video.h | ||
90 | +++ b/i965_drv_video/i965_drv_video.h | ||
91 | @@ -41,7 +41,7 @@ | ||
92 | #define I965_MAX_PROFILES 11 | ||
93 | #define I965_MAX_ENTRYPOINTS 5 | ||
94 | #define I965_MAX_CONFIG_ATTRIBUTES 10 | ||
95 | -#define I965_MAX_IMAGE_FORMATS 10 | ||
96 | +#define I965_MAX_IMAGE_FORMATS 1 | ||
97 | #define I965_MAX_SUBPIC_FORMATS 4 | ||
98 | #define I965_MAX_DISPLAY_ATTRIBUTES 4 | ||
99 | #define I965_STR_VENDOR "i965 Driver 0.1" | ||
100 | -- | ||
101 | 1.5.4.3 | ||
102 | |||