tests/drv_hangman: Adjust to 64bit bb offsets

commit e1f123257a1f7d3af36a31a0fb2d4c6f40039fed
Author: Michel Thierry <michel.thierry@intel.com>
Date:   Wed Jul 29 17:23:56 2015 +0100

    drm/i915: Expand error state's address width to 64b

changed the batch buffer address to be 64b. Fix the parsing
of gtt offset accordingly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91638
Cc: Akash Goel <akash.goel@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
This commit is contained in:
Mika Kuoppala 2015-08-18 17:44:38 +03:00
parent 0e25e5d92d
commit c37b235202

View File

@ -252,7 +252,8 @@ static void check_error_state(const int gen,
while (getline(&line, &line_size, file) > 0) { while (getline(&line, &line_size, file) > 0) {
char *dashes = NULL; char *dashes = NULL;
int bb_matched = 0; int bb_matched = 0;
uint32_t gtt_offset; uint32_t gtt_offset_upper, gtt_offset_lower;
uint64_t gtt_offset;
int req_matched = 0; int req_matched = 0;
int requests; int requests;
uint32_t tail; uint32_t tail;
@ -267,9 +268,11 @@ static void check_error_state(const int gen,
strncpy(ring_name, line, dashes - line); strncpy(ring_name, line, dashes - line);
ring_name[dashes - line - 1] = '\0'; ring_name[dashes - line - 1] = '\0';
bb_matched = sscanf(dashes, "--- gtt_offset = 0x%08x\n", bb_matched = sscanf(dashes, "--- gtt_offset = 0x%08x %08x\n",
&gtt_offset); &gtt_offset_upper, &gtt_offset_lower);
if (bb_matched == 1) { gtt_offset = ((uint64_t)gtt_offset_upper << 32) | gtt_offset_lower;
if (bb_matched == 2) {
char expected_line[32]; char expected_line[32];
igt_assert(strstr(ring_name, expected_ring_name)); igt_assert(strstr(ring_name, expected_ring_name));
@ -305,7 +308,7 @@ static void check_error_state(const int gen,
} }
ringbuf_matched = sscanf(dashes, "--- ringbuffer = 0x%08x\n", ringbuf_matched = sscanf(dashes, "--- ringbuffer = 0x%08x\n",
&gtt_offset); &gtt_offset_lower);
if (ringbuf_matched == 1) { if (ringbuf_matched == 1) {
unsigned int offset, command, expected_addr = 0; unsigned int offset, command, expected_addr = 0;