libports: Add Mesa-21.0.0 support

* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
This commit is contained in:
Sebastian Sumpf 2021-03-19 15:29:55 +01:00 committed by Christian Helmuth
parent 9041567f14
commit 38d731bd79
73 changed files with 6990 additions and 4 deletions

View File

@ -1,3 +0,0 @@
include $(REP_DIR)/lib/import/import-libdrm.inc
INC_DIR += $(DRM_SRC_DIR) $(addprefix $(DRM_SRC_DIR)/,iris)

View File

@ -7,3 +7,4 @@ endif
INC_DIR += $(DRM_SRC_DIR)
INC_DIR += $(addprefix $(DRM_SRC_DIR)/,include/drm include)
INC_DIR += $(addprefix $(DRM_SRC_DIR)/,etnaviv)
INC_DIR += $(addprefix $(DRM_SRC_DIR)/,iris)

View File

@ -0,0 +1 @@
include $(call select_from_repositories,lib/import/import-mesa_api.mk)

View File

@ -0,0 +1,3 @@
MESA_INC_DIR := $(call select_from_ports,mesa)
INC_DIR += $(MESA_INC_DIR)/include
INC_DIR += $(call select_from_repositories,include/drm-uapi)

View File

@ -0,0 +1,34 @@
SHARED_LIB = yes
LIBS = libc blit
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_SRC_DIR)/src/egl/main \
$(MESA_SRC_DIR)/src/egl/drivers/dri2 \
$(MESA_SRC_DIR)/src/loader
SRC_C = main/eglapi.c \
main/eglarray.c \
main/eglconfig.c \
main/eglcontext.c \
main/eglcurrent.c \
main/egldevice.c \
main/egldisplay.c \
main/eglglobals.c \
main/eglimage.c \
main/egllog.c \
main/eglsurface.c \
main/eglsync.c \
drivers/dri2/egl_dri2.c \
drivers/dri2/platform_device.c \
platform.c
SRC_CC = genode_interface.cc
CC_OPT += -D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_GENODE \
-DHAVE_GENODE_PLATFORM
vpath %.c $(MESA_SRC_DIR)/src/egl
vpath %.c $(LIB_DIR)/egl
vpath %.cc $(LIB_DIR)/egl

View File

@ -0,0 +1,19 @@
SHARED_LIB = yes
LIBS = libc egl etnaviv
include $(REP_DIR)/lib/mk/mesa-common.inc
SRC_CC := drm_init.cc
SRC_C = platform_etnaviv.c
CC_OPT += -DHAVE_GENODE_PLATFORM
INC_DIR += $(MESA_SRC_DIR)/src/egl/drivers/dri2 \
$(MESA_SRC_DIR)/src/egl/main \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa
vpath %.c $(LIB_DIR)/etnaviv
vpath %.cc $(LIB_DIR)/etnaviv
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,17 @@
SHARED_LIB = yes
LIBS = libc egl softpipe
include $(REP_DIR)/lib/mk/mesa-common.inc
SRC_C = platform_softpipe.c
CC_OPT += -DHAVE_GENODE_PLATFORM
INC_DIR += $(MESA_SRC_DIR)/src/egl/drivers/dri2 \
$(MESA_SRC_DIR)/src/egl/main \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa \
vpath %.c $(LIB_DIR)/softpipe
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,63 @@
LIBS = libc libdrm
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_SRC_DIR)/src/compiler/nir \
$(MESA_SRC_DIR)/src/etnaviv \
$(MESA_SRC_DIR)/src/gallium/auxiliary \
$(MESA_SRC_DIR)/src/gallium/drivers \
$(MESA_SRC_DIR)/src/util \
$(MESA_GEN_DIR)/src/compiler/nir \
$(MESA_PORT_DIR)/include/drm-uapi
REP_INC_DIR += include/drm-uapi
SRC_C = etnaviv/drm/etnaviv_bo.c \
etnaviv/drm/etnaviv_bo_cache.c \
etnaviv/drm/etnaviv_cmd_stream.c \
etnaviv/drm/etnaviv_device.c \
etnaviv/drm/etnaviv_gpu.c \
etnaviv/drm/etnaviv_perfmon.c \
etnaviv/drm/etnaviv_pipe.c \
gallium/drivers/etnaviv/etnaviv_asm.c \
gallium/drivers/etnaviv/etnaviv_blend.c \
gallium/drivers/etnaviv/etnaviv_blt.c \
gallium/drivers/etnaviv/etnaviv_clear_blit.c \
gallium/drivers/etnaviv/etnaviv_compiler.c \
gallium/drivers/etnaviv/etnaviv_compiler_nir.c \
gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c \
gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c \
gallium/drivers/etnaviv/etnaviv_compiler_nir_ra.c \
gallium/drivers/etnaviv/etnaviv_compiler_tgsi.c \
gallium/drivers/etnaviv/etnaviv_context.c \
gallium/drivers/etnaviv/etnaviv_disasm.c \
gallium/drivers/etnaviv/etnaviv_disk_cache.c \
gallium/drivers/etnaviv/etnaviv_emit.c \
gallium/drivers/etnaviv/etnaviv_etc2.c \
gallium/drivers/etnaviv/etnaviv_fence.c \
gallium/drivers/etnaviv/etnaviv_format.c \
gallium/drivers/etnaviv/etnaviv_nir.c \
gallium/drivers/etnaviv/etnaviv_perfmon.c \
gallium/drivers/etnaviv/etnaviv_query_acc.c \
gallium/drivers/etnaviv/etnaviv_query_acc_occlusion.c \
gallium/drivers/etnaviv/etnaviv_query_acc_perfmon.c \
gallium/drivers/etnaviv/etnaviv_query.c \
gallium/drivers/etnaviv/etnaviv_query_sw.c \
gallium/drivers/etnaviv/etnaviv_rasterizer.c \
gallium/drivers/etnaviv/etnaviv_resource.c \
gallium/drivers/etnaviv/etnaviv_rs.c \
gallium/drivers/etnaviv/etnaviv_screen.c \
gallium/drivers/etnaviv/etnaviv_shader.c \
gallium/drivers/etnaviv/etnaviv_state.c \
gallium/drivers/etnaviv/etnaviv_surface.c \
gallium/drivers/etnaviv/etnaviv_texture.c \
gallium/drivers/etnaviv/etnaviv_texture_desc.c \
gallium/drivers/etnaviv/etnaviv_texture_state.c \
gallium/drivers/etnaviv/etnaviv_tiling.c \
gallium/drivers/etnaviv/etnaviv_transfer.c \
gallium/drivers/etnaviv/etnaviv_uniforms.c \
gallium/winsys/etnaviv/drm/etnaviv_drm_winsys.c \
gallium/drivers/etnaviv/etnaviv_zsa.c
vpath %.c $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,17 @@
SHARED_LIB = yes
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_GEN_DIR)/src/mapi
SRC_C = mapi/entry.c \
mapi/mapi_glapi.c \
mapi/stub.c \
mapi/table.c \
mapi/u_current.c \
mapi/u_execmem.c
CC_OPT += -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\" -DMAPI_MODE_GLAPI
vpath %.c $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,19 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_GEN_DIR)/src/compiler/nir \
$(MESA_GEN_DIR)/src/intel \
$(MESA_SRC_DIR)/src/compiler/nir \
$(MESA_SRC_DIR)/src/gallium/auxiliary \
$(MESA_SRC_DIR)/src/intel \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa
CC_OPT += -DGALLIUM_IRIS
SRC_C = gallium/drivers/iris/iris_query.c \
gallium/drivers/iris/iris_state.c \
gallium/drivers/iris/iris_blorp.c
vpath %.c $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,11 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_GEN_DIR)/src/intel \
$(MESA_SRC_DIR)/src/intel
SRC_C = intel/isl/isl_emit_depth_stencil.c \
intel/isl/isl_surface_state.c
vpath %.c $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,70 @@
MESA_PORT_DIR := $(call select_from_ports,mesa)
MESA_SRC_DIR := $(MESA_PORT_DIR)/src/lib/mesa
MESA_GEN_DIR := $(MESA_PORT_DIR)/generated
LIB_DIR := $(REP_DIR)/src/lib/mesa
INC_DIR += $(LIB_DIR)/include \
$(MESA_PORT_DIR)/include \
$(MESA_SRC_DIR)/src/gallium/include \
$(MESA_SRC_DIR)/src \
$(MESA_GEN_DIR)/src
CC_OPT += -D__GENODE__ -DGALLIUM_SOFTPIPE
#CC_OPT += -DENABLE_SHADER_CACHE
CC_OPT += -DENABLE_ST_OMX_BELLAGIO=0 \
-DENABLE_ST_OMX_TIZONIA=0 \
-DHAVE___BUILTIN_BSWAP32 \
-DHAVE___BUILTIN_BSWAP64 \
-DHAVE___BUILTIN_CLZ \
-DHAVE___BUILTIN_CLZLL \
-DHAVE___BUILTIN_CTZ \
-DHAVE___BUILTIN_EXPECT \
-DHAVE___BUILTIN_FFS \
-DHAVE___BUILTIN_FFSLL \
-DHAVE___BUILTIN_POPCOUNT \
-DHAVE___BUILTIN_POPCOUNTLL \
-DHAVE___BUILTIN_TYPES_COMPATIBLE_P \
-DHAVE___BUILTIN_UNREACHABLE \
-DHAVE_CET_H \
-DHAVE_DIRENT_D_TYPE \
-DHAVE_DLADDR \
-DHAVE_DLFCN_H \
-DHAVE_DL_ITERATE_PHDR \
-DHAVE_EXECINFO_H \
-DHAVE_FLOCK \
-DHAVE_FUNC_ATTRIBUTE_ALIAS \
-DHAVE_FUNC_ATTRIBUTE_CONST \
-DHAVE_FUNC_ATTRIBUTE_FLATTEN \
-DHAVE_FUNC_ATTRIBUTE_FORMAT \
-DHAVE_FUNC_ATTRIBUTE_MALLOC \
-DHAVE_FUNC_ATTRIBUTE_NORETURN \
-DHAVE_FUNC_ATTRIBUTE_PACKED \
-DHAVE_FUNC_ATTRIBUTE_PURE \
-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL \
-DHAVE_FUNC_ATTRIBUTE_UNUSED \
-DHAVE_FUNC_ATTRIBUTE_VISIBILITY \
-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT \
-DHAVE_FUNC_ATTRIBUTE_WEAK \
-DHAVE_GETRANDOM \
-DHAVE_MKOSTEMP \
-DHAVE_PIPE_LOADER_DRI \
-DHAVE_POSIX_MEMALIGN \
-DHAVE_PTHREAD \
-DHAVE_PTHREAD_NP_H \
-DHAVE_RANDOM_R \
-DHAVE_STRTOF \
-DHAVE_STRTOK_R \
-DHAVE_TIMESPEC_GET \
-DHAVE_ZLIB \
-DPACKAGE_BUGREPORT='"https://gitlab.freedesktop.org/mesa/mesa/-/issues"' \
-DPACKAGE_VERSION='"21.0.0"' \
-D__STDC_CONSTANT_MACROS \
-D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS \
-DUSE_GCC_ATOMIC_BUILTINS \
#-DUSE_X86_64_ASM
# vi: set ft=make :

View File

