2019-05-19 19:07:45 +07:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2013-10-09 14:18:51 +07:00
|
|
|
config DRM_I915
|
|
|
|
tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
|
|
|
|
depends on DRM
|
2013-11-05 19:00:08 +07:00
|
|
|
depends on X86 && PCI
|
|
|
|
select INTEL_GTT
|
drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl
By exporting the ability to map user address and inserting PTEs
representing their backing pages into the GTT, we can exploit UMA in order
to utilize normal application data as a texture source or even as a
render target (depending upon the capabilities of the chipset). This has
a number of uses, with zero-copy downloads to the GPU and efficient
readback making the intermixed streaming of CPU and GPU operations
fairly efficient. This ability has many widespread implications from
faster rendering of client-side software rasterisers (chromium),
mitigation of stalls due to read back (firefox) and to faster pipelining
of texture data (such as pixel buffer objects in GL or data blobs in CL).
v2: Compile with CONFIG_MMU_NOTIFIER
v3: We can sleep while performing invalidate-range, which we can utilise
to drop our page references prior to the kernel manipulating the vma
(for either discard or cloning) and so protect normal users.
v4: Only run the invalidate notifier if the range intercepts the bo.
v5: Prevent userspace from attempting to GTT mmap non-page aligned buffers
v6: Recheck after reacquire mutex for lost mmu.
v7: Fix implicit padding of ioctl struct by rounding to next 64bit boundary.
v8: Fix rebasing error after forwarding porting the back port.
v9: Limit the userptr to page aligned entries. We now expect userspace
to handle all the offset-in-page adjustments itself.
v10: Prevent vma from being copied across fork to avoid issues with cow.
v11: Drop vma behaviour changes -- locking is nigh on impossible.
Use a worker to load user pages to avoid lock inversions.
v12: Use get_task_mm()/mmput() for correct refcounting of mm.
v13: Use a worker to release the mmu_notifier to avoid lock inversion
v14: Decouple mmu_notifier from struct_mutex using a custom mmu_notifer
with its own locking and tree of objects for each mm/mmu_notifier.
v15: Prevent overlapping userptr objects, and invalidate all objects
within the mmu_notifier range
v16: Fix a typo for iterating over multiple objects in the range and
rearrange error path to destroy the mmu_notifier locklessly.
Also close a race between invalidate_range and the get_pages_worker.
v17: Close a race between get_pages_worker/invalidate_range and fresh
allocations of the same userptr range - and notice that
struct_mutex was presumed to be held when during creation it wasn't.
v18: Sigh. Fix the refactor of st_set_pages() to allocate enough memory
for the struct sg_table and to clear it before reporting an error.
v19: Always error out on read-only userptr requests as we don't have the
hardware infrastructure to support them at the moment.
v20: Refuse to implement read-only support until we have the required
infrastructure - but reserve the bit in flags for future use.
v21: use_mm() is not required for get_user_pages(). It is only meant to
be used to fix up the kernel thread's current->mm for use with
copy_user().
v22: Use sg_alloc_table_from_pages for that chunky feeling
v23: Export a function for sanity checking dma-buf rather than encode
userptr details elsewhere, and clean up comments based on
suggestions by Bradley.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
Cc: Akash Goel <akash.goel@intel.com>
Cc: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
[danvet: Frob ioctl allocation to pick the next one - will cause a bit
of fuss with create2 apparently, but such are the rules.]
[danvet2: oops, forgot to git add after manual patch application]
[danvet3: Appease sparse.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16 20:22:37 +07:00
|
|
|
select INTERVAL_TREE
|
2013-10-09 14:18:51 +07:00
|
|
|
# we need shmfs for the swappable backing store, and in particular
|
|
|
|
# the shmem_readpage() which depends upon tmpfs
|
|
|
|
select SHMEM
|
|
|
|
select TMPFS
|
|
|
|
select DRM_KMS_HELPER
|
2015-01-23 20:30:56 +07:00
|
|
|
select DRM_PANEL
|
2015-01-16 19:27:23 +07:00
|
|
|
select DRM_MIPI_DSI
|
2016-10-12 23:24:34 +07:00
|
|
|
select RELAY
|
2017-09-11 15:41:26 +07:00
|
|
|
select IRQ_WORK
|
2013-10-09 14:18:51 +07:00
|
|
|
# i915 depends on ACPI_VIDEO when ACPI is enabled
|
|
|
|
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
|
|
|
|
select BACKLIGHT_CLASS_DEVICE if ACPI
|
|
|
|
select INPUT if ACPI
|
|
|
|
select ACPI_VIDEO if ACPI
|
|
|
|
select ACPI_BUTTON if ACPI
|
2017-01-27 16:40:08 +07:00
|
|
|
select SYNC_FILE
|
2017-02-10 17:28:02 +07:00
|
|
|
select IOSF_MBI
|
2017-06-21 13:34:20 +07:00
|
|
|
select CRC32
|
ALSA: hda: Make audio component support more generic
This is the final step for more generic support of DRM audio
component. The generic audio component code is now moved to its own
file, and the symbols are renamed from snd_hac_i915_* to
snd_hdac_acomp_*, respectively. The generic code is enabled via the
new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
kept as the super-class.
Along with the split, three new callbacks are added to audio_ops:
pin2port is for providing the conversion between the pin number and
the widget id, and master_bind/master_unbin are called at binding /
unbinding the master component, respectively. All these are optional,
but used in i915 implementation and also other later implementations.
A note about the new snd_hdac_acomp_init() function: there is a slight
difference between this and the old snd_hdac_i915_init(). The latter
(still) synchronizes with the master component binding, i.e. it
assures that the relevant DRM component gets bound when it returns, or
gives a negative error. Meanwhile the new function doesn't
synchronize but just leaves as is. It's the responsibility by the
caller's side to synchronize, or the caller may accept the
asynchronous binding on the fly.
v1->v2: Fix missing NULL check in master_bind/unbind
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-11 21:23:16 +07:00
|
|
|
select SND_HDA_I915 if SND_HDA_CORE
|
2018-07-04 22:08:17 +07:00
|
|
|
select CEC_CORE if CEC_NOTIFIER
|
2013-10-09 14:18:51 +07:00
|
|
|
help
|
|
|
|
Choose this option if you have a system that has "Intel Graphics
|
|
|
|
Media Accelerator" or "HD Graphics" integrated graphics,
|
|
|
|
including 830M, 845G, 852GM, 855GM, 865G, 915G, 945G, 965G,
|
|
|
|
G35, G41, G43, G45 chipsets and Celeron, Pentium, Core i3,
|
|
|
|
Core i5, Core i7 as well as Atom CPUs with integrated graphics.
|
2016-10-21 16:14:17 +07:00
|
|
|
|
|
|
|
This driver is used by the Intel driver in X.org 6.8 and
|
|
|
|
XFree86 4.4 and above. It replaces the older i830 module that
|
|
|
|
supported a subset of the hardware in older X.org releases.
|
2013-10-09 14:18:51 +07:00
|
|
|
|
|
|
|
Note that the older i810/i815 chipsets require the use of the
|
|
|
|
i810 driver instead, and the Atom z5xx series has an entirely
|
|
|
|
different implementation.
|
|
|
|
|
2016-10-21 16:14:17 +07:00
|
|
|
If "M" is selected, the module will be called i915.
|
|
|
|
|
2019-05-06 20:48:01 +07:00
|
|
|
config DRM_I915_FORCE_PROBE
|
|
|
|
string "Force probe driver for selected new Intel hardware"
|
|
|
|
depends on DRM_I915
|
|
|
|
help
|
|
|
|
This is the default value for the i915.force_probe module
|
|
|
|
parameter. Using the module parameter overrides this option.
|
|
|
|
|
|
|
|
Force probe the driver for new Intel graphics devices that are
|
|
|
|
recognized but not properly supported by this kernel version. It is
|
|
|
|
recommended to upgrade to a kernel version with proper support as soon
|
|
|
|
as it is available.
|
|
|
|
|
|
|
|
Use "" to disable force probe. If in doubt, use this.
|
|
|
|
|
|
|
|
Use "<pci-id>[,<pci-id>,...]" to force probe the driver for listed
|
|
|
|
devices. For example, "4500" or "4500,4571".
|
2013-10-09 14:18:51 +07:00
|
|
|
|
2019-05-06 20:48:01 +07:00
|
|
|
Use "*" to force probe the driver for all known devices.
|
2016-01-11 16:16:14 +07:00
|
|
|
|
2016-10-12 16:05:18 +07:00
|
|
|
config DRM_I915_CAPTURE_ERROR
|
|
|
|
bool "Enable capturing GPU state following a hang"
|
|
|
|
depends on DRM_I915
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option enables capturing the GPU state when a hang is detected.
|
|
|
|
This information is vital for triaging hangs and assists in debugging.
|
2020-02-12 23:04:34 +07:00
|
|
|
Please report any hang for triaging according to:
|
|
|
|
https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs
|
2016-10-12 16:05:18 +07:00
|
|
|
|
|
|
|
If in doubt, say "Y".
|
|
|
|
|
2016-10-12 16:05:22 +07:00
|
|
|
config DRM_I915_COMPRESS_ERROR
|
|
|
|
bool "Compress GPU error state"
|
|
|
|
depends on DRM_I915_CAPTURE_ERROR
|
|
|
|
select ZLIB_DEFLATE
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option selects ZLIB_DEFLATE if it isn't already
|
|
|
|
selected and causes any error state captured upon a GPU hang
|
|
|
|
to be compressed using zlib.
|
|
|
|
|
|
|
|
If in doubt, say "Y".
|
|
|
|
|
2016-01-11 16:16:14 +07:00
|
|
|
config DRM_I915_USERPTR
|
|
|
|
bool "Always enable userptr support"
|
|
|
|
depends on DRM_I915
|
|
|
|
select MMU_NOTIFIER
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option selects CONFIG_MMU_NOTIFIER if it isn't already
|
|
|
|
selected to enabled full userptr support.
|
|
|
|
|
|
|
|
If in doubt, say "Y".
|
2016-03-03 21:36:43 +07:00
|
|
|
|
drm/i915: gvt: Introduce the basic architecture of GVT-g
This patch introduces the very basic framework of GVT-g device model,
includes basic prototypes, definitions, initialization.
v12:
- Call intel_gvt_init() in driver early initialization stage. (Chris)
v8:
- Remove the GVT idr and mutex in intel_gvt_host. (Joonas)
v7:
- Refine the URL link in Kconfig. (Joonas)
- Refine the introduction of GVT-g host support in Kconfig. (Joonas)
- Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
- Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
- Remove {alloc, free}_gvt_device()
- Rename intel_gvt_{create, destroy}_gvt_device()
- Expost intel_gvt_init_host()
- Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
v6:
- Refine introduction in Kconfig. (Chris)
- The exposed API functions will take struct intel_gvt * instead of
void *. (Chris/Tvrtko)
- Remove most memebers of strct intel_gvt_device_info. Will add them
in the device model patches.(Chris)
- Remove gvt_info() and gvt_err() in debug.h. (Chris)
- Move GVT kernel parameter into i915_params. (Chris)
- Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
- Remove the redundant struct i915_gvt *, as the functions in i915
will directly take struct intel_gvt *.
- Add more comments for reviewer.
v5:
Take Tvrtko's comments:
- Fix the misspelled words in Kconfig
- Let functions take drm_i915_private * instead of struct drm_device *
- Remove redundant prints/local varible initialization
v3:
Take Joonas' comments:
- Change file name i915_gvt.* to intel_gvt.*
- Move GVT kernel parameter into intel_gvt.c
- Remove redundant debug macros
- Change error handling style
- Add introductions for some stub functions
- Introduce drm/i915_gvt.h.
Take Kevin's comments:
- Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
v2:
- Introduce i915_gvt.c.
It's necessary to introduce the stubs between i915 driver and GVT-g host,
as GVT-g components is configurable in kernel config. When disabled, the
stubs here do nothing.
Take Joonas' comments:
- Replace boolean return value with int.
- Replace customized info/warn/debug macros with DRM macros.
- Document all non-static functions like i915.
- Remove empty and unused functions.
- Replace magic number with marcos.
- Set GVT-g in kernel config to "n" by default.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-5-git-send-email-zhi.a.wang@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-16 19:07:00 +07:00
|
|
|
config DRM_I915_GVT
|
2019-10-08 00:33:46 +07:00
|
|
|
bool "Enable Intel GVT-g graphics virtualization host support"
|
|
|
|
depends on DRM_I915
|
|
|
|
depends on 64BIT
|
|
|
|
default n
|
|
|
|
help
|
drm/i915: gvt: Introduce the basic architecture of GVT-g
This patch introduces the very basic framework of GVT-g device model,
includes basic prototypes, definitions, initialization.
v12:
- Call intel_gvt_init() in driver early initialization stage. (Chris)
v8:
- Remove the GVT idr and mutex in intel_gvt_host. (Joonas)
v7:
- Refine the URL link in Kconfig. (Joonas)
- Refine the introduction of GVT-g host support in Kconfig. (Joonas)
- Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
- Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
- Remove {alloc, free}_gvt_device()
- Rename intel_gvt_{create, destroy}_gvt_device()
- Expost intel_gvt_init_host()
- Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
v6:
- Refine introduction in Kconfig. (Chris)
- The exposed API functions will take struct intel_gvt * instead of
void *. (Chris/Tvrtko)
- Remove most memebers of strct intel_gvt_device_info. Will add them
in the device model patches.(Chris)
- Remove gvt_info() and gvt_err() in debug.h. (Chris)
- Move GVT kernel parameter into i915_params. (Chris)
- Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
- Remove the redundant struct i915_gvt *, as the functions in i915
will directly take struct intel_gvt *.
- Add more comments for reviewer.
v5:
Take Tvrtko's comments:
- Fix the misspelled words in Kconfig
- Let functions take drm_i915_private * instead of struct drm_device *
- Remove redundant prints/local varible initialization
v3:
Take Joonas' comments:
- Change file name i915_gvt.* to intel_gvt.*
- Move GVT kernel parameter into intel_gvt.c
- Remove redundant debug macros
- Change error handling style
- Add introductions for some stub functions
- Introduce drm/i915_gvt.h.
Take Kevin's comments:
- Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
v2:
- Introduce i915_gvt.c.
It's necessary to introduce the stubs between i915 driver and GVT-g host,
as GVT-g components is configurable in kernel config. When disabled, the
stubs here do nothing.
Take Joonas' comments:
- Replace boolean return value with int.
- Replace customized info/warn/debug macros with DRM macros.
- Document all non-static functions like i915.
- Remove empty and unused functions.
- Replace magic number with marcos.
- Set GVT-g in kernel config to "n" by default.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-5-git-send-email-zhi.a.wang@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-16 19:07:00 +07:00
|
|
|
Choose this option if you want to enable Intel GVT-g graphics
|
|
|
|
virtualization technology host support with integrated graphics.
|
|
|
|
With GVT-g, it's possible to have one integrated graphics
|
|
|
|
device shared by multiple VMs under different hypervisors.
|
|
|
|
|
|
|
|
Note that at least one hypervisor like Xen or KVM is required for
|
|
|
|
this driver to work, and it only supports newer device from
|
|
|
|
Broadwell+. For further information and setup guide, you can
|
|
|
|
visit: http://01.org/igvt-g.
|
|
|
|
|
|
|
|
Now it's just a stub to support the modifications of i915 for
|
|
|
|
GVT device model. It requires at least one MPT modules for Xen/KVM
|
|
|
|
and other components of GVT device model to work. Use it under
|
|
|
|
you own risk.
|
|
|
|
|
|
|
|
If in doubt, say "N".
|
|
|
|
|
drm/i915/gvt: add KVMGT support
KVMGT is the MPT implementation based on VFIO/KVM. It provides
a kvmgt_mpt ops to gvt for vGPU access mediation, e.g. to
mediate and emulate the MMIO accesses, to inject interrupts
to vGPU user, to intercept the GTT writing and replace it with
DMA-able address, to write-protect guest PPGTT table for
shadowing synchronization, etc. This patch provides the MPT
implementation for GVT, not yet functional due to theabsence
of mdev.
It's built as kvmgt.ko, depends on vfio.ko, kvm.ko and mdev.ko,
and being required by i915.ko. To not introduce hard dependency
in i915.ko, we used indirect symbol reference. But that means
users have to include kvmgt.ko into init ramdisk if their
i915.ko is included.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Xiaoguang Chen <xiaoguang.chen@intel.com>
Signed-off-by: Jike Song <jike.song@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2016-11-09 19:30:59 +07:00
|
|
|
config DRM_I915_GVT_KVMGT
|
|
|
|
tristate "Enable KVM/VFIO support for Intel GVT-g"
|
|
|
|
depends on DRM_I915_GVT
|
|
|
|
depends on KVM
|
2016-12-08 10:00:36 +07:00
|
|
|
depends on VFIO_MDEV && VFIO_MDEV_DEVICE
|
drm/i915/gvt: add KVMGT support
KVMGT is the MPT implementation based on VFIO/KVM. It provides
a kvmgt_mpt ops to gvt for vGPU access mediation, e.g. to
mediate and emulate the MMIO accesses, to inject interrupts
to vGPU user, to intercept the GTT writing and replace it with
DMA-able address, to write-protect guest PPGTT table for
shadowing synchronization, etc. This patch provides the MPT
implementation for GVT, not yet functional due to theabsence
of mdev.
It's built as kvmgt.ko, depends on vfio.ko, kvm.ko and mdev.ko,
and being required by i915.ko. To not introduce hard dependency
in i915.ko, we used indirect symbol reference. But that means
users have to include kvmgt.ko into init ramdisk if their
i915.ko is included.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Xiaoguang Chen <xiaoguang.chen@intel.com>
Signed-off-by: Jike Song <jike.song@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2016-11-09 19:30:59 +07:00
|
|
|
default n
|
|
|
|
help
|
|
|
|
Choose this option if you want to enable KVMGT support for
|
|
|
|
Intel GVT-g.
|
|
|
|
|
2016-03-03 21:36:43 +07:00
|
|
|
menu "drm/i915 Debugging"
|
|
|
|
depends on DRM_I915
|
|
|
|
depends on EXPERT
|
2018-12-11 18:01:04 +07:00
|
|
|
source "drivers/gpu/drm/i915/Kconfig.debug"
|
2016-03-03 21:36:43 +07:00
|
|
|
endmenu
|
2019-04-20 01:26:25 +07:00
|
|
|
|
|
|
|
menu "drm/i915 Profile Guided Optimisation"
|
|
|
|
visible if EXPERT
|
|
|
|
depends on DRM_I915
|
|
|
|
source "drivers/gpu/drm/i915/Kconfig.profile"
|
|
|
|
endmenu
|
2019-10-27 22:43:14 +07:00
|
|
|
|
|
|
|
menu "drm/i915 Unstable Evolution"
|
|
|
|
visible if EXPERT && STAGING && BROKEN
|
|
|
|
depends on DRM_I915
|
|
|
|
source "drivers/gpu/drm/i915/Kconfig.unstable"
|
|
|
|
endmenu
|