From: Dipam Turkar <dipamt1729@gmail.com>
To: jani.nikula@linux.intel.com
Cc: joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com,
tvrtko.ursulin@linux.intel.com, airlied@gmail.com,
daniel@ffwll.ch, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dipam Turkar <dipamt1729@gmail.com>
Subject: [PATCH v2] Remove custom dumb_map_offset implementations in i915 driver
Date: Sat, 11 Nov 2023 00:11:27 +0530 [thread overview]
Message-ID: <20231110184126.712310-1-dipamt1729@gmail.com> (raw)
Making i915 use drm_gem_create_mmap_offset() instead of its custom
implementations for associating GEM object with a fake offset.
Signed-off-by: Dipam Turkar <dipamt1729@gmail.com>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 21 ---------------------
drivers/gpu/drm/i915/gem/i915_gem_mman.h | 4 ----
drivers/gpu/drm/i915/i915_driver.c | 3 ++-
3 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index aa4d842d4c5a..71d621a1f249 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -771,27 +771,6 @@ __assign_mmap_offset_handle(struct drm_file *file,
return err;
}
-int
-i915_gem_dumb_mmap_offset(struct drm_file *file,
- struct drm_device *dev,
- u32 handle,
- u64 *offset)
-{
- struct drm_i915_private *i915 = to_i915(dev);
- enum i915_mmap_type mmap_type;
-
- if (HAS_LMEM(to_i915(dev)))
- mmap_type = I915_MMAP_TYPE_FIXED;
- else if (pat_enabled())
- mmap_type = I915_MMAP_TYPE_WC;
- else if (!i915_ggtt_has_aperture(to_gt(i915)->ggtt))
- return -ENODEV;
- else
- mmap_type = I915_MMAP_TYPE_GTT;
-
- return __assign_mmap_offset_handle(file, handle, mmap_type, offset);
-}
-
/**
* i915_gem_mmap_offset_ioctl - prepare an object for GTT mmap'ing
* @dev: DRM device
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.h b/drivers/gpu/drm/i915/gem/i915_gem_mman.h
index 196417fd0f5c..253435795caf 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.h
@@ -20,10 +20,6 @@ struct mutex;
int i915_gem_mmap_gtt_version(void);
int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma);
-int i915_gem_dumb_mmap_offset(struct drm_file *file_priv,
- struct drm_device *dev,
- u32 handle, u64 *offset);
-
void __i915_gem_object_release_mmap_gtt(struct drm_i915_gem_object *obj);
void i915_gem_object_release_mmap_gtt(struct drm_i915_gem_object *obj);
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index d50347e5773a..48d7e53c49d6 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -42,6 +42,7 @@
#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_ioctl.h>
+#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
@@ -1826,7 +1827,7 @@ static const struct drm_driver i915_drm_driver = {
.gem_prime_import = i915_gem_prime_import,
.dumb_create = i915_gem_dumb_create,
- .dumb_map_offset = i915_gem_dumb_mmap_offset,
+ .dumb_map_offset = drm_gem_dumb_map_offset,
.ioctls = i915_ioctls,
.num_ioctls = ARRAY_SIZE(i915_ioctls),
--
2.34.1
next reply other threads:[~2023-11-10 19:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 18:41 Dipam Turkar [this message]
2023-11-13 7:25 ` kernel test robot
2023-11-13 17:53 ` Jani Nikula
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=20231110184126.712310-1-dipamt1729@gmail.com \
--to=dipamt1729@gmail.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
/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
all inboxes | Powered by JetHome®