@ -0,0 +1,754 @@
SHARED_LIB := yes
LIBS += libc stdcxx zlib expat glapi softpipe mesa_api libdrm
include $(REP_DIR)/lib/mk/mesa-common.inc
SRC_CC += mesa.cc
INC_DIR += $(MESA_GEN_DIR)/src/compiler \
$(MESA_GEN_DIR)/src/compiler/glsl \
$(MESA_GEN_DIR)/src/compiler/nir \
$(MESA_GEN_DIR)/src/compiler/spirv \
$(MESA_GEN_DIR)/src/mapi \
$(MESA_GEN_DIR)/src/mesa \
$(MESA_GEN_DIR)/src/mesa/main \
$(MESA_GEN_DIR)/src/util/format \
$(MESA_SRC_DIR)/src \
$(MESA_SRC_DIR)/src/compiler \
$(MESA_SRC_DIR)/src/compiler/glsl \
$(MESA_SRC_DIR)/src/compiler/glsl/glcpp \
$(MESA_SRC_DIR)/src/compiler/nir \
$(MESA_SRC_DIR)/src/compiler/spirv \
$(MESA_SRC_DIR)/src/gallium/auxiliary \
$(MESA_SRC_DIR)/src/gallium/drivers \
$(MESA_SRC_DIR)/src/gallium/frontends/dri \
$(MESA_SRC_DIR)/src/gallium/winsys \
$(MESA_SRC_DIR)/src/loader \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa \
$(MESA_SRC_DIR)/src/mesa/drivers/dri/common \
$(MESA_SRC_DIR)/src/mesa/main \
$(MESA_SRC_DIR)/src/util \
$(MESA_SRC_DIR)/src/util/format
# C++ generated
SRC_CC += compiler/glsl/glsl_lexer.cpp \
compiler/glsl/glsl_parser.cpp
# C++
SRC_CC += compiler/glsl/ast_array_index.cpp \
compiler/glsl/ast_expr.cpp \
compiler/glsl/ast_function.cpp \
compiler/glsl/ast_to_hir.cpp \
compiler/glsl/ast_type.cpp \
compiler/glsl/builtin_functions.cpp \
compiler/glsl/builtin_types.cpp \
compiler/glsl/builtin_variables.cpp \
compiler/glsl/generate_ir.cpp \
compiler/glsl/glsl_parser_extras.cpp \
compiler/glsl/glsl_symbol_table.cpp \
compiler/glsl/glsl_to_nir.cpp \
compiler/glsl/hir_field_selection.cpp \
compiler/glsl/ir_array_refcount.cpp \
compiler/glsl/ir_basic_block.cpp \
compiler/glsl/ir_builder.cpp \
compiler/glsl/ir_clone.cpp \
compiler/glsl/ir_constant_expression.cpp \
compiler/glsl/ir.cpp \
compiler/glsl/ir_equals.cpp \
compiler/glsl/ir_expression_flattening.cpp \
compiler/glsl/ir_function_can_inline.cpp \
compiler/glsl/ir_function.cpp \
compiler/glsl/ir_function_detect_recursion.cpp \
compiler/glsl/ir_hierarchical_visitor.cpp \
compiler/glsl/ir_hv_accept.cpp \
compiler/glsl/ir_print_visitor.cpp \
compiler/glsl/ir_rvalue_visitor.cpp \
compiler/glsl/ir_set_program_inouts.cpp \
compiler/glsl/ir_validate.cpp \
compiler/glsl/ir_variable_refcount.cpp \
compiler/glsl/link_atomics.cpp \
compiler/glsl/linker.cpp \
compiler/glsl/linker_util.cpp \
compiler/glsl/link_functions.cpp \
compiler/glsl/link_interface_blocks.cpp \
compiler/glsl/link_uniform_block_active_visitor.cpp \
compiler/glsl/link_uniform_blocks.cpp \
compiler/glsl/link_uniform_initializers.cpp \
compiler/glsl/link_uniforms.cpp \
compiler/glsl/link_varyings.cpp \
compiler/glsl/loop_analysis.cpp \
compiler/glsl/loop_unroll.cpp \
compiler/glsl/lower_blend_equation_advanced.cpp \
compiler/glsl/lower_buffer_access.cpp \
compiler/glsl/lower_builtins.cpp \
compiler/glsl/lower_const_arrays_to_uniforms.cpp \
compiler/glsl/lower_cs_derived.cpp \
compiler/glsl/lower_discard.cpp \
compiler/glsl/lower_discard_flow.cpp \
compiler/glsl/lower_distance.cpp \
compiler/glsl/lower_if_to_cond_assign.cpp \
compiler/glsl/lower_instructions.cpp \
compiler/glsl/lower_int64.cpp \
compiler/glsl/lower_jumps.cpp \
compiler/glsl/lower_mat_op_to_vec.cpp \
compiler/glsl/lower_named_interface_blocks.cpp \
compiler/glsl/lower_offset_array.cpp \
compiler/glsl/lower_output_reads.cpp \
compiler/glsl/lower_packed_varyings.cpp \
compiler/glsl/lower_packing_builtins.cpp \
compiler/glsl/lower_precision.cpp \
compiler/glsl/lower_shared_reference.cpp \
compiler/glsl/lower_subroutine.cpp \
compiler/glsl/lower_tess_level.cpp \
compiler/glsl/lower_ubo_reference.cpp \
compiler/glsl/lower_variable_index_to_cond_assign.cpp \
compiler/glsl/lower_vec_index_to_cond_assign.cpp \
compiler/glsl/lower_vec_index_to_swizzle.cpp \
compiler/glsl/lower_vector.cpp \
compiler/glsl/lower_vector_derefs.cpp \
compiler/glsl/lower_vector_insert.cpp \
compiler/glsl/lower_vertex_id.cpp \
compiler/glsl/lower_xfb_varying.cpp \
compiler/glsl/opt_algebraic.cpp \
compiler/glsl/opt_array_splitting.cpp \
compiler/glsl/opt_conditional_discard.cpp \
compiler/glsl/opt_constant_folding.cpp \
compiler/glsl/opt_constant_propagation.cpp \
compiler/glsl/opt_constant_variable.cpp \
compiler/glsl/opt_copy_propagation_elements.cpp \
compiler/glsl/opt_dead_builtin_variables.cpp \
compiler/glsl/opt_dead_builtin_varyings.cpp \
compiler/glsl/opt_dead_code.cpp \
compiler/glsl/opt_dead_code_local.cpp \
compiler/glsl/opt_dead_functions.cpp \
compiler/glsl/opt_flatten_nested_if_blocks.cpp \
compiler/glsl/opt_flip_matrices.cpp \
compiler/glsl/opt_function_inlining.cpp \
compiler/glsl/opt_if_simplification.cpp \
compiler/glsl/opt_minmax.cpp \
compiler/glsl/opt_rebalance_tree.cpp \
compiler/glsl/opt_redundant_jumps.cpp \
compiler/glsl/opt_structure_splitting.cpp \
compiler/glsl/opt_swizzle.cpp \
compiler/glsl/opt_tree_grafting.cpp \
compiler/glsl/opt_vectorize.cpp \
compiler/glsl/propagate_invariance.cpp \
compiler/glsl/serialize.cpp \
compiler/glsl/shader_cache.cpp \
compiler/glsl/string_to_uint_map.cpp \
compiler/glsl_types.cpp \
compiler/nir_types.cpp \
gallium/auxiliary/tessellator/p_tessellator.cpp \
gallium/auxiliary/tessellator/tessellator.cpp \
mesa/main/ff_fragment_shader.cpp \
mesa/main/shader_query.cpp \
mesa/main/texcompress_astc.cpp \
mesa/main/uniform_query.cpp \
mesa/program/ir_to_mesa.cpp \
mesa/state_tracker/st_glsl_to_ir.cpp \
mesa/state_tracker/st_glsl_to_nir.cpp \
mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp \
mesa/state_tracker/st_glsl_to_tgsi.cpp \
mesa/state_tracker/st_glsl_to_tgsi_private.cpp \
mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp \
util/u_printf.cpp
# C generated
SRC_C += \
compiler/glsl/glcpp/glcpp-parse.c \
compiler/glsl/glcpp/glcpp-lex.c \
compiler/nir/nir_constant_expressions.c \
compiler/nir/nir_intrinsics.c \
compiler/nir/nir_opt_algebraic.c \
compiler/nir/nir_opcodes.c \
compiler/spirv/spirv_info.c \
compiler/spirv/vtn_gather_types.c \
mapi/glapi/gen/api_exec.c \
mapi/glapi/gen/enums.c \
mapi/glapi/gen/marshal_generated0.c \
mapi/glapi/gen/marshal_generated1.c \
mapi/glapi/gen/marshal_generated2.c \
mapi/glapi/gen/marshal_generated3.c \
mapi/glapi/gen/marshal_generated4.c \
mapi/glapi/gen/marshal_generated5.c \
mapi/glapi/gen/marshal_generated6.c \
mapi/glapi/gen/marshal_generated7.c \
mesa/format_fallback.c \
mesa/format_pack.c \
mesa/format_unpack.c \
mesa/program/lex.yy.c \
mesa/program/program_parse.tab.c \
util/format_srgb.c \
util/format/u_format_table.c
# C
SRC_C += compiler/glsl/glcpp/pp.c \
compiler/glsl/gl_nir_link_atomics.c \
compiler/glsl/gl_nir_linker.c \
compiler/glsl/gl_nir_link_uniform_blocks.c \
compiler/glsl/gl_nir_link_uniform_initializers.c \
compiler/glsl/gl_nir_link_uniforms.c \
compiler/glsl/gl_nir_link_xfb.c \
compiler/glsl/gl_nir_lower_atomics.c \
compiler/glsl/gl_nir_lower_buffers.c \
compiler/glsl/gl_nir_lower_images.c \
compiler/glsl/gl_nir_lower_samplers_as_deref.c \
compiler/glsl/gl_nir_lower_samplers.c \
compiler/nir/nir_builtin_builder.c \
compiler/nir/nir.c \
compiler/nir/nir_clone.c \
compiler/nir/nir_control_flow.c \
compiler/nir/nir_deref.c \
compiler/nir/nir_divergence_analysis.c \
compiler/nir/nir_dominance.c \
compiler/nir/nir_from_ssa.c \
compiler/nir/nir_gather_info.c \
compiler/nir/nir_gather_ssa_types.c \
compiler/nir/nir_gather_xfb_info.c \
compiler/nir/nir_gs_count_vertices.c \
compiler/nir/nir_inline_functions.c \
compiler/nir/nir_instr_set.c \
compiler/nir/nir_linking_helpers.c \
compiler/nir/nir_liveness.c \
compiler/nir/nir_loop_analyze.c \
compiler/nir/nir_lower_alpha_test.c \
compiler/nir/nir_lower_alu.c \
compiler/nir/nir_lower_alu_to_scalar.c \
compiler/nir/nir_lower_array_deref_of_vec.c \
compiler/nir/nir_lower_atomics_to_ssbo.c \
compiler/nir/nir_lower_bitmap.c \
compiler/nir/nir_lower_bool_to_bitsize.c \
compiler/nir/nir_lower_bit_size.c \
compiler/nir/nir_lower_bool_to_float.c \
compiler/nir/nir_lower_bool_to_int32.c \
compiler/nir/nir_lower_clamp_color_outputs.c \
compiler/nir/nir_lower_clip.c \
compiler/nir/nir_lower_clip_cull_distance_arrays.c \
compiler/nir/nir_lower_clip_disable.c \
compiler/nir/nir_lower_clip_halfz.c \
compiler/nir/nir_lower_double_ops.c \
compiler/nir/nir_lower_drawpixels.c \
compiler/nir/nir_lower_flatshade.c \
compiler/nir/nir_lower_flrp.c \
compiler/nir/nir_lower_frexp.c \
compiler/nir/nir_lower_global_vars_to_local.c \
compiler/nir/nir_lower_goto_ifs.c \
compiler/nir/nir_lower_gs_intrinsics.c \
compiler/nir/nir_lower_idiv.c \
compiler/nir/nir_lower_indirect_derefs.c \
compiler/nir/nir_lower_int64.c \
compiler/nir/nir_lower_interpolation.c \
compiler/nir/nir_lower_int_to_float.c \
compiler/nir/nir_lower_io_arrays_to_elements.c \
compiler/nir/nir_lower_io.c \
compiler/nir/nir_lower_io_to_scalar.c \
compiler/nir/nir_lower_io_to_temporaries.c \
compiler/nir/nir_lower_io_to_vector.c \
compiler/nir/nir_lower_load_const_to_scalar.c \
compiler/nir/nir_lower_locals_to_regs.c \
compiler/nir/nir_lower_packing.c \
compiler/nir/nir_lower_passthrough_edgeflags.c \
compiler/nir/nir_lower_patch_vertices.c \
compiler/nir/nir_lower_phis_to_scalar.c \
compiler/nir/nir_lower_pntc_ytransform.c \
compiler/nir/nir_lower_point_size_mov.c \
compiler/nir/nir_lower_regs_to_ssa.c \
compiler/nir/nir_lower_returns.c \
compiler/nir/nir_lower_samplers.c \
compiler/nir/nir_lower_subgroups.c \
compiler/nir/nir_lower_system_values.c \
compiler/nir/nir_lower_tex.c \
compiler/nir/nir_lower_to_source_mods.c \
compiler/nir/nir_lower_two_sided_color.c \
compiler/nir/nir_lower_ubo_vec4.c \
compiler/nir/nir_lower_uniforms_to_ubo.c \
compiler/nir/nir_lower_var_copies.c \
compiler/nir/nir_lower_variable_initializers.c \
compiler/nir/nir_lower_vars_to_ssa.c \
compiler/nir/nir_lower_vec_to_movs.c \
compiler/nir/nir_lower_wpos_ytransform.c \
compiler/nir/nir_metadata.c \
compiler/nir/nir_move_vec_src_uses_to_dest.c \
compiler/nir/nir_normalize_cubemap_coords.c \
compiler/nir/nir_opt_access.c \
compiler/nir/nir_opt_barriers.c \
compiler/nir/nir_opt_combine_stores.c \
compiler/nir/nir_opt_comparison_pre.c \
compiler/nir/nir_opt_conditional_discard.c \
compiler/nir/nir_opt_constant_folding.c \
compiler/nir/nir_opt_copy_propagate.c \
compiler/nir/nir_opt_copy_prop_vars.c \
compiler/nir/nir_opt_cse.c \
compiler/nir/nir_opt_dce.c \
compiler/nir/nir_opt_dead_cf.c \
compiler/nir/nir_opt_dead_write_vars.c \
compiler/nir/nir_opt_find_array_copies.c \
compiler/nir/nir_opt_gcm.c \
compiler/nir/nir_opt_idiv_const.c \
compiler/nir/nir_opt_if.c \
compiler/nir/nir_opt_intrinsics.c \
compiler/nir/nir_opt_large_constants.c \
compiler/nir/nir_opt_load_store_vectorize.c \
compiler/nir/nir_opt_loop_unroll.c \
compiler/nir/nir_opt_move.c \
compiler/nir/nir_opt_peephole_select.c \
compiler/nir/nir_opt_rematerialize_compares.c \
compiler/nir/nir_opt_remove_phis.c \
compiler/nir/nir_opt_shrink_vectors.c \
compiler/nir/nir_opt_sink.c \
compiler/nir/nir_opt_trivial_continues.c \
compiler/nir/nir_opt_undef.c \
compiler/nir/nir_opt_vectorize.c \
compiler/nir/nir_phi_builder.c \
compiler/nir/nir_print.c \
compiler/nir/nir_range_analysis.c \
compiler/nir/nir_remove_dead_variables.c \
compiler/nir/nir_repair_ssa.c \
compiler/nir/nir_search.c \
compiler/nir/nir_serialize.c \
compiler/nir/nir_split_per_member_structs.c \
compiler/nir/nir_split_var_copies.c \
compiler/nir/nir_split_vars.c \
compiler/nir/nir_sweep.c \
compiler/nir/nir_to_lcssa.c \
compiler/nir/nir_validate.c \
compiler/nir/nir_worklist.c \
compiler/shader_enums.c \
compiler/spirv/gl_spirv.c \
compiler/spirv/spirv_to_nir.c \
compiler/spirv/vtn_alu.c \
compiler/spirv/vtn_amd.c \
compiler/spirv/vtn_cfg.c \
compiler/spirv/vtn_glsl450.c \
compiler/spirv/vtn_opencl.c \
compiler/spirv/vtn_subgroup.c \
compiler/spirv/vtn_variables.c \
gallium/auxiliary/cso_cache/cso_cache.c \
gallium/auxiliary/cso_cache/cso_context.c \
gallium/auxiliary/cso_cache/cso_hash.c \
gallium/auxiliary/draw/draw_context.c \
gallium/auxiliary/draw/draw_fs.c \
gallium/auxiliary/draw/draw_gs.c \
gallium/auxiliary/draw/draw_pipe_aaline.c \
gallium/auxiliary/draw/draw_pipe_aapoint.c \
gallium/auxiliary/draw/draw_pipe.c \
gallium/auxiliary/draw/draw_pipe_clip.c \
gallium/auxiliary/draw/draw_pipe_cull.c \
gallium/auxiliary/draw/draw_pipe_flatshade.c \
gallium/auxiliary/draw/draw_pipe_offset.c \
gallium/auxiliary/draw/draw_pipe_pstipple.c \
gallium/auxiliary/draw/draw_pipe_stipple.c \
gallium/auxiliary/draw/draw_pipe_twoside.c \
gallium/auxiliary/draw/draw_pipe_unfilled.c \
gallium/auxiliary/draw/draw_pipe_user_cull.c \
gallium/auxiliary/draw/draw_pipe_util.c \
gallium/auxiliary/draw/draw_pipe_validate.c \
gallium/auxiliary/draw/draw_pipe_vbuf.c \
gallium/auxiliary/draw/draw_pipe_wide_line.c \
gallium/auxiliary/draw/draw_pipe_wide_point.c \
gallium/auxiliary/draw/draw_prim_assembler.c \
gallium/auxiliary/draw/draw_pt.c \
gallium/auxiliary/draw/draw_pt_emit.c \
gallium/auxiliary/draw/draw_pt_fetch.c \
gallium/auxiliary/draw/draw_pt_fetch_emit.c \
gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c \
gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c \
gallium/auxiliary/draw/draw_pt_post_vs.c \
gallium/auxiliary/draw/draw_pt_so_emit.c \
gallium/auxiliary/draw/draw_pt_util.c \
gallium/auxiliary/draw/draw_pt_vsplit.c \
gallium/auxiliary/draw/draw_tess.c \
gallium/auxiliary/draw/draw_vertex.c \
gallium/auxiliary/draw/draw_vs.c \
gallium/auxiliary/draw/draw_vs_exec.c \
gallium/auxiliary/draw/draw_vs_variant.c \
gallium/auxiliary/driver_ddebug/dd_context.c \
gallium/auxiliary/driver_ddebug/dd_draw.c \
gallium/auxiliary/driver_ddebug/dd_screen.c \
gallium/auxiliary/driver_noop/noop_pipe.c \
gallium/auxiliary/driver_noop/noop_state.c \
gallium/auxiliary/driver_rbug/rbug_context.c \
gallium/auxiliary/driver_rbug/rbug_core.c \
gallium/auxiliary/driver_rbug/rbug_objects.c \
gallium/auxiliary/driver_rbug/rbug_screen.c \
gallium/auxiliary/driver_trace/tr_context.c \
gallium/auxiliary/driver_trace/tr_dump.c \
gallium/auxiliary/driver_trace/tr_dump_state.c \
gallium/auxiliary/driver_trace/tr_screen.c \
gallium/auxiliary/driver_trace/tr_texture.c \
gallium/auxiliary/hud/font.c \
gallium/auxiliary/hud/hud_context.c \
gallium/auxiliary/hud/hud_cpu.c \
gallium/auxiliary/hud/hud_driver_query.c \
gallium/auxiliary/hud/hud_fps.c \
gallium/auxiliary/indices/u_indices_gen.c \
gallium/auxiliary/indices/u_primconvert.c \
gallium/auxiliary/nir/nir_draw_helpers.c \
gallium/auxiliary/nir/nir_to_tgsi.c \
gallium/auxiliary/nir/tgsi_to_nir.c \
gallium/auxiliary/os/os_process.c \
gallium/auxiliary/pipe-loader/pipe_loader.c \
gallium/auxiliary/pipe-loader/pipe_loader_drm.c \
gallium/auxiliary/pipe-loader/pipe_loader_sw.c \
gallium/auxiliary/postprocess/pp_celshade.c \
gallium/auxiliary/postprocess/pp_colors.c \
gallium/auxiliary/postprocess/pp_init.c \
gallium/auxiliary/postprocess/pp_mlaa.c \
gallium/auxiliary/postprocess/pp_program.c \
gallium/auxiliary/postprocess/pp_run.c \
gallium/auxiliary/rbug/rbug_connection.c \
gallium/auxiliary/rbug/rbug_context.c \
gallium/auxiliary/rbug/rbug_core.c \
gallium/auxiliary/rbug/rbug_demarshal.c \
gallium/auxiliary/rbug/rbug_shader.c \
gallium/auxiliary/rbug/rbug_texture.c \
gallium/auxiliary/renderonly/renderonly.c \
gallium/auxiliary/rtasm/rtasm_cpu.c \
gallium/auxiliary/rtasm/rtasm_execmem.c \
gallium/auxiliary/rtasm/rtasm_x86sse.c \
gallium/auxiliary/tgsi/tgsi_build.c \
gallium/auxiliary/tgsi/tgsi_dump.c \
gallium/auxiliary/tgsi/tgsi_emulate.c \
gallium/auxiliary/tgsi/tgsi_exec.c \
gallium/auxiliary/tgsi/tgsi_from_mesa.c \
gallium/auxiliary/tgsi/tgsi_info.c \
gallium/auxiliary/tgsi/tgsi_iterate.c \
gallium/auxiliary/tgsi/tgsi_lowering.c \
gallium/auxiliary/tgsi/tgsi_parse.c \
gallium/auxiliary/tgsi/tgsi_sanity.c \
gallium/auxiliary/tgsi/tgsi_scan.c \
gallium/auxiliary/tgsi/tgsi_strings.c \
gallium/auxiliary/tgsi/tgsi_text.c \
gallium/auxiliary/tgsi/tgsi_transform.c \
gallium/auxiliary/tgsi/tgsi_ureg.c \
gallium/auxiliary/tgsi/tgsi_util.c \
gallium/auxiliary/translate/translate.c \
gallium/auxiliary/translate/translate_cache.c \
gallium/auxiliary/translate/translate_generic.c \
gallium/auxiliary/translate/translate_sse.c \
gallium/auxiliary/util/u_bitmask.c \
gallium/auxiliary/util/u_blitter.c \
gallium/auxiliary/util/u_debug_describe.c \
gallium/auxiliary/util/u_debug_refcnt.c \
gallium/auxiliary/util/u_dl.c \
gallium/auxiliary/util/u_draw.c \
gallium/auxiliary/util/u_draw_quad.c \
gallium/auxiliary/util/u_dump_defines.c \
gallium/auxiliary/util/u_dump_state.c \
gallium/auxiliary/util/u_framebuffer.c \
gallium/auxiliary/util/u_gen_mipmap.c \
gallium/auxiliary/util/u_hash_table.c \
gallium/auxiliary/util/u_helpers.c \
gallium/auxiliary/util/u_log.c \
gallium/auxiliary/util/u_network.c \
gallium/auxiliary/util/u_prim_restart.c \
gallium/auxiliary/util/u_pstipple.c \
gallium/auxiliary/util/u_sampler.c \
gallium/auxiliary/util/u_screen.c \
gallium/auxiliary/util/u_simple_shaders.c \
gallium/auxiliary/util/u_surface.c \
gallium/auxiliary/util/u_tests.c \
gallium/auxiliary/util/u_texture.c \
gallium/auxiliary/util/u_tile.c \
gallium/auxiliary/util/u_transfer.c \
gallium/auxiliary/util/u_transfer_helper.c \
gallium/auxiliary/util/u_upload_mgr.c \
gallium/auxiliary/util/u_vbuf.c \
gallium/frontends/dri/dri2.c \
gallium/frontends/dri/dri_context.c \
gallium/frontends/dri/dri_drawable.c \
gallium/frontends/dri/dri_helpers.c \
gallium/frontends/dri/dri_query_renderer.c \
gallium/frontends/dri/dri_screen.c \
gallium/frontends/dri/drisw.c \
gallium/frontends/dri/dri2.c \
gallium/targets/dri/target.c \
gallium/winsys/sw/dri/dri_sw_winsys.c \
gallium/winsys/sw/null/null_sw_winsys.c \
gallium/winsys/sw/wrapper/wrapper_sw_winsys.c \
loader/loader.c \
loader/pci_id_driver_map.c \
mesa/drivers/dri/common/dri_util.c \
mapi/entry.c \
mesa/drivers/dri/common/megadriver_stub.c \
mesa/drivers/dri/common/utils.c \
mesa/main/accum.c \
mesa/main/api_arrayelt.c \
mesa/main/arbprogram.c \
mesa/main/arrayobj.c \
mesa/main/atifragshader.c \
mesa/main/attrib.c \
mesa/main/barrier.c \
mesa/main/bbox.c \
mesa/main/blend.c \
mesa/main/blit.c \
mesa/main/bufferobj.c \
mesa/main/buffers.c \
mesa/main/clear.c \
mesa/main/clip.c \
mesa/main/colortab.c \
mesa/main/compute.c \
mesa/main/condrender.c \
mesa/main/conservativeraster.c \
mesa/main/context.c \
mesa/main/convolve.c \
mesa/main/copyimage.c \
mesa/main/cpuinfo.c \
mesa/main/debug.c \
mesa/main/debug_output.c \
mesa/main/depth.c \
mesa/main/dlist.c \
mesa/main/draw.c \
mesa/main/drawpix.c \
mesa/main/drawtex.c \
mesa/main/draw_validate.c \
mesa/main/enable.c \
mesa/main/errors.c \
mesa/main/es1_conversion.c \
mesa/main/eval.c \
mesa/main/extensions.c \
mesa/main/extensions_table.c \
mesa/main/externalobjects.c \
mesa/main/fbobject.c \
mesa/main/feedback.c \
mesa/main/ffvertex_prog.c \
mesa/main/fog.c \
mesa/main/formatquery.c \
mesa/main/formats.c \
mesa/main/format_utils.c \
mesa/main/framebuffer.c \
mesa/main/genmipmap.c \
mesa/main/get.c \
mesa/main/getstring.c \
mesa/main/glformats.c \
mesa/main/glspirv.c \
mesa/main/glthread_bufferobj.c \
mesa/main/glthread.c \
mesa/main/glthread_draw.c \
mesa/main/glthread_shaderobj.c \
mesa/main/glthread_varray.c \
mesa/main/hash.c \
mesa/main/hint.c \
mesa/main/histogram.c \
mesa/main/image.c \
mesa/main/light.c \
mesa/main/lines.c \
mesa/main/matrix.c \
mesa/main/mipmap.c \
mesa/main/multisample.c \
mesa/main/objectlabel.c \
mesa/main/objectpurge.c \
mesa/main/pack.c \
mesa/main/pbo.c \
mesa/main/performance_monitor.c \
mesa/main/performance_query.c \
mesa/main/pipelineobj.c \
mesa/main/pixel.c \
mesa/main/pixelstore.c \
mesa/main/pixeltransfer.c \
mesa/main/points.c \
mesa/main/polygon.c \
mesa/main/program_binary.c \
mesa/main/program_resource.c \
mesa/main/querymatrix.c \
mesa/main/queryobj.c \
mesa/main/rastpos.c \
mesa/main/readpix.c \
mesa/main/remap.c \
mesa/main/renderbuffer.c \
mesa/main/robustness.c \
mesa/main/samplerobj.c \
mesa/main/scissor.c \
mesa/main/shaderapi.c \
mesa/main/shaderimage.c \
mesa/main/shaderobj.c \
mesa/main/shared.c \
mesa/main/spirv_extensions.c \
mesa/main/state.c \
mesa/main/stencil.c \
mesa/main/syncobj.c \
mesa/main/texcompress_bptc.c \
mesa/main/texcompress.c \
mesa/main/texcompress_cpal.c \
mesa/main/texcompress_etc.c \
mesa/main/texcompress_fxt1.c \
mesa/main/texcompress_rgtc.c \
mesa/main/texcompress_s3tc.c \
mesa/main/texenv.c \
mesa/main/texgen.c \
mesa/main/texgetimage.c \
mesa/main/teximage.c \
mesa/main/texobj.c \
mesa/main/texparam.c \
mesa/main/texstate.c \
mesa/main/texstorage.c \
mesa/main/texstore.c \
mesa/main/texturebindless.c \
mesa/main/textureview.c \
mesa/main/transformfeedback.c \
mesa/main/uniforms.c \
mesa/main/varray.c \
mesa/main/vdpau.c \
mesa/main/version.c \
mesa/main/viewport.c \
mesa/main/vtxfmt.c \
mesa/math/m_eval.c \
mesa/math/m_matrix.c \
mesa/program/arbprogparse.c \
mesa/program/prog_cache.c \
mesa/program/prog_instruction.c \
mesa/program/prog_opt_constant_fold.c \
mesa/program/prog_optimize.c \
mesa/program/prog_parameter.c \
mesa/program/prog_parameter_layout.c \
mesa/program/prog_print.c \
mesa/program/program.c \
mesa/program/programopt.c \
mesa/program/program_parse_extra.c \
mesa/program/prog_statevars.c \
mesa/program/prog_to_nir.c \
mesa/program/symbol_table.c \
mesa/state_tracker/st_atifs_to_nir.c \
mesa/state_tracker/st_atom_array.c \
mesa/state_tracker/st_atom_atomicbuf.c \
mesa/state_tracker/st_atom_blend.c \
mesa/state_tracker/st_atom.c \
mesa/state_tracker/st_atom_clip.c \
mesa/state_tracker/st_atom_constbuf.c \
mesa/state_tracker/st_atom_depth.c \
mesa/state_tracker/st_atom_framebuffer.c \
mesa/state_tracker/st_atom_image.c \
mesa/state_tracker/st_atom_msaa.c \
mesa/state_tracker/st_atom_pixeltransfer.c \
mesa/state_tracker/st_atom_rasterizer.c \
mesa/state_tracker/st_atom_sampler.c \
mesa/state_tracker/st_atom_scissor.c \
mesa/state_tracker/st_atom_shader.c \
mesa/state_tracker/st_atom_stipple.c \
mesa/state_tracker/st_atom_storagebuf.c \
mesa/state_tracker/st_atom_tess.c \
mesa/state_tracker/st_atom_texture.c \
mesa/state_tracker/st_atom_viewport.c \
mesa/state_tracker/st_cb_bitmap.c \
mesa/state_tracker/st_cb_bitmap_shader.c \
mesa/state_tracker/st_cb_blit.c \
mesa/state_tracker/st_cb_bufferobjects.c \
mesa/state_tracker/st_cb_clear.c \
mesa/state_tracker/st_cb_compute.c \
mesa/state_tracker/st_cb_condrender.c \
mesa/state_tracker/st_cb_copyimage.c \
mesa/state_tracker/st_cb_drawpixels.c \
mesa/state_tracker/st_cb_drawpixels_shader.c \
mesa/state_tracker/st_cb_drawtex.c \
mesa/state_tracker/st_cb_eglimage.c \
mesa/state_tracker/st_cb_fbo.c \
mesa/state_tracker/st_cb_feedback.c \
mesa/state_tracker/st_cb_flush.c \
mesa/state_tracker/st_cb_memoryobjects.c \
mesa/state_tracker/st_cb_msaa.c \
mesa/state_tracker/st_cb_perfmon.c \
mesa/state_tracker/st_cb_perfquery.c \
mesa/state_tracker/st_cb_program.c \
mesa/state_tracker/st_cb_queryobj.c \
mesa/state_tracker/st_cb_rasterpos.c \
mesa/state_tracker/st_cb_readpixels.c \
mesa/state_tracker/st_cb_semaphoreobjects.c \
mesa/state_tracker/st_cb_strings.c \
mesa/state_tracker/st_cb_syncobj.c \
mesa/state_tracker/st_cb_texturebarrier.c \
mesa/state_tracker/st_cb_texture.c \
mesa/state_tracker/st_cb_viewport.c \
mesa/state_tracker/st_cb_xformfb.c \
mesa/state_tracker/st_context.c \
mesa/state_tracker/st_debug.c \
mesa/state_tracker/st_draw.c \
mesa/state_tracker/st_draw_feedback.c \
mesa/state_tracker/st_extensions.c \
mesa/state_tracker/st_format.c \
mesa/state_tracker/st_gen_mipmap.c \
mesa/state_tracker/st_manager.c \
mesa/state_tracker/st_nir_builtins.c \
mesa/state_tracker/st_nir_lower_builtin.c \
mesa/state_tracker/st_nir_lower_tex_src_plane.c \
mesa/state_tracker/st_pbo.c \
mesa/state_tracker/st_program.c \
mesa/state_tracker/st_sampler_view.c \
mesa/state_tracker/st_scissor.c \
mesa/state_tracker/st_shader_cache.c \
mesa/state_tracker/st_texture.c \
mesa/state_tracker/st_tgsi_lower_depth_clamp.c \
mesa/state_tracker/st_tgsi_lower_yuv.c \
mesa/vbo/vbo_context.c \
mesa/vbo/vbo_exec_api.c \
mesa/vbo/vbo_exec.c \
mesa/vbo/vbo_exec_draw.c \
mesa/vbo/vbo_exec_eval.c \
mesa/vbo/vbo_minmax_index.c \
mesa/vbo/vbo_noop.c \
mesa/vbo/vbo_save_api.c \
mesa/vbo/vbo_save.c \
mesa/vbo/vbo_save_draw.c \
mesa/vbo/vbo_save_loopback.c \
mesa/x86/common_x86.c \
util/blob.c \
util/build_id.c \
util/crc32.c \
util/debug.c \
util/disk_cache.c \
util/disk_cache_os.c \
util/double.c \
util/fast_idiv_by_const.c \
util/format/u_format_bptc.c \
util/format/u_format.c \
util/format/u_format_etc.c \
util/format/u_format_latc.c \
util/format/u_format_other.c \
util/format/u_format_rgtc.c \
util/format/u_format_s3tc.c \
util/format/u_format_yuv.c \
util/format/u_format_zs.c \
util/half_float.c \
util/hash_table.c \
util/mesa-sha1.c \
util/os_file.c \
util/os_misc.c \
util/os_time.c \
util/ralloc.c \
util/rand_xor.c \
util/register_allocate.c \
util/rgtc.c \
util/set.c \
util/sha1/sha1.c \
util/slab.c \
util/softfloat.c \
util/string_buffer.c \
util/strtod.c \
util/u_cpu_detect.c \
util/u_debug.c \
util/u_idalloc.c \
util/u_math.c \
util/u_mm.c \
util/u_process.c \
util/u_queue.c \
util/u_vector.c \
util/vma.c \
util/xmlconfig.c
CC_OPT += -DMAPI_ABI_HEADER=\"glapi/gen/glapi_mapi_tmp.h\" \
-DMAPI_MODE_BRIDGE
CC_OPT_loader/loader = -DDEFAULT_DRIVER_DIR='"/drivers"'
CC_OPT_compiler/glsl/glsl_lexer = -include "stdint.h"
CC_OPT_gallium/auxiliary/pipe-loader/pipe_loader_sw = -DPIPE_SEARCH_DIR='"/pipe"' -DGALLIUM_STATIC_TARGETS=1
CC_OPT_gallium/auxiliary/pipe-loader/pipe_loader = -DGALLIUM_STATIC_TARGETS=1
CC_OPT_gallium/auxiliary/pipe-loader/pipe_loader_drm = -DGALLIUM_STATIC_TARGETS=1 -DDRM_DIR_NAME='"/dev/dri"'
CC_CXX_WARN_STRICT =
vpath %.c $(MESA_SRC_DIR)/src
vpath %.c $(MESA_GEN_DIR)/src
vpath %.cpp $(MESA_SRC_DIR)/src
vpath %.cpp $(MESA_GEN_DIR)/src
vpath %.cc $(LIB_DIR)

