summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-01-29 10:53:51 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-01-29 10:53:51 +0000
commit52baa9074dfcd1c783b3b86c279aa4cdec508fbe (patch)
treed8282564307f2f3e597b7bd42d168f382d88560b /lib
parent8d337e014bb2587682f6acd00715ac4a257b6d09 (diff)
Import Mesa 18.3.2
Diffstat (limited to 'lib')
-rw-r--r--lib/mesa/src/mesa/drivers/dri/i965/brw_program_binary.c30
-rw-r--r--lib/mesa/src/mesa/drivers/dri/i965/meson.build196
-rw-r--r--lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.c17
-rw-r--r--lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.h2
4 files changed, 152 insertions, 93 deletions
diff --git a/lib/mesa/src/mesa/drivers/dri/i965/brw_program_binary.c b/lib/mesa/src/mesa/drivers/dri/i965/brw_program_binary.c
index 919ddd3c1..db0333224 100644
--- a/lib/mesa/src/mesa/drivers/dri/i965/brw_program_binary.c
+++ b/lib/mesa/src/mesa/drivers/dri/i965/brw_program_binary.c
@@ -64,7 +64,7 @@ brw_get_program_binary_driver_sha1(struct gl_context *ctx, uint8_t *sha1)
enum driver_cache_blob_part {
END_PART,
- INTEL_PART,
+ GEN_PART,
NIR_PART,
};
@@ -81,7 +81,7 @@ blob_parts_valid(void *blob, uint32_t size)
if (part_type == END_PART)
return reader.current == reader.end;
switch ((enum driver_cache_blob_part)part_type) {
- case INTEL_PART:
+ case GEN_PART:
case NIR_PART:
/* Read the uint32_t part-size and skip over it */
blob_skip_bytes(&reader, blob_read_uint32(&reader));
@@ -112,14 +112,14 @@ blob_has_part(void *blob, uint32_t size, enum driver_cache_blob_part part)
}
static bool
-driver_blob_is_ready(void *blob, uint32_t size, bool with_intel_program)
+driver_blob_is_ready(void *blob, uint32_t size, bool with_gen_program)
{
if (!blob) {
return false;
} else if (!blob_parts_valid(blob, size)) {
unreachable("Driver blob format is bad!");
return false;
- } else if (blob_has_part(blob, size, INTEL_PART) == with_intel_program) {
+ } else if (blob_has_part(blob, size, GEN_PART) == with_gen_program) {
return true;
} else {
return false;
@@ -132,7 +132,7 @@ serialize_nir_part(struct blob *writer, struct gl_program *prog)
blob_write_uint32(writer, NIR_PART);
intptr_t size_offset = blob_reserve_uint32(writer);
size_t nir_start = writer->size;
- nir_serialize(writer, prog->nir, false);
+ nir_serialize(writer, prog->nir);
blob_overwrite_uint32(writer, size_offset, writer->size - nir_start);
}
@@ -157,14 +157,14 @@ brw_program_serialize_nir(struct gl_context *ctx, struct gl_program *prog)
}
static bool
-deserialize_intel_program(struct blob_reader *reader, struct gl_context *ctx,
+deserialize_gen_program(struct blob_reader *reader, struct gl_context *ctx,
struct gl_program *prog, gl_shader_stage stage)
{
struct brw_context *brw = brw_context(ctx);
union brw_any_prog_key prog_key;
blob_copy_bytes(reader, &prog_key, brw_prog_key_size(stage));
- prog_key.base.program_string_id = brw_program(prog)->id;
+ brw_prog_key_set_id(&prog_key, stage, brw_program(prog)->id);
enum brw_cache_id cache_id = brw_stage_cache_id(stage);
@@ -205,15 +205,15 @@ brw_program_deserialize_driver_blob(struct gl_context *ctx,
if ((enum driver_cache_blob_part)part_type == END_PART)
break;
switch ((enum driver_cache_blob_part)part_type) {
- case INTEL_PART: {
- ASSERTED uint32_t gen_size = blob_read_uint32(&reader);
+ case GEN_PART: {
+ uint32_t gen_size = blob_read_uint32(&reader);
assert(!reader.overrun &&
(uintptr_t)(reader.end - reader.current) > gen_size);
- deserialize_intel_program(&reader, ctx, prog, stage);
+ deserialize_gen_program(&reader, ctx, prog, stage);
break;
}
case NIR_PART: {
- ASSERTED uint32_t nir_size = blob_read_uint32(&reader);
+ uint32_t nir_size = blob_read_uint32(&reader);
assert(!reader.overrun &&
(uintptr_t)(reader.end - reader.current) > nir_size);
const struct nir_shader_compiler_options *options =
@@ -244,14 +244,14 @@ brw_deserialize_program_binary(struct gl_context *ctx,
}
static void
-serialize_intel_part(struct blob *writer, struct gl_context *ctx,
+serialize_gen_part(struct blob *writer, struct gl_context *ctx,
struct gl_shader_program *sh_prog,
struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
union brw_any_prog_key key;
- brw_populate_default_key(brw->screen->compiler, &key, sh_prog, prog);
+ brw_populate_default_key(&brw->screen->devinfo, &key, sh_prog, prog);
const gl_shader_stage stage = prog->info.stage;
uint32_t offset = 0;
@@ -266,7 +266,7 @@ serialize_intel_part(struct blob *writer, struct gl_context *ctx,
* use _mesa_streaming_load_memcpy to read from the program mapped
* memory.
*/
- blob_write_uint32(writer, INTEL_PART);
+ blob_write_uint32(writer, GEN_PART);
intptr_t size_offset = blob_reserve_uint32(writer);
size_t gen_start = writer->size;
blob_write_bytes(writer, &key, brw_prog_key_size(stage));
@@ -297,7 +297,7 @@ brw_serialize_program_binary(struct gl_context *ctx,
struct blob writer;
blob_init(&writer);
serialize_nir_part(&writer, prog);
- serialize_intel_part(&writer, ctx, sh_prog, prog);
+ serialize_gen_part(&writer, ctx, sh_prog, prog);
blob_write_uint32(&writer, END_PART);
prog->driver_cache_blob = ralloc_size(NULL, writer.size);
memcpy(prog->driver_cache_blob, writer.data, writer.size);
diff --git a/lib/mesa/src/mesa/drivers/dri/i965/meson.build b/lib/mesa/src/mesa/drivers/dri/i965/meson.build
index 25bcd1ae6..24172955e 100644
--- a/lib/mesa/src/mesa/drivers/dri/i965/meson.build
+++ b/lib/mesa/src/mesa/drivers/dri/i965/meson.build
@@ -39,6 +39,7 @@ files_i965 = files(
'brw_draw.h',
'brw_draw_upload.c',
'brw_ff_gs.c',
+ 'brw_ff_gs_emit.c',
'brw_ff_gs.h',
'brw_formatquery.c',
'brw_generate_mipmap.c',
@@ -53,7 +54,10 @@ files_i965 = files(
'brw_nir_uniforms.cpp',
'brw_object_purgeable.c',
'brw_pipe_control.c',
+ 'brw_performance_query.h',
'brw_performance_query.c',
+ 'brw_performance_query_mdapi.c',
+ 'brw_performance_query_metrics.h',
'brw_program.c',
'brw_program.h',
'brw_program_binary.c',
@@ -80,87 +84,147 @@ files_i965 = files(
'brw_wm.c',
'brw_wm.h',
'brw_wm_surface_state.c',
- 'gfx4_blorp_exec.h',
- 'gfx6_clip_state.c',
- 'gfx6_constant_state.c',
- 'gfx6_multisample_state.c',
- 'gfx6_queryobj.c',
- 'gfx6_sampler_state.c',
- 'gfx6_sol.c',
- 'gfx6_urb.c',
- 'gfx7_l3_state.c',
- 'gfx7_sol_state.c',
- 'gfx7_urb.c',
- 'gfx8_depth_state.c',
- 'gfx8_multisample_state.c',
+ 'gen4_blorp_exec.h',
+ 'gen6_clip_state.c',
+ 'gen6_constant_state.c',
+ 'gen6_multisample_state.c',
+ 'gen6_queryobj.c',
+ 'gen6_sampler_state.c',
+ 'gen6_sol.c',
+ 'gen6_urb.c',
+ 'gen7_l3_state.c',
+ 'gen7_sol_state.c',
+ 'gen7_urb.c',
+ 'gen8_depth_state.c',
+ 'gen8_multisample_state.c',
'hsw_queryobj.c',
'hsw_sol.c',
- 'brw_batch.c',
- 'brw_batch.h',
- 'brw_blit.c',
- 'brw_blit.h',
- 'brw_buffer_objects.c',
- 'brw_buffer_objects.h',
- 'brw_buffers.c',
- 'brw_buffers.h',
- 'brw_copy_image.c',
- 'brw_extensions.c',
- 'brw_fbo.c',
- 'brw_fbo.h',
- 'brw_image.h',
- 'brw_mipmap_tree.c',
- 'brw_mipmap_tree.h',
- 'brw_pixel_bitmap.c',
- 'brw_pixel.c',
- 'brw_pixel_copy.c',
- 'brw_pixel_draw.c',
- 'brw_pixel.h',
- 'brw_pixel_read.c',
- 'brw_screen.c',
- 'brw_screen.h',
- 'brw_state.c',
- 'brw_tex.c',
- 'brw_tex_copy.c',
- 'brw_tex.h',
- 'brw_tex_image.c',
- 'brw_tex_obj.h',
- 'brw_tex_validate.c',
- 'brw_upload.c',
+ 'intel_batchbuffer.c',
+ 'intel_batchbuffer.h',
+ 'intel_blit.c',
+ 'intel_blit.h',
+ 'intel_buffer_objects.c',
+ 'intel_buffer_objects.h',
+ 'intel_buffers.c',
+ 'intel_buffers.h',
+ 'intel_copy_image.c',
+ 'intel_extensions.c',
+ 'intel_fbo.c',
+ 'intel_fbo.h',
+ 'intel_image.h',
+ 'intel_mipmap_tree.c',
+ 'intel_mipmap_tree.h',
+ 'intel_pixel_bitmap.c',
+ 'intel_pixel.c',
+ 'intel_pixel_copy.c',
+ 'intel_pixel_draw.c',
+ 'intel_pixel.h',
+ 'intel_pixel_read.c',
+ 'intel_screen.c',
+ 'intel_screen.h',
+ 'intel_state.c',
+ 'intel_tex.c',
+ 'intel_tex_copy.c',
+ 'intel_tex.h',
+ 'intel_tex_image.c',
+ 'intel_tex_obj.h',
+ 'intel_tex_validate.c',
+ 'intel_upload.c',
'libdrm_macros.h',
)
-i965_per_hw_ver_libs = []
-foreach v : ['40', '45', '50', '60', '70', '75', '80', '90', '110']
- i965_per_hw_ver_libs += static_library(
- 'i965_per_hw_ver@0@'.format(v),
- ['genX_blorp_exec.c', 'genX_boilerplate.h', 'genX_pipe_control.c',
- 'genX_state_upload.c', gen_xml_pack],
- include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_dri_common],
+files_intel_tiled_memcpy = files(
+ 'intel_tiled_memcpy_normal.c',
+ 'intel_tiled_memcpy.h',
+)
+
+files_intel_tiled_memcpy_sse41 = files(
+ 'intel_tiled_memcpy_sse41.c',
+ 'intel_tiled_memcpy_sse41.h',
+)
+
+i965_gen_libs = []
+foreach v : ['40', '45', '50', '60', '70', '75', '80', '90', '100', '110']
+ i965_gen_libs += static_library(
+ 'i965_gen@0@'.format(v),
+ ['genX_blorp_exec.c', 'genX_state_upload.c', gen_xml_pack],
+ include_directories : [inc_common, inc_intel, inc_dri_common],
c_args : [
- no_override_init_args, c_sse2_args,
- '-DGFX_VERx10=@0@'.format(v),
+ c_vis_args, no_override_init_args, c_sse2_args,
+ '-DGEN_VERSIONx10=@0@'.format(v),
],
- gnu_symbol_visibility : 'hidden',
- dependencies : [dep_libdrm, idep_nir_headers, idep_mesautil],
+ dependencies : [dep_libdrm, idep_nir_headers],
)
endforeach
+i965_hw_metrics = [
+ 'hsw',
+ 'bdw', 'chv',
+ 'sklgt2', 'sklgt3', 'sklgt4',
+ 'kblgt2', 'kblgt3',
+ 'cflgt2', 'cflgt3',
+ 'bxt', 'glk',
+ 'cnl',
+]
+
+i965_hw_metrics_xml_files = []
+foreach hw : i965_hw_metrics
+ i965_hw_metrics_xml_files += 'brw_oa_@0@.xml'.format(hw)
+endforeach
+
+i965_oa_sources = custom_target(
+ 'i965-oa-sources',
+ input : i965_hw_metrics_xml_files,
+ output : [ 'brw_oa_metrics.c', 'brw_oa_metrics.h' ],
+ command : [
+ prog_python, files('brw_oa.py'),
+ '--code', '@OUTPUT0@', '--header', '@OUTPUT1@',
+ '@INPUT@',
+ ],
+)
+
+intel_tiled_memcpy = static_library(
+ 'intel_tiled_memcpy',
+ [files_intel_tiled_memcpy],
+ include_directories : [
+ inc_common, inc_intel, inc_dri_common, inc_drm_uapi,
+ ],
+ c_args : [c_vis_args, no_override_init_args, '-msse2'],
+ extra_files : ['intel_tiled_memcpy.c']
+)
+
+if with_sse41
+ intel_tiled_memcpy_sse41 = static_library(
+ 'intel_tiled_memcpy_sse41',
+ [files_intel_tiled_memcpy_sse41],
+ include_directories : [
+ inc_common, inc_intel, inc_dri_common, inc_drm_uapi,
+ ],
+ link_args : ['-Wl,--exclude-libs=ALL'],
+ c_args : [c_vis_args, no_override_init_args, '-Wl,--exclude-libs=ALL', '-msse2', sse41_args],
+ extra_files : ['intel_tiled_memcpy.c']
+ )
+else
+ intel_tiled_memcpy_sse41 = []
+endif
+
+
libi965 = static_library(
'i965',
- [files_i965, ir_expression_operation_h],
+ [files_i965, i965_oa_sources, ir_expression_operation_h,
+ xmlpool_options_h],
include_directories : [
- inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_dri_common,
+ inc_common, inc_intel, inc_dri_common, inc_util, inc_drm_uapi,
],
- c_args : [no_override_init_args, c_sse2_args],
- cpp_args : [c_sse2_args],
- gnu_symbol_visibility : 'hidden',
+ c_args : [c_vis_args, no_override_init_args, c_sse2_args],
+ cpp_args : [cpp_vis_args, c_sse2_args],
link_with : [
- i965_per_hw_ver_libs, libintel_dev, libisl, libintel_compiler, libblorp,
- libintel_perf
- ],
- dependencies : [
- dep_libdrm, dep_valgrind, idep_libintel_common, idep_nir_headers, idep_genxml,
- idep_xmlconfig,
+ i965_gen_libs, libintel_common, libintel_dev, libisl, libintel_compiler,
+ libblorp, intel_tiled_memcpy, intel_tiled_memcpy_sse41
],
+ dependencies : [dep_libdrm, dep_valgrind, idep_nir_headers],
)
+
+dri_drivers += libi965
+dri_link += 'i965_dri.so'
diff --git a/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.c b/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.c
index 6d9741358..4a3faf575 100644
--- a/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.c
+++ b/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.c
@@ -21,7 +21,7 @@
* DEALINGS IN THE SOFTWARE.
*/
-
+#include "main/imports.h"
#include "main/mtypes.h"
#include "main/context.h"
@@ -29,12 +29,11 @@
#include "st_context.h"
#include "st_texture.h"
-#include "st_util.h"
#include "st_cb_bitmap.h"
#include "st_cb_bufferobjects.h"
#include "st_cb_semaphoreobjects.h"
-#include "frontend/drm_driver.h"
+#include "state_tracker/drm_driver.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
@@ -109,8 +108,7 @@ st_server_wait_semaphore(struct gl_context *ctx,
continue;
bufObj = st_buffer_object(bufObjs[i]);
- if (bufObj->buffer)
- pipe->flush_resource(pipe, bufObj->buffer);
+ pipe->flush_resource(pipe, bufObj->buffer);
}
for (unsigned i = 0; i < numTextureBarriers; i++) {
@@ -118,8 +116,7 @@ st_server_wait_semaphore(struct gl_context *ctx,
continue;
texObj = st_texture_object(texObjs[i]);
- if (texObj->pt)
- pipe->flush_resource(pipe, texObj->pt);
+ pipe->flush_resource(pipe, texObj->pt);
}
}
@@ -143,8 +140,7 @@ st_server_signal_semaphore(struct gl_context *ctx,
continue;
bufObj = st_buffer_object(bufObjs[i]);
- if (bufObj->buffer)
- pipe->flush_resource(pipe, bufObj->buffer);
+ pipe->flush_resource(pipe, bufObj->buffer);
}
for (unsigned i = 0; i < numTextureBarriers; i++) {
@@ -152,8 +148,7 @@ st_server_signal_semaphore(struct gl_context *ctx,
continue;
texObj = st_texture_object(texObjs[i]);
- if (texObj->pt)
- pipe->flush_resource(pipe, texObj->pt);
+ pipe->flush_resource(pipe, texObj->pt);
}
/* The driver is allowed to flush during fence_server_signal, be prepared */
diff --git a/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.h b/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.h
index dba0b7021..6e87b82c8 100644
--- a/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.h
+++ b/lib/mesa/src/mesa/state_tracker/st_cb_semaphoreobjects.h
@@ -24,7 +24,7 @@
#ifndef ST_CB_SEMAPHOREOBJECTS_H
#define ST_CB_SEMAPHOREOBJECTS_H
-#include "util/compiler.h"
+#include "main/compiler.h"
#include "main/mtypes.h"
struct dd_function_table;