All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 2/3] amdgpu: Fix amdgpu_semaphore_handle typedef not to hide pointer type
Date: Fri, 16 Sep 2016 18:46:09 +1000	[thread overview]
Message-ID: <1474015570-30928-3-git-send-email-funfunctor@folklore1984.net> (raw)
In-Reply-To: <1474015570-30928-1-git-send-email-funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
---
 amdgpu/amdgpu.h            | 10 +++++-----
 amdgpu/amdgpu_cs.c         | 20 ++++++++++----------
 tests/amdgpu/basic_tests.c |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index f322497..9332fab 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -127,7 +127,7 @@ typedef struct amdgpu_va amdgpu_va_handle_t;
 /**
  * Define handle for semaphore
  */
-typedef struct amdgpu_semaphore *amdgpu_semaphore_handle;
+typedef struct amdgpu_semaphore amdgpu_semaphore_handle_t;
 
 /*--------------------------------------------------------------------------*/
 /* -------------------------- Structures ---------------------------------- */
@@ -1194,7 +1194,7 @@ int amdgpu_bo_va_op(amdgpu_bo_handle bo,
  *          <0 - Negative POSIX Error code
  *
 */
-int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle *sem);
+int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle_t ** sem);
 
 /**
  *  signal semaphore
@@ -1213,7 +1213,7 @@ int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
 			       uint32_t ip_type,
 			       uint32_t ip_instance,
 			       uint32_t ring,
-			       amdgpu_semaphore_handle sem);
+			       amdgpu_semaphore_handle_t * sem);
 
 /**
  *  wait semaphore
@@ -1232,7 +1232,7 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
 			     uint32_t ip_type,
 			     uint32_t ip_instance,
 			     uint32_t ring,
-			     amdgpu_semaphore_handle sem);
+			     amdgpu_semaphore_handle_t * sem);
 
 /**
  *  destroy semaphore
@@ -1243,6 +1243,6 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
  *          <0 - Negative POSIX Error code
  *
 */
-int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem);
+int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle_t * sem);
 
 #endif /* #ifdef _AMDGPU_H_ */
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index fb5b3a8..c72825a 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -40,8 +40,8 @@
 #include "amdgpu_drm.h"
 #include "amdgpu_internal.h"
 
-static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem);
-static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem);
+static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle_t * sem);
+static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle_t * sem);
 
 /**
  * Create command submission context
@@ -124,7 +124,7 @@ int amdgpu_cs_ctx_free(amdgpu_context_handle context)
 	for (i = 0; i < AMDGPU_HW_IP_NUM; i++) {
 		for (j = 0; j < AMDGPU_HW_IP_INSTANCE_MAX_COUNT; j++) {
 			for (k = 0; k < AMDGPU_CS_MAX_RINGS; k++) {
-				amdgpu_semaphore_handle sem;
+				amdgpu_semaphore_handle_t * sem;
 				LIST_FOR_EACH_ENTRY(sem, &context->sem_list[i][j][k], list) {
 					list_del(&sem->list);
 					amdgpu_cs_reset_sem(sem);
@@ -179,7 +179,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
 	struct drm_amdgpu_cs_chunk_dep *dependencies = NULL;
 	struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL;
 	struct list_head *sem_list;
-	amdgpu_semaphore_handle sem, tmp;
+	amdgpu_semaphore_handle_t * sem, * tmp;
 	uint32_t i, size, sem_count = 0;
 	bool user_fence;
 	int r = 0;
@@ -443,7 +443,7 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
 	return r;
 }
 
-int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle *sem)
+int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle_t ** sem)
 {
 	struct amdgpu_semaphore *gpu_semaphore;
 
@@ -464,7 +464,7 @@ int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
 			       uint32_t ip_type,
 			       uint32_t ip_instance,
 			       uint32_t ring,
-			       amdgpu_semaphore_handle sem)
+			       amdgpu_semaphore_handle_t * sem)
 {
 	if (NULL == ctx)
 		return -EINVAL;
@@ -492,7 +492,7 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
 			     uint32_t ip_type,
 			     uint32_t ip_instance,
 			     uint32_t ring,
-			     amdgpu_semaphore_handle sem)
+			     amdgpu_semaphore_handle_t * sem)
 {
 	if (NULL == ctx)
 		return -EINVAL;
@@ -512,7 +512,7 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
 	return 0;
 }
 
-static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem)
+static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle_t * sem)
 {
 	if (NULL == sem)
 		return -EINVAL;
@@ -528,7 +528,7 @@ static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem)
 	return 0;
 }
 
-static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem)
+static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle_t * sem)
 {
 	if (NULL == sem)
 		return -EINVAL;
@@ -538,7 +538,7 @@ static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem)
 	return 0;
 }
 
-int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem)
+int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle_t * sem)
 {
 	return amdgpu_cs_unreference_sem(sem);
 }
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 40e9ef1..7838249 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -479,7 +479,7 @@ static void amdgpu_command_submission_gfx(void)
 static void amdgpu_semaphore_test(void)
 {
 	amdgpu_context_handle context_handle[2];
-	amdgpu_semaphore_handle sem;
+	amdgpu_semaphore_handle_t * sem;
 	amdgpu_bo_handle ib_result_handle[2];
 	void *ib_result_cpu[2];
 	uint64_t ib_result_mc_address[2];
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2016-09-16  8:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16  8:46 libdrm/amdgpu - Fixup typedef not to hide pointer type Edward O'Callaghan
     [not found] ` <1474015570-30928-1-git-send-email-funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2016-09-16  8:46   ` [PATCH 1/3] amdgpu: Fix amdgpu_va_handle " Edward O'Callaghan
2016-09-16  8:46   ` Edward O'Callaghan [this message]
2016-09-16  8:46   ` [PATCH 3/3] amdgpu: Fix amdgpu_bo_list_handle " Edward O'Callaghan
2016-09-16  8:49   ` libdrm/amdgpu - Fixup " Christian König
     [not found]     ` <98564703-e915-2729-b5c9-43afddc881a5-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-16  9:02       ` Edward O'Callaghan
     [not found]         ` <bc823f27-6163-1688-9cf0-0c8b5934111d-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2016-09-16  9:12           ` Christian König
     [not found]             ` <223e0fa5-bb37-c9d8-9d04-b9ef29d0d9f7-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-16 10:49               ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474015570-30928-3-git-send-email-funfunctor@folklore1984.net \
    --to=funfunctor-dczkzgxz+bnupwh3paxdjq@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.