View File

@ -0,0 +1 @@
include $(REP_DIR)/lib/mk/mesa.inc

View File

@ -0,0 +1,3 @@
# stub mk file
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,45 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
INC_DIR += $(MESA_SRC_DIR)/src/gallium/auxiliary \
$(MESA_SRC_DIR)/src/compiler/nir \
$(MESA_GEN_DIR)/src/compiler/nir \
SRC_C = gallium/drivers/softpipe/sp_buffer.c \
gallium/drivers/softpipe/sp_clear.c \
gallium/drivers/softpipe/sp_compute.c \
gallium/drivers/softpipe/sp_context.c \
gallium/drivers/softpipe/sp_draw_arrays.c \
gallium/drivers/softpipe/sp_fence.c \
gallium/drivers/softpipe/sp_flush.c \
gallium/drivers/softpipe/sp_fs_exec.c \
gallium/drivers/softpipe/sp_image.c \
gallium/drivers/softpipe/sp_prim_vbuf.c \
gallium/drivers/softpipe/sp_quad_blend.c \
gallium/drivers/softpipe/sp_quad_depth_test.c \
gallium/drivers/softpipe/sp_quad_fs.c \
gallium/drivers/softpipe/sp_quad_pipe.c \
gallium/drivers/softpipe/sp_quad_stipple.c \
gallium/drivers/softpipe/sp_query.c \
gallium/drivers/softpipe/sp_screen.c \
gallium/drivers/softpipe/sp_setup.c \
gallium/drivers/softpipe/sp_state_blend.c \
gallium/drivers/softpipe/sp_state_clip.c \
gallium/drivers/softpipe/sp_state_derived.c \
gallium/drivers/softpipe/sp_state_image.c \
gallium/drivers/softpipe/sp_state_rasterizer.c \
gallium/drivers/softpipe/sp_state_sampler.c \
gallium/drivers/softpipe/sp_state_shader.c \
gallium/drivers/softpipe/sp_state_so.c \
gallium/drivers/softpipe/sp_state_surface.c \
gallium/drivers/softpipe/sp_state_vertex.c \
gallium/drivers/softpipe/sp_surface.c \
gallium/drivers/softpipe/sp_tex_sample.c \
gallium/drivers/softpipe/sp_tex_tile_cache.c \
gallium/drivers/softpipe/sp_texture.c \
gallium/drivers/softpipe/sp_tile_cache.c \
vpath %.c $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,12 @@
SHARED_LIB := yes
LIBS += libdrm
LIBS += etnaviv
CC_OPT += -DGALLIUM_ETNAVIV \
-DHAVE_UINT128
include $(REP_DIR)/lib/mk/mesa.inc
# use etnaviv_drmif.h from mesa DRM backend
INC_DIR += $(MESA_SRC_DIR)/src/etnaviv

