public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 2/7] drm/i915: setup io-mapping for LMEM
Date: Mon, 21 Oct 2019 20:27:42 +0100	[thread overview]
Message-ID: <20191021192747.24804-2-matthew.auld@intel.com> (raw)
In-Reply-To: <20191021192747.24804-1-matthew.auld@intel.com>

From: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_region_lmem.c | 28 ++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_region_lmem.c b/drivers/gpu/drm/i915/intel_region_lmem.c
index 199532056e1b..9a351af45ce6 100644
--- a/drivers/gpu/drm/i915/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/intel_region_lmem.c
@@ -9,8 +9,32 @@
 #include "gem/i915_gem_region.h"
 #include "intel_region_lmem.h"
 
+static void
+region_lmem_release(struct intel_memory_region *mem)
+{
+	io_mapping_fini(&mem->iomap);
+	intel_memory_region_release_buddy(mem);
+}
+
+static int
+region_lmem_init(struct intel_memory_region *mem)
+{
+	int ret;
+
+	if (!io_mapping_init_wc(&mem->iomap,
+				mem->io_start,
+				resource_size(&mem->region)))
+		return -EIO;
+
+	ret = intel_memory_region_init_buddy(mem);
+	if (ret)
+		io_mapping_fini(&mem->iomap);
+
+	return ret;
+}
+
 const struct intel_memory_region_ops intel_region_lmem_ops = {
-	.init = intel_memory_region_init_buddy,
-	.release = intel_memory_region_release_buddy,
+	.init = region_lmem_init,
+	.release = region_lmem_release,
 	.create_object = __i915_gem_lmem_object_create,
 };
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-10-21 19:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 19:27 [PATCH v2 1/7] drm/i915: support creating LMEM objects Matthew Auld
2019-10-21 19:27 ` Matthew Auld [this message]
2019-10-21 19:27 ` [PATCH v2 3/7] drm/i915/lmem: support kernel mapping Matthew Auld
2019-10-21 19:37   ` Chris Wilson
2019-10-21 19:39     ` Chris Wilson
2019-10-21 19:27 ` [PATCH v2 4/7] drm/i915/selftests: add write-dword test for LMEM Matthew Auld
2019-10-21 19:27 ` [PATCH v2 5/7] drm/i915/selftests: extend coverage to include LMEM huge-pages Matthew Auld
2019-10-21 19:27 ` [PATCH v2 6/7] drm/i915/selftests: prefer random sizes for the huge-GTT-page smoke tests Matthew Auld
2019-10-21 19:27 ` [PATCH v2 7/7] drm/i915/selftests: add sanity selftest for huge-GTT-pages Matthew Auld
2019-10-21 20:28   ` Chris Wilson
2019-10-21 20:24 ` [PATCH v2 1/7] drm/i915: support creating LMEM objects Chris Wilson

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=20191021192747.24804-2-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --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