All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type
@ 2015-08-24  9:59 Stefan Dirsch
  2015-08-26 10:42 ` Thomas Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Dirsch @ 2015-08-24  9:59 UTC (permalink / raw)
  To: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi

Find a simple buildfix against current intel-gpu-tools git sources attached.

Thanks,
Stefan

Public Key available
------------------------------------------------------
Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 
---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------

[-- Attachment #2: 0001-Fixes-compiler-warnings-about-wrong-function-type.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

>From 89822e4caba0868b397afb141a9f561a254fe92c Mon Sep 17 00:00:00 2001
From: Stefan Dirsch <sndirsch@suse.de>
Date: Fri, 21 Aug 2015 12:40:23 +0200
Subject: [PATCH] Fixes compiler warnings about wrong function type.

Makes definition of function types for gen8_setup_null_render_state
and gen9_setup_null_render_state consistent with the ones from functions
for earlier GPU families like gen6_setup_null_render_state,
gen7_setup_null_render_state, ...

Signed-off-by: Stefan Dirsch <sndirsch@suse.com>
---
 tools/null_state_gen/intel_renderstate_gen8.c | 5 +----
 tools/null_state_gen/intel_renderstate_gen9.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c
index 2d7a4b0..58ba6fa 100644
--- a/tools/null_state_gen/intel_renderstate_gen8.c
+++ b/tools/null_state_gen/intel_renderstate_gen8.c
@@ -322,11 +322,8 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch)
         OUT_BATCH(0);   /* index buffer offset, ignored */
 }
 
-int gen8_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen8_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
-	int i;
-
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
 
 	OUT_BATCH(GEN6_PIPE_CONTROL | (6 - 2));
diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
index 37bc675..08ee7ba 100644
--- a/tools/null_state_gen/intel_renderstate_gen9.c
+++ b/tools/null_state_gen/intel_renderstate_gen9.c
@@ -342,9 +342,8 @@ static void gen9_emit_state_base_address(struct intel_batchbuffer *batch) {
  * Generate the batch buffer commands needed to initialize the 3D engine
  * to its "golden state".
  */
-int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
 	int i;
 
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
@@ -477,6 +476,4 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 	gen8_emit_primitive(batch);
 
 	OUT_BATCH(MI_BATCH_BUFFER_END);
-
-	return ret;
 }
-- 
1.8.4.5


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type
  2015-08-24  9:59 [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type Stefan Dirsch
@ 2015-08-26 10:42 ` Thomas Wood
  2015-08-28 14:11   ` [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings Thomas Wood
  2015-08-31 10:12   ` [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type Stefan Dirsch
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Wood @ 2015-08-26 10:42 UTC (permalink / raw)
  To: sndirsch; +Cc: Intel Graphics Development

On 24 August 2015 at 10:59, Stefan Dirsch <sndirsch@suse.de> wrote:
> Hi
>
> Find a simple buildfix against current intel-gpu-tools git sources attached.

I assume the compiler warning is about uninitialised values and unused
variables? It looks like the Makefile is not using the debug cflags so
these warning do not appear by default.

intel_null_state_gen.c appears to assume the
gen*_setup_null_render_state functions have return values in the
extern declarations, so this could do with fixing too.


>
> Thanks,
> Stefan
>
> Public Key available
> ------------------------------------------------------
> Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
> Tel: 0911-740 53 0            Maxfeldstraße 5
> FAX: 0911-740 53 479          D-90409 Nürnberg
> http://www.suse.de            Germany
> ---------------------------------------------------------------
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
> Norton, HRB 21284 (AG Nürnberg)
> ---------------------------------------------------------------
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings
  2015-08-26 10:42 ` Thomas Wood
@ 2015-08-28 14:11   ` Thomas Wood
  2015-08-28 14:38     ` Mika Kuoppala
  2015-08-31 10:12   ` [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type Stefan Dirsch
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Wood @ 2015-08-28 14:11 UTC (permalink / raw)
  To: intel-gfx; +Cc: sndirsch, mika.kuoppala

Add the debug and warning flags to cflags and fix the resulting issues.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tools/null_state_gen/Makefile.am              |  2 ++
 tools/null_state_gen/intel_batchbuffer.c      |  7 +++---
 tools/null_state_gen/intel_batchbuffer.h      |  4 +++-
 tools/null_state_gen/intel_null_state_gen.c   |  8 ++-----
 tools/null_state_gen/intel_renderstate.h      | 34 +++++++++++++++++++++++++++
 tools/null_state_gen/intel_renderstate_gen6.c |  2 +-
 tools/null_state_gen/intel_renderstate_gen7.c |  4 +---
 tools/null_state_gen/intel_renderstate_gen8.c |  6 ++---
 tools/null_state_gen/intel_renderstate_gen9.c |  7 ++----
 9 files changed, 51 insertions(+), 23 deletions(-)
 create mode 100644 tools/null_state_gen/intel_renderstate.h

diff --git a/tools/null_state_gen/Makefile.am b/tools/null_state_gen/Makefile.am
index bf8cbdb..24884a7 100644
--- a/tools/null_state_gen/Makefile.am
+++ b/tools/null_state_gen/Makefile.am
@@ -1,11 +1,13 @@
 GPU_TOOLS_PATH := $(top_srcdir)
 AM_CPPFLAGS = -I$(top_srcdir)
+AM_CFLAGS = $(DEBUG_CFLAGS) $(CWARNFLAGS)
 
 noinst_PROGRAMS = intel_null_state_gen
 
 intel_null_state_gen_SOURCES = 	\
 	intel_batchbuffer.c \
 	intel_batchbuffer.h \
+	intel_renderstate.h \
 	intel_renderstate_gen6.c \
 	intel_renderstate_gen7.c \
 	intel_renderstate_gen8.c \
diff --git a/tools/null_state_gen/intel_batchbuffer.c b/tools/null_state_gen/intel_batchbuffer.c
index a31ea38..5aa980e 100644
--- a/tools/null_state_gen/intel_batchbuffer.c
+++ b/tools/null_state_gen/intel_batchbuffer.c
@@ -3,7 +3,7 @@
  * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
  *
- * Copyright 2014 Intel Corporation
+ * Copyright 2014, 2015 Intel Corporation
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -164,7 +164,7 @@ unsigned intel_batch_num_cmds(struct intel_batchbuffer *batch)
 	return bb_area_items(batch->cmds);
 }
 
-static unsigned intel_batch_num_state(struct intel_batchbuffer *batch)
+unsigned intel_batch_num_state(struct intel_batchbuffer *batch)
 {
 	return bb_area_items(batch->state);
 }
@@ -217,9 +217,10 @@ uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch,
 
 	for (i = 0; i < dwords; i++) {
 		char offsetinside[80];
+		uint32_t *s;
 		sprintf(offsetinside, "%s: 0x%x", str, i * 4);
 
-		uint32_t *s = (uint32_t *)(uint8_t *)d + i;
+		s = (uint32_t *)(uint8_t *)d + i;
 		bb_area_emit(batch->state, *s, STATE, offsetinside);
 	}
 
diff --git a/tools/null_state_gen/intel_batchbuffer.h b/tools/null_state_gen/intel_batchbuffer.h
index 8b87c02..2919e87 100644
--- a/tools/null_state_gen/intel_batchbuffer.h
+++ b/tools/null_state_gen/intel_batchbuffer.h
@@ -3,7 +3,7 @@
  * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
  *
- * Copyright 2014 Intel Corporation
+ * Copyright 2014, 2015 Intel Corporation
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -86,6 +86,8 @@ uint32_t intel_batch_state_alloc(struct intel_batchbuffer *batch, unsigned bytes
 				 const char *name);
 uint32_t intel_batch_state_offset(struct intel_batchbuffer *batch, unsigned align);
 unsigned intel_batch_num_cmds(struct intel_batchbuffer *batch);
+struct bb_item *intel_batch_state_get(struct intel_batchbuffer *batch, unsigned i);
+unsigned intel_batch_num_state(struct intel_batchbuffer *batch);
 
 struct bb_item *intel_batch_cmd_get(struct intel_batchbuffer *batch, unsigned i);
 int intel_batch_is_reloc(struct intel_batchbuffer *batch, unsigned i);
diff --git a/tools/null_state_gen/intel_null_state_gen.c b/tools/null_state_gen/intel_null_state_gen.c
index 8024ac3..7d5887e 100644
--- a/tools/null_state_gen/intel_null_state_gen.c
+++ b/tools/null_state_gen/intel_null_state_gen.c
@@ -30,13 +30,9 @@
 #include <errno.h>
 #include <assert.h>
 
+#include "intel_renderstate.h"
 #include "intel_batchbuffer.h"
 
-extern int gen6_setup_null_render_state(struct intel_batchbuffer *batch);
-extern int gen7_setup_null_render_state(struct intel_batchbuffer *batch);
-extern int gen8_setup_null_render_state(struct intel_batchbuffer *batch);
-extern int gen9_setup_null_render_state(struct intel_batchbuffer *batch);
-
 static int debug = 0;
 
 static void print_usage(char *s)
@@ -115,7 +111,7 @@ static int do_generate(int gen)
 {
 	struct intel_batchbuffer *batch;
 	int ret = -EINVAL;
-	int (*null_state_gen)(struct intel_batchbuffer *batch) = NULL;
+	void (*null_state_gen)(struct intel_batchbuffer *batch) = NULL;
 
 	batch = intel_batchbuffer_create();
 	if (batch == NULL)
diff --git a/tools/null_state_gen/intel_renderstate.h b/tools/null_state_gen/intel_renderstate.h
new file mode 100644
index 0000000..b27b434
--- /dev/null
+++ b/tools/null_state_gen/intel_renderstate.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __INTEL_RENDERSTATE_H__
+#define __INTEL_RENDERSTATE_H__
+
+#include "intel_batchbuffer.h"
+
+void gen6_setup_null_render_state(struct intel_batchbuffer *batch);
+void gen7_setup_null_render_state(struct intel_batchbuffer *batch);
+void gen8_setup_null_render_state(struct intel_batchbuffer *batch);
+void gen9_setup_null_render_state(struct intel_batchbuffer *batch);
+
+#endif /* __INTEL_RENDERSTATE_H__ */
diff --git a/tools/null_state_gen/intel_renderstate_gen6.c b/tools/null_state_gen/intel_renderstate_gen6.c
index f18bb12..5c1b7f9 100644
--- a/tools/null_state_gen/intel_renderstate_gen6.c
+++ b/tools/null_state_gen/intel_renderstate_gen6.c
@@ -24,7 +24,7 @@
  *	Mika Kuoppala <mika.kuoppala@intel.com>
  */
 
-#include "intel_batchbuffer.h"
+#include "intel_renderstate.h"
 #include <lib/gen6_render.h>
 #include <lib/intel_reg.h>
 #include <string.h>
diff --git a/tools/null_state_gen/intel_renderstate_gen7.c b/tools/null_state_gen/intel_renderstate_gen7.c
index a48fb27..df20bc2 100644
--- a/tools/null_state_gen/intel_renderstate_gen7.c
+++ b/tools/null_state_gen/intel_renderstate_gen7.c
@@ -24,7 +24,7 @@
  *	Mika Kuoppala <mika.kuoppala@intel.com>
  */
 
-#include "intel_batchbuffer.h"
+#include "intel_renderstate.h"
 #include <lib/gen7_render.h>
 #include <lib/intel_reg.h>
 #include <string.h>
@@ -417,8 +417,6 @@ gen7_emit_null_depth_buffer(struct intel_batchbuffer *batch)
 
 void gen7_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
-
 	OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_3D);
 
 	gen7_emit_state_base_address(batch);
diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c
index 2d7a4b0..6a309d4 100644
--- a/tools/null_state_gen/intel_renderstate_gen8.c
+++ b/tools/null_state_gen/intel_renderstate_gen8.c
@@ -24,6 +24,7 @@
  *	Mika Kuoppala <mika.kuoppala@intel.com>
  */
 
+#include "intel_renderstate.h"
 #include "intel_batchbuffer.h"
 #include <lib/gen8_render.h>
 #include <lib/intel_reg.h>
@@ -322,11 +323,8 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch)
         OUT_BATCH(0);   /* index buffer offset, ignored */
 }
 