View File

@ -0,0 +1,17 @@
SHARED_LIB = yes
LIBS = libc egl iris
include $(REP_DIR)/lib/mk/mesa-common.inc
SRC_C = platform_iris.c
SRC_CC = drm_init.cc
CC_OPT += -DHAVE_GENODE_PLATFORM
INC_DIR += $(MESA_SRC_DIR)/src/egl/drivers/dri2 \
$(MESA_SRC_DIR)/src/egl/main \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa
vpath %.c $(LIB_DIR)/iris
vpath %.cc $(LIB_DIR)/iris

View File

@ -0,0 +1,162 @@
LIBS = libc libdrm \
iris_gen80 iris_gen90 iris_gen110 iris_gen120 iris_gen125 \
isl_gen80 isl_gen90 isl_gen110 isl_gen120 isl_gen125
LIBS += expat zlib
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_CXX_WARN_STRICT =
CC_OPT += -DGALLIUM_IRIS
# We rename 'ioctl' calls to 'genode_ioctl' calls (drm lib)
CC_C_OPT += -Dioctl=genode_ioctl
CC_C_OPT += -DUSE_SSE41 -msse4
INC_DIR += $(MESA_GEN_DIR)/src/compiler \
$(MESA_GEN_DIR)/src/compiler/nir \
$(MESA_GEN_DIR)/src/intel
INC_DIR += $(MESA_SRC_DIR)/src/compiler/nir \
$(MESA_SRC_DIR)/src/gallium/auxiliary \
$(MESA_SRC_DIR)/src/intel \
$(MESA_SRC_DIR)/src/mapi \
$(MESA_SRC_DIR)/src/mesa/main \
$(MESA_SRC_DIR)/src/mesa
SRC_C = gallium/drivers/iris/iris_batch.c \
gallium/drivers/iris/iris_binder.c \
gallium/drivers/iris/iris_blit.c \
gallium/drivers/iris/iris_border_color.c \
gallium/drivers/iris/iris_bufmgr.c \
gallium/drivers/iris/iris_clear.c \
gallium/drivers/iris/iris_context.c \
gallium/drivers/iris/iris_disk_cache.c \
gallium/drivers/iris/iris_draw.c \
gallium/drivers/iris/iris_fence.c \
gallium/drivers/iris/iris_fine_fence.c \
gallium/drivers/iris/iris_formats.c \
gallium/drivers/iris/iris_monitor.c \
gallium/drivers/iris/iris_perf.c \
gallium/drivers/iris/iris_performance_query.c \
gallium/drivers/iris/iris_pipe_control.c \
gallium/drivers/iris/iris_program.c \
gallium/drivers/iris/iris_program_cache.c \
gallium/drivers/iris/iris_resolve.c \
gallium/drivers/iris/iris_resource.c \
gallium/drivers/iris/iris_screen.c \
gallium/winsys/iris/drm/iris_drm_winsys.c
SRC_C += $(addprefix intel/blorp/, $(notdir $(wildcard $(MESA_SRC_DIR)/src/intel/blorp/*.c)))
SRC_C += $(addprefix intel/perf/, $(notdir $(wildcard $(MESA_SRC_DIR)/src/intel/perf/*.c)))
SRC_C += intel/perf/gen_perf_metrics.c
SRC_C += $(addprefix intel/common/, $(notdir $(wildcard $(MESA_SRC_DIR)/src/intel/common/*.c)))
SRC_C += intel/compiler/brw_clip_line.c \
intel/compiler/brw_clip_point.c \
intel/compiler/brw_clip_tri.c \
intel/compiler/brw_clip_unfilled.c \
intel/compiler/brw_clip_util.c \
intel/compiler/brw_compile_clip.c \
intel/compiler/brw_compiler.c \
intel/compiler/brw_compile_sf.c \
intel/compiler/brw_debug_recompile.c \
intel/compiler/brw_disasm.c \
intel/compiler/brw_disasm_info.c \
intel/compiler/brw_eu_compact.c \
intel/compiler/brw_eu_emit.c \
intel/compiler/brw_eu_util.c \
intel/compiler/brw_eu_validate.c \
intel/compiler/brw_interpolation_map.c \
intel/compiler/brw_nir_analyze_boolean_resolves.c \
intel/compiler/brw_nir_analyze_ubo_ranges.c \
intel/compiler/brw_nir_attribute_workarounds.c \
intel/compiler/brw_nir.c \
intel/compiler/brw_nir_clamp_image_1d_2d_array_sizes.c \
intel/compiler/brw_nir_lower_alpha_to_coverage.c \
intel/compiler/brw_nir_lower_conversions.c \
intel/compiler/brw_nir_lower_cs_intrinsics.c \
intel/compiler/brw_nir_lower_image_load_store.c \
intel/compiler/brw_nir_lower_intersection_shader.c \
intel/compiler/brw_nir_lower_mem_access_bit_sizes.c \
intel/compiler/brw_nir_lower_rt_intrinsics.c \
intel/compiler/brw_nir_lower_scoped_barriers.c \
intel/compiler/brw_nir_lower_shader_calls.c \
intel/compiler/brw_nir_opt_peephole_ffma.c \
intel/compiler/brw_nir_rt.c \
intel/compiler/brw_nir_tcs_workarounds.c \
intel/compiler/brw_packed_float.c \
intel/compiler/brw_reg_type.c \
intel/compiler/brw_vue_map.c
SRC_CC += intel/compiler/brw_cfg.cpp \
intel/compiler/brw_dead_control_flow.cpp \
intel/compiler/brw_eu.cpp \
intel/compiler/brw_fs_bank_conflicts.cpp \
intel/compiler/brw_fs_cmod_propagation.cpp \
intel/compiler/brw_fs_combine_constants.cpp \
intel/compiler/brw_fs_copy_propagation.cpp \
intel/compiler/brw_fs.cpp \
intel/compiler/brw_fs_cse.cpp \
intel/compiler/brw_fs_dead_code_eliminate.cpp \
intel/compiler/brw_fs_generator.cpp \
intel/compiler/brw_fs_live_variables.cpp \
intel/compiler/brw_fs_lower_pack.cpp \
intel/compiler/brw_fs_lower_regioning.cpp \
intel/compiler/brw_fs_nir.cpp \
intel/compiler/brw_fs_reg_allocate.cpp \
intel/compiler/brw_fs_register_coalesce.cpp \
intel/compiler/brw_fs_saturate_propagation.cpp \
intel/compiler/brw_fs_scoreboard.cpp \
intel/compiler/brw_fs_sel_peephole.cpp \
intel/compiler/brw_fs_validate.cpp \
intel/compiler/brw_fs_visitor.cpp \
intel/compiler/brw_ir_performance.cpp \
intel/compiler/brw_predicated_break.cpp \
intel/compiler/brw_schedule_instructions.cpp \
intel/compiler/brw_shader.cpp \
intel/compiler/brw_vec4_cmod_propagation.cpp \
intel/compiler/brw_vec4_copy_propagation.cpp \
intel/compiler/brw_vec4.cpp \
intel/compiler/brw_vec4_cse.cpp \
intel/compiler/brw_vec4_dead_code_eliminate.cpp \
intel/compiler/brw_vec4_generator.cpp \
intel/compiler/brw_vec4_gs_nir.cpp \
intel/compiler/brw_vec4_gs_visitor.cpp \
intel/compiler/brw_vec4_live_variables.cpp \
intel/compiler/brw_vec4_nir.cpp \
intel/compiler/brw_vec4_reg_allocate.cpp \
intel/compiler/brw_vec4_surface_builder.cpp \
intel/compiler/brw_vec4_tcs.cpp \
intel/compiler/brw_vec4_tes.cpp \
intel/compiler/brw_vec4_visitor.cpp \
intel/compiler/brw_vec4_vs_visitor.cpp \
intel/compiler/brw_wm_iz.cpp \
intel/compiler/gen6_gs_visitor.cpp
SRC_C += intel/dev/gen_debug.c \
intel/dev/gen_device_info.c
SRC_C += intel/isl/isl.c \
intel/isl/isl_aux_info.c \
intel/isl/isl_gen7.c \
intel/isl/isl_gen8.c \
intel/isl/isl_gen9.c \
intel/isl/isl_gen12.c \
intel/isl/isl_drm.c \
intel/isl/isl_format.c \
intel/isl/isl_format_layout.c \
intel/isl/isl_storage_image.c \
intel/isl/isl_tiled_memcpy_normal.c \
intel/isl/isl_tiled_memcpy_sse41.c
SRC_C += $(addprefix mesa/swrast/, $(notdir $(wildcard $(MESA_SRC_DIR)/src/mesa/swrast/*.c)))
SRC_C += $(addprefix mesa/tnl/, $(notdir $(wildcard $(MESA_SRC_DIR)/src/mesa/tnl/*.c)))
SRC_C += mesa/main/texformat.c
vpath %.c $(MESA_GEN_DIR)/src
vpath %.c $(MESA_SRC_DIR)/src
vpath %.cpp $(MESA_SRC_DIR)/src

View File

@ -0,0 +1,7 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=110
include $(REP_DIR)/lib/mk/iris_gen.inc

View File

@ -0,0 +1,7 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=120
include $(REP_DIR)/lib/mk/iris_gen.inc

View File

@ -0,0 +1,7 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=125
include $(REP_DIR)/lib/mk/iris_gen.inc

View File

@ -0,0 +1,7 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=80
include $(REP_DIR)/lib/mk/iris_gen.inc

View File

@ -0,0 +1,7 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=90
include $(REP_DIR)/lib/mk/iris_gen.inc

View File

@ -0,0 +1,6 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=110
include $(REP_DIR)/lib/mk/isl_gen.inc

View File

@ -0,0 +1,6 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=120
include $(REP_DIR)/lib/mk/isl_gen.inc

View File

@ -0,0 +1,6 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=125
include $(REP_DIR)/lib/mk/isl_gen.inc

View File

@ -0,0 +1,6 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=80
include $(REP_DIR)/lib/mk/isl_gen.inc

View File

@ -0,0 +1,6 @@
LIBS = libc
include $(REP_DIR)/lib/mk/mesa-common.inc
CC_OPT += -DGEN_VERSIONx10=90
include $(REP_DIR)/lib/mk/isl_gen.inc

View File

@ -1,5 +1,5 @@
include $(REP_DIR)/lib/mk/libdrm.inc
include $(call select_from_repositories,lib/import/import-libdrm-iris.mk)
include $(call select_from_repositories,lib/import/import-libdrm.mk)
SRC_CC := ioctl_iris.cc

View File

@ -0,0 +1,6 @@
LIBS += libdrm iris
CC_OPT += -DGALLIUM_IRIS \
-DHAVE_UINT128
include $(REP_DIR)/lib/mk/mesa.inc

View File

@ -0,0 +1,125 @@
_eglAddAtExitCall T
_eglAppendArray T
_eglBindContext T
_eglBindTexImage T
_eglBuiltInDriverDRI2 T
_eglBuiltInDrivers D 32
_eglCheckDisplayHandle T
_eglCheckResource T
_eglChooseConfig T
_eglCleanupDisplay T
_eglCompareConfigs T
_eglCreateArray T
_eglDestroyArray T
_eglDestroyCurrentThread T
_eglEraseArray T
_eglError T
_eglFilterArray T
_eglFilterConfigArray T
_eglFindArray T
_eglFindDisplay T
_eglFiniDisplay T
_eglFlattenArray T
_eglGetAPIContext T
_eglGetConfigAttrib T
_eglGetConfigs T
_eglGetCurrentContext T
_eglGetCurrentThread T
_eglGetDriverProc T
_eglGetNativePlatform T
_eglGetResource T
_eglGetSyncAttrib T
_eglGlobal D 136
_eglInitConfig T
_eglInitContext T
_eglInitDriverFallbacks T
_eglInitImage T
_eglInitResource T
_eglInitSurface T
_eglInitSync T
_eglIsCurrentThreadDummy T
_eglLinkConfig T
_eglLinkResource T
_eglLog T
_eglLookupConfig T
_eglMatchConfig T
_eglMatchDriver T
_eglParseConfigAttribList T
_eglParseImageAttribList T
_eglPutResource T
_eglQueryContext T
_eglQuerySurface T
_eglReleaseDisplayResources T
_eglReleaseTexImage T
_eglSetLogLevel T
_eglSetLogProc T
_eglSurfaceAttrib T
_eglSwapInterval T
_eglUnlinkResource T
_eglUnloadDrivers T
_eglValidateConfig T
blit T
dri2_add_config T
dri2_create_image_khr T
dri2_create_screen T
dri2_flush_drawable_for_swapbuffers T
dri2_genode_create_pixmap_surface T
dri2_genode_create_window_surface T
dri2_genode_destroy_surface T
dri2_genode_swap_interval T
dri2_get_dri_config T
dri2_initialize_genode T
dri2_load_driver T
dri2_load_driver_dri3 T
dri2_load_driver_swrast T
dri2_lookup_egl_image T
dri2_setup_screen T
dri2_surface_get_dri_drawable T
dri2_to_egl_attribute_map D 196
eglBindAPI T
eglBindTexImage T
eglChooseConfig T
eglClientWaitSync T
eglCopyBuffers T
eglCreateContext T
eglCreateImage T
eglCreatePbufferFromClientBuffer T
eglCreatePbufferSurface T
eglCreatePixmapSurface T
eglCreatePlatformPixmapSurface T
eglCreatePlatformWindowSurface T
eglCreateSync T
eglCreateWindowSurface T
eglDestroyContext T
eglDestroyImage T
eglDestroySurface T
eglDestroySync T
eglGetConfigAttrib T
eglGetConfigs T
eglGetCurrentContext T
eglGetCurrentDisplay T
eglGetCurrentSurface T
eglGetDisplay T
eglGetError T
eglGetPlatformDisplay T
eglGetProcAddress T
eglGetSyncAttrib T
eglInitialize T
eglMakeCurrent T
eglQueryAPI T
eglQueryContext T
eglQueryString T
eglQuerySurface T
eglReleaseTexImage T
eglReleaseThread T
eglSurfaceAttrib T
eglSwapBuffers T
eglSwapInterval T
eglTerminate T
eglWaitClient T
eglWaitGL T
eglWaitNative T
eglWaitSync T
genode_blit T
image_lookup_extension D 24
use_invalidate D 16

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
d94cb280e69b2663c9405efbd4117f04f2d9c563

View File

@ -0,0 +1,381 @@
LICENSE := GPLv2
VERSION := 21.0.0
DOWNLOADS := mesa.archive
#
# Mesa sources
#
URL_BASE := https://archive.mesa3d.org
URL(mesa) := $(URL_BASE)/mesa-$(VERSION).tar.xz
SHA(mesa) := e6204e98e6a8d77cf9dc5d34f99dd8e3ef7144f3601c808ca0dd26ba522e0d84
DIR(mesa) := src/lib/mesa
TAR_OPT(mesa) := --strip-components=1 --files-from $(REP_DIR)/src/lib/mesa/files.list
HASH_INPUT += $(REP_DIR)/src/lib/mesa/files.list
PATCHES := src/lib/mesa/patches/bitset_redefined.patch \
src/lib/mesa/patches/etnaviv.patch \
src/lib/mesa/patches/iris.patch \
src/lib/mesa/patches/iris_bufmgr_tmp.patch \
src/lib/mesa/patches/iris_binder.patch \
src/lib/mesa/patches/iris_disable_compute.patch \
src/lib/mesa/patches/mesa.patch \
src/lib/mesa/patches/os_mmap.patch \
src/lib/mesa/patches/softpipe_cache.patch
PATCH_OPT := -p1
#
# Generated Mesa sources
#
URL(generated) = https://github.com/ssumpf/mesa_generated.git
REV(generated) = 396d4b08cbcff941126640e6d3e3d2a5f807d527
DIR(generated) = generated
#
# Include directories for API
#
SRC = ${DIR(mesa)}
DIRS := include
DIR_CONTENT(include) = $(wildcard $(SRC)/include/*)
DIRS += include/drm-uapi
DIR_CONTENT(include/drm-uapi) = $(wildcard $(SRC)/include/drm-uapi/*.h)
DIRS += include/pci_ids
DIR_CONTENT(include/pci_ids) = $(wildcard $(SRC)/include/pci_ids/*.h)
default: $(DOWNLOADS) generated
GEN_TARGET = generated
#
# Generate files
#
generated_files = $(GEN_TARGET)/src/compiler/glsl/float64_glsl.h \
$(GEN_TARGET)/src/compiler/glsl/glcpp/glcpp-lex.c \
$(GEN_TARGET)/src/compiler/glsl/glcpp/glcpp-parse.c \
$(GEN_TARGET)/src/compiler/glsl/glsl_lexer.cpp \
$(GEN_TARGET)/src/compiler/glsl/glsl_parser.cpp \
$(GEN_TARGET)/src/compiler/glsl/glsl_parser.cpp \
$(GEN_TARGET)/src/compiler/ir_expression_operation_constant.h \
$(GEN_TARGET)/src/compiler/ir_expression_operation.h \
$(GEN_TARGET)/src/compiler/ir_expression_operation_strings.h \
$(GEN_TARGET)/src/compiler/nir/nir_builder_opcodes.h \
$(GEN_TARGET)/src/compiler/nir/nir_constant_expressions.c \
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics.c \
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics.h \
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics_indices.h \
$(GEN_TARGET)/src/compiler/nir/nir_opcodes.c \
$(GEN_TARGET)/src/compiler/nir/nir_opcodes.h \
$(GEN_TARGET)/src/compiler/nir/nir_opt_algebraic.c \
$(GEN_TARGET)/src/compiler/spirv/spirv_info.c \
$(GEN_TARGET)/src/compiler/spirv/vtn_gather_types.c \
$(GEN_TARGET)/src/compiler/spirv/vtn_generator_ids.h \
$(GEN_TARGET)/src/gallium/auxiliary/indices/u_indices_gen.c \
$(GEN_TARGET)/src/git_sha1.h \
$(GEN_TARGET)/src/mapi/glapi/gen/api_exec.c \
$(GEN_TARGET)/src/mapi/glapi/gen/enums.c \
$(GEN_TARGET)/src/mapi/glapi/gen/glapi_mapi_tmp.h \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated0.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated1.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated2.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated3.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated4.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated5.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated6.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated7.c \
$(GEN_TARGET)/src/mapi/shared-glapi/glapi_mapi_tmp.h \
$(GEN_TARGET)/src/mesa/format_fallback.c \
$(GEN_TARGET)/src/mesa/format_info.h \
$(GEN_TARGET)/src/mesa/format_pack.c \
$(GEN_TARGET)/src/mesa/format_unpack.c \
$(GEN_TARGET)/src/mesa/get_hash.h \
$(GEN_TARGET)/src/mesa/main/dispatch.h \
$(GEN_TARGET)/src/mesa/main/marshal_generated.h \
$(GEN_TARGET)/src/mesa/main/remap_helper.h \
$(GEN_TARGET)/src/mesa/program/lex.yy.c \
$(GEN_TARGET)/src/mesa/program/program_parse.tab.c \
$(GEN_TARGET)/src/util/format_srgb.c \
$(GEN_TARGET)/src/util/format/u_format_pack.h \
$(GEN_TARGET)/src/util/format/u_format_table.c \
$(GEN_TARGET)/src/intel/genxml/gen8_pack.h \
$(GEN_TARGET)/src/intel/genxml/gen9_pack.h \
$(GEN_TARGET)/src/intel/genxml/gen11_pack.h \
$(GEN_TARGET)/src/intel/genxml/gen12_pack.h \
$(GEN_TARGET)/src/intel/genxml/gen125_pack.h \
$(GEN_TARGET)/src/intel/genxml/genX_bits.h \
$(GEN_TARGET)/src/intel/genxml/genX_xml.h \
$(GEN_TARGET)/src/intel/isl/isl_format_layout.c \
$(GEN_TARGET)/src/intel/perf/gen_perf_metrics.h
#
# Print message and create directory
#
MSG_DIR = @$(MSG_GENERATE)$(notdir $@); \
mkdir -p $(@D)
#
# Substitute generated target with source dir
#
_src = $(subst $(GEN_TARGET),$(SRC),$(1))
#
# Call CMD(<filename>)
#
CMD = ${CMD($(notdir $@))}
#
# Generated creation rules
#
$(GEN_TARGET)/src/compiler/glsl/float64_glsl.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/util/xxd.py \
$(SRC)/src/compiler/glsl/float64.glsl $@ -n float64_source
CMD(nir_opcodes.h) = nir_opcodes_h.py
CMD(nir_opcodes.c) = nir_opcodes_c.py
CMD(nir_builder_opcodes.h) = nir_builder_opcodes_h.py
CMD(nir_constant_expressions.c) = nir_constant_expressions.py
CMD(nir_opt_algebraic.c) = nir_opt_algebraic.py
$(GEN_TARGET)/src/compiler/nir/nir_opcodes.h \
$(GEN_TARGET)/src/compiler/nir/nir_opcodes.c \
$(GEN_TARGET)/src/compiler/nir/nir_builder_opcodes.h \
$(GEN_TARGET)/src/compiler/nir/nir_constant_expressions.c \
$(GEN_TARGET)/src/compiler/nir/nir_opt_algebraic.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/compiler/nir/$(CMD) > $@
CMD(nir_intrinsics.h) = nir_intrinsics_h.py
CMD(nir_intrinsics.c) = nir_intrinsics_c.py
CMD(nir_intrinsics_indices.h) = nir_intrinsics_indices_h.py
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics.h \
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics.c \
$(GEN_TARGET)/src/compiler/nir/nir_intrinsics_indices.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/compiler/nir/$(CMD) --outdir $(@D)
CMD($(GEN_TARGET)/src/mapi/shared-glapi/glapi_mapi_tmp.h) = shared-glapi
CMD($(GEN_TARGET)/src/mapi/glapi/gen/glapi_mapi_tmp.h) = glapi
$(GEN_TARGET)/src/mapi/shared-glapi/glapi_mapi_tmp.h \
$(GEN_TARGET)/src/mapi/glapi/gen/glapi_mapi_tmp.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mapi/mapi_abi.py --printer ${CMD($@)} \
$(SRC)/src/mapi/glapi/gen/gl_and_es_API.xml > $@
CMD(ir_expression_operation.h) = enum
CMD(ir_expression_operation_constant.h) = constant
CMD(ir_expression_operation_strings.h) = strings
$(GEN_TARGET)/src/compiler/ir_expression_operation.h \
$(GEN_TARGET)/src/compiler/ir_expression_operation_constant.h \
$(GEN_TARGET)/src/compiler/ir_expression_operation_strings.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/compiler/glsl/ir_expression_operation.py \
$(CMD) > $@
CMD(vtn_generator_ids.h) = vtn_generator_ids_h.py $(call _src,$(@D))/spir-v.xml
CMD(vtn_gather_types.c) = vtn_gather_types_c.py $(call _src,$(@D))/spirv.core.grammar.json
CMD(spirv_info.c) = spirv_info_c.py $(call _src,$(@D))/spirv.core.grammar.json
$(GEN_TARGET)/src/compiler/spirv/vtn_generator_ids.h \
$(GEN_TARGET)/src/compiler/spirv/vtn_gather_types.c \
$(GEN_TARGET)/src/compiler/spirv/spirv_info.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/compiler/spirv/$(CMD) $@
CMD(dispatch.h) = gl_table.py -m remap_table
CMD(marshal_generated.h) = gl_marshal_h.py
CMD(remap_helper.h) = remap_helper.py
CMD(api_exec.c) = gl_genexec.py
CMD(marshal_generated0.c) = gl_marshal.py -i 0 -n 8
CMD(marshal_generated1.c) = gl_marshal.py -i 1 -n 8
CMD(marshal_generated2.c) = gl_marshal.py -i 2 -n 8
CMD(marshal_generated3.c) = gl_marshal.py -i 3 -n 8
CMD(marshal_generated4.c) = gl_marshal.py -i 4 -n 8
CMD(marshal_generated5.c) = gl_marshal.py -i 5 -n 8
CMD(marshal_generated6.c) = gl_marshal.py -i 6 -n 8
CMD(marshal_generated7.c) = gl_marshal.py -i 7 -n 8
$(GEN_TARGET)/src/mesa/main/dispatch.h \
$(GEN_TARGET)/src/mesa/main/marshal_generated.h \
$(GEN_TARGET)/src/mesa/main/remap_helper.h \
$(GEN_TARGET)/src/mapi/glapi/gen/api_exec.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated0.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated1.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated2.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated3.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated4.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated5.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated6.c \
$(GEN_TARGET)/src/mapi/glapi/gen/marshal_generated7.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mapi/glapi/gen/$(CMD) \
-f $(SRC)/src/mapi/glapi/gen/gl_and_es_API.xml > $@
$(GEN_TARGET)/src/mesa/get_hash.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mesa/main/get_hash_generator.py \
-f $(SRC)/src/mapi/glapi/gen/gl_and_es_API.xml > $@
$(GEN_TARGET)/src/mapi/glapi/gen/enums.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mapi/glapi/gen/gl_enums.py \
-f $(SRC)/src/mapi/glapi/registry/gl.xml > $@
$(GEN_TARGET)/src/gallium/auxiliary/indices/u_indices_gen.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) \
$(SRC)/src/gallium/auxiliary/indices/u_indices_gen.py > $@
$(GEN_TARGET)/src/git_sha1.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/bin/git_sha1_gen.py --output $@
CMD(format_info.h) = format_info.py
CMD(format_pack.c) = format_pack.py
CMD(format_unpack.c) = format_unpack.py
$(GEN_TARGET)/src/mesa/format_info.h \
$(GEN_TARGET)/src/mesa/format_pack.c \
$(GEN_TARGET)/src/mesa/format_unpack.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mesa/main/$(CMD) $(SRC)/src/mesa/main/formats.csv \
> $@
$(GEN_TARGET)/src/mesa/format_fallback.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/mesa/main/format_fallback.py $(SRC)/src/mesa/main/formats.csv \
$@
CMD(u_format_pack.h) = --header
$(GEN_TARGET)/src/util/format/u_format_pack.h \
$(GEN_TARGET)/src/util/format/u_format_table.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/util/format/u_format_table.py \
$(call _src,$(@D))/u_format.csv $(CMD) > $@
$(GEN_TARGET)/src/util/format_srgb.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/util/format_srgb.py > $@
$(GEN_TARGET)/src/compiler/glsl/glsl_parser.cpp:
$(MSG_DIR)
$(VERBOSE)bison -Wno-deprecated -o $@ -p "_mesa_glsl_" \
--defines=$(@D)/glsl_parser.h $(SRC)/src/compiler/glsl/glsl_parser.yy
$(GEN_TARGET)/src/compiler/glsl/glcpp/glcpp-parse.c:
$(MSG_DIR)
$(VERBOSE)bison -Wno-deprecated -o $@ -p glcpp_parser_ \
--defines=$(@D)/glcpp-parse.h $(SRC)/src/compiler/glsl/glcpp/glcpp-parse.y
$(GEN_TARGET)/src/mesa/program/program_parse.tab.c:
$(MSG_DIR)
$(VERBOSE)bison -Wno-deprecated -o $@ \
--defines=$(@D)/program_parse.tab.h $(SRC)/src/mesa/program/program_parse.y
$(GEN_TARGET)/src/intel/genxml/gen8_pack.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_pack_header.py $(SRC)/src/intel/genxml/gen8.xml >$@
$(GEN_TARGET)/src/intel/genxml/gen9_pack.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_pack_header.py $(SRC)/src/intel/genxml/gen9.xml >$@
$(GEN_TARGET)/src/intel/genxml/gen11_pack.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_pack_header.py $(SRC)/src/intel/genxml/gen11.xml >$@
$(GEN_TARGET)/src/intel/genxml/gen12_pack.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_pack_header.py $(SRC)/src/intel/genxml/gen12.xml >$@
$(GEN_TARGET)/src/intel/genxml/gen125_pack.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_pack_header.py $(SRC)/src/intel/genxml/gen125.xml >$@
$(GEN_TARGET)/src/intel/genxml/genX_bits.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_bits_header.py \
$(SRC)/src/intel/genxml/gen8.xml \
$(SRC)/src/intel/genxml/gen9.xml \
$(SRC)/src/intel/genxml/gen11.xml \
$(SRC)/src/intel/genxml/gen12.xml \
$(SRC)/src/intel/genxml/gen125.xml \
-o $@
$(GEN_TARGET)/src/intel/genxml/genX_xml.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/genxml/gen_zipped_file.py \
$(SRC)/src/intel/genxml/gen8.xml \
$(SRC)/src/intel/genxml/gen9.xml \
$(SRC)/src/intel/genxml/gen11.xml \
$(SRC)/src/intel/genxml/gen12.xml \
$(SRC)/src/intel/genxml/gen125.xml \
> $@
$(GEN_TARGET)/src/intel/isl/isl_format_layout.c:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/isl/gen_format_layout.py \
--csv $(call _src,$(@D))/isl_format_layout.csv --out $@
$(GEN_TARGET)/src/intel/perf/gen_perf_metrics.h:
$(MSG_DIR)
$(VERBOSE)$(PYTHON) $(SRC)/src/intel/perf/gen_perf.py \
--code generated/src/intel/perf/gen_perf_metrics.c \
--header generated/src/intel/perf/gen_perf_metrics.h \
$(SRC)/src/intel/perf/oa-bdw.xml \
$(SRC)/src/intel/perf/oa-bxt.xml \
$(SRC)/src/intel/perf/oa-cflgt2.xml \
$(SRC)/src/intel/perf/oa-cflgt3.xml \
$(SRC)/src/intel/perf/oa-chv.xml \
$(SRC)/src/intel/perf/oa-glk.xml \
$(SRC)/src/intel/perf/oa-hsw.xml \
$(SRC)/src/intel/perf/oa-icl.xml \
$(SRC)/src/intel/perf/oa-kblgt2.xml \
$(SRC)/src/intel/perf/oa-kblgt3.xml \
$(SRC)/src/intel/perf/oa-lkf.xml \
$(SRC)/src/intel/perf/oa-sklgt2.xml \
$(SRC)/src/intel/perf/oa-sklgt3.xml \
$(SRC)/src/intel/perf/oa-sklgt4.xml \
$(SRC)/src/intel/perf/oa-tgl.xml
CMD(glcpp-lex.c) = glcpp-lex.l
CMD(glsl_lexer.cpp) = glsl_lexer.ll
CMD(lex.yy.c) = program_lexer.l
$(GEN_TARGET)/src/compiler/glsl/glcpp/glcpp-lex.c \
$(GEN_TARGET)/src/compiler/glsl/glsl_lexer.cpp \
$(GEN_TARGET)/src/mesa/program/lex.yy.c:
$(MSG_DIR)
$(VERBOSE)flex -o $@ $(subst $(GEN_TARGET),$(SRC),$(@D))/$(CMD)
ifeq ($(GENERATE_FILES),1)
$(call check_tool,bison)
$(call check_tool,flex)
#
# Determine python version to use
#
PYTHON := $(notdir $(lastword $(shell which python3 $(addprefix python3.,5 6 7 8))))
ifeq ($(PYTHON),)
default: python_not_installed
python_not_installed:
$(error mesa requires python3)
else
python_installed:
$(info Using python: $(PYTHON))
endif
generated: python_installed $(generated_files)
else
generated: generated.git
endif # GENERATE_FILES
# vi: set ft=make :

View File

@ -0,0 +1,23 @@
MIRROR_FROM_REP_DIR := lib/import/import-mesa.mk \
lib/import/import-mesa_api.mk \
lib/symbols/egl \
lib/symbols/mesa
content: $(MIRROR_FROM_REP_DIR)
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/mesa)
content: include
include:
mkdir -p $@
cp -r $(PORT_DIR)/include/* $@
cp -r $(REP_DIR)/include/EGL $@
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/lib/mesa/docs/license.rst $@

View File

@ -0,0 +1 @@
2021-04-29-a 65147d23537f454486604bd66b4fe63fe5b541af

View File

@ -0,0 +1 @@
mesa

View File

@ -0,0 +1,51 @@
MIRROR_FROM_REP_DIR := \
lib/mk/egl.mk \
lib/mk/egl_etnaviv.mk \
lib/mk/egl_swrast.mk \
lib/mk/etnaviv.mk \
lib/mk/iris_gen.inc \
lib/mk/isl_gen.inc \
lib/mk/glapi.mk \
lib/mk/mesa.inc \
lib/mk/mesa_api.mk \
lib/mk/mesa-common.inc \
lib/mk/softpipe.mk \
lib/mk/spec/arm_v8/mesa.mk \
lib/mk/spec/x86/egl_iris.mk \
lib/mk/spec/x86/iris.mk \
lib/mk/spec/x86/iris_gen110.mk \
lib/mk/spec/x86/iris_gen120.mk \
lib/mk/spec/x86/iris_gen125.mk \
lib/mk/spec/x86/iris_gen80.mk \
lib/mk/spec/x86/iris_gen90.mk \
lib/mk/spec/x86/isl_gen110.mk \
lib/mk/spec/x86/isl_gen120.mk \
lib/mk/spec/x86/isl_gen125.mk \
lib/mk/spec/x86/isl_gen80.mk \
lib/mk/spec/x86/isl_gen90.mk \
lib/mk/spec/x86_64/mesa.mk \
src/lib/mesa
content: $(MIRROR_FROM_REP_DIR) src/lib/mesa/target.mk
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
src/lib/mesa/target.mk:
mkdir -p $(dir $@)
echo "LIBS = mesa" > $@
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/mesa)
MIRROR_FROM_PORT_DIR := src/lib/mesa/src generated \
content: $(MIRROR_FROM_PORT_DIR)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $(dir $@)
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/lib/mesa/docs/license.rst $@

View File

@ -0,0 +1 @@
2021-04-29-e 8d1052bf8f93cac1e30c55822a51846c07be18d9

View File

@ -0,0 +1,10 @@
base
blit
libdrm
expat
gpu_session
libc
os
stdcxx
timer_session
zlib

View File

@ -0,0 +1,20 @@
set demo_component test/mesa_demo/gears
set demo_binary gears
set demo_ram_quota 256M
set demo_caps 1500
set demo_config {
<config ld_verbose="true">
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" />
<vfs>
<dir name="dev">
<log/> <inline name="rtc">2000-01-01 00:00</inline>
</dir>
</vfs>
</config>}
set demo_modules {
gears
}
source ${genode_dir}/repos/libports/run/mesa.inc

View File

@ -0,0 +1,3 @@
set use_iris 0
set use_etnaviv 0
source ${genode_dir}/repos/libports/run/mesa-gears.inc

View File

@ -0,0 +1,3 @@
set use_iris 0
set use_etnaviv 1
source ${genode_dir}/repos/libports/run/mesa-gears.inc

View File

@ -0,0 +1,3 @@
set use_iris 1
set use_etnaviv 0
source ${genode_dir}/repos/libports/run/mesa-gears.inc

View File

@ -0,0 +1,23 @@
set demo_component test/mesa_demo/triangle_gl
set demo_binary triangle_gl
set demo_ram_quota 34M
set demo_caps 200
set demo_config {
<config ld_verbose="true">
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
<vfs>
<dir name="dev">
<log/> <inline name="rtc">2020-01-01 00:00</inline>
</dir>
</vfs>
<arg value="triangle_gl"/>
<env key="MESA_LOADER_DRIVER_OVERRIDE" value="iris"/>
<env key="INTEL_DEBUG" value="buf, submit, pc, sync"/>
</config>}
set demo_modules {
triangle_gl
}
source ${genode_dir}/repos/libports/run/mesa.inc

View File

@ -0,0 +1,3 @@
set use_iris 1
set use_etnaviv 0
source ${genode_dir}/repos/libports/run/mesa-triangle_gl.inc

223
repos/libports/run/mesa.inc Normal file
View File

@ -0,0 +1,223 @@
if {[have_spec linux] && ($use_iris || $use_etnaviv)} {
puts "Hardware driver not supported on Linux."
exit 1
}
if {[have_include power_on/qemu] && ($use_iris || $use_etnaviv)} {
puts "Hardware driver not supported in Qemu."
exit 1
}
create_boot_directory
set imports { }
if {$use_etnaviv} {
lappend imports [depot_user]/pkg/drivers_managed-[board]
} else {
lappend imports [depot_user]/pkg/drivers_interactive-[board]
}
lappend imports [depot_user]/src/nitpicker
lappend imports [depot_user]/src/gui_fb
lappend imports [depot_user]/src/demo
lappend imports [depot_user]/src/report_rom
import_from_depot $imports
set build_components {
drivers/gpu/intel
drivers/framebuffer/intel
lib/mesa/softpipe
core init timer
}
lappend_if $use_iris build_components lib/mesa/iris
lappend_if $use_etnaviv build_components lib/mesa/etnaviv
lappend_if $use_etnaviv build_components drivers/gpu/etnaviv
lappend build_components $demo_component
build $build_components
set config {
<config prio_levels="2" verbose="yes">
<parent-provides>
<service name="CPU"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default caps="100"/>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no"/>
<route>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="drivers" caps="2500" managing_system="yes">
<resource name="RAM" quantum="128M"/>
<binary name="init"/>
<provides> <service name="Platform"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Capture"> <child name="nitpicker"/> </service>
<service name="Event"> <child name="nitpicker"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="nitpicker" caps="200">
<resource name="RAM" quantum="2M"/>
<provides>
<service name="Gui"/> <service name="Capture"/> <service name="Event"/>
</provides>
<config>
<capture/> <event/>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" label="no" focus="click" hover="always" />
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
<route><any-service><parent/><any-child/></any-service></route>
</start>
<start name="pointer">
<resource name="RAM" quantum="1M"/>
</start>}
set backend_library egl_swrast.lib.so
if {$use_iris} { set backend_library egl_iris.lib.so }
if {$use_etnaviv} { set backend_library egl_etnaviv.lib.so }
set launchpad_config {
<config>
<launcher name="init" ram_quota="1G" caps="2000">
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="Gui"/>
<service name="Timer"/>
<service name="Gpu"/>
</parent-provides>
<start name="liquid_fb" caps="200">
<resource name="RAM" quantum="16M"/>
<provides> <service name="Framebuffer"/> <service name="Input"/> </provides>
<config resize_handle="off" animate="off" title="gears" width="600" height="600" xpos="100" ypos="100"/>
<route>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>}
append launchpad_config "
<start name=\"$demo_binary\" caps=\"$demo_caps\">
<resource name=\"RAM\" quantum=\"$demo_ram_quota\"/>"
append launchpad_config $demo_config
append launchpad_config "
<route>
<service name=\"ROM\" label=\"egl_drv.lib.so\">
<parent label=\"$backend_library\"/>
</service>"
append launchpad_config {
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>
</launcher>
</config>}
append config {
<start name="launchpad" caps="3000">
<resource name="RAM" quantum="512M"/>}
append config $launchpad_config
append config {
</start>}
append_if $use_iris config {
<start name="intel_gpu_drv" caps="2000">
<resource name="RAM" quantum="40M"/>
<provides>
<service name="Gpu"/>
<service name="Platform"/>
</provides>
<route>
<service name="Platform"> <child name="drivers"/> </service>
<any-service> <parent /> <any-child/> </any-service>
</route>
</start>
<start name="intel_fb_drv" caps="1000">
<resource name="RAM" quantum="96M"/>
<route>
<service name="Platform"> <child name="intel_gpu_drv"/> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if $use_etnaviv config {
<start name="imx8q_gpu_drv" caps="200">
<resource name="RAM" quantum="64M"/>
<provides> <service name="Drm"/> </provides>
<route>
<service name="Timer"> <child name="timer"/> </service>
<service name="Platform"> <child name="drivers"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>}
append config {
</config>}
install_config $config
set boot_modules {
libc.lib.so vfs.lib.so libm.lib.so
egl.lib.so mesa.lib.so stdcxx.lib.so
expat.lib.so glapi.lib.so zlib.lib.so
core init ld.lib.so timer egl_swrast.lib.so
libdrm.lib.so
}
append_if $use_iris boot_modules {
egl_iris.lib.so libdrm.lib.so
intel_gpu_drv intel_fb_drv
}
append_if $use_etnaviv boot_modules {
egl_etnaviv.lib.so libdrm.lib.so
imx8q_gpu_drv
}
append boot_modules $demo_modules
build_boot_image $boot_modules
append qemu_args " -m 768"
run_genode_until forever

View File

@ -0,0 +1,26 @@
/**
* \brief Genode C bindings for EGL back end
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* needed since there exists a 'util/list.h' in mesa */
#include <../include/util/list.h>
#include <blit/blit.h>
#include <base/log.h>
extern "C" {
#include <platform.h>
}
void genode_blit(void const *src, unsigned src_w, void *dst, unsigned dst_w, int w, int h)
{
blit(src, src_w, dst, dst_w, w, h);
}

View File

@ -0,0 +1,187 @@
/**
* \brief Generic EGL-DRI2 back end
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/*
* Mesa
*/
#include <egl_dri2.h>
/*
* Libc
*/
#include <string.h>
#include <dlfcn.h>
#include <unistd.h>
EGLBoolean dri2_genode_swap_interval(_EGLDisplay *disp,
_EGLSurface *surf, EGLint interval)
{
if (interval > surf->Config->MaxSwapInterval)
interval = surf->Config->MaxSwapInterval;
else if (interval < surf->Config->MinSwapInterval)
interval = surf->Config->MinSwapInterval;
surf->SwapInterval = interval;
return EGL_TRUE;
}
static _EGLSurface *
_create_surface(_EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list,
enum Surface_type type)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct Genode_egl_window *window = native_window;
struct Genode_egl_window *window_dynamic;
struct dri2_egl_surface *dri2_surf;
const __DRIconfig *config;
window->type = type;
dri2_surf = calloc(1, sizeof *dri2_surf);
if (type == PIXMAP) {
window_dynamic = calloc(1, sizeof(struct Genode_egl_window));
*window_dynamic = *window;
window = window_dynamic;
}
if (!dri2_surf)
{
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, EGL_WINDOW_BIT, conf, attrib_list, native_window))
goto cleanup_surf;
dri2_surf->g_win = window;
dri2_surf->base.Width = window->width;;
dri2_surf->base.Height = window->height;
config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
dri2_surf->base.GLColorspace);
if (dri2_dpy->dri2) {
dri2_surf->dri_drawable = (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
dri2_surf);
/* create back buffer image */
unsigned flags = 0;
flags |= __DRI_IMAGE_USE_LINEAR;
flags |= (__DRI_IMAGE_USE_SHARE | __DRI_IMAGE_USE_BACKBUFFER);
dri2_surf->back_image = dri2_dpy->image->createImage(dri2_dpy->dri_screen,
dri2_surf->base.Width,
dri2_surf->base.Height,
__DRI_IMAGE_FORMAT_XRGB8888,
flags,
NULL);
} else {
assert(dri2_dpy->swrast);
dri2_surf->dri_drawable =
(*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen,
config, dri2_surf);
}
if (dri2_surf->dri_drawable == NULL)
{
_eglError(EGL_BAD_ALLOC, "swrast->createNewDrawable");
goto cleanup_dri_drawable;
}
dri2_genode_swap_interval(disp, &dri2_surf->base,
dri2_dpy->default_swap_interval);
return &dri2_surf->base;
cleanup_dri_drawable:
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
cleanup_surf:
if (type == PIXMAP)
free(window_dynamic);
free(dri2_surf);
return NULL;
}
_EGLSurface *
dri2_genode_create_window_surface(_EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
_EGLSurface *surf = _create_surface(disp, conf, native_window, attrib_list, WINDOW);
return surf;
}
_EGLSurface*
dri2_genode_create_pixmap_surface(_EGLDisplay *dpy,
_EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
return _create_surface(dpy, conf, native_pixmap, attrib_list, PIXMAP);
}
EGLBoolean
dri2_genode_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct Genode_egl_window *window = dri2_surf->g_win;
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
if (dri2_surf->back_image)
dri2_dpy->image->destroyImage(dri2_surf->back_image);
if (window->type == PIXMAP)
free(window);
free(dri2_surf);
return EGL_TRUE;
}
EGLBoolean dri2_initialize_genode(_EGLDisplay *disp)
{
void *handle;
if (!(handle = dlopen("egl_drv.lib.so", 0))) {
printf("Error: could not open EGL back end driver ('egl_drv.lib.so')\n");
return EGL_FALSE;
}
typedef EGLBoolean (*genode_backend)(_EGLDisplay *);
genode_backend init = (genode_backend)dlsym(handle, "dri2_initialize_genode_backend");
if (!init) {
printf("Error: could not find 'dri2_initialize_genode_backend'\n");
return EGL_FALSE;
}
return init(disp);
}
EGLBoolean
dri2_initialize_surfaceless(_EGLDisplay *disp)
{
printf("%s:%d\n", __func__, __LINE__);
while (1) ;
return false;
}

