From 321bd6c280bf54b00921014d77732a8dbdf83c21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 1 Apr 2018 19:01:32 -0400 Subject: [PATCH] radeonsi: move r600_buffer_common.c and r600_texture.c into radeonsi Acked-by: Timothy Arceri --- src/gallium/drivers/radeon/Makefile.sources | 2 - src/gallium/drivers/radeon/r600_pipe_common.h | 80 +------------------ src/gallium/drivers/radeonsi/Makefile.sources | 2 + .../si_buffer.c} | 0 src/gallium/drivers/radeonsi/si_pipe.h | 77 ++++++++++++++++++ .../r600_texture.c => radeonsi/si_texture.c} | 0 6 files changed, 80 insertions(+), 81 deletions(-) rename src/gallium/drivers/{radeon/r600_buffer_common.c => radeonsi/si_buffer.c} (100%) rename src/gallium/drivers/{radeon/r600_texture.c => radeonsi/si_texture.c} (100%) diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources index dd08b2285fa..fbd1ab697a9 100644 --- a/src/gallium/drivers/radeon/Makefile.sources +++ b/src/gallium/drivers/radeon/Makefile.sources @@ -1,8 +1,6 @@ C_SOURCES := \ - r600_buffer_common.c \ r600_perfcounter.c \ r600_pipe_common.h \ - r600_texture.c \ radeon_uvd.c \ radeon_uvd.h \ radeon_vcn_dec.c \ diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 4e377d45407..81bf3865ed9 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -23,8 +23,7 @@ */ /** - * This file contains common screen and context structures and functions - * for r600g and radeonsi. + * This file is going to be removed. */ #ifndef R600_PIPE_COMMON_H @@ -402,86 +401,9 @@ struct r600_common_context { uint64_t offset, uint64_t size, unsigned value); }; -/* r600_buffer_common.c */ -bool si_rings_is_buffer_referenced(struct si_context *sctx, - struct pb_buffer *buf, - enum radeon_bo_usage usage); -void *si_buffer_map_sync_with_rings(struct si_context *sctx, - struct r600_resource *resource, - unsigned usage); -void si_init_resource_fields(struct si_screen *sscreen, - struct r600_resource *res, - uint64_t size, unsigned alignment); -bool si_alloc_resource(struct si_screen *sscreen, - struct r600_resource *res); -struct pipe_resource *si_aligned_buffer_create(struct pipe_screen *screen, - unsigned flags, - unsigned usage, - unsigned size, - unsigned alignment); -void si_replace_buffer_storage(struct pipe_context *ctx, - struct pipe_resource *dst, - struct pipe_resource *src); -void si_init_screen_buffer_functions(struct si_screen *sscreen); -void si_init_buffer_functions(struct si_context *sctx); - /* r600_perfcounters.c */ void si_perfcounters_destroy(struct si_screen *sscreen); -/* r600_texture.c */ -bool si_prepare_for_dma_blit(struct si_context *sctx, - struct r600_texture *rdst, - unsigned dst_level, unsigned dstx, - unsigned dsty, unsigned dstz, - struct r600_texture *rsrc, - unsigned src_level, - const struct pipe_box *src_box); -void si_texture_get_fmask_info(struct si_screen *sscreen, - struct r600_texture *rtex, - unsigned nr_samples, - struct r600_fmask_info *out); -void si_texture_get_cmask_info(struct si_screen *sscreen, - struct r600_texture *rtex, - struct r600_cmask_info *out); -void si_eliminate_fast_color_clear(struct si_context *sctx, - struct r600_texture *rtex); -void si_texture_discard_cmask(struct si_screen *sscreen, - struct r600_texture *rtex); -bool si_init_flushed_depth_texture(struct pipe_context *ctx, - struct pipe_resource *texture, - struct r600_texture **staging); -void si_print_texture_info(struct si_screen *sscreen, - struct r600_texture *rtex, struct u_log_context *log); -struct pipe_resource *si_texture_create(struct pipe_screen *screen, - const struct pipe_resource *templ); -bool vi_dcc_formats_compatible(enum pipe_format format1, - enum pipe_format format2); -bool vi_dcc_formats_are_incompatible(struct pipe_resource *tex, - unsigned level, - enum pipe_format view_format); -void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, - struct pipe_resource *tex, - unsigned level, - enum pipe_format view_format); -struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe, - struct pipe_resource *texture, - const struct pipe_surface *templ, - unsigned width0, unsigned height0, - unsigned width, unsigned height); -unsigned si_translate_colorswap(enum pipe_format format, bool do_endian_swap); -void vi_separate_dcc_try_enable(struct si_context *sctx, - struct r600_texture *tex); -void vi_separate_dcc_start_query(struct si_context *sctx, - struct r600_texture *tex); -void vi_separate_dcc_stop_query(struct si_context *sctx, - struct r600_texture *tex); -void vi_separate_dcc_process_and_reset_stats(struct pipe_context *ctx, - struct r600_texture *tex); -bool si_texture_disable_dcc(struct si_context *sctx, - struct r600_texture *rtex); -void si_init_screen_texture_functions(struct si_screen *sscreen); -void si_init_context_texture_functions(struct si_context *sctx); - /* Inline helpers. */ diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources index c008fc6f396..3b1726d17dc 100644 --- a/src/gallium/drivers/radeonsi/Makefile.sources +++ b/src/gallium/drivers/radeonsi/Makefile.sources @@ -6,6 +6,7 @@ C_SOURCES := \ cik_sdma.c \ driinfo_radeonsi.h \ si_blit.c \ + si_buffer.c \ si_clear.c \ si_compute.c \ si_compute.h \ @@ -42,4 +43,5 @@ C_SOURCES := \ si_state_viewport.c \ si_state.h \ si_test_dma.c \ + si_texture.c \ si_uvd.c diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeonsi/si_buffer.c similarity index 100% rename from src/gallium/drivers/radeon/r600_buffer_common.c rename to src/gallium/drivers/radeonsi/si_buffer.c diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 7c1214542bd..29ee25abf56 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -746,6 +746,29 @@ void si_blit_decompress_depth(struct pipe_context *ctx, unsigned first_layer, unsigned last_layer, unsigned first_sample, unsigned last_sample); +/* si_buffer.c */ +bool si_rings_is_buffer_referenced(struct si_context *sctx, + struct pb_buffer *buf, + enum radeon_bo_usage usage); +void *si_buffer_map_sync_with_rings(struct si_context *sctx, + struct r600_resource *resource, + unsigned usage); +void si_init_resource_fields(struct si_screen *sscreen, + struct r600_resource *res, + uint64_t size, unsigned alignment); +bool si_alloc_resource(struct si_screen *sscreen, + struct r600_resource *res); +struct pipe_resource *si_aligned_buffer_create(struct pipe_screen *screen, + unsigned flags, + unsigned usage, + unsigned size, + unsigned alignment); +void si_replace_buffer_storage(struct pipe_context *ctx, + struct pipe_resource *dst, + struct pipe_resource *src); +void si_init_screen_buffer_functions(struct si_screen *sscreen); +void si_init_buffer_functions(struct si_context *sctx); + /* si_clear.c */ void vi_dcc_clear_level(struct si_context *sctx, struct r600_texture *rtex, @@ -866,6 +889,60 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe, void si_update_vs_viewport_state(struct si_context *ctx); void si_init_viewport_functions(struct si_context *ctx); +/* r600_texture.c */ +bool si_prepare_for_dma_blit(struct si_context *sctx, + struct r600_texture *rdst, + unsigned dst_level, unsigned dstx, + unsigned dsty, unsigned dstz, + struct r600_texture *rsrc, + unsigned src_level, + const struct pipe_box *src_box); +void si_texture_get_fmask_info(struct si_screen *sscreen, + struct r600_texture *rtex, + unsigned nr_samples, + struct r600_fmask_info *out); +void si_texture_get_cmask_info(struct si_screen *sscreen, + struct r600_texture *rtex, + struct r600_cmask_info *out); +void si_eliminate_fast_color_clear(struct si_context *sctx, + struct r600_texture *rtex); +void si_texture_discard_cmask(struct si_screen *sscreen, + struct r600_texture *rtex); +bool si_init_flushed_depth_texture(struct pipe_context *ctx, + struct pipe_resource *texture, + struct r600_texture **staging); +void si_print_texture_info(struct si_screen *sscreen, + struct r600_texture *rtex, struct u_log_context *log); +struct pipe_resource *si_texture_create(struct pipe_screen *screen, + const struct pipe_resource *templ); +bool vi_dcc_formats_compatible(enum pipe_format format1, + enum pipe_format format2); +bool vi_dcc_formats_are_incompatible(struct pipe_resource *tex, + unsigned level, + enum pipe_format view_format); +void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, + struct pipe_resource *tex, + unsigned level, + enum pipe_format view_format); +struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe, + struct pipe_resource *texture, + const struct pipe_surface *templ, + unsigned width0, unsigned height0, + unsigned width, unsigned height); +unsigned si_translate_colorswap(enum pipe_format format, bool do_endian_swap); +void vi_separate_dcc_try_enable(struct si_context *sctx, + struct r600_texture *tex); +void vi_separate_dcc_start_query(struct si_context *sctx, + struct r600_texture *tex); +void vi_separate_dcc_stop_query(struct si_context *sctx, + struct r600_texture *tex); +void vi_separate_dcc_process_and_reset_stats(struct pipe_context *ctx, + struct r600_texture *tex); +bool si_texture_disable_dcc(struct si_context *sctx, + struct r600_texture *rtex); +void si_init_screen_texture_functions(struct si_screen *sscreen); +void si_init_context_texture_functions(struct si_context *sctx); + /* * common helpers diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeonsi/si_texture.c similarity index 100% rename from src/gallium/drivers/radeon/r600_texture.c rename to src/gallium/drivers/radeonsi/si_texture.c -- 2.30.2