Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/6] drm/i915: setup io-mapping for LMEM
Date: Fri, 18 Oct 2019 17:55:54 +0100	[thread overview]
Message-ID: <20191018165558.18518-2-matthew.auld@intel.com> (raw)
In-Reply-To: <20191018165558.18518-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>
---
 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 7a3f96e1f766..051069664074 100644
--- a/drivers/gpu/drm/i915/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/intel_region_lmem.c
@@ -36,8 +36,32 @@ lmem_create_object(struct intel_memory_region *mem,
 	return obj;
 }
 
+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 = lmem_create_object,
 };
-- 
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-18 16:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 16:55 [PATCH 1/6] drm/i915: support creating LMEM objects Matthew Auld
2019-10-18 16:55 ` Matthew Auld [this message]
2019-10-18 22:50   ` [PATCH 2/6] drm/i915: setup io-mapping for LMEM Chris Wilson
2019-10-18 16:55 ` [PATCH 3/6] drm/i915/lmem: support kernel mapping Matthew Auld
2019-10-18 22:48   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 4/6] drm/i915/selftests: add write-dword test for LMEM Matthew Auld
2019-10-18 22:46   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 5/6] drm/i915/selftests: extend coverage to include LMEM huge-pages Matthew Auld
2019-10-18 22:44   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 6/6] drm/i915/selftests: prefer random sizes for the huge-GTT-page smoke tests Matthew Auld
2019-10-18 22:43   ` Chris Wilson
2019-10-18 17:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] drm/i915: support creating LMEM objects Patchwork
2019-10-18 17:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-10-18 18:27 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-18 20:43 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-18 21:48 ` [PATCH 1/6] " 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=20191018165558.18518-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