View File

@ -0,0 +1,27 @@
/**
* \brief Initialize DRM libraries session interface
* \author Josef Soentgen
* \date 2021-04-30
*/
/*
* Copyright (C) 2021 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <../include/util/list.h>
#include <base/env.h>
extern "C" {
#include <platform.h>
}
extern void drm_init(Genode::Env &env);
void genode_drm_init()
{
drm_init(*genode_env);
}

View File

@ -0,0 +1,266 @@
/**
* \brief etnaviv (Vivante) EGL-DRI2 back end
* \author Sebastian Sumpf
* \date 2021-04-30
*/
/*
* Copyright (C) 2021 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/*
* Mesa
*/
#include <egl_dri2.h>
#include <drivers/dri/common/utils.h>
/*
* Libc
*/
#include <string.h>
#include <dlfcn.h>
/*
* Local
*/
#include <platform.h>
static int stride(int value)
{
/* 32-bit RGB888 */
return value * 4;
}
static void
dri2_genode_etnaviv_put_image(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
struct Genode_egl_window *window = dri2_surf->g_win;
unsigned char *dst = window->addr;
int src_stride;
int dst_stride = stride(dri2_surf->base.Width);
dri2_dpy->image->queryImage(dri2_surf->back_image, __DRI_IMAGE_ATTRIB_STRIDE, &src_stride);
int copy_width = src_stride;
int x_offset = stride(x);
dst += x_offset;
dst += y * dst_stride;
/* copy width over stride boundary */
if (copy_width > dst_stride - x_offset)
copy_width = dst_stride - x_offset;
/* limit height */
if (h > dri2_surf->base.Height - y)
h = dri2_surf->base.Height - y;
/* copy to frame buffer and refresh */
genode_blit(data, src_stride, dst, dst_stride, copy_width, h);
}
static EGLBoolean
dri2_genode_etnaviv_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
dri2_flush_drawable_for_swapbuffers(disp, draw);
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
_EGLContext *ctx = _eglGetCurrentContext();
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
void *map_data = NULL;
int stride;
void *data =
dri2_dpy->image->mapImage(dri2_ctx->dri_context, dri2_surf->back_image,
0, 0,
dri2_surf->base.Width,
dri2_surf->base.Height,
__DRI_IMAGE_TRANSFER_READ, &stride,
&map_data);
if (data) {
dri2_genode_etnaviv_put_image(dri2_surf->dri_drawable, 0, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height,
(char *)data, (void *)dri2_surf);
}
dri2_dpy->image->unmapImage(dri2_ctx->dri_context, dri2_surf->back_image, map_data);
return EGL_TRUE;
}
static struct dri2_egl_display_vtbl dri2_genode_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_genode_create_window_surface,
.create_pixmap_surface = dri2_genode_create_pixmap_surface,
.destroy_surface = dri2_genode_destroy_surface,
.swap_interval = dri2_genode_swap_interval,
.swap_buffers = dri2_genode_etnaviv_swap_buffers,
.get_dri_drawable = dri2_surface_get_dri_drawable,
};
static __DRIbuffer *
dri2_genode_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
_eglError(EGL_BAD_PARAMETER, "dri2_genode_get_buffers not implemented");
*out_count = 0;
return NULL;
}
static void
dri2_genode_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
_eglError(EGL_BAD_PARAMETER, "dri2_genode_flush_front_buffer not implemented");
}
static __DRIbuffer *
dri2_genode_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
_eglError(EGL_BAD_PARAMETER, "dri2_genode_get_buffers_with_format not implemented");
*out_count = 0;
return NULL;
}
static int
dri2_genode_image_get_buffers(__DRIdrawable *driDrawable,
unsigned int format,
uint32_t *stamp,
void *loaderPrivate,
uint32_t buffer_mask,
struct __DRIimageList *buffers)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
buffers->image_mask = 0;
buffers->front = NULL;
buffers->back = NULL;
buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;
buffers->back = dri2_surf->back_image;
return 1;
}
static const __DRIdri2LoaderExtension dri2_loader_extension = {
.base = { __DRI_DRI2_LOADER, 3 },
.getBuffers = dri2_genode_get_buffers,
.flushFrontBuffer = dri2_genode_flush_front_buffer,
.getBuffersWithFormat = dri2_genode_get_buffers_with_format,
};
static const __DRIimageLoaderExtension image_loader_extension = {
.base = { __DRI_IMAGE_LOADER, 1 },
.getBuffers = dri2_genode_image_get_buffers,
.flushFrontBuffer = dri2_genode_flush_front_buffer,
};
static const __DRIextension *dri2_loader_extensions[] = {
&dri2_loader_extension.base,
&image_loader_extension.base,
&image_lookup_extension.base,
&background_callable_extension.base,
NULL,
};
static EGLBoolean dri2_initialize_genode_etnaviv(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
static int rgb888_shifts[4] = { 16, 8, 0, 24 };
static unsigned rgb888_sizes[4] = { 8, 8, 8, 8 };
int i;
/* initialize DRM back end */
genode_drm_init();
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = 42;
dri2_dpy->driver_name = strdup("etnaviv");
disp->DriverData = (void *)dri2_dpy;
if (!dri2_load_driver_dri3(disp))
goto close_driver;
dri2_dpy->dri2_major = 2;
dri2_dpy->dri2_minor = __DRI_DRI2_VERSION;
dri2_dpy->loader_extensions = dri2_loader_extensions;
/*
* The driver extensions are queried by the loader, where the
* extensions point to '__driDriverGetExtensions_etnaviv' that
* in return is wraps the 'galliumdrm_driver_extensions'.
* The the third entry in the 'galliumdrm_driver_extensions' array
* points 'driDRI2Extension.base', which is the extension we are
* interested in.
*
* extern const __DRIextension **__driDriverGetExtensions_etnaviv(void);
* dri2_dpy->driver_extensions = __driDriverGetExtensions_etnaviv();
*/
dri2_dpy->dri2 = (const __DRIdri2Extension*)dri2_dpy->driver_extensions[2];
if (!dri2_create_screen(disp))
goto close_screen;
if (!dri2_setup_extensions(disp))
goto close_screen;
dri2_setup_screen(disp);
EGLint attrs[] = {
EGL_DEPTH_SIZE, 0, /* set in loop below (from DRI config) */
EGL_NATIVE_VISUAL_TYPE, 0,
EGL_NATIVE_VISUAL_ID, 0,
EGL_NONE };
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
/* set depth size in attrs */
attrs[1] = dri2_dpy->driver_configs[i]->modes.depthBits;
dri2_add_config(disp, dri2_dpy->driver_configs[i], i,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT,
attrs, rgb888_shifts, rgb888_sizes);
}
dri2_dpy->vtbl = &dri2_genode_display_vtbl;
return EGL_TRUE;
close_screen:
dlclose(dri2_dpy->driver);
close_driver:
free(dri2_dpy);
return EGL_FALSE;
}
EGLBoolean dri2_initialize_genode_backend(_EGLDisplay *disp)
{
return dri2_initialize_genode_etnaviv(disp);
}

