From patchwork Fri Aug 28 14:11:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 7091981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A349BEEC1 for ; Fri, 28 Aug 2015 14:20:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3953020853 for ; Fri, 28 Aug 2015 14:20:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D25642064B for ; Fri, 28 Aug 2015 14:20:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63B226E909; Fri, 28 Aug 2015 07:20:38 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id CAF226E909 for ; Fri, 28 Aug 2015 07:20:37 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 28 Aug 2015 07:20:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,425,1437462000"; d="scan'208";a="777510982" Received: from otc-vmt1.isw.intel.com ([10.237.224.80]) by fmsmga001.fm.intel.com with ESMTP; 28 Aug 2015 07:20:36 -0700 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Aug 2015 15:11:35 +0100 Message-Id: <1440771095-16100-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ MIME-Version: 1.0 Cc: sndirsch@suse.com, mika.kuoppala@intel.com Subject: [Intel-gfx] [PATCH i-g-t] tools/null_state_gen: fix various compiler warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the debug and warning flags to cflags and fix the resulting issues. Signed-off-by: Thomas Wood Reviewed-by: Mika Kuoppala --- 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 #include +#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 */ -#include "intel_batchbuffer.h" +#include "intel_renderstate.h" #include #include #include 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 */ -#include "intel_batchbuffer.h" +#include "intel_renderstate.h" #include #include #include @@ -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 */ +#include "intel_renderstate.h" #include "intel_batchbuffer.h" #include #include @@ -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 */ -#include "intel_batchbuffer.h" +#include "intel_renderstate.h" #include #include @@ -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; }