r600: Remove Gallium dependencies in r600_asm

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
This commit is contained in:
Vitaliy Triang3l Kuzmin
2023-10-07 19:40:13 +03:00
committed by Marge Bot
parent b7e5a8b5ca
commit bcb34884c2
7 changed files with 23 additions and 9 deletions
+2 -1
View File
@@ -23,6 +23,7 @@
#include "r600_formats.h"
#include "r600_shader.h"
#include "r600_query.h"
#include "r600d_common.h"
#include "evergreend.h"
#include "pipe/p_shader_tokens.h"
@@ -2210,7 +2211,7 @@ static void evergreen_emit_constant_buffers(struct r600_context *rctx,
va = rbuffer->gpu_address + cb->buffer_offset;
if (buffer_index < R600_MAX_HW_CONST_BUFFERS) {
if (buffer_index < R600_MAX_ALU_CONST_BUFFERS) {
radeon_set_context_reg_flag(cs, reg_alu_constbuf_size + buffer_index * 4,
DIV_ROUND_UP(cb->buffer_size, 256), pkt_flags);
radeon_set_context_reg_flag(cs, reg_alu_const_cache + buffer_index * 4, va >> 8,
+11 -5
View File
@@ -20,17 +20,18 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "r600_asm.h"
#include "r600_sq.h"
#include "r600_opcodes.h"
#include "r600_formats.h"
#include "r600_shader.h"
#include "r600d.h"
#include "r600d_common.h"
#include <errno.h>
#include "util/u_bitcast.h"
#include <string.h>
#include "compiler/shader_enums.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "pipe/p_shader_tokens.h"
#define NUM_OF_CYCLES 3
#define NUM_OF_COMPONENTS 4
@@ -1085,7 +1086,7 @@ static int r600_bytecode_alloc_inst_kcache_lines(struct r600_bytecode *bc,
continue;
bank = alu->src[i].kc_bank;
assert(bank < R600_MAX_HW_CONST_BUFFERS);
assert(bank < R600_MAX_ALU_CONST_BUFFERS);
line = (sel-512)>>4;
index_mode = alu->src[i].kc_rel;
@@ -2130,7 +2131,12 @@ static int print_src(struct r600_bytecode_alu *alu, unsigned idx)
need_chan = 1;
break;
case V_SQ_ALU_SRC_LITERAL:
o += fprintf(stderr, "[0x%08X %f]", src->value, u_bitcast_u2f(src->value));
{
const uint32_t value_uint32 = src->value;
float value_float;
memcpy(&value_float, &value_uint32, sizeof(float));
o += fprintf(stderr, "[0x%08X %f]", value_uint32, value_float);
}
break;
case V_SQ_ALU_SRC_0_5:
o += fprintf(stderr, "0.5");
+5 -1
View File
@@ -23,9 +23,13 @@
#ifndef R600_ASM_H
#define R600_ASM_H
#include "r600_pipe.h"
#include "util/format/u_format.h"
#include "util/list.h"
#include "amd_family.h"
#include "r600_isa.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#ifdef __cplusplus
-1
View File
@@ -75,7 +75,6 @@
#define R600_MAX_USER_CONST_BUFFERS 15
#define R600_MAX_DRIVER_CONST_BUFFERS 3
#define R600_MAX_CONST_BUFFERS (R600_MAX_USER_CONST_BUFFERS + R600_MAX_DRIVER_CONST_BUFFERS)
#define R600_MAX_HW_CONST_BUFFERS 16
/* start driver buffers after user buffers */
#define R600_BUFFER_INFO_CONST_BUFFER (R600_MAX_USER_CONST_BUFFERS)
+1
View File
@@ -24,6 +24,7 @@
#define R600_SHADER_H
#include "r600_asm.h"
#include "r600_pipe.h"
#ifdef __cplusplus
+2 -1
View File
@@ -23,6 +23,7 @@
#include "r600_formats.h"
#include "r600_shader.h"
#include "r600d.h"
#include "r600d_common.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_endian.h"
@@ -1721,7 +1722,7 @@ static void r600_emit_constant_buffers(struct r600_context *rctx,
offset = cb->buffer_offset;
if (!gs_ring_buffer) {
assert(buffer_index < R600_MAX_HW_CONST_BUFFERS);
assert(buffer_index < R600_MAX_ALU_CONST_BUFFERS);
radeon_set_context_reg(cs, reg_alu_constbuf_size + buffer_index * 4,
DIV_ROUND_UP(cb->buffer_size, 256));
radeon_set_context_reg(cs, reg_alu_const_cache + buffer_index * 4, offset >> 8);
+2
View File
@@ -134,4 +134,6 @@
#define EG_S_028C70_FAST_CLEAR(x) (((unsigned)(x) & 0x1) << 17)
#define SI_S_028C70_FAST_CLEAR(x) (((unsigned)(x) & 0x1) << 13)
#define R600_MAX_ALU_CONST_BUFFERS 16
#endif