From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 08/11] tools/intel_dump|error_decode: Use local igt decode code
Date: Tue, 6 Dec 2022 08:47:05 +0100 [thread overview]
Message-ID: <20221206074708.30690-9-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20221206074708.30690-1-zbigniew.kempczynski@intel.com>
Instead of using libdrm decode code, switch to ported to IGT counterpart.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
---
tools/intel_dump_decode.c | 16 ++++++++--------
tools/intel_error_decode.c | 14 +++++++-------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c
index 4bb774406f..95e06fbe7f 100644
--- a/tools/intel_dump_decode.c
+++ b/tools/intel_dump_decode.c
@@ -34,9 +34,9 @@
#include <fcntl.h>
#include <getopt.h>
-#include <intel_bufmgr.h>
+#include "i915/intel_decode.h"
-struct drm_intel_decode *ctx;
+struct intel_decode *ctx;
static void
read_bin_file(const char * filename)
@@ -54,12 +54,12 @@ read_bin_file(const char * filename)
exit (1);
}
- drm_intel_decode_set_dump_past_end(ctx, 1);
+ intel_decode_set_dump_past_end(ctx, 1);
offset = 0;
while ((ret = read (fd, buf, sizeof(buf))) > 0) {
- drm_intel_decode_set_batch_pointer(ctx, buf, offset, ret/4);
- drm_intel_decode(ctx);
+ intel_decode_set_batch_pointer(ctx, buf, offset, ret/4);
+ intel_decode(ctx);
offset += ret;
}
close (fd);
@@ -112,8 +112,8 @@ read_data_file(const char * filename)
}
if (count) {
- drm_intel_decode_set_batch_pointer(ctx, data, gtt_offset, count);
- drm_intel_decode(ctx);
+ intel_decode_set_batch_pointer(ctx, data, gtt_offset, count);
+ intel_decode(ctx);
}
free (data);
@@ -192,7 +192,7 @@ main (int argc, char *argv[])
if (devid_str)
devid = strtoul(devid_str, NULL, 0);
- ctx = drm_intel_decode_context_alloc(devid);
+ ctx = intel_decode_context_alloc(devid);
if (optind == argc) {
fprintf(stderr, "no input file given\n");
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index 90a18a07ba..99680bedc7 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -49,7 +49,6 @@
#include <sys/stat.h>
#include <err.h>
#include <assert.h>
-#include <intel_bufmgr.h>
#include <zlib.h>
#include <ctype.h>
@@ -58,6 +57,7 @@
#include "instdone.h"
#include "intel_reg.h"
#include "drmtest.h"
+#include "i915/intel_decode.h"
static uint32_t
print_head(unsigned int reg)
@@ -445,7 +445,7 @@ static bool maybe_ascii(const void *data, int check)
return true;
}
-static void decode(struct drm_intel_decode *ctx,
+static void decode(struct intel_decode *ctx,
const char *buffer_name,
const char *ring_name,
uint64_t gtt_offset,
@@ -466,9 +466,9 @@ static void decode(struct drm_intel_decode *ctx,
printf("\n");
if (decode && ctx) {
- drm_intel_decode_set_batch_pointer(ctx, data, gtt_offset,
+ intel_decode_set_batch_pointer(ctx, data, gtt_offset,
*count);
- drm_intel_decode(ctx);
+ intel_decode(ctx);
} else if (maybe_ascii(data, 16)) {
printf("%*s\n", 4 * *count, (char *)data);
} else {
@@ -566,7 +566,7 @@ static int ascii85_decode(const char *in, uint32_t **out, bool inflate)
static void
read_data_file(FILE *file)
{
- struct drm_intel_decode *decode_ctx = NULL;
+ struct intel_decode *decode_ctx = NULL;
uint32_t devid = PCI_CHIP_I855_GM;
uint32_t *data = NULL;
uint32_t head[MAX_RINGS];
@@ -692,7 +692,7 @@ read_data_file(FILE *file)
printf("Detected GEN%i chipset\n",
intel_gen(devid));
- decode_ctx = drm_intel_decode_context_alloc(devid);
+ decode_ctx = intel_decode_context_alloc(devid);
}
matched = sscanf(line, " CTL: 0x%08x\n", ®);
@@ -708,7 +708,7 @@ read_data_file(FILE *file)
if (matched == 1) {
print_acthd(reg, ring_length);
if (decode_ctx)
- drm_intel_decode_set_head_tail(decode_ctx,
+ intel_decode_set_head_tail(decode_ctx,
reg,
0xffffffff);
}
--
2.34.1
next prev parent reply other threads:[~2022-12-06 7:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 7:46 [igt-dev] [PATCH i-g-t v4 00/11] Remove libdrm remnants in i915 code Zbigniew Kempczyński
2022-12-06 7:46 ` [igt-dev] [PATCH i-g-t v4 01/11] tests/i915_pipe_stress: Remove unused bufmgr field Zbigniew Kempczyński
2022-12-06 7:46 ` [igt-dev] [PATCH i-g-t v4 02/11] tests/prime_udl: Remove intel-libdrm dependency Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 03/11] tests/prime_nv: Remove intel-libdrm calls Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 04/11] tests/drm_import_export: Remove the test Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 05/11] benchmarks/intel_upload_blit_*: Remove libdrm in upload blits Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 06/11] lib/intel_batchbuffer: Get rid of libdrm batchbuffer Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 07/11] lib/intel_decode: Get drm decode code and adopt to use in igt Zbigniew Kempczyński
2022-12-06 7:47 ` Zbigniew Kempczyński [this message]
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 09/11] lib/ioctl_wrappers: Remove gem_handle_to_libdrm_bo Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 10/11] tools/meson: Move tools out of libdrm scope Zbigniew Kempczyński
2022-12-06 7:47 ` [igt-dev] [PATCH i-g-t v4 11/11] lib/meson: Remove libdrm configuration and intel_bufmgr stubs Zbigniew Kempczyński
2022-12-06 9:07 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove libdrm remnants in i915 code (rev4) Patchwork
2022-12-06 10:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-14 8:21 ` Petri Latvala
2022-12-14 12:18 ` Zbigniew Kempczyński
2022-12-14 14:01 ` Petri Latvala
2022-12-14 16:39 ` Zbigniew Kempczyński
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=20221206074708.30690-9-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@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