hardware/intel/intel-driver
Révision | 18d0aee33fd4a32f846475cf31a2be6499b17b4b (tree) |
---|---|
l'heure | 2014-06-03 02:30:43 |
Auteur | Gwenole Beauchesne <gwenole.beauchesne@inte...> |
Commiter | Gwenole Beauchesne |
surface: fix geometry (size, layout) of grayscale surfaces.
Fix size of the allocated buffer used to represent grayscale (Y800)
surfaces. Only the luminance component is needed, thus implying a
single plane.
Likewise, update render routines to only submit the first plane.
The existing render kernels readily only care about that single
plane.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
@@ -276,6 +276,9 @@ gen8_render_src_surfaces_state( | ||
276 | 276 | gen8_render_src_surface_state(ctx, 1, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); /* Y */ |
277 | 277 | gen8_render_src_surface_state(ctx, 2, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); |
278 | 278 | |
279 | + if (obj_surface->fourcc == VA_FOURCC_Y800) /* single plane for grayscale */ | |
280 | + return; | |
281 | + | |
279 | 282 | if (obj_surface->fourcc == VA_FOURCC_NV12) { |
280 | 283 | gen8_render_src_surface_state(ctx, 3, region, |
281 | 284 | region_pitch * obj_surface->y_cb_offset, |
@@ -861,6 +861,7 @@ bpp_1stplane_by_fourcc(unsigned int fourcc) | ||
861 | 861 | case VA_FOURCC_YUY2: |
862 | 862 | return 2; |
863 | 863 | |
864 | + case VA_FOURCC_Y800: | |
864 | 865 | case VA_FOURCC_YV12: |
865 | 866 | case VA_FOURCC_IMC3: |
866 | 867 | case VA_FOURCC_IYUV: |
@@ -2868,13 +2869,13 @@ i965_check_alloc_surface_bo(VADriverContextP ctx, | ||
2868 | 2869 | |
2869 | 2870 | case VA_FOURCC_Y800: |
2870 | 2871 | assert(subsampling == SUBSAMPLE_YUV400); |
2871 | - obj_surface->cb_cr_pitch = obj_surface->width; | |
2872 | + obj_surface->cb_cr_pitch = 0; | |
2872 | 2873 | obj_surface->cb_cr_width = 0; |
2873 | 2874 | obj_surface->cb_cr_height = 0; |
2874 | - obj_surface->y_cb_offset = obj_surface->height; | |
2875 | - obj_surface->y_cr_offset = obj_surface->y_cb_offset + ALIGN(obj_surface->cb_cr_height, 32); | |
2875 | + obj_surface->y_cb_offset = 0; | |
2876 | + obj_surface->y_cr_offset = 0; | |
2876 | 2877 | region_width = obj_surface->width; |
2877 | - region_height = obj_surface->height + ALIGN(obj_surface->cb_cr_height, 32) * 2; | |
2878 | + region_height = obj_surface->height; | |
2878 | 2879 | |
2879 | 2880 | break; |
2880 | 2881 |
@@ -876,6 +876,9 @@ i965_render_src_surfaces_state( | ||
876 | 876 | i965_render_src_surface_state(ctx, 1, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); /* Y */ |
877 | 877 | i965_render_src_surface_state(ctx, 2, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); |
878 | 878 | |
879 | + if (obj_surface->fourcc == VA_FOURCC_Y800) /* single plane for grayscale */ | |
880 | + return; | |
881 | + | |
879 | 882 | if (obj_surface->fourcc == VA_FOURCC_NV12) { |
880 | 883 | i965_render_src_surface_state(ctx, 3, region, |
881 | 884 | region_pitch * obj_surface->y_cb_offset, |