• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Révision18d0aee33fd4a32f846475cf31a2be6499b17b4b (tree)
l'heure2014-06-03 02:30:43
AuteurGwenole Beauchesne <gwenole.beauchesne@inte...>
CommiterGwenole Beauchesne

Message de Log

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>

Change Summary

Modification

--- a/src/gen8_render.c
+++ b/src/gen8_render.c
@@ -276,6 +276,9 @@ gen8_render_src_surfaces_state(
276276 gen8_render_src_surface_state(ctx, 1, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); /* Y */
277277 gen8_render_src_surface_state(ctx, 2, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags);
278278
279+ if (obj_surface->fourcc == VA_FOURCC_Y800) /* single plane for grayscale */
280+ return;
281+
279282 if (obj_surface->fourcc == VA_FOURCC_NV12) {
280283 gen8_render_src_surface_state(ctx, 3, region,
281284 region_pitch * obj_surface->y_cb_offset,
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -861,6 +861,7 @@ bpp_1stplane_by_fourcc(unsigned int fourcc)
861861 case VA_FOURCC_YUY2:
862862 return 2;
863863
864+ case VA_FOURCC_Y800:
864865 case VA_FOURCC_YV12:
865866 case VA_FOURCC_IMC3:
866867 case VA_FOURCC_IYUV:
@@ -2868,13 +2869,13 @@ i965_check_alloc_surface_bo(VADriverContextP ctx,
28682869
28692870 case VA_FOURCC_Y800:
28702871 assert(subsampling == SUBSAMPLE_YUV400);
2871- obj_surface->cb_cr_pitch = obj_surface->width;
2872+ obj_surface->cb_cr_pitch = 0;
28722873 obj_surface->cb_cr_width = 0;
28732874 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;
28762877 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;
28782879
28792880 break;
28802881
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -876,6 +876,9 @@ i965_render_src_surfaces_state(
876876 i965_render_src_surface_state(ctx, 1, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags); /* Y */
877877 i965_render_src_surface_state(ctx, 2, region, 0, rw, rh, region_pitch, I965_SURFACEFORMAT_R8_UNORM, flags);
878878
879+ if (obj_surface->fourcc == VA_FOURCC_Y800) /* single plane for grayscale */
880+ return;
881+
879882 if (obj_surface->fourcc == VA_FOURCC_NV12) {
880883 i965_render_src_surface_state(ctx, 3, region,
881884 region_pitch * obj_surface->y_cb_offset,