View File

@ -0,0 +1 @@
LIBS = egl_etnaviv

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
#ifndef _INCLUDE__ERRNO_H_
#define _INCLUDE__ERRNO_H_
#include <sys/errno.h>
#define ENODATA 61
#define ETIME 62
#endif /* _INCLUDE__ERRNO_H_ */

View File

@ -0,0 +1,49 @@
/**
* \brief Platform C/C++ inteface
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _PLATFORM_H_
#define _PLATFORM_H_
#ifdef __cplusplus
namespace Genode { class Env; }
extern Genode::Env *genode_env;
#endif
#include <EGL/egl.h>
struct Genode_egl_window;
void genode_blit(void const *src, unsigned src_w, void *dst, unsigned dst_w, int w, int h);
void genode_drm_init();
void genode_drm_complete();
struct _EGLSurface;
struct _EGLConfig;
struct _EGLDisplay;
_EGLSurface *
dri2_genode_create_window_surface(_EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list);
EGLBoolean
dri2_genode_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf);
_EGLSurface *
dri2_genode_create_pixmap_surface(_EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list);
EGLBoolean
dri2_genode_swap_interval(_EGLDisplay *disp,
_EGLSurface *surf, EGLint interval);
#endif

View File

@ -0,0 +1,6 @@
#ifndef _INCLUDE__UTIL__FUTEX_H_
#define _INCLUDE__UTIL__FUTEX_H_
#define UTIL_FUTEX_SUPPORTED 0
#endif /* _INCLUDE__UTIL__FUTEX_H_ */

