Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 10/13] intel: Fix printf format warnings for intel_decode.
Date: Wed, 21 Dec 2011 10:09:40 -0800	[thread overview]
Message-ID: <1324490983-6975-11-git-send-email-eric@anholt.net> (raw)
In-Reply-To: <1324490983-6975-1-git-send-email-eric@anholt.net>

There was plenty of dropped useful data, and some horribly
mis-formatted data.
---
 intel/intel_decode.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index 1b5f858..8d6ea55 100644
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
@@ -1345,8 +1345,7 @@ decode_3d_1d(uint32_t *data, uint32_t count,
 						break;
 					case 3:
 						instr_out(data, hw_offset, i,
-							  "S3: not documented\n",
-							  word);
+							  "S3: not documented\n");
 						break;
 					case 4:
 						{
@@ -1410,7 +1409,7 @@ decode_3d_1d(uint32_t *data, uint32_t count,
 								  hw_offset, i,
 								  "S4: point_width=%i, line_width=%.1f,"
 								  "%s%s%s%s%s cullmode=%s, vfmt=%s%s%s%s%s%s "
-								  "%s%s\n",
+								  "%s%s%s%s%s\n",
 								  (data[i] >>
 								   23) & 0x1ff,
 								  ((data[i] >>
@@ -2026,9 +2025,7 @@ decode_3d_1d(uint32_t *data, uint32_t count,
 				dword = data[i];
 				instr_out(data, hw_offset, i++,
 					  "sampler %d SS4: border color\n",
-					  sampler,
-					  ((dword >> 24) & 0xff) / (0x10 * 1.0),
-					  dword);
+					  sampler);
 			}
 		}
 		if (len != i) {
@@ -3183,11 +3180,12 @@ decode_3d_965(uint32_t *data, uint32_t count, uint32_t hw_offset, uint32_t devid
 			  (data[4] & (1 << 12)) != 0 ? 4 : 8,
 			  (data[4] & (1 << 11)) != 0);
 		instr_out(data, hw_offset, 5,
-			  "Global Depth Offset Constant %f\n", data[5]);
+			  "Global Depth Offset Constant %f\n",
+			  *(float *)(&data[5]));
 		instr_out(data, hw_offset, 6, "Global Depth Offset Scale %f\n",
-			  data[6]);
+			  *(float *)(&data[6]));
 		instr_out(data, hw_offset, 7, "Global Depth Offset Clamp %f\n",
-			  data[7]);
+			  *(float *)(&data[7]));
 		int i, j;
 		for (i = 0, j = 0; i < 8; i++, j += 2)
 			instr_out(data, hw_offset, i + 8,
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-21 18:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 18:09 Moving intel_decode.c to libdrm Eric Anholt
2011-12-21 18:09 ` [PATCH 01/13] intel: Import intel_decode.c from intel-gpu-tools Eric Anholt
2011-12-21 18:09 ` [PATCH 02/13] intel: Make intel_chipset handle devid directly Eric Anholt
2011-12-21 18:09 ` [PATCH 03/13] intel: intel: Add IS_GEN[567] macros Eric Anholt
2011-12-21 18:09 ` [PATCH 04/13] intel: Reformat intel_decode.c from intel-gpu-tools using Lindent Eric Anholt
2011-12-21 18:09 ` [PATCH 05/13] intel: Minor style tweaks after Lindent Eric Anholt
2011-12-21 18:09 ` [PATCH 06/13] intel: Get intel_decode.c minimally building Eric Anholt
2011-12-21 18:09 ` [PATCH 07/13] intel: Fix Wsigned-compare warnings (soon to be enabled) Eric Anholt
2011-12-21 18:09 ` [PATCH 08/13] intel: Fix a ton of signed vs unsigned and const char *warnings Eric Anholt
2011-12-21 18:09 ` [PATCH 09/13] intel: Add printflike warnings for instr_out Eric Anholt
2011-12-21 18:09 ` Eric Anholt [this message]
2011-12-21 18:09 ` [PATCH 11/13] intel: Remove c99ish variable declarations Eric Anholt
2011-12-21 18:09 ` [PATCH 12/13] intel: Turn on normal warnings for intel_decode.c build Eric Anholt
2011-12-21 18:09 ` [PATCH 13/13] intel: Disable unused decode_logic_op() Eric Anholt
2011-12-21 18:46 ` Moving intel_decode.c to libdrm Daniel Vetter
2011-12-21 20:00   ` Eugeni Dodonov

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=1324490983-6975-11-git-send-email-eric@anholt.net \
    --to=eric@anholt.net \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox