Skip to content
Permalink
Browse files
drm/i915: Skip remap_io() calls for non-x86 platforms
Only hw that supports mappable aperture would hit this path
vm_fault_gtt/vm_fault_tmm, So we never hit these functions
remap_io_mapping() and remap_io_sg in discrete, So skip this
code for non-x86 architectures.

Signed-off-by: Siva Mullati <siva.mullati@intel.com>
  • Loading branch information
smullati authored and intel-lab-lkp committed Nov 18, 2021
1 parent a59308a commit 3cc867f614222b682fb1f739ff6db5133d9352ad
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
@@ -62,12 +62,12 @@ i915-y += i915_driver.o \
i915-y += \
dma_resv_utils.o \
i915_memcpy.o \
i915_mm.o \
i915_sw_fence.o \
i915_sw_fence_work.o \
i915_syncmap.o \
i915_user_extensions.o

i915-$(CONFIG_X86) += i915_mm.o
i915-$(CONFIG_COMPAT) += i915_ioc32.o
i915-$(CONFIG_DEBUG_FS) += \
i915_debugfs.o \
@@ -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"
@@ -1959,14 +1959,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)
@@ -27,6 +27,7 @@


#include "i915_drv.h"
#include "i915_mm.h"

struct remap_pfn {
struct mm_struct *mm;
@@ -0,0 +1,31 @@
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2021 Intel Corporation
*/

#ifndef __I915_MM_H__
#define __I915_MM_H__

#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);
int remap_io_sg(struct vm_area_struct *vma,
unsigned long addr, unsigned long size,
struct scatterlist *sgl, resource_size_t iobase);
#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)
{
return 0;
}
static inline int remap_io_sg(struct vm_area_struct *vma,
unsigned long addr, unsigned long size,
struct scatterlist *sgl, resource_size_t iobase)
{
return 0;
}
#endif

#endif /* __I915_MM_H__ */

0 comments on commit 3cc867f

Please sign in to comment.