View File

@ -0,0 +1,27 @@
/**
* \brief Initialize DRM libraries session interface
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <../include/util/list.h>
#include <base/env.h>
extern "C" {
#include <platform.h>
}
extern Genode::Entrypoint &genode_entrypoint();
extern void drm_init(Genode::Env &env, Genode::Entrypoint &ep);
void genode_drm_init()
{
drm_init(*genode_env, genode_entrypoint());
}

View File

@ -0,0 +1,260 @@
/**
* \brief Intel GPU EGL-DRI2 back end
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/*
* Mesa
*/
#include <egl_dri2.h>
#include <drivers/dri/common/utils.h>
/*
* Libc
*/
#include <dlfcn.h>
/*
* Local
*/
#include <platform.h>
static int stride(int value)
{
/* 32-bit RGB888 */
return value * 4;
}
static void
dri2_genode_put_image(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
struct Genode_egl_window *window = dri2_surf->g_win;
unsigned char *dst = window->addr;
int src_stride;
int dst_stride = stride(dri2_surf->base.Width);
dri2_dpy->image->queryImage(dri2_surf->back_image, __DRI_IMAGE_ATTRIB_STRIDE, &src_stride);
int copy_width = src_stride;
int x_offset = stride(x);
dst += x_offset;
dst += y * dst_stride;
/* copy width over stride boundary */
if (copy_width > dst_stride - x_offset)
copy_width = dst_stride - x_offset;
/* limit height */
if (h > dri2_surf->base.Height - y)
h = dri2_surf->base.Height - y;
/* copy to frame buffer and refresh */
genode_blit(data, src_stride, dst, dst_stride, copy_width, h);
}
static EGLBoolean
dri2_genode_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
dri2_flush_drawable_for_swapbuffers(disp, draw);
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
_EGLContext *ctx = _eglGetCurrentContext();
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
void *map_data = NULL;
int stride;
void *data =
dri2_dpy->image->mapImage(dri2_ctx->dri_context, dri2_surf->back_image,
0, 0,
dri2_surf->base.Width,
dri2_surf->base.Height,
__DRI_IMAGE_TRANSFER_READ, &stride,
&map_data);
if (data) {
dri2_genode_put_image(dri2_surf->dri_drawable, 0, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height,
(char *)data, (void *)dri2_surf);
}
dri2_dpy->image->unmapImage(dri2_ctx->dri_context, dri2_surf->back_image, map_data);
return EGL_TRUE;
}
/*
* platform functions
*/
static struct dri2_egl_display_vtbl dri2_genode_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_genode_create_window_surface,
.create_pixmap_surface = dri2_genode_create_pixmap_surface,
.destroy_surface = dri2_genode_destroy_surface,
.swap_interval = dri2_genode_swap_interval,
.swap_buffers = dri2_genode_swap_buffers,
.get_dri_drawable = dri2_surface_get_dri_drawable,
};
static __DRIbuffer *
dri2_genode_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
_eglError(EGL_BAD_PARAMETER, "dri2_genode_get_buffers not implemented");
*out_count = 0;
return NULL;
}
static void
dri2_genode_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
_eglError(EGL_BAD_PARAMETER, "dri2_genode_flush_front_buffer not implemented");
}
static void
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
__DRIimage * const image = dri2_surf->back_image;
int name, pitch;
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &name);
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);
buffer->attachment = __DRI_BUFFER_BACK_LEFT;
buffer->name = name;
buffer->pitch = pitch;
buffer->cpp = 4;
buffer->flags = 0;
}
static __DRIbuffer *
dri2_genode_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int i, j;
for (i = 0, j = 0; i < 2 * count; i += 2, j++) {
switch (attachments[i]) {
case __DRI_BUFFER_BACK_LEFT:
back_bo_to_dri_buffer(dri2_surf, &dri2_surf->buffers[j]);
break;
default:
printf("ERROR: not implemented\n");
j = 0;
break;
}
}
*out_count = j;
if (j == 0)
return NULL;
*width = dri2_surf->base.Width;
*height = dri2_surf->base.Height;
return dri2_surf->buffers;
}
static const __DRIdri2LoaderExtension dri2_loader_extension = {
.base = { __DRI_DRI2_LOADER, 3 },
.getBuffers = dri2_genode_get_buffers,
.flushFrontBuffer = dri2_genode_flush_front_buffer,
.getBuffersWithFormat = dri2_genode_get_buffers_with_format,
};
static const __DRIextension *dri2_loader_extensions[] = {
&dri2_loader_extension.base,
&image_lookup_extension.base,
&background_callable_extension.base,
NULL,
};
EGLBoolean dri2_initialize_genode_backend(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
static int rgb888_shifts[4] = { 16, 8, 0, 24 };
static unsigned rgb888_sizes[4] = { 8, 8, 8, 8 };
/* initialize DRM back end */
genode_drm_init();
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = 43;
dri2_dpy->driver_name = strdup("iris");
disp->DriverData = (void *)dri2_dpy;
dri2_dpy->vtbl = &dri2_genode_display_vtbl;
if (!dri2_load_driver(disp))
goto close_driver;
dri2_dpy->dri2_major = 2;
dri2_dpy->dri2_minor = __DRI_DRI2_VERSION;
dri2_dpy->loader_extensions = dri2_loader_extensions;
if (!dri2_create_screen(disp))
goto close_screen;
if (!dri2_setup_extensions(disp))
goto close_screen;
dri2_setup_screen(disp);
EGLint attrs[] = {
EGL_DEPTH_SIZE, 0, /* set in loop below (from DRI config) */
EGL_NATIVE_VISUAL_TYPE, 0,
EGL_NATIVE_VISUAL_ID, 0,
EGL_NONE };
for (unsigned i = 0; dri2_dpy->driver_configs[i]; i++) {
/* set depth size in attrs */
attrs[1] = dri2_dpy->driver_configs[i]->modes.depthBits;
dri2_add_config(disp, dri2_dpy->driver_configs[i], i,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT,
attrs, rgb888_shifts, rgb888_sizes);
}
return EGL_TRUE;
close_screen:
dlclose(dri2_dpy->driver);
close_driver:
free(dri2_dpy);
return EGL_FALSE;
}

View File

@ -0,0 +1,2 @@
TARGET = dummy-egl_iris
LIBS = egl_iris

View File

@ -0,0 +1,4 @@
#include <pthread.h>
extern "C" void pthread_set_name_np(pthread_t, const char *)
{ }

View File

