hardware/intel/intel-driver
修订版 | a82f0be3588fc7b42060ad18e9e4ff6e319e9507 (tree) |
---|---|
时间 | 2016-05-26 13:54:42 |
作者 | Zhao Yakui <yakui.zhao@inte...> |
Commiter | Xiang, Haihao |
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>
@@ -734,7 +734,8 @@ gen8_gpe_set_surface2_state(VADriverContextP ctx, | ||
734 | 734 | |
735 | 735 | memset(ss, 0, sizeof(*ss)); |
736 | 736 | /* 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); | |
738 | 739 | /* ss1 */ |
739 | 740 | ss->ss1.cbcr_pixel_offset_v_direction = 2; |
740 | 741 | ss->ss1.width = w - 1; |
@@ -794,7 +795,8 @@ gen8_gpe_set_media_rw_surface_state(VADriverContextP ctx, | ||
794 | 795 | ss->ss0.surface_type = I965_SURFACE_2D; |
795 | 796 | ss->ss0.surface_format = I965_SURFACEFORMAT_R8_UNORM; |
796 | 797 | /* 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); | |
798 | 800 | /* ss2 */ |
799 | 801 | ss->ss2.width = w / 4 - 1; /* in DWORDs for media read & write message */ |
800 | 802 | ss->ss2.height = h - 1; |
@@ -811,6 +813,7 @@ gen8_gpe_set_media_chroma_surface_state(VADriverContextP ctx, | ||
811 | 813 | int w, w_pitch; |
812 | 814 | unsigned int tiling, swizzle; |
813 | 815 | int cbcr_offset; |
816 | + uint64_t base_offset; | |
814 | 817 | |
815 | 818 | dri_bo_get_tiling(obj_surface->bo, &tiling, &swizzle); |
816 | 819 | w = obj_surface->orig_width; |
@@ -822,7 +825,9 @@ gen8_gpe_set_media_chroma_surface_state(VADriverContextP ctx, | ||
822 | 825 | ss->ss0.surface_type = I965_SURFACE_2D; |
823 | 826 | ss->ss0.surface_format = I965_SURFACEFORMAT_R8_UNORM; |
824 | 827 | /* 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); | |
826 | 831 | /* ss2 */ |
827 | 832 | ss->ss2.width = w / 4 - 1; /* in DWORDs for media read & write message */ |
828 | 833 | ss->ss2.height = (obj_surface->height / 2) -1; |
@@ -901,7 +906,8 @@ gen8_gpe_set_buffer_surface_state(VADriverContextP ctx, | ||
901 | 906 | /* ss0 */ |
902 | 907 | ss->ss0.surface_type = I965_SURFACE_BUFFER; |
903 | 908 | /* 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); | |
905 | 911 | /* ss2 */ |
906 | 912 | ss->ss2.width = ((num_entries - 1) & 0x7f); |
907 | 913 | ss->ss2.height = (((num_entries - 1) >> 7) & 0x3fff); |
@@ -950,36 +956,39 @@ gen8_gpe_state_base_address(VADriverContextP ctx, | ||
950 | 956 | OUT_BATCH(batch, 0); |
951 | 957 | |
952 | 958 | /*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 */ | |
955 | 960 | |
956 | 961 | /*DW6. Dynamic state base address */ |
957 | 962 | if (gpe_context->dynamic_state.bo) |
958 | - OUT_RELOC(batch, gpe_context->dynamic_state.bo, | |
963 | + OUT_RELOC64(batch, gpe_context->dynamic_state.bo, | |
959 | 964 | I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER, |
960 | 965 | 0, BASE_ADDRESS_MODIFY); |
961 | - else | |
966 | + else { | |
962 | 967 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
968 | + OUT_BATCH(batch, 0); | |
969 | + } | |
963 | 970 | |
964 | - OUT_BATCH(batch, 0); | |
965 | 971 | |
966 | 972 | /*DW8. Indirect Object base address */ |
967 | 973 | if (gpe_context->indirect_state.bo) |
968 | - OUT_RELOC(batch, gpe_context->indirect_state.bo, | |
974 | + OUT_RELOC64(batch, gpe_context->indirect_state.bo, | |
969 | 975 | I915_GEM_DOMAIN_SAMPLER, |
970 | 976 | 0, BASE_ADDRESS_MODIFY); |
971 | - else | |
977 | + else { | |
972 | 978 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
979 | + OUT_BATCH(batch, 0); | |
980 | + } | |
973 | 981 | |
974 | - OUT_BATCH(batch, 0); | |
975 | 982 | |
976 | 983 | /*DW10. Instruct base address */ |
977 | 984 | if (gpe_context->instruction_state.bo) |
978 | - OUT_RELOC(batch, gpe_context->instruction_state.bo, | |
985 | + OUT_RELOC64(batch, gpe_context->instruction_state.bo, | |
979 | 986 | I915_GEM_DOMAIN_INSTRUCTION, |
980 | 987 | 0, BASE_ADDRESS_MODIFY); |
981 | - else | |
988 | + else { | |
982 | 989 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
990 | + OUT_BATCH(batch, 0); | |
991 | + } | |
983 | 992 | |
984 | 993 | OUT_BATCH(batch, 0); |
985 | 994 |
@@ -1218,38 +1227,40 @@ gen9_gpe_state_base_address(VADriverContextP ctx, | ||
1218 | 1227 | OUT_BATCH(batch, 0); |
1219 | 1228 | |
1220 | 1229 | /*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 */ | |
1223 | 1231 | |
1224 | 1232 | /*DW6. Dynamic state base address */ |
1225 | 1233 | if (gpe_context->dynamic_state.bo) |
1226 | - OUT_RELOC(batch, gpe_context->dynamic_state.bo, | |
1234 | + OUT_RELOC64(batch, gpe_context->dynamic_state.bo, | |
1227 | 1235 | 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 { | |
1230 | 1238 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
1239 | + OUT_BATCH(batch, 0); | |
1240 | + } | |
1231 | 1241 | |
1232 | - OUT_BATCH(batch, 0); | |
1233 | 1242 | |
1234 | 1243 | /*DW8. Indirect Object base address */ |
1235 | 1244 | if (gpe_context->indirect_state.bo) |
1236 | - OUT_RELOC(batch, gpe_context->indirect_state.bo, | |
1245 | + OUT_RELOC64(batch, gpe_context->indirect_state.bo, | |
1237 | 1246 | I915_GEM_DOMAIN_SAMPLER, |
1238 | 1247 | 0, BASE_ADDRESS_MODIFY); |
1239 | - else | |
1248 | + else { | |
1240 | 1249 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
1250 | + OUT_BATCH(batch, 0); | |
1251 | + } | |
1241 | 1252 | |
1242 | - OUT_BATCH(batch, 0); | |
1243 | 1253 | |
1244 | 1254 | /*DW10. Instruct base address */ |
1245 | 1255 | if (gpe_context->instruction_state.bo) |
1246 | - OUT_RELOC(batch, gpe_context->instruction_state.bo, | |
1256 | + OUT_RELOC64(batch, gpe_context->instruction_state.bo, | |
1247 | 1257 | I915_GEM_DOMAIN_INSTRUCTION, |
1248 | 1258 | 0, BASE_ADDRESS_MODIFY); |
1249 | - else | |
1259 | + else { | |
1250 | 1260 | OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY); |
1261 | + OUT_BATCH(batch, 0); | |
1262 | + } | |
1251 | 1263 | |
1252 | - OUT_BATCH(batch, 0); | |
1253 | 1264 | |
1254 | 1265 | /* DW12. Size limitation */ |
1255 | 1266 | OUT_BATCH(batch, 0xFFFFF000 | BASE_ADDRESS_MODIFY); //General State Access Upper Bound |