summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/r600
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/drivers/r600')
-rw-r--r--lib/mesa/src/gallium/drivers/r600/Android.mk4
-rw-r--r--lib/mesa/src/gallium/drivers/r600/meson.build80
-rw-r--r--lib/mesa/src/gallium/drivers/r600/r600_dump.c32
-rw-r--r--lib/mesa/src/gallium/drivers/r600/r600_pipe_common.c62
-rw-r--r--lib/mesa/src/gallium/drivers/r600/r600_texture.c21
-rw-r--r--lib/mesa/src/gallium/drivers/r600/radeon_vce.c1
6 files changed, 24 insertions, 176 deletions
diff --git a/lib/mesa/src/gallium/drivers/r600/Android.mk b/lib/mesa/src/gallium/drivers/r600/Android.mk
index 296aa3ac9..19a3ba820 100644
--- a/lib/mesa/src/gallium/drivers/r600/Android.mk
+++ b/lib/mesa/src/gallium/drivers/r600/Android.mk
@@ -32,10 +32,8 @@ LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)
LOCAL_C_INCLUDES += \
$(MESA_TOP)/src/amd/common \
- $(MESA_TOP)/src/amd/llvm \
- $(MESA_TOP)/src/mesa
+ $(MESA_TOP)/src/amd/llvm
-LOCAL_STATIC_LIBRARIES := libmesa_nir
LOCAL_SHARED_LIBRARIES := libdrm_radeon
LOCAL_MODULE := libmesa_pipe_r600
diff --git a/lib/mesa/src/gallium/drivers/r600/meson.build b/lib/mesa/src/gallium/drivers/r600/meson.build
index 0bb31dca2..91f62a8a7 100644
--- a/lib/mesa/src/gallium/drivers/r600/meson.build
+++ b/lib/mesa/src/gallium/drivers/r600/meson.build
@@ -105,79 +105,7 @@ files_r600 = files(
'sb/sb_shader.h',
'sb/sb_ssa_builder.cpp',
'sb/sb_valtable.cpp',
- 'sfn/sfn_alu_defines.cpp',
- 'sfn/sfn_alu_defines.h',
- 'sfn/sfn_callstack.cpp',
- 'sfn/sfn_callstack.h',
- 'sfn/sfn_conditionaljumptracker.cpp',
- 'sfn/sfn_conditionaljumptracker.h',
- 'sfn/sfn_defines.h',
- 'sfn/sfn_debug.cpp',
- 'sfn/sfn_debug.h',
- 'sfn/sfn_emitaluinstruction.cpp',
- 'sfn/sfn_emitaluinstruction.h',
- 'sfn/sfn_emitinstruction.cpp',
- 'sfn/sfn_emitinstruction.h',
- 'sfn/sfn_emitssboinstruction.cpp',
- 'sfn/sfn_emitssboinstruction.h',
- 'sfn/sfn_emittexinstruction.cpp',
- 'sfn/sfn_emittexinstruction.h',
- 'sfn/sfn_emitinstruction.h',
- 'sfn/sfn_instruction_alu.cpp',
- 'sfn/sfn_instruction_alu.h',
- 'sfn/sfn_instruction_base.cpp',
- 'sfn/sfn_instruction_base.h',
- 'sfn/sfn_instruction_block.cpp',
- 'sfn/sfn_instruction_block.h',
- 'sfn/sfn_instruction_cf.cpp',
- 'sfn/sfn_instruction_cf.h',
- 'sfn/sfn_instruction_export.cpp',
- 'sfn/sfn_instruction_export.h',
- 'sfn/sfn_instruction_fetch.cpp',
- 'sfn/sfn_instruction_fetch.h',
- 'sfn/sfn_instruction_gds.cpp',
- 'sfn/sfn_instruction_gds.h',
- 'sfn/sfn_instruction_lds.cpp',
- 'sfn/sfn_instruction_lds.h',
- 'sfn/sfn_instruction_misc.cpp',
- 'sfn/sfn_instruction_misc.h',
- 'sfn/sfn_instruction_tex.cpp',
- 'sfn/sfn_instruction_tex.h',
- 'sfn/sfn_ir_to_assembly.cpp',
- 'sfn/sfn_ir_to_assembly.h',
- 'sfn/sfn_liverange.cpp',
- 'sfn/sfn_liverange.h',
- 'sfn/sfn_nir.cpp',
- 'sfn/sfn_nir.h',
- 'sfn/sfn_nir_lower_fs_out_to_vector.cpp',
- 'sfn/sfn_nir_lower_fs_out_to_vector.h',
- 'sfn/sfn_nir_lower_tess_io.cpp',
- 'sfn/sfn_nir_vectorize_vs_inputs.c',
- 'sfn/sfn_shader_base.cpp',
- 'sfn/sfn_shader_base.h',
- 'sfn/sfn_shader_compute.cpp',
- 'sfn/sfn_shader_compute.h',
- 'sfn/sfn_shader_fragment.cpp',
- 'sfn/sfn_shader_fragment.h',
- 'sfn/sfn_shader_geometry.cpp',
- 'sfn/sfn_shader_geometry.h',
- 'sfn/sfn_shader_tcs.cpp',
- 'sfn/sfn_shader_tcs.h',
- 'sfn/sfn_shader_tess_eval.cpp',
- 'sfn/sfn_shader_tess_eval.h',
- 'sfn/sfn_shader_vertex.cpp',
- 'sfn/sfn_shader_vertex.h',
- 'sfn/sfn_shaderio.cpp',
- 'sfn/sfn_shaderio.h',
- 'sfn/sfn_value.cpp',
- 'sfn/sfn_value.h',
- 'sfn/sfn_value_gpr.cpp',
- 'sfn/sfn_value_gpr.h',
- 'sfn/sfn_valuepool.cpp',
- 'sfn/sfn_valuepool.h',
- 'sfn/sfn_vertexstageexport.cpp',
- 'sfn/sfn_vertexstageexport.h',
- )
+)
egd_tables_h = custom_target(
'egd_tables.h',
@@ -198,13 +126,13 @@ libr600 = static_library(
c_args : [c_vis_args, r600_c_args, '-Wstrict-overflow=0'],
cpp_args : [cpp_vis_args],
include_directories : [
- inc_src, inc_mapi, inc_mesa, inc_include, inc_compiler, inc_gallium, inc_gallium_aux, inc_amd_common,
+ inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common,
inc_gallium_drivers,
],
- dependencies: [dep_libdrm_radeon, dep_elf, dep_llvm, idep_nir, idep_nir_headers],
+ dependencies: [dep_libdrm_radeon, dep_elf, dep_llvm],
)
driver_r600 = declare_dependency(
compile_args : '-DGALLIUM_R600',
- link_with : [libr600, libmesa_gallium, libradeonwinsys],
+ link_with : [libr600, libradeonwinsys],
)
diff --git a/lib/mesa/src/gallium/drivers/r600/r600_dump.c b/lib/mesa/src/gallium/drivers/r600/r600_dump.c
index 76b56bc7d..29a89605e 100644
--- a/lib/mesa/src/gallium/drivers/r600/r600_dump.c
+++ b/lib/mesa/src/gallium/drivers/r600/r600_dump.c
@@ -26,7 +26,6 @@
#include "r600_dump.h"
#include "r600_shader.h"
-#include "tgsi/tgsi_strings.h"
void print_shader_info(FILE *f , int id, struct r600_shader *shader)
{
@@ -166,35 +165,4 @@ void print_pipe_info(FILE *f, struct tgsi_shader_info *shader)
PRINT_UINT_MEMBER(writes_memory);
PRINT_UINT_MEMBER(file_mask[TGSI_FILE_HW_ATOMIC]);
PRINT_UINT_MEMBER(file_count[TGSI_FILE_HW_ATOMIC]);
-
- for(unsigned int i = 0; i < TGSI_PROPERTY_COUNT; ++i) {
- if (shader->properties[i] != 0)
- fprintf(stderr, "PROP: %s = %d\n", tgsi_property_names[i], shader->properties[i]);
- }
-
-#define PRINT_UINT_ARRAY_MEMBER(M, IDX) \
- if (shader-> M [ IDX ]) fprintf(f, #M "[%d] = %d\n", IDX, (unsigned) shader-> M [ IDX ]);
-
- for (int i = 0; i < shader->num_inputs; ++i) {
- PRINT_UINT_ARRAY_MEMBER(input_semantic_name, i); /**< TGSI_SEMANTIC_x */
- PRINT_UINT_ARRAY_MEMBER(input_semantic_index, i);
- PRINT_UINT_ARRAY_MEMBER(input_interpolate, i);
- PRINT_UINT_ARRAY_MEMBER(input_interpolate_loc, i);
- PRINT_UINT_ARRAY_MEMBER(input_usage_mask, i);
- PRINT_UINT_ARRAY_MEMBER(input_cylindrical_wrap, i);
- }
-
- for (int i = 0; i < shader->num_inputs; ++i) {
- PRINT_UINT_ARRAY_MEMBER(output_semantic_name, i);
- PRINT_UINT_ARRAY_MEMBER(output_semantic_index, i);
- PRINT_UINT_ARRAY_MEMBER(output_usagemask, i);
- PRINT_UINT_ARRAY_MEMBER(output_streams, i);
- }
-
- for (int i = 0; i < shader->num_system_values; ++i)
- PRINT_UINT_ARRAY_MEMBER(system_value_semantic_name, i);
-
- PRINT_UINT_MEMBER(reads_pervertex_outputs);
- PRINT_UINT_MEMBER(reads_perpatch_outputs);
- PRINT_UINT_MEMBER(reads_tessfactor_outputs);
}
diff --git a/lib/mesa/src/gallium/drivers/r600/r600_pipe_common.c b/lib/mesa/src/gallium/drivers/r600/r600_pipe_common.c
index d242389a2..91607ca71 100644
--- a/lib/mesa/src/gallium/drivers/r600/r600_pipe_common.c
+++ b/lib/mesa/src/gallium/drivers/r600/r600_pipe_common.c
@@ -27,7 +27,6 @@
#include "r600_pipe_common.h"
#include "r600_cs.h"
#include "tgsi/tgsi_parse.h"
-#include "compiler/nir/nir.h"
#include "util/list.h"
#include "util/u_draw_quad.h"
#include "util/u_memory.h"
@@ -39,7 +38,6 @@
#include "radeon_video.h"
#include <inttypes.h>
#include <sys/utsname.h>
-#include <stdlib.h>
#ifdef LLVM_AVAILABLE
#include <llvm-c/TargetMachine.h>
@@ -911,8 +909,7 @@ const char *r600_get_llvm_processor_name(enum radeon_family family)
static unsigned get_max_threads_per_block(struct r600_common_screen *screen,
enum pipe_shader_ir ir_type)
{
- if (ir_type != PIPE_SHADER_IR_TGSI &&
- ir_type != PIPE_SHADER_IR_NIR)
+ if (ir_type != PIPE_SHADER_IR_TGSI)
return 256;
if (screen->chip_class >= EVERGREEN)
return 1024;
@@ -1180,58 +1177,6 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
}
}
-const struct nir_shader_compiler_options r600_nir_fs_options = {
- .fuse_ffma = true,
- .lower_scmp = true,
- .lower_flrp32 = true,
- .lower_flrp64 = true,
- .lower_fpow = true,
- .lower_fdiv = true,
- .lower_idiv = true,
- .lower_fmod = true,
- .lower_doubles_options = nir_lower_fp64_full_software,
- .lower_int64_options = 0,
- .lower_extract_byte = true,
- .lower_extract_word = true,
- .max_unroll_iterations = 32,
- .lower_all_io_to_temps = true,
- .vectorize_io = true,
- .has_umad24 = true,
- .has_umul24 = true,
-};
-
-const struct nir_shader_compiler_options r600_nir_options = {
- .fuse_ffma = true,
- .lower_scmp = true,
- .lower_flrp32 = true,
- .lower_flrp64 = true,
- .lower_fpow = true,
- .lower_fdiv = true,
- .lower_idiv = true,
- .lower_fmod = true,
- .lower_doubles_options = nir_lower_fp64_full_software,
- .lower_int64_options = 0,
- .lower_extract_byte = true,
- .lower_extract_word = true,
- .max_unroll_iterations = 32,
- .vectorize_io = true,
- .has_umad24 = true,
- .has_umul24 = true,
-};
-
-
-static const void *
-r600_get_compiler_options(struct pipe_screen *screen,
- enum pipe_shader_ir ir,
- enum pipe_shader_type shader)
-{
- assert(ir == PIPE_SHADER_IR_NIR);
- if (shader == PIPE_SHADER_FRAGMENT)
- return &r600_nir_fs_options;
- else
- return &r600_nir_options;
-}
-
bool r600_common_screen_init(struct r600_common_screen *rscreen,
struct radeon_winsys *ws)
{
@@ -1265,7 +1210,6 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
rscreen->b.get_compute_param = r600_get_compute_param;
rscreen->b.get_paramf = r600_get_paramf;
rscreen->b.get_timestamp = r600_get_timestamp;
- rscreen->b.get_compiler_options = r600_get_compiler_options;
rscreen->b.fence_finish = r600_fence_finish;
rscreen->b.fence_reference = r600_fence_reference;
rscreen->b.resource_destroy = u_resource_destroy_vtbl;
@@ -1286,10 +1230,6 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
rscreen->family = rscreen->info.family;
rscreen->chip_class = rscreen->info.chip_class;
rscreen->debug_flags |= debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
- int has_draw_use_llvm = debug_get_bool_option("DRAW_USE_LLVM", FALSE);
- if (!has_draw_use_llvm)
- setenv("DRAW_USE_LLVM", "no", 0);
-
r600_disk_cache_create(rscreen);
diff --git a/lib/mesa/src/gallium/drivers/r600/r600_texture.c b/lib/mesa/src/gallium/drivers/r600/r600_texture.c
index 3ffa7be72..518e92d9f 100644
--- a/lib/mesa/src/gallium/drivers/r600/r600_texture.c
+++ b/lib/mesa/src/gallium/drivers/r600/r600_texture.c
@@ -243,6 +243,8 @@ static int r600_init_surface(struct r600_common_screen *rscreen,
flags |= RADEON_SURF_SHAREABLE;
if (is_imported)
flags |= RADEON_SURF_IMPORTED | RADEON_SURF_SHAREABLE;
+ if (!(ptex->flags & R600_RESOURCE_FLAG_FORCE_TILING))
+ flags |= RADEON_SURF_OPTIMIZE_FOR_SPACE;
r = rscreen->ws->surface_init(rscreen->ws, ptex,
flags, bpe, array_mode, surface);
@@ -916,6 +918,7 @@ r600_texture_create_object(struct pipe_screen *screen,
resource = &rtex->resource;
resource->b.b = *base;
+ resource->b.b.next = NULL;
resource->b.vtbl = &r600_texture_vtbl;
pipe_reference_init(&resource->b.b.reference, 1);
resource->b.b.screen = screen;
@@ -1632,11 +1635,11 @@ static void r600_clear_texture(struct pipe_context *pipe,
/* Depth is always present. */
clear = PIPE_CLEAR_DEPTH;
- util_format_unpack_z_float(tex->format, &depth, data, 1);
+ desc->unpack_z_float(&depth, 0, data, 0, 1, 1);
if (rtex->surface.has_stencil) {
clear |= PIPE_CLEAR_STENCIL;
- util_format_unpack_s_8uint(tex->format, &stencil, data, 1);
+ desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1);
}
pipe->clear_depth_stencil(pipe, sf, clear, depth, stencil,
@@ -1645,7 +1648,13 @@ static void r600_clear_texture(struct pipe_context *pipe,
} else {
union pipe_color_union color;
- util_format_unpack_rgba(tex->format, color.ui, data, 1);
+ /* pipe_color_union requires the full vec4 representation. */
+ if (util_format_is_pure_uint(tex->format))
+ desc->unpack_rgba_uint(color.ui, 0, data, 0, 1, 1);
+ else if (util_format_is_pure_sint(tex->format))
+ desc->unpack_rgba_sint(color.i, 0, data, 0, 1, 1);
+ else
+ desc->unpack_rgba_float(color.f, 0, data, 0, 1, 1);
if (screen->is_format_supported(screen, tex->format,
tex->target, 0, 0,
@@ -1742,8 +1751,12 @@ static void evergreen_set_clear_color(struct r600_texture *rtex,
color->ui[0] == color->ui[2]);
uc.ui[0] = color->ui[0];
uc.ui[1] = color->ui[3];
+ } else if (util_format_is_pure_uint(surface_format)) {
+ util_format_write_4ui(surface_format, color->ui, 0, &uc, 0, 0, 0, 1, 1);
+ } else if (util_format_is_pure_sint(surface_format)) {
+ util_format_write_4i(surface_format, color->i, 0, &uc, 0, 0, 0, 1, 1);
} else {
- util_pack_color_union(surface_format, &uc, color);
+ util_pack_color(color->f, surface_format, &uc);
}
memcpy(rtex->color_clear_value, &uc, 2 * sizeof(uint32_t));
diff --git a/lib/mesa/src/gallium/drivers/r600/radeon_vce.c b/lib/mesa/src/gallium/drivers/r600/radeon_vce.c
index cd7cdb24b..16f48c694 100644
--- a/lib/mesa/src/gallium/drivers/r600/radeon_vce.c
+++ b/lib/mesa/src/gallium/drivers/r600/radeon_vce.c
@@ -438,6 +438,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
}
templat.buffer_format = PIPE_FORMAT_NV12;
+ templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = enc->base.width;
templat.height = enc->base.height;
templat.interlaced = false;