@ -0,0 +1,93 @@
--- a/src/lib/mesa/src/intel/compiler/brw_nir_lower_shader_calls.c
+++ b/src/lib/mesa/src/intel/compiler/brw_nir_lower_shader_calls.c
@@ -151,15 +151,15 @@
intrin->intrinsic == nir_intrinsic_execute_callable;
}
-struct bitset {
+struct brw_bitset {
BITSET_WORD *set;
unsigned size;
};
-static struct bitset
+static struct brw_bitset
bitset_create(void *mem_ctx, unsigned size)
{
- return (struct bitset) {
+ return (struct brw_bitset) {
.set = rzalloc_array(mem_ctx, BITSET_WORD, BITSET_WORDS(size)),
.size = size,
};
@@ -168,7 +168,7 @@
static bool
src_is_in_bitset(nir_src *src, void *_set)
{
- struct bitset *set = _set;
+ struct brw_bitset *set = _set;
assert(src->is_ssa);
/* Any SSA values which were added after we generated liveness information
@@ -183,7 +183,7 @@
}
static void
-add_ssa_def_to_bitset(nir_ssa_def *def, struct bitset *set)
+add_ssa_def_to_bitset(nir_ssa_def *def, struct brw_bitset *set)
{
if (def->index >= set->size)
return;
@@ -192,7 +192,7 @@
}
static bool
-can_remat_instr(nir_instr *instr, struct bitset *remat)
+can_remat_instr(nir_instr *instr, struct brw_bitset *remat)
{
/* Set of all values which are trivially re-materializable and we shouldn't
* ever spill them. This includes:
@@ -270,7 +270,7 @@
}
static bool
-can_remat_ssa_def(nir_ssa_def *def, struct bitset *remat)
+can_remat_ssa_def(nir_ssa_def *def, struct brw_bitset *remat)
{
return can_remat_instr(def->parent_instr, remat);
}
@@ -362,7 +362,7 @@
const unsigned num_ssa_defs = impl->ssa_alloc;
const unsigned live_words = BITSET_WORDS(num_ssa_defs);
- struct bitset trivial_remat = bitset_create(mem_ctx, num_ssa_defs);
+ struct brw_bitset trivial_remat = bitset_create(mem_ctx, num_ssa_defs);
/* Array of all live SSA defs which are spill candidates */
nir_ssa_def **spill_defs =
@@ -434,7 +434,7 @@
/* Make a copy of trivial_remat that we'll update as we crawl through
* the live SSA defs and unspill them.
*/
- struct bitset remat = bitset_create(mem_ctx, num_ssa_defs);
+ struct brw_bitset remat = bitset_create(mem_ctx, num_ssa_defs);
memcpy(remat.set, trivial_remat.set, live_words * sizeof(BITSET_WORD));
/* Before the two builders are always separated by the call
@@ -926,7 +926,7 @@
struct exec_list *child_list,
bool child_list_contains_cursor,
nir_instr *resume_instr,
- struct bitset *remat)
+ struct brw_bitset *remat)
{
nir_shader *shader = impl->function->shader;
nir_cf_list cf_list;
@@ -1113,7 +1113,7 @@
/* Used to track which things may have been assumed to be re-materialized
* by the spilling pass and which we shouldn't delete.
*/
- struct bitset remat = bitset_create(mem_ctx, impl->ssa_alloc);
+ struct brw_bitset remat = bitset_create(mem_ctx, impl->ssa_alloc);
/* Create a nop instruction to use as a cursor as we extract and re-insert
* stuff into the CFG.

View File

@ -0,0 +1,45 @@
--- a/src/lib/mesa/src/gallium/frontends/dri/dri2.c
+++ b/src/lib/mesa/src/gallium/frontends/dri/dri2.c
@@ -550,7 +550,11 @@ dri2_allocate_textures(struct dri_context *ctx,
whandle.format = format;
whandle.modifier = DRM_FORMAT_MOD_INVALID;
if (screen->can_share_buffer)
- whandle.type = WINSYS_HANDLE_TYPE_SHARED;
+ /*
+ * Change from SHARED to FD because we abuse etna_screen_create
+ * to allocate the BO but the imx8q_gpu_drv is rendernode only.
+ */
+ whandle.type = WINSYS_HANDLE_TYPE_FD;
else
whandle.type = WINSYS_HANDLE_TYPE_KMS;
drawable->textures[statt] =
--- a/src/lib/mesa/src/loader/loader.c
+++ b/src/lib/mesa/src/loader/loader.c
@@ -467,6 +467,9 @@ out:
char *
loader_get_driver_for_fd(int fd)
{
+ if (fd == 42) {
+ return "etnaviv";
+ }
char *driver;
/* Allow an environment variable to force choosing a different driver
--- a/src/lib/mesa/src/util/os_file.c
+++ b/src/lib/mesa/src/util/os_file.c
@@ -50,6 +50,12 @@ os_dupfd_cloexec(int fd)
int
os_dupfd_cloexec(int fd)
{
+ /*
+ * The fd is not allocate via the libc so dup will not work, just
+ * return the original fd.
+ */
+ return fd;
+
int minfd = 3;
int newfd = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
--
2.20.1

View File

@ -0,0 +1,12 @@
--- a/src/lib/mesa/src/loader/loader.c
--- b/src/lib/mesa/src/loader/loader.c
@@ -470,6 +470,9 @@
if (fd == 42) {
return "etnaviv";
}
+ if (fd == 43) {
+ return "iris";
+ }
char *driver;
/* Allow an environment variable to force choosing a different driver

View File

@ -0,0 +1,26 @@
The binder re-uses vgpu addresses of buffer objects, which are scheduled
to be deleted, but not yet destroyed. The drm_ioctl backend still have a
vgpu mapping of the not yet destroyed buffer object. When the binder reuses
the vgpu address for a new/another buffer object, the gpu multiplexer will
complain about an overmap. To avoid that, as workaround, don't reuse vgpu
addresses immediately in the binder.
--- a/src/lib/mesa/src/gallium/drivers/iris/iris_binder.c
+++ a/src/lib/mesa/src/gallium/drivers/iris/iris_binder.c
@@ -71,7 +71,7 @@
struct iris_bufmgr *bufmgr = screen->bufmgr;
struct iris_binder *binder = &ice->state.binder;
- uint64_t next_address = IRIS_MEMZONE_BINDER_START;
+ static uint64_t next_address = IRIS_MEMZONE_BINDER_START;
if (binder->bo) {
/* Place the new binder just after the old binder, unless we've hit the
@@ -100,6 +100,8 @@
*/
ice->state.dirty |= IRIS_DIRTY_RENDER_BUFFER;
ice->state.stage_dirty |= IRIS_ALL_STAGE_DIRTY_BINDINGS;
+
+ next_address += IRIS_BINDER_SIZE;
}
static uint32_t

View File

@ -0,0 +1,59 @@
--- a/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/lib/mesa/src/gallium/drivers/iris/iris_bufmgr.c
@@ -1297,6 +1297,8 @@
return ret;
}
+struct iris_bufmgr * single_bufmgr = NULL;
+
static void
iris_bufmgr_destroy(struct iris_bufmgr *bufmgr)
{
@@ -1814,10 +1816,13 @@
static struct iris_bufmgr *
iris_bufmgr_create(struct gen_device_info *devinfo, int fd, bool bo_reuse)
{
- uint64_t gtt_size = iris_gtt_size(fd);
+printf("%s:%u\n", __func__, __LINE__);
+// uint64_t gtt_size = iris_gtt_size(fd);
+ uint64_t gtt_size = 2 * IRIS_MEMZONE_OTHER_START;
if (gtt_size <= IRIS_MEMZONE_OTHER_START)
return NULL;
+printf("%s:%u\n", __func__, __LINE__);
struct iris_bufmgr *bufmgr = calloc(1, sizeof(*bufmgr));
if (bufmgr == NULL)
return NULL;
@@ -1920,14 +1925,18 @@
struct iris_bufmgr *
iris_bufmgr_get_for_fd(struct gen_device_info *devinfo, int fd, bool bo_reuse)
{
+printf("%s:%u\n", __func__, __LINE__);
+#if 0
struct stat st;
if (fstat(fd, &st))
return NULL;
+#endif
struct iris_bufmgr *bufmgr = NULL;
mtx_lock(&global_bufmgr_list_mutex);
+#if 0
list_for_each_entry(struct iris_bufmgr, iter_bufmgr, &global_bufmgr_list, link) {
struct stat iter_st;
if (fstat(iter_bufmgr->fd, &iter_st))
@@ -1939,7 +1948,13 @@
goto unlock;
}
}
+#endif
+ if (single_bufmgr) {
+ struct iris_bufmgr * iter_bufmgr = single_bufmgr;
+ bufmgr = iris_bufmgr_ref(iter_bufmgr);
+ goto unlock;
+ } else
bufmgr = iris_bufmgr_create(devinfo, fd, bo_reuse);
if (bufmgr)
list_addtail(&bufmgr->link, &global_bufmgr_list);

View File

@ -0,0 +1,18 @@
Disable compute batch intialization since it requires its own DRM context. This
is currently not supported by the GPU multiplexer and in turn corrupts the state
of the render batch.
diff --git a/src/lib/mesa/src/gallium/drivers/iris/iris_context.c b/src/lib/mesa/src/gallium/drivers/iris/iris_context.c
index 9fc6bb3..ac58e82 100644
--- a/src/lib/mesa/src/gallium/drivers/iris/iris_context.c
+++ b/src/lib/mesa/src/gallium/drivers/iris/iris_context.c
@@ -361,7 +361,8 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags)
}
screen->vtbl.init_render_context(&ice->batches[IRIS_BATCH_RENDER]);
- screen->vtbl.init_compute_context(&ice->batches[IRIS_BATCH_COMPUTE]);
+ //XXX: we need support multiple contexts in GPU driver
+ //screen->vtbl.init_compute_context(&ice->batches[IRIS_BATCH_COMPUTE]);
return ctx;
}

View File

@ -0,0 +1,113 @@
diff --git a/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.c b/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.c
index 62fc7fb..0725756 100644
--- a/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.c
@@ -1188,6 +1188,9 @@ dri2_initialize(_EGLDisplay *disp)
case _EGL_PLATFORM_ANDROID:
ret = dri2_initialize_android(disp);
break;
+ case _EGL_PLATFORM_GENODE:
+ ret = dri2_initialize_genode(disp);
+ break;
default:
unreachable("Callers ensure we cannot get here.");
return EGL_FALSE;
diff --git a/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.h b/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.h
index d7f9696..007c630 100644
--- a/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/lib/mesa/src/egl/drivers/dri2/egl_dri2.h
@@ -296,6 +296,12 @@ struct dri2_egl_surface
int format;
#endif
+#ifdef HAVE_GENODE_PLATFORM
+ struct Genode_egl_window *g_win;
+ __DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
+ __DRIimage *back_image;
+#endif
+
#ifdef HAVE_DRM_PLATFORM
struct gbm_dri_surface *gbm_surf;
#endif
@@ -516,6 +522,9 @@ dri2_initialize_android(_EGLDisplay *disp)
EGLBoolean
dri2_initialize_surfaceless(_EGLDisplay *disp);
+EGLBoolean
+dri2_initialize_genode(_EGLDisplay *disp);
+
EGLBoolean
dri2_initialize_device(_EGLDisplay *disp);
static inline void
diff --git a/src/lib/mesa/src/egl/main/egldisplay.c b/src/lib/mesa/src/egl/main/egldisplay.c
index 765618f..be99e17 100644
--- a/src/lib/mesa/src/egl/main/egldisplay.c
+++ b/src/lib/mesa/src/egl/main/egldisplay.c
@@ -77,6 +77,7 @@ static const struct {
{ _EGL_PLATFORM_HAIKU, "haiku" },
{ _EGL_PLATFORM_SURFACELESS, "surfaceless" },
{ _EGL_PLATFORM_DEVICE, "device" },
+ { _EGL_PLATFORM_DEVICE, "genode" },
};
diff --git a/src/lib/mesa/src/egl/main/egldisplay.h b/src/lib/mesa/src/egl/main/egldisplay.h
index 4d2afbc..3dd6b72 100644
--- a/src/lib/mesa/src/egl/main/egldisplay.h
+++ b/src/lib/mesa/src/egl/main/egldisplay.h
@@ -52,6 +52,7 @@ enum _egl_platform_type {
_EGL_PLATFORM_HAIKU,
_EGL_PLATFORM_SURFACELESS,
_EGL_PLATFORM_DEVICE,
+ _EGL_PLATFORM_GENODE,
_EGL_NUM_PLATFORMS,
_EGL_INVALID_PLATFORM = -1
diff --git a/src/lib/mesa/src/egl/main/egllog.c b/src/lib/mesa/src/egl/main/egllog.c
index 6a91952..b41b481 100644
--- a/src/lib/mesa/src/egl/main/egllog.c
+++ b/src/lib/mesa/src/egl/main/egllog.c
@@ -57,7 +57,7 @@
#endif /* HAVE_ANDROID_PLATFORM */
#define MAXSTRING 1000
-#define FALLBACK_LOG_LEVEL _EGL_WARNING
+#define FALLBACK_LOG_LEVEL _EGL_DEBUG
static struct {
diff --git a/src/lib/mesa/src/loader/loader.c b/src/lib/mesa/src/loader/loader.c
index d64bc7c..9a25398 100644
--- a/src/lib/mesa/src/loader/loader.c
+++ b/src/lib/mesa/src/loader/loader.c
@@ -561,7 +561,7 @@ loader_open_driver(const char *driver_name,
driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
#endif
if (driver == NULL) {
- snprintf(path, sizeof(path), "%.*s/%s_dri.so", len, p, driver_name);
+ snprintf(path, sizeof(path), "%.*s/egl_drv.lib.so", len, p);
driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
if (driver == NULL) {
dl_error = dlerror();
diff --git a/src/lib/mesa/src/util/u_thread.h b/src/lib/mesa/src/util/u_thread.h
index c5f7fb6..f3166a4 100644
--- a/src/lib/mesa/src/util/u_thread.h
+++ b/src/lib/mesa/src/util/u_thread.h
@@ -209,7 +209,7 @@ util_set_current_thread_affinity(const uint32_t *mask,
static inline int64_t
util_thread_get_time_nano(thrd_t thread)
{
-#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
+#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__GENODE__)
struct timespec ts;
clockid_t cid;
@@ -249,7 +249,7 @@ static inline bool u_thread_is_self(thrd_t thread)
* util_barrier
*/
-#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
+#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__GENODE__)
typedef pthread_barrier_t util_barrier;

View File

@ -0,0 +1,25 @@
--- a/src/lib/mesa/src/gallium/auxiliary/os/os_mman.h
+++ b/src/lib/mesa/src/gallium/auxiliary/os/os_mman.h
@@ -59,10 +59,12 @@ extern "C" {
munmap(addr, length)
#else
+extern void *drm_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
/* assume large file support exists */
# define os_mmap(addr, length, prot, flags, fd, offset) \
- mmap(addr, length, prot, flags, fd, offset)
+ drm_mmap(addr, length, prot, flags, fd, offset)
+extern int drm_munmap(void *addr, size_t length);
static inline int os_munmap(void *addr, size_t length)
{
/* Copied from configure code generated by AC_SYS_LARGEFILE */
@@ -72,7 +74,7 @@ static inline int os_munmap(void *addr, size_t length)
LARGE_OFF_T % 2147483647 == 1);
#undef LARGE_OFF_T
- return munmap(addr, length);
+ return drm_munmap(addr, length);
}
#endif

View File

@ -0,0 +1,100 @@
Allocate texture cache lazy instead of relying on OS specific VM address space
reservation via malloc.
diff --git a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
index 8725930..d36c833 100644
--- a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -724,7 +724,7 @@ get_texel_buffer_no_border(const struct sp_sampler_view *sp_sview,
tile = sp_get_cached_tile_tex(sp_sview->cache, addr);
- return &tile->data.color[0][x][0];
+ return &tile->data->color[0][x][0];
}
@@ -740,7 +740,7 @@ get_texel_2d_no_border(const struct sp_sampler_view *sp_sview,
tile = sp_get_cached_tile_tex(sp_sview->cache, addr);
- return &tile->data.color[y][x][0];
+ return &tile->data->color[y][x][0];
}
@@ -927,10 +927,10 @@ get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_view *sp_sview,
tile = sp_get_cached_tile_tex(sp_sview->cache, addr);
- out[0] = &tile->data.color[y ][x ][0];
- out[1] = &tile->data.color[y ][x+1][0];
- out[2] = &tile->data.color[y+1][x ][0];
- out[3] = &tile->data.color[y+1][x+1][0];
+ out[0] = &tile->data->color[y ][x ][0];
+ out[1] = &tile->data->color[y ][x+1][0];
+ out[2] = &tile->data->color[y+1][x ][0];
+ out[3] = &tile->data->color[y+1][x+1][0];
}
@@ -966,7 +966,7 @@ get_texel_3d_no_border(const struct sp_sampler_view *sp_sview,
tile = sp_get_cached_tile_tex(sp_sview->cache, addr);
- return &tile->data.color[y][x][0];
+ return &tile->data->color[y][x][0];
}
diff --git a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
index 7a1009a..78de40a 100644
--- a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
+++ b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
@@ -221,6 +221,9 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
pos, x/TILE_SIZE, y/TILE_SIZE, z, face, level,
pos, tile->addr.bits.x, tile->addr.bits.y, tile->z, tile->face, tile->level);
#endif
+
+ if (tile->data == NULL)
+ tile->data = malloc(sizeof(struct softpipe_tex_data));
/* check if we need to get a new transfer */
if (!tc->tex_trans ||
@@ -265,7 +268,7 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
TEX_TILE_SIZE,
TEX_TILE_SIZE,
tc->format,
- (float *) tile->data.color);
+ (float *) tile->data->color);
tile->addr = addr;
}
diff --git a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h
index 2e4635f..fa21e1f 100644
--- a/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h
+++ b/src/lib/mesa/src/gallium/drivers/softpipe/sp_tex_tile_cache.h
@@ -60,15 +60,19 @@ union tex_tile_address {
uint64_t value;
};
-
-struct softpipe_tex_cached_tile
+struct softpipe_tex_data
{
- union tex_tile_address addr;
union {
float color[TEX_TILE_SIZE][TEX_TILE_SIZE][4];
unsigned int colorui[TEX_TILE_SIZE][TEX_TILE_SIZE][4];
int colori[TEX_TILE_SIZE][TEX_TILE_SIZE][4];
- } data;
+ };
+};
+
+struct softpipe_tex_cached_tile
+{
+ union tex_tile_address addr;
+ struct softpipe_tex_data *data;
};
/*

View File

@ -0,0 +1,224 @@
/**
* \brief Software EGL-DRI2 back end
* \author Sebastian Sumpf
* \date 2017-08-17
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/*
* Mesa
*/
#include <egl_dri2.h>
#include <drivers/dri/common/utils.h>
/*
* Libc
*/
#include <string.h>
#include <dlfcn.h>
/*
* Local
*/
#include <platform.h>
static int stride(int value)
{
/* 32-bit RGB888 */
return value * 4;
}
static EGLBoolean
dri2_genode_swrast_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
return EGL_TRUE;
}
static struct dri2_egl_display_vtbl dri2_genode_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_genode_create_window_surface,
.create_pixmap_surface = dri2_genode_create_pixmap_surface,
//.create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
.destroy_surface = dri2_genode_destroy_surface,
//.create_image = dri2_fallback_create_image_khr,
.swap_interval = dri2_genode_swap_interval,
.swap_buffers = dri2_genode_swrast_swap_buffers,
//.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
//.swap_buffers_region = dri2_fallback_swap_buffers_region,
//.post_sub_buffer = dri2_fallback_post_sub_buffer,
//.copy_buffers = dri2_fallback_copy_buffers,
//.query_buffer_age = dri2_fallback_query_buffer_age,
//.get_sync_values = dri2_fallback_get_sync_values,
.get_dri_drawable = dri2_surface_get_dri_drawable,
};
static void
dri2_genode_swrast_get_image(__DRIdrawable * read,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct Genode_egl_window *window = dri2_surf->g_win;
unsigned char * src = window->addr;
int src_stride = stride(dri2_surf->base.Width);
int copy_width = stride(w);
int x_offset = stride(x);
int dst_stride = copy_width;
assert(data != (char *)src);
src += x_offset;
src += y * src_stride;
/* copy width over stride boundary */
if (copy_width > src_stride - x_offset)
copy_width = src_stride - x_offset;
/* limit height */
if (h > dri2_surf->base.Height - y)
h = dri2_surf->base.Height - y;
/* copy to surface */
genode_blit(src, src_stride, data, dst_stride, copy_width, h);
}
static void
dri2_genode_swrast_put_image(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct Genode_egl_window *window = dri2_surf->g_win;
unsigned char * dst = window->addr;
int dst_stride = stride(dri2_surf->base.Width);
int copy_width = stride(w);
int x_offset = stride(x);
int src_stride = copy_width;
dst += x_offset;
dst += y * dst_stride;
/* copy width over stride boundary */
if (copy_width >dst_stride - x_offset)
copy_width = dst_stride - x_offset;
/* limit height */
if (h > dri2_surf->base.Height - y)
h = dri2_surf->base.Height - y;
/* copy to frame buffer and refresh */
genode_blit(data, src_stride, dst, dst_stride, copy_width, h);
}
static void
dri2_genode_swrast_get_drawable_info(__DRIdrawable * draw,
int *x, int *y, int *w, int *h,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
//XXX: (void) swrast_update_buffers(dri2_surf);
struct Genode_egl_window *window = dri2_surf->g_win;
*x = 0;
*y = 0;
*w = window->width;
*h = window->height;
dri2_surf->base.Width = window->width;
dri2_surf->base.Height = window->height;
}
static const __DRIswrastLoaderExtension swrast_loader_extension = {
.base = { __DRI_SWRAST_LOADER, 1 },
.getDrawableInfo = dri2_genode_swrast_get_drawable_info,
.putImage = dri2_genode_swrast_put_image,
.getImage = dri2_genode_swrast_get_image
};
static const __DRIextension *swrast_loader_extensions[] = {
&swrast_loader_extension.base,
NULL,
NULL,
};
static EGLBoolean
dri2_initialize_genode_swrast(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
static int rgb888_shifts[4] = { 16, 8, 0, 24 };
static unsigned rgb888_sizes[4] = { 8, 8, 8, 8 };
int i;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
disp->DriverData = (void *)dri2_dpy;
dri2_dpy->fd = -1;
dri2_dpy->driver_name = strdup("swrast");
if (!dri2_load_driver_swrast(disp))
goto close_driver;
dri2_dpy->loader_extensions = swrast_loader_extensions;
if (!dri2_create_screen(disp))
goto close_screen;
if (!dri2_setup_extensions(disp))
goto close_screen;
dri2_setup_screen(disp);
EGLint attrs[] = {
EGL_DEPTH_SIZE, 0, /* set in loop below (from DRI config) */
EGL_NATIVE_VISUAL_TYPE, 0,
EGL_NATIVE_VISUAL_ID, 0,
EGL_NONE };
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
/* set depth size in attrs */
attrs[1] = dri2_dpy->driver_configs[i]->modes.depthBits;
dri2_add_config(disp, dri2_dpy->driver_configs[i], i,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT,
attrs, rgb888_shifts, rgb888_sizes);
}
dri2_dpy->vtbl = &dri2_genode_display_vtbl;
return EGL_TRUE;
close_screen:
dlclose(dri2_dpy->driver);
close_driver:
free(dri2_dpy);
return EGL_FALSE;
}
EGLBoolean dri2_initialize_genode_backend(_EGLDisplay *disp)
{
return dri2_initialize_genode_swrast(disp);
}

View File

@ -0,0 +1 @@
LIBS = egl_swrast