• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

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

修订版a82f0be3588fc7b42060ad18e9e4ff6e319e9507 (tree)
时间2016-05-26 13:54:42
作者Zhao Yakui <yakui.zhao@inte...>
CommiterXiang, Haihao

Log Message

Fix the 48-bit address issue for gpe_util functions on gen8+

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Sean V Kelley <sean.v.kelley@intel.com>

更改概述

差异

--- a/src/i965_gpe_utils.c
+++ b/src/i965_gpe_utils.c
@@ -734,7 +734,8 @@ gen8_gpe_set_surface2_state(VADriverContextP ctx,
734734
735735 memset(ss, 0, sizeof(*ss));
736736 /* ss0 */
737- ss->ss6.base_addr = obj_surface->bo->offset;
737+ ss->ss6.base_addr = (uint32_t)obj_surface->bo->offset64;
738+ ss->ss7.base_addr_high = (uint32_t)(obj_surface->bo->offset64 >> 32);
738739 /* ss1 */
739740 ss->ss1.cbcr_pixel_offset_v_direction = 2;
740741 ss->ss1.width = w - 1;
@@ -794,7 +795,8 @@ gen8_gpe_set_media_rw_surface_state(VADriverContextP ctx,
794795 ss->ss0.surface_type = I965_SURFACE_2D;
795796 ss->ss0.surface_format = I965_SURFACEFORMAT_R8_UNORM;
796797 /* ss1 */
797- ss->ss8.base_addr = obj_surface->bo->offset;
798+ ss->ss8.base_addr = (uint32_t)obj_surface->bo->offset64;
799+ ss->ss9.base_addr_high = (uint32_t)(obj_surface->bo->offset64 >> 32);
798800 /* ss2 */
799801 ss->ss2.width = w / 4 - 1; /* in DWORDs for media read & write message */
800802 ss->ss2.height = h - 1;
@@ -811,6 +813,7 @@ gen8_gpe_set_media_chroma_surface_state(VADriverContextP ctx,
811813 int w, w_pitch;
812814 unsigned int tiling, swizzle;
813815 int cbcr_offset;
816+ uint64_t base_offset;
814817
815818 dri_bo_get_tiling(obj_surface->bo, &tiling, &swizzle);
816819 w = obj_surface->orig_width;
@@ -822,7 +825,9 @@ gen8_gpe_set_media_chroma_surface_state(VADriverContextP ctx,
822825 ss->ss0.surface_type = I965_SURFACE_2D;
823826 ss->ss0.surface_format = I965_SURFACEFORMAT_R8_UNORM;
824827 /* ss1 */
825- ss->ss8.base_addr = obj_surface->bo->offset + cbcr_offset;
828+ base_offset = obj_surface->bo->offset64 + cbcr_offset;
829+ ss->ss8.base_addr = (uint32_t) base_offset;
830+ ss->ss9.base_addr_high = (uint32_t) (base_offset >> 32);
826831 /* ss2 */
827832 ss->ss2.width = w / 4 - 1; /* in DWORDs for media read & write message */
828833 ss->ss2.height = (obj_surface->height / 2) -1;
@@ -901,7 +906,8 @@ gen8_gpe_set_buffer_surface_state(VADriverContextP ctx,
901906 /* ss0 */
902907 ss->ss0.surface_type = I965_SURFACE_BUFFER;
903908 /* ss1 */
904- ss->ss8.base_addr = buffer_surface->bo->offset;
909+ ss->ss8.base_addr = (uint32_t)buffer_surface->bo->offset64;
910+ ss->ss9.base_addr_high = (uint32_t)(buffer_surface->bo->offset64 >> 32);
905911 /* ss2 */
906912 ss->ss2.width = ((num_entries - 1) & 0x7f);
907913 ss->ss2.height = (((num_entries - 1) >> 7) & 0x3fff);
@@ -950,36 +956,39 @@ gen8_gpe_state_base_address(VADriverContextP ctx,
950956 OUT_BATCH(batch, 0);
951957
952958 /*DW4 Surface state base address */
953- OUT_RELOC(batch, gpe_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
954- OUT_BATCH(batch, 0);
959+ OUT_RELOC64(batch, gpe_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
955960
956961 /*DW6. Dynamic state base address */
957962 if (gpe_context->dynamic_state.bo)
958- OUT_RELOC(batch, gpe_context->dynamic_state.bo,
963+ OUT_RELOC64(batch, gpe_context->dynamic_state.bo,
959964 I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER,
960965 0, BASE_ADDRESS_MODIFY);
961- else
966+ else {
962967 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
968+ OUT_BATCH(batch, 0);
969+ }
963970
964- OUT_BATCH(batch, 0);
965971
966972 /*DW8. Indirect Object base address */
967973 if (gpe_context->indirect_state.bo)
968- OUT_RELOC(batch, gpe_context->indirect_state.bo,
974+ OUT_RELOC64(batch, gpe_context->indirect_state.bo,
969975 I915_GEM_DOMAIN_SAMPLER,
970976 0, BASE_ADDRESS_MODIFY);
971- else
977+ else {
972978 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
979+ OUT_BATCH(batch, 0);
980+ }
973981
974- OUT_BATCH(batch, 0);
975982
976983 /*DW10. Instruct base address */
977984 if (gpe_context->instruction_state.bo)
978- OUT_RELOC(batch, gpe_context->instruction_state.bo,
985+ OUT_RELOC64(batch, gpe_context->instruction_state.bo,
979986 I915_GEM_DOMAIN_INSTRUCTION,
980987 0, BASE_ADDRESS_MODIFY);
981- else
988+ else {
982989 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
990+ OUT_BATCH(batch, 0);
991+ }
983992
984993 OUT_BATCH(batch, 0);
985994
@@ -1218,38 +1227,40 @@ gen9_gpe_state_base_address(VADriverContextP ctx,
12181227 OUT_BATCH(batch, 0);
12191228
12201229 /*DW4 Surface state base address */
1221- OUT_RELOC(batch, gpe_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
1222- OUT_BATCH(batch, 0);
1230+ OUT_RELOC64(batch, gpe_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
12231231
12241232 /*DW6. Dynamic state base address */
12251233 if (gpe_context->dynamic_state.bo)
1226- OUT_RELOC(batch, gpe_context->dynamic_state.bo,
1234+ OUT_RELOC64(batch, gpe_context->dynamic_state.bo,
12271235 I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER,
1228- 0, BASE_ADDRESS_MODIFY);
1229- else
1236+ I915_GEM_DOMAIN_RENDER, BASE_ADDRESS_MODIFY);
1237+ else {
12301238 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
1239+ OUT_BATCH(batch, 0);
1240+ }
12311241
1232- OUT_BATCH(batch, 0);
12331242
12341243 /*DW8. Indirect Object base address */
12351244 if (gpe_context->indirect_state.bo)
1236- OUT_RELOC(batch, gpe_context->indirect_state.bo,
1245+ OUT_RELOC64(batch, gpe_context->indirect_state.bo,
12371246 I915_GEM_DOMAIN_SAMPLER,
12381247 0, BASE_ADDRESS_MODIFY);
1239- else
1248+ else {
12401249 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
1250+ OUT_BATCH(batch, 0);
1251+ }
12411252
1242- OUT_BATCH(batch, 0);
12431253
12441254 /*DW10. Instruct base address */
12451255 if (gpe_context->instruction_state.bo)
1246- OUT_RELOC(batch, gpe_context->instruction_state.bo,
1256+ OUT_RELOC64(batch, gpe_context->instruction_state.bo,
12471257 I915_GEM_DOMAIN_INSTRUCTION,
12481258 0, BASE_ADDRESS_MODIFY);
1249- else
1259+ else {
12501260 OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
1261+ OUT_BATCH(batch, 0);
1262+ }
12511263
1252- OUT_BATCH(batch, 0);
12531264
12541265 /* DW12. Size limitation */
12551266 OUT_BATCH(batch, 0xFFFFF000 | BASE_ADDRESS_MODIFY); //General State Access Upper Bound