public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: [igt-dev] [PATCH i-g-t v2 1/4] lib/intel_bufops: add fields for keeping offset and context
Date: Thu,  4 Jun 2020 11:13:54 +0200	[thread overview]
Message-ID: <20200604091357.22604-2-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20200604091357.22604-1-zbigniew.kempczynski@intel.com>

To avoid relocations when intel_buf is used we need to keep previous
offset and context. Add addr structure with offset and ctx fields.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/gpu_cmds.c     | 6 +++---
 lib/intel_bufops.h | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 8c284eb1..417253a7 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -109,7 +109,7 @@ gen7_fill_surface_state(struct intel_bb *ibb,
 
 	address = intel_bb_offset_reloc(ibb, buf->handle,
 					read_domain, write_domain,
-					offset + 4, 0x0);
+					offset + 4, buf->addr.offset);
 	igt_assert(address >> 32 == 0);
 
 	ss->ss1.base_addr = address;
@@ -161,7 +161,7 @@ gen8_fill_surface_state(struct intel_bb *ibb,
 
 	address = intel_bb_offset_reloc(ibb, buf->handle,
 					read_domain, write_domain,
-					offset + 4 * 8, 0x0);
+					offset + 4 * 8, buf->addr.offset);
 
 	ss->ss8.base_addr = (uint32_t) address;
 	ss->ss9.base_addr_hi = address >> 32;
@@ -218,7 +218,7 @@ gen11_fill_surface_state(struct intel_bb *ibb,
 
 	address = intel_bb_offset_reloc(ibb, buf->handle,
 					read_domain, write_domain,
-					offset + 4 * 8, 0x0);
+					offset + 4 * 8, buf->addr.offset);
 
 	ss->ss8.base_addr = (uint32_t) address;
 	ss->ss9.base_addr_hi = address >> 32;
diff --git a/lib/intel_bufops.h b/lib/intel_bufops.h
index 3a4fae4e..95217cfe 100644
--- a/lib/intel_bufops.h
+++ b/lib/intel_bufops.h
@@ -18,6 +18,10 @@ struct intel_buf {
 		uint32_t offset;
 		uint32_t stride;
 	} aux;
+	struct {
+		uint64_t offset;
+		uint32_t ctx;
+	} addr;
 };
 
 static inline unsigned int intel_buf_width(const struct intel_buf *buf)
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-06-04  9:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  9:13 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04  9:13 ` Zbigniew Kempczyński [this message]
2020-06-04  9:13 ` [igt-dev] [PATCH i-g-t v2 2/4] lib/intel_batchbuffer: add bb reset Zbigniew Kempczyński
  -- strict thread matches above, loose matches on Subject: below --
2020-06-04  9:16 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04  9:16 ` [igt-dev] [PATCH i-g-t v2 1/4] lib/intel_bufops: add fields for keeping offset and context Zbigniew Kempczyński
2020-06-04 10:03 [igt-dev] [PATCH i-g-t v2 0/4] Remove libdrm from media_spin Zbigniew Kempczyński
2020-06-04 10:03 ` [igt-dev] [PATCH i-g-t v2 1/4] lib/intel_bufops: add fields for keeping offset and context 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=20200604091357.22604-2-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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