-int gen8_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen8_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
-	int i;
-
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
 
 	OUT_BATCH(GEN6_PIPE_CONTROL | (6 - 2));
diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
index 37bc675..a0b7d8a 100644
--- a/tools/null_state_gen/intel_renderstate_gen9.c
+++ b/tools/null_state_gen/intel_renderstate_gen9.c
@@ -25,7 +25,7 @@
  *	Mika Kuoppala <mika.kuoppala@intel.com>
  */
 
-#include "intel_batchbuffer.h"
+#include "intel_renderstate.h"
 #include <lib/gen9_render.h>
 #include <lib/intel_reg.h>
 
@@ -342,9 +342,8 @@ static void gen9_emit_state_base_address(struct intel_batchbuffer *batch) {
  * Generate the batch buffer commands needed to initialize the 3D engine
  * to its "golden state".
  */
-int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
+void gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 {
-	int ret;
 	int i;
 
 #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
@@ -477,6 +476,4 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 	gen8_emit_primitive(batch);
 
 	OUT_BATCH(MI_BATCH_BUFFER_END);
-
-	return ret;
 }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings
  2015-08-28 14:11   ` [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings Thomas Wood
@ 2015-08-28 14:38     ` Mika Kuoppala
  0 siblings, 0 replies; 5+ messages in thread
From: Mika Kuoppala @ 2015-08-28 14:38 UTC (permalink / raw)
  To: Thomas Wood, intel-gfx; +Cc: sndirsch

Thomas Wood <thomas.wood@intel.com> writes:

> Add the debug and warning flags to cflags and fix the resulting issues.
>
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>

Much better now,

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>


> ---
>  tools/null_state_gen/Makefile.am              |  2 ++
>  tools/null_state_gen/intel_batchbuffer.c      |  7 +++---
>  tools/null_state_gen/intel_batchbuffer.h      |  4 +++-
>  tools/null_state_gen/intel_null_state_gen.c   |  8 ++-----
>  tools/null_state_gen/intel_renderstate.h      | 34 +++++++++++++++++++++++++++
>  tools/null_state_gen/intel_renderstate_gen6.c |  2 +-
>  tools/null_state_gen/intel_renderstate_gen7.c |  4 +---
>  tools/null_state_gen/intel_renderstate_gen8.c |  6 ++---
>  tools/null_state_gen/intel_renderstate_gen9.c |  7 ++----
>  9 files changed, 51 insertions(+), 23 deletions(-)
>  create mode 100644 tools/null_state_gen/intel_renderstate.h
>
> diff --git a/tools/null_state_gen/Makefile.am b/tools/null_state_gen/Makefile.am
> index bf8cbdb..24884a7 100644
> --- a/tools/null_state_gen/Makefile.am
> +++ b/tools/null_state_gen/Makefile.am
> @@ -1,11 +1,13 @@
>  GPU_TOOLS_PATH := $(top_srcdir)
>  AM_CPPFLAGS = -I$(top_srcdir)
> +AM_CFLAGS = $(DEBUG_CFLAGS) $(CWARNFLAGS)
>  
>  noinst_PROGRAMS = intel_null_state_gen
>  
>  intel_null_state_gen_SOURCES = 	\
>  	intel_batchbuffer.c \
>  	intel_batchbuffer.h \
> +	intel_renderstate.h \
>  	intel_renderstate_gen6.c \
>  	intel_renderstate_gen7.c \
>  	intel_renderstate_gen8.c \
> diff --git a/tools/null_state_gen/intel_batchbuffer.c b/tools/null_state_gen/intel_batchbuffer.c
> index a31ea38..5aa980e 100644
> --- a/tools/null_state_gen/intel_batchbuffer.c
> +++ b/tools/null_state_gen/intel_batchbuffer.c
> @@ -3,7 +3,7 @@
>   * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
>   * All Rights Reserved.
>   *
> - * Copyright 2014 Intel Corporation
> + * Copyright 2014, 2015 Intel Corporation
>   * All Rights Reserved.
>   *
>   * Permission is hereby granted, free of charge, to any person obtaining a
> @@ -164,7 +164,7 @@ unsigned intel_batch_num_cmds(struct intel_batchbuffer *batch)
>  	return bb_area_items(batch->cmds);
>  }
>  
> -static unsigned intel_batch_num_state(struct intel_batchbuffer *batch)
> +unsigned intel_batch_num_state(struct intel_batchbuffer *batch)
>  {
>  	return bb_area_items(batch->state);
>  }
> @@ -217,9 +217,10 @@ uint32_t intel_batch_state_copy(struct intel_batchbuffer *batch,
>  
>  	for (i = 0; i < dwords; i++) {
>  		char offsetinside[80];
> +		uint32_t *s;
>  		sprintf(offsetinside, "%s: 0x%x", str, i * 4);
>  
> -		uint32_t *s = (uint32_t *)(uint8_t *)d + i;
> +		s = (uint32_t *)(uint8_t *)d + i;
>  		bb_area_emit(batch->state, *s, STATE, offsetinside);
>  	}
>  
> diff --git a/tools/null_state_gen/intel_batchbuffer.h b/tools/null_state_gen/intel_batchbuffer.h
> index 8b87c02..2919e87 100644
> --- a/tools/null_state_gen/intel_batchbuffer.h
> +++ b/tools/null_state_gen/intel_batchbuffer.h
> @@ -3,7 +3,7 @@
>   * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
>   * All Rights Reserved.
>   *
> - * Copyright 2014 Intel Corporation
> + * Copyright 2014, 2015 Intel Corporation
>   * All Rights Reserved.
>   *
>   * Permission is hereby granted, free of charge, to any person obtaining a
> @@ -86,6 +86,8 @@ uint32_t intel_batch_state_alloc(struct intel_batchbuffer *batch, unsigned bytes
>  				 const char *name);
>  uint32_t intel_batch_state_offset(struct intel_batchbuffer *batch, unsigned align);
>  unsigned intel_batch_num_cmds(struct intel_batchbuffer *batch);
> +struct bb_item *intel_batch_state_get(struct intel_batchbuffer *batch, unsigned i);
> +unsigned intel_batch_num_state(struct intel_batchbuffer *batch);
>  
>  struct bb_item *intel_batch_cmd_get(struct intel_batchbuffer *batch, unsigned i);
>  int intel_batch_is_reloc(struct intel_batchbuffer *batch, unsigned i);
> diff --git a/tools/null_state_gen/intel_null_state_gen.c b/tools/null_state_gen/intel_null_state_gen.c
> index 8024ac3..7d5887e 100644
> --- a/tools/null_state_gen/intel_null_state_gen.c
> +++ b/tools/null_state_gen/intel_null_state_gen.c
> @@ -30,13 +30,9 @@
>  #include <errno.h>
>  #include <assert.h>
>  
> +#include "intel_renderstate.h"
>  #include "intel_batchbuffer.h"
>  
> -extern int gen6_setup_null_render_state(struct intel_batchbuffer *batch);
> -extern int gen7_setup_null_render_state(struct intel_batchbuffer *batch);
> -extern int gen8_setup_null_render_state(struct intel_batchbuffer *batch);
> -extern int gen9_setup_null_render_state(struct intel_batchbuffer *batch);
> -
>  static int debug = 0;
>  
>  static void print_usage(char *s)
> @@ -115,7 +111,7 @@ static int do_generate(int gen)
>  {
>  	struct intel_batchbuffer *batch;
>  	int ret = -EINVAL;
> -	int (*null_state_gen)(struct intel_batchbuffer *batch) = NULL;
> +	void (*null_state_gen)(struct intel_batchbuffer *batch) = NULL;
>  
>  	batch = intel_batchbuffer_create();
>  	if (batch == NULL)
> diff --git a/tools/null_state_gen/intel_renderstate.h b/tools/null_state_gen/intel_renderstate.h
> new file mode 100644
> index 0000000..b27b434
> --- /dev/null
> +++ b/tools/null_state_gen/intel_renderstate.h
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#ifndef __INTEL_RENDERSTATE_H__
> +#define __INTEL_RENDERSTATE_H__
> +
> +#include "intel_batchbuffer.h"
> +
> +void gen6_setup_null_render_state(struct intel_batchbuffer *batch);
> +void gen7_setup_null_render_state(struct intel_batchbuffer *batch);
> +void gen8_setup_null_render_state(struct intel_batchbuffer *batch);
> +void gen9_setup_null_render_state(struct intel_batchbuffer *batch);
> +
> +#endif /* __INTEL_RENDERSTATE_H__ */
> diff --git a/tools/null_state_gen/intel_renderstate_gen6.c b/tools/null_state_gen/intel_renderstate_gen6.c
> index f18bb12..5c1b7f9 100644
> --- a/tools/null_state_gen/intel_renderstate_gen6.c
> +++ b/tools/null_state_gen/intel_renderstate_gen6.c
> @@ -24,7 +24,7 @@
>   *	Mika Kuoppala <mika.kuoppala@intel.com>
>   */
>  
> -#include "intel_batchbuffer.h"
> +#include "intel_renderstate.h"
>  #include <lib/gen6_render.h>
>  #include <lib/intel_reg.h>
>  #include <string.h>
> diff --git a/tools/null_state_gen/intel_renderstate_gen7.c b/tools/null_state_gen/intel_renderstate_gen7.c
> index a48fb27..df20bc2 100644
> --- a/tools/null_state_gen/intel_renderstate_gen7.c
> +++ b/tools/null_state_gen/intel_renderstate_gen7.c
> @@ -24,7 +24,7 @@
>   *	Mika Kuoppala <mika.kuoppala@intel.com>
>   */
>  
> -#include "intel_batchbuffer.h"
> +#include "intel_renderstate.h"
>  #include <lib/gen7_render.h>
>  #include <lib/intel_reg.h>
>  #include <string.h>
> @@ -417,8 +417,6 @@ gen7_emit_null_depth_buffer(struct intel_batchbuffer *batch)
>  
>  void gen7_setup_null_render_state(struct intel_batchbuffer *batch)
>  {
> -	int ret;
> -
>  	OUT_BATCH(GEN7_PIPELINE_SELECT | PIPELINE_SELECT_3D);
>  
>  	gen7_emit_state_base_address(batch);
> diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c
> index 2d7a4b0..6a309d4 100644
> --- a/tools/null_state_gen/intel_renderstate_gen8.c
> +++ b/tools/null_state_gen/intel_renderstate_gen8.c
> @@ -24,6 +24,7 @@
>   *	Mika Kuoppala <mika.kuoppala@intel.com>
>   */
>  
> +#include "intel_renderstate.h"
>  #include "intel_batchbuffer.h"
>  #include <lib/gen8_render.h>
>  #include <lib/intel_reg.h>
> @@ -322,11 +323,8 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch)
>          OUT_BATCH(0);   /* index buffer offset, ignored */
>  }
>  
> -int gen8_setup_null_render_state(struct intel_batchbuffer *batch)
> +void gen8_setup_null_render_state(struct intel_batchbuffer *batch)
>  {
> -	int ret;
> -	int i;
> -
>  #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
>  
>  	OUT_BATCH(GEN6_PIPE_CONTROL | (6 - 2));
> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
> index 37bc675..a0b7d8a 100644
> --- a/tools/null_state_gen/intel_renderstate_gen9.c
> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
> @@ -25,7 +25,7 @@
>   *	Mika Kuoppala <mika.kuoppala@intel.com>
>   */
>  
> -#include "intel_batchbuffer.h"
> +#include "intel_renderstate.h"
>  #include <lib/gen9_render.h>
>  #include <lib/intel_reg.h>
>  
> @@ -342,9 +342,8 @@ static void gen9_emit_state_base_address(struct intel_batchbuffer *batch) {
>   * Generate the batch buffer commands needed to initialize the 3D engine
>   * to its "golden state".
>   */
> -int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
> +void gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>  {
> -	int ret;
>  	int i;
>  
>  #define GEN8_PIPE_CONTROL_GLOBAL_GTT   (1 << 24)
> @@ -477,6 +476,4 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>  	gen8_emit_primitive(batch);
>  
>  	OUT_BATCH(MI_BATCH_BUFFER_END);
> -
> -	return ret;
>  }
> -- 
> 1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type
  2015-08-26 10:42 ` Thomas Wood
  2015-08-28 14:11   ` [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings Thomas Wood
@ 2015-08-31 10:12   ` Stefan Dirsch
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Dirsch @ 2015-08-31 10:12 UTC (permalink / raw)
  To: Thomas Wood; +Cc: Intel Graphics Development

On Wed, Aug 26, 2015 at 11:42:23AM +0100, Thomas Wood wrote:
> On 24 August 2015 at 10:59, Stefan Dirsch <sndirsch@suse.de> wrote:
> > Hi
> >
> > Find a simple buildfix against current intel-gpu-tools git sources attached.
> 
> I assume the compiler warning is about uninitialised values and unused
> variables? It looks like the Makefile is not using the debug cflags so
> these warning do not appear by default.

Warnings/error were:

W: intel-gpu-tools uninitialized-variable intel_renderstate_gen9.c:476
E: intel-gpu-tools no-return-in-nonvoid-function intel_renderstate_gen8.c:441

> intel_null_state_gen.c appears to assume the
> gen*_setup_null_render_state functions have return values in the
> extern declarations, so this could do with fixing too.

Indeed your patches fixes these warnings/errors. So no need any longer to
include/review my patch as long as your patch gets integrated. ;-)

Thanks,
Stefan

Public Key available
------------------------------------------------------
Stefan Dirsch (Res. & Dev.)   SUSE LINUX GmbH
Tel: 0911-740 53 0            Maxfeldstraße 5
FAX: 0911-740 53 479          D-90409 Nürnberg
http://www.suse.de            Germany 
---------------------------------------------------------------
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham
Norton, HRB 21284 (AG Nürnberg)
---------------------------------------------------------------
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-31 10:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24  9:59 [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type Stefan Dirsch
2015-08-26 10:42 ` Thomas Wood
2015-08-28 14:11   ` [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings Thomas Wood
2015-08-28 14:38     ` Mika Kuoppala
2015-08-31 10:12   ` [PATCH] intel-gpu-tools: Fixes-compiler-warnings-about-wrong-function-type Stefan Dirsch

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.