Discussion:
[PATCH 1/3] ac: resolve conflicts introduced with "ac: remove amdgpu.h dependency"
Add Reply
Emil Velikov
2017-06-16 20:09:08 UTC
Reply
Permalink
Raw Message
From: Emil Velikov <***@collabora.com>

The commit did not add the relevant includes - in particular
stdint.h and stdbool.h for the respective standard types.

At the same time, the amdgpu_device_handle typedef redeclaration was
off.

Fixes: 81945ded0dc ("ac: remove amdgpu.h dependency")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101471
Cc: Bas Nieuwenhuizen <***@basnieuwenhuizen.nl>
Cc: Mark Janes <***@intel.com>
Reported-by: Bas Nieuwenhuizen <***@basnieuwenhuizen.nl>
Reported-by: Mark Janes <***@intel.com>
Signed-off-by: Emil Velikov <***@collabora.com>
---
src/amd/common/ac_gpu_info.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index a72ab58f9a3..3091fed6a43 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -26,6 +26,8 @@
#ifndef AC_GPU_INFO_H
#define AC_GPU_INFO_H

+#include <stdint.h>
+#include <stdbool.h>
#include "amd_family.h"

#ifdef __cplusplus
@@ -33,7 +35,7 @@ extern "C" {
#endif

/* Prior to C11 the following may trigger a typedef redeclaration warning */
-typedef void * amdgpu_device_handle;
+typedef struct amdgpu_device *amdgpu_device_handle;
struct amdgpu_gpu_info;

struct radeon_info {
--
2.13.0
Emil Velikov
2017-06-16 20:09:10 UTC
Reply
Permalink
Raw Message
From: Emil Velikov <***@collabora.com>

The header embeds the struct so it needs the header inclusion instead of
the dummy forward declaration.

Cc: Nicolai Hähnle <***@amd.com>
Cc: Marek Olšák <***@amd.com>
Cc: Tom Stellard <***@redhat.com>
Fixes: 32206c5e560 ("radeonsi: Add radeon_shader_binary member to struct
si_shader")
Signed-off-by: Emil Velikov <***@collabora.com>
---
NB! The series seems to build fine on my end and within Travis, yet
Jenkin results are still pending. Sent early for people to skim through.

src/gallium/drivers/radeonsi/si_shader.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 063747a4096..60fe86609b5 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -139,9 +139,9 @@
#include <llvm-c/TargetMachine.h>
#include "tgsi/tgsi_scan.h"
#include "util/u_queue.h"
-#include "si_state.h"

-struct ac_shader_binary;
+#include "ac_binary.h"
+#include "si_state.h"

#define SI_MAX_VS_OUTPUTS 40
--
2.13.0
Emil Velikov
2017-06-16 20:27:17 UTC
Reply
Permalink
Raw Message
Post by Emil Velikov
NB! The series seems to build fine on my end and within Travis, yet
Jenkin results are still pending. Sent early for people to skim through.
The Jenkins build seem happy with the series.

-Emil
Emil Velikov
2017-06-16 20:09:09 UTC
Reply
Permalink
Raw Message
From: Emil Velikov <***@collabora.com>

Those are used by r600 and radeonsi, so moving them within the former
was a bad idea.

Fixes: d96a210842b ("r600g,compute: provide local copy of functions
from ac_binary.c")
Cc: Jan Vesely <***@rutgers.edu>
Cc: Aaron Watry <***@gmail.com>
Signed-off-by: Emil Velikov <***@collabora.com>
---
src/gallium/drivers/r600/evergreen_compute.c | 25 ++-----------------------
src/gallium/drivers/radeon/r600_pipe_common.c | 21 +++++++++++++++++++++
src/gallium/drivers/radeon/r600_pipe_common.h | 5 +++++
3 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 1f1e08374fb..37cfed4497b 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -180,27 +180,6 @@ static void evergreen_cs_set_constant_buffer(struct r600_context *rctx,
#define R_028850_SQ_PGM_RESOURCES_PS 0x028850

#ifdef HAVE_OPENCL
-/*
- * shader binary helpers.
- */
-static void r600_shader_binary_init(struct ac_shader_binary *b)
-{
- memset(b, 0, sizeof(*b));
-}
-
-static void r600_shader_binary_clean(struct ac_shader_binary *b)
-{
- if (!b)
- return;
- FREE(b->code);
- FREE(b->config);
- FREE(b->rodata);
- FREE(b->global_symbol_offsets);
- FREE(b->relocs);
- FREE(b->disasm_string);
- FREE(b->llvm_ir_string);
-}
-
static void parse_symbol_table(Elf_Data *symbol_table_data,
const GElf_Shdr *symbol_table_header,
struct ac_shader_binary *binary)
@@ -435,7 +414,7 @@ static void *evergreen_create_compute_state(struct pipe_context *ctx,
COMPUTE_DBG(rctx->screen, "*** evergreen_create_compute_state\n");
header = cso->prog;
code = cso->prog + sizeof(struct pipe_llvm_program_header);
- r600_shader_binary_init(&shader->binary);
+ radeon_shader_binary_init(&shader->binary);
r600_elf_read(code, header->num_bytes, &shader->binary);
r600_create_shader(&shader->bc, &shader->binary, &use_kill);

@@ -467,7 +446,7 @@ static void evergreen_delete_compute_state(struct pipe_context *ctx, void *state
return;

#ifdef HAVE_OPENCL
- r600_shader_binary_clean(&shader->binary);
+ radeon_shader_binary_clean(&shader->binary);
#endif
r600_destroy_shader(&shader->bc);

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 038627c4aeb..1cec6d5ea68 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -64,6 +64,27 @@ struct r600_multi_fence {
};

/*
+ * shader binary helpers.
+ */
+void radeon_shader_binary_init(struct ac_shader_binary *b)
+{
+ memset(b, 0, sizeof(*b));
+}
+
+void radeon_shader_binary_clean(struct ac_shader_binary *b)
+{
+ if (!b)
+ return;
+ FREE(b->code);
+ FREE(b->config);
+ FREE(b->rodata);
+ FREE(b->global_symbol_offsets);
+ FREE(b->relocs);
+ FREE(b->disasm_string);
+ FREE(b->llvm_ir_string);
+}
+
+/*
* pipe_context
*/

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 8ba5c369a66..45ed5bab74b 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -34,6 +34,8 @@

#include <stdio.h>

+#include "amd/common/ac_binary.h"
+
#include "radeon/radeon_winsys.h"

#include "util/disk_cache.h"
@@ -132,6 +134,9 @@ struct r600_perfcounters;
struct tgsi_shader_info;
struct r600_qbo_state;

+void radeon_shader_binary_init(struct ac_shader_binary *b);
+void radeon_shader_binary_clean(struct ac_shader_binary *b);
+
/* Only 32-bit buffer allocations are supported, gallium doesn't support more
* at the moment.
*/
--
2.13.0
Bas Nieuwenhuizen
2017-06-16 22:37:27 UTC
Reply
Permalink
Raw Message
The series is
Post by Emil Velikov
The commit did not add the relevant includes - in particular
stdint.h and stdbool.h for the respective standard types.
At the same time, the amdgpu_device_handle typedef redeclaration was
off.
Fixes: 81945ded0dc ("ac: remove amdgpu.h dependency")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101471
---
src/amd/common/ac_gpu_info.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index a72ab58f9a3..3091fed6a43 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -26,6 +26,8 @@
#ifndef AC_GPU_INFO_H
#define AC_GPU_INFO_H
+#include <stdint.h>
+#include <stdbool.h>
#include "amd_family.h"
#ifdef __cplusplus
@@ -33,7 +35,7 @@ extern "C" {
#endif
/* Prior to C11 the following may trigger a typedef redeclaration warning */
-typedef void * amdgpu_device_handle;
+typedef struct amdgpu_device *amdgpu_device_handle;
struct amdgpu_gpu_info;
struct radeon_info {
--
2.13.0
Emil Velikov
2017-06-17 10:41:08 UTC
Reply
Permalink
Raw Message
Post by Bas Nieuwenhuizen
The series is
Thanks pushed to master. Sincere apologies for glitching things up.

-Emil

Loading...