public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	Mullati Siva <siva.mullati@intel.com>
Cc: intel-gfx@lists.freedesktop.org, matthew.auld@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Skip remap_io_mapping() for non-x86 platforms
Date: Wed, 01 Dec 2021 11:04:27 +0200	[thread overview]
Message-ID: <87h7bsitlw.fsf@intel.com> (raw)
In-Reply-To: <20211130191728.hiyeuvchddhly3qx@ldmartin-desk2>

On Tue, 30 Nov 2021, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Mon, Nov 22, 2021 at 06:01:42PM +0530, Mullati Siva wrote:
>>From: Siva Mullati <siva.mullati@intel.com>
>>
>>Only hw that supports mappable aperture would hit this path
>>vm_fault_gtt/vm_fault_tmm, So we never hit this function
>>remap_io_mapping() in discrete, So skip this code for non-x86
>>architectures.
>>
>>Signed-off-by: Siva Mullati <siva.mullati@intel.com>
>>---
>> drivers/gpu/drm/i915/gem/i915_gem_mman.c |  1 +
>> drivers/gpu/drm/i915/i915_drv.h          |  8 ------
>> drivers/gpu/drm/i915/i915_mm.c           |  1 +
>> drivers/gpu/drm/i915/i915_mm.h           | 32 ++++++++++++++++++++++++
>> 4 files changed, 34 insertions(+), 8 deletions(-)
>> create mode 100644 drivers/gpu/drm/i915/i915_mm.h
>>
>>diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>>index 65fc6ff5f59d..39bb15eafc07 100644
>>--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>>+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
>>@@ -17,6 +17,7 @@
>> #include "i915_gem_ioctls.h"
>> #include "i915_gem_object.h"
>> #include "i915_gem_mman.h"
>>+#include "i915_mm.h"
>> #include "i915_trace.h"
>> #include "i915_user_extensions.h"
>> #include "i915_gem_ttm.h"
>>diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>index 1bfadd9127fc..7ae0f0cc6866 100644
>>--- a/drivers/gpu/drm/i915/i915_drv.h
>>+++ b/drivers/gpu/drm/i915/i915_drv.h
>>@@ -1967,14 +1967,6 @@ mkwrite_device_info(struct drm_i915_private *dev_priv)
>> int i915_reg_read_ioctl(struct drm_device *dev, void *data,
>> 			struct drm_file *file);
>>
>>-/* i915_mm.c */
>>-int remap_io_mapping(struct vm_area_struct *vma,
>>-		     unsigned long addr, unsigned long pfn, unsigned long size,
>>-		     struct io_mapping *iomap);
>>-int remap_io_sg(struct vm_area_struct *vma,
>>-		unsigned long addr, unsigned long size,
>>-		struct scatterlist *sgl, resource_size_t iobase);
>>-
>> static inline int intel_hws_csb_write_index(struct drm_i915_private *i915)
>> {
>> 	if (GRAPHICS_VER(i915) >= 11)
>>diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
>>index 666808cb3a32..f4df15fe7cf8 100644
>>--- a/drivers/gpu/drm/i915/i915_mm.c
>>+++ b/drivers/gpu/drm/i915/i915_mm.c
>>@@ -27,6 +27,7 @@
>>
>>
>> #include "i915_drv.h"
>>+#include "i915_mm.h"
>>
>> struct remap_pfn {
>> 	struct mm_struct *mm;
>>diff --git a/drivers/gpu/drm/i915/i915_mm.h b/drivers/gpu/drm/i915/i915_mm.h
>>new file mode 100644
>>index 000000000000..1d3bbb9cbf43
>>--- /dev/null
>>+++ b/drivers/gpu/drm/i915/i915_mm.h
>>@@ -0,0 +1,32 @@
>>+/* SPDX-License-Identifier: MIT */
>>+/*
>>+ * Copyright © 2021 Intel Corporation
>>+ */
>>+
>>+#ifndef __I915_MM_H__
>>+#define __I915_MM_H__
>>+
>>+#include <linux/types.h>
>>+
>>+struct vm_area_struct;
>>+struct io_mapping;
>>+struct scatterlist;
>>+
>>+#if IS_ENABLED(CONFIG_X86)
>>+int remap_io_mapping(struct vm_area_struct *vma,
>>+		unsigned long addr, unsigned long pfn, unsigned long size,
>>+		struct io_mapping *iomap);
>>+#else
>>+static inline int remap_io_mapping(struct vm_area_struct *vma,
>>+		unsigned long addr, unsigned long pfn, unsigned long size,
>>+		struct io_mapping *iomap)
>>+{
>
> would probably be good to add:
>
> 	pr_err("Architecture has no remap_io_mapping() and shouldn't be calling this function\n");
> 	WARN_ON_ONCE(1);
>
> the same way that is done in drivers/gpu/drm/drm_cache.c
>
> Other than that:
>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Since you're adding this header, can you follow up with one additional
> patch to move the rest of the prototypes off i915_drv.h and into this
> new header?

There's only the two functions?

BR,
Jani.


>
>
> thanks
> Lucas De Marchi
>
>
>>+	return 0;
>>+}
>>+#endif
>>+
>>+int remap_io_sg(struct vm_area_struct *vma,
>>+		unsigned long addr, unsigned long size,
>>+		struct scatterlist *sgl, resource_size_t iobase);
>>+
>>+#endif /* __I915_MM_H__ */
>>-- 
>>2.33.0
>>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2021-12-01  9:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 12:31 [Intel-gfx] [PATCH] drm/i915: Skip remap_io_mapping() for non-x86 platforms Mullati Siva
2021-11-22 17:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Skip remap_io_mapping() for non-x86 platforms (rev3) Patchwork
2021-11-22 17:33 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-11-22 18:12 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-11-30 19:17 ` [Intel-gfx] [PATCH] drm/i915: Skip remap_io_mapping() for non-x86 platforms Lucas De Marchi
2021-12-01  9:04   ` Jani Nikula [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-08  4:12 Mullati Siva
2021-12-08 21:26 ` Lucas De Marchi
2021-12-07 16:49 Mullati Siva
2021-12-01 11:32 Mullati Siva
2021-11-12 17:18 Mullati Siva
2021-11-12 22:18 ` Jani Nikula
2021-11-13 17:34   ` Lucas De Marchi
2021-11-16 19:24     ` Matthew Auld
2021-11-12 13:24 Mullati Siva
2021-11-12 14:09 ` 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=87h7bsitlw.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.auld@intel.com \
    --cc=siva.mullati@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