License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 21:07:57 +07:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2008-05-29 07:09:59 +07:00
|
|
|
#
|
|
|
|
# Makefile for the drm device driver. This driver provides support for the
|
|
|
|
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
|
|
|
|
2017-10-25 01:15:47 +07:00
|
|
|
# Add a set of useful warning flags and enable -Werror for CI to prevent
|
|
|
|
# trivial mistakes from creeping in. We have to do this piecemeal as we reject
|
|
|
|
# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
|
|
|
|
# need to filter out dubious warnings. Still it is our interest
|
|
|
|
# to keep running locally with W=1 C=1 until we are completely clean.
|
|
|
|
#
|
|
|
|
# Note the danger in using -Wall -Wextra is that when CI updates gcc we
|
|
|
|
# will most likely get a sudden build breakage... Hopefully we will fix
|
|
|
|
# new warnings before CI updates!
|
2018-06-26 05:59:34 +07:00
|
|
|
subdir-ccflags-y := -Wall -Wextra
|
2017-10-31 00:29:27 +07:00
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, type-limits)
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
|
2018-02-08 23:16:39 +07:00
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
|
2018-05-02 01:24:40 +07:00
|
|
|
# clang warnings
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
|
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
|
2019-01-26 14:11:23 +07:00
|
|
|
subdir-ccflags-y += $(call cc-disable-warning, uninitialized)
|
2017-10-25 01:15:47 +07:00
|
|
|
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
|
|
|
|
|
|
|
|
# Fine grained warnings disable
|
2017-10-31 00:29:27 +07:00
|
|
|
CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
|
|
|
|
CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init)
|
2017-10-25 01:15:47 +07:00
|
|
|
|
2016-08-12 18:39:59 +07:00
|
|
|
subdir-ccflags-y += \
|
|
|
|
$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
|
2016-04-13 23:35:00 +07:00
|
|
|
|
2019-04-03 20:52:36 +07:00
|
|
|
# Extra header tests
|
|
|
|
include $(src)/Makefile.header-test
|
|
|
|
|
2019-04-25 00:48:39 +07:00
|
|
|
subdir-ccflags-y += -I$(src)
|
|
|
|
|
2014-03-07 15:17:21 +07:00
|
|
|
# Please keep these build lists sorted!
|
|
|
|
|
|
|
|
# core driver code
|
2019-04-03 20:52:36 +07:00
|
|
|
i915-y += i915_drv.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
i915_irq.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
i915_params.o \
|
2016-06-24 20:00:26 +07:00
|
|
|
i915_pci.o \
|
2018-12-05 18:06:08 +07:00
|
|
|
i915_suspend.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
i915_sysfs.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
intel_csr.o \
|
2016-07-05 16:40:20 +07:00
|
|
|
intel_device_info.o \
|
2014-09-30 15:56:38 +07:00
|
|
|
intel_pm.o \
|
2018-04-10 23:12:46 +07:00
|
|
|
intel_runtime_pm.o \
|
2019-04-25 03:07:13 +07:00
|
|
|
intel_wakeref.o \
|
2019-04-25 00:48:39 +07:00
|
|
|
intel_uncore.o
|
|
|
|
|
|
|
|
# core library code
|
|
|
|
i915-y += \
|
|
|
|
i915_memcpy.o \
|
|
|
|
i915_mm.o \
|
|
|
|
i915_sw_fence.o \
|
|
|
|
i915_syncmap.o \
|
|
|
|
i915_user_extensions.o
|
2014-09-30 15:56:38 +07:00
|
|
|
|
2014-03-07 15:17:21 +07:00
|
|
|
i915-$(CONFIG_COMPAT) += i915_ioc32.o
|
2016-12-12 19:29:48 +07:00
|
|
|
i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o intel_pipe_crc.o
|
drm/i915/pmu: Expose a PMU interface for perf queries
From: Chris Wilson <chris@chris-wilson.co.uk>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
From: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
The first goal is to be able to measure GPU (and invidual ring) busyness
without having to poll registers from userspace. (Which not only incurs
holding the forcewake lock indefinitely, perturbing the system, but also
runs the risk of hanging the machine.) As an alternative we can use the
perf event counter interface to sample the ring registers periodically
and send those results to userspace.
Functionality we are exporting to userspace is via the existing perf PMU
API and can be exercised via the existing tools. For example:
perf stat -a -e i915/rcs0-busy/ -I 1000
Will print the render engine busynnes once per second. All the performance
counters can be enumerated (perf list) and have their unit of measure
correctly reported in sysfs.
v1-v2 (Chris Wilson):
v2: Use a common timer for the ring sampling.
v3: (Tvrtko Ursulin)
* Decouple uAPI from i915 engine ids.
* Complete uAPI defines.
* Refactor some code to helpers for clarity.
* Skip sampling disabled engines.
* Expose counters in sysfs.
* Pass in fake regs to avoid null ptr deref in perf core.
* Convert to class/instance uAPI.
* Use shared driver code for rc6 residency, power and frequency.
v4: (Dmitry Rogozhkin)
* Register PMU with .task_ctx_nr=perf_invalid_context
* Expose cpumask for the PMU with the single CPU in the mask
* Properly support pmu->stop(): it should call pmu->read()
* Properly support pmu->del(): it should call stop(event, PERF_EF_UPDATE)
* Introduce refcounting of event subscriptions.
* Make pmu.busy_stats a refcounter to avoid busy stats going away
with some deleted event.
* Expose cpumask for i915 PMU to avoid multiple events creation of
the same type followed by counter aggregation by perf-stat.
* Track CPUs getting online/offline to migrate perf context. If (likely)
cpumask will initially set CPU0, CONFIG_BOOTPARAM_HOTPLUG_CPU0 will be
needed to see effect of CPU status tracking.
* End result is that only global events are supported and perf stat
works correctly.
* Deny perf driver level sampling - it is prohibited for uncore PMU.
v5: (Tvrtko Ursulin)
* Don't hardcode number of engine samplers.
* Rewrite event ref-counting for correctness and simplicity.
* Store initial counter value when starting already enabled events
to correctly report values to all listeners.
* Fix RC6 residency readout.
* Comments, GPL header.
v6:
* Add missing entry to v4 changelog.
* Fix accounting in CPU hotplug case by copying the approach from
arch/x86/events/intel/cstate.c. (Dmitry Rogozhkin)
v7:
* Log failure message only on failure.
* Remove CPU hotplug notification state on unregister.
v8:
* Fix error unwind on failed registration.
* Checkpatch cleanup.
v9:
* Drop the energy metric, it is available via intel_rapl_perf.
(Ville Syrjälä)
* Use HAS_RC6(p). (Chris Wilson)
* Handle unsupported non-engine events. (Dmitry Rogozhkin)
* Rebase for intel_rc6_residency_ns needing caller managed
runtime pm.
* Drop HAS_RC6 checks from the read callback since creating those
events will be rejected at init time already.
* Add counter units to sysfs so perf stat output is nicer.
* Cleanup the attribute tables for brevity and readability.
v10:
* Fixed queued accounting.
v11:
* Move intel_engine_lookup_user to intel_engine_cs.c
* Commit update. (Joonas Lahtinen)
v12:
* More accurate sampling. (Chris Wilson)
* Store and report frequency in MHz for better usability from
perf stat.
* Removed metrics: queued, interrupts, rc6 counters.
* Sample engine busyness based on seqno difference only
for less MMIO (and forcewake) on all platforms. (Chris Wilson)
v13:
* Comment spelling, use mul_u32_u32 to work around potential GCC
issue and somne code alignment changes. (Chris Wilson)
v14:
* Rebase.
v15:
* Rebase for RPS refactoring.
v16:
* Use the dynamic slot in the CPU hotplug state machine so that we are
free to setup our state as multi-instance. Previously we were re-using
the CPUHP_AP_PERF_X86_UNCORE_ONLINE slot which is neither used as
multi-instance, nor owned by our driver to start with.
* Register the CPU hotplug handlers after the PMU, otherwise the callback
will get called before the PMU is initialized which can end up in
perf_pmu_migrate_context with an un-initialized base.
* Added workaround for a probable bug in cpuhp core.
v17:
* Remove workaround for the cpuhp bug.
v18:
* Rebase for drm_i915_gem_engine_class getting upstream before us.
v19:
* Rebase. (trivial)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171121181852.16128-2-tvrtko.ursulin@linux.intel.com
2017-11-22 01:18:45 +07:00
|
|
|
i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o
|
2014-03-07 15:17:21 +07:00
|
|
|
|
2019-04-25 00:48:39 +07:00
|
|
|
# "Graphics Technology" (aka we talk to the gpu)
|
|
|
|
obj-y += gt/
|
|
|
|
gt-y += \
|
|
|
|
gt/intel_breadcrumbs.o \
|
|
|
|
gt/intel_context.o \
|
|
|
|
gt/intel_engine_cs.o \
|
drm/i915: Invert the GEM wakeref hierarchy
In the current scheme, on submitting a request we take a single global
GEM wakeref, which trickles down to wake up all GT power domains. This
is undesirable as we would like to be able to localise our power
management to the available power domains and to remove the global GEM
operations from the heart of the driver. (The intent there is to push
global GEM decisions to the boundary as used by the GEM user interface.)
Now during request construction, each request is responsible via its
logical context to acquire a wakeref on each power domain it intends to
utilize. Currently, each request takes a wakeref on the engine(s) and
the engines themselves take a chipset wakeref. This gives us a
transition on each engine which we can extend if we want to insert more
powermangement control (such as soft rc6). The global GEM operations
that currently require a struct_mutex are reduced to listening to pm
events from the chipset GT wakeref. As we reduce the struct_mutex
requirement, these listeners should evaporate.
Perhaps the biggest immediate change is that this removes the
struct_mutex requirement around GT power management, allowing us greater
flexibility in request construction. Another important knock-on effect,
is that by tracking engine usage, we can insert a switch back to the
kernel context on that engine immediately, avoiding any extra delay or
inserting global synchronisation barriers. This makes tracking when an
engine and its associated contexts are idle much easier -- important for
when we forgo our assumed execution ordering and need idle barriers to
unpin used contexts. In the process, it means we remove a large chunk of
code whose only purpose was to switch back to the kernel context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190424200717.1686-5-chris@chris-wilson.co.uk
2019-04-25 03:07:17 +07:00
|
|
|
gt/intel_engine_pm.o \
|
|
|
|
gt/intel_gt_pm.o \
|
2019-04-25 00:48:39 +07:00
|
|
|
gt/intel_hangcheck.o \
|
|
|
|
gt/intel_lrc.o \
|
|
|
|
gt/intel_reset.o \
|
|
|
|
gt/intel_ringbuffer.o \
|
|
|
|
gt/intel_mocs.o \
|
|
|
|
gt/intel_sseu.o \
|
|
|
|
gt/intel_workarounds.o
|
|
|
|
gt-$(CONFIG_DRM_I915_SELFTEST) += \
|
|
|
|
gt/mock_engine.o
|
|
|
|
i915-y += $(gt-y)
|
|
|
|
|
|
|
|
# GEM (Graphics Execution Management) code
|
2019-02-05 20:00:02 +07:00
|
|
|
i915-y += \
|
|
|
|
i915_active.o \
|
|
|
|
i915_cmd_parser.o \
|
2014-12-12 03:13:08 +07:00
|
|
|
i915_gem_batch_pool.o \
|
2017-02-22 18:40:48 +07:00
|
|
|
i915_gem_clflush.o \
|
drm/i915: preliminary context support
Very basic code for context setup/destruction in the driver.
Adds the file i915_gem_context.c This file implements HW context
support. On gen5+ a HW context consists of an opaque GPU object which is
referenced at times of context saves and restores. With RC6 enabled,
the context is also referenced as the GPU enters and exists from RC6
(GPU has it's own internal power context, except on gen5). Though
something like a context does exist for the media ring, the code only
supports contexts for the render ring.
In software, there is a distinction between contexts created by the
user, and the default HW context. The default HW context is used by GPU
clients that do not request setup of their own hardware context. The
default context's state is never restored to help prevent programming
errors. This would happen if a client ran and piggy-backed off another
clients GPU state. The default context only exists to give the GPU some
offset to load as the current to invoke a save of the context we
actually care about. In fact, the code could likely be constructed,
albeit in a more complicated fashion, to never use the default context,
though that limits the driver's ability to swap out, and/or destroy
other contexts.
All other contexts are created as a request by the GPU client. These
contexts store GPU state, and thus allow GPU clients to not re-emit
state (and potentially query certain state) at any time. The kernel
driver makes certain that the appropriate commands are inserted.
There are 4 entry points into the contexts, init, fini, open, close.
The names are self-explanatory except that init can be called during
reset, and also during pm thaw/resume. As we expect our context to be
preserved across these events, we do not reinitialize in this case.
As Adam Jackson pointed out, The cutoff of 1MB where a HW context is
considered too big is arbitrary. The reason for this is even though
context sizes are increasing with every generation, they have yet to
eclipse even 32k. If we somehow read back way more than that, it
probably means BIOS has done something strange, or we're running on a
platform that wasn't designed for this.
v2: rename load/unload to init/fini (daniel)
remove ILK support for get_size() (indirectly daniel)
add HAS_HW_CONTEXTS macro to clarify supported platforms (daniel)
added comments (Ben)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-05 04:42:42 +07:00
|
|
|
i915_gem_context.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
i915_gem_dmabuf.o \
|
2010-08-07 17:01:23 +07:00
|
|
|
i915_gem_evict.o \
|
2010-11-26 01:00:26 +07:00
|
|
|
i915_gem_execbuffer.o \
|
2016-11-11 17:43:54 +07:00
|
|
|
i915_gem_fence_reg.o \
|
2010-11-26 01:00:26 +07:00
|
|
|
i915_gem_gtt.o \
|
2016-10-28 19:58:30 +07:00
|
|
|
i915_gem_internal.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
i915_gem.o \
|
2017-08-11 18:11:16 +07:00
|
|
|
i915_gem_object.o \
|
2019-04-25 03:07:14 +07:00
|
|
|
i915_gem_pm.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
i915_gem_render_state.o \
|
2015-03-18 16:46:04 +07:00
|
|
|
i915_gem_shrinker.o \
|
2012-04-24 21:47:39 +07:00
|
|
|
i915_gem_stolen.o \
|
DRM: i915: add mode setting support
This commit adds i915 driver support for the DRM mode setting APIs.
Currently, VGA, LVDS, SDVO DVI & VGA, TV and DVO LVDS outputs are
supported. HDMI, DisplayPort and additional SDVO output support will
follow.
Support for the mode setting code is controlled by the new 'modeset'
module option. A new config option, CONFIG_DRM_I915_KMS controls the
default behavior, and whether a PCI ID list is built into the module for
use by user level module utilities.
Note that if mode setting is enabled, user level drivers that access
display registers directly or that don't use the kernel graphics memory
manager will likely corrupt kernel graphics memory, disrupt output
configuration (possibly leading to hangs and/or blank displays), and
prevent panic/oops messages from appearing. So use caution when
enabling this code; be sure your user level code supports the new
interfaces.
A new SysRq key, 'g', provides emergency support for switching back to
the kernel's framebuffer console; which is useful for testing.
Co-authors: Dave Airlie <airlied@linux.ie>, Hong Liu <hong.liu@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-08 05:24:08 +07:00
|
|
|
i915_gem_tiling.o \
|
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
|
|
|
i915_gem_userptr.o \
|
2017-10-07 05:18:14 +07:00
|
|
|
i915_gemfs.o \
|
2019-02-28 17:20:33 +07:00
|
|
|
i915_globals.o \
|
2018-03-06 19:28:56 +07:00
|
|
|
i915_query.o \
|
2018-02-21 16:56:36 +07:00
|
|
|
i915_request.o \
|
2018-10-01 21:47:54 +07:00
|
|
|
i915_scheduler.o \
|
2018-05-02 23:38:39 +07:00
|
|
|
i915_timeline.o \
|
2009-08-25 17:15:50 +07:00
|
|
|
i915_trace_points.o \
|
2016-11-11 17:43:54 +07:00
|
|
|
i915_vma.o \
|
2018-03-14 07:32:50 +07:00
|
|
|
intel_wopcm.o
|
2014-03-07 15:17:21 +07:00
|
|
|
|
2015-08-12 21:43:36 +07:00
|
|
|
# general-purpose microcontroller (GuC) support
|
2016-11-26 00:59:35 +07:00
|
|
|
i915-y += intel_uc.o \
|
2017-10-04 22:33:25 +07:00
|
|
|
intel_uc_fw.o \
|
2017-10-05 01:13:41 +07:00
|
|
|
intel_guc.o \
|
2018-01-03 04:20:24 +07:00
|
|
|
intel_guc_ads.o \
|
2017-05-26 18:13:25 +07:00
|
|
|
intel_guc_ct.o \
|
2017-10-16 21:47:14 +07:00
|
|
|
intel_guc_fw.o \
|
2017-11-16 20:32:41 +07:00
|
|
|
intel_guc_log.o \
|
|
|
|
intel_guc_submission.o \
|
2018-03-01 23:45:45 +07:00
|
|
|
intel_huc.o \
|
|
|
|
intel_huc_fw.o
|
2015-08-12 21:43:36 +07:00
|
|
|
|
2014-05-14 21:02:16 +07:00
|
|
|
# autogenerated null render state
|
|
|
|
i915-y += intel_renderstate_gen6.o \
|
|
|
|
intel_renderstate_gen7.o \
|
2014-10-23 22:34:28 +07:00
|
|
|
intel_renderstate_gen8.o \
|
|
|
|
intel_renderstate_gen9.o
|
2014-05-14 21:02:16 +07:00
|
|
|
|
2014-03-07 15:17:21 +07:00
|
|
|
# modesetting core code
|
2014-10-27 21:26:43 +07:00
|
|
|
i915-y += intel_audio.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
intel_atomic.o \
|
|
|
|
intel_atomic_plane.o \
|
2014-10-27 21:26:43 +07:00
|
|
|
intel_bios.o \
|
2019-05-24 22:36:14 +07:00
|
|
|
intel_bw.o \
|
2017-02-08 01:33:05 +07:00
|
|
|
intel_cdclk.o \
|
2016-03-16 17:57:14 +07:00
|
|
|
intel_color.o \
|
2018-11-06 23:06:18 +07:00
|
|
|
intel_combo_phy.o \
|
2018-10-10 14:52:04 +07:00
|
|
|
intel_connector.o \
|
DRM: i915: add mode setting support
This commit adds i915 driver support for the DRM mode setting APIs.
Currently, VGA, LVDS, SDVO DVI & VGA, TV and DVO LVDS outputs are
supported. HDMI, DisplayPort and additional SDVO output support will
follow.
Support for the mode setting code is controlled by the new 'modeset'
module option. A new config option, CONFIG_DRM_I915_KMS controls the
default behavior, and whether a PCI ID list is built into the module for
use by user level module utilities.
Note that if mode setting is enabled, user level drivers that access
display registers directly or that don't use the kernel graphics memory
manager will likely corrupt kernel graphics memory, disrupt output
configuration (possibly leading to hangs and/or blank displays), and
prevent panic/oops messages from appearing. So use caution when
enabling this code; be sure your user level code supports the new
interfaces.
A new SysRq key, 'g', provides emergency support for switching back to
the kernel's framebuffer console; which is useful for testing.
Co-authors: Dave Airlie <airlied@linux.ie>, Hong Liu <hong.liu@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-08 05:24:08 +07:00
|
|
|
intel_display.o \
|
2016-04-27 19:44:17 +07:00
|
|
|
intel_dpio_phy.o \
|
2016-03-08 22:46:15 +07:00
|
|
|
intel_dpll_mgr.o \
|
2014-12-08 23:09:10 +07:00
|
|
|
intel_fbc.o \
|
2014-09-30 15:56:46 +07:00
|
|
|
intel_fifo_underrun.o \
|
2014-09-19 23:27:27 +07:00
|
|
|
intel_frontbuffer.o \
|
2018-01-09 02:55:39 +07:00
|
|
|
intel_hdcp.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
intel_hotplug.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_overlay.o \
|
2014-11-14 23:52:28 +07:00
|
|
|
intel_psr.o \
|
2018-10-16 21:42:27 +07:00
|
|
|
intel_quirks.o \
|
2013-05-22 19:36:16 +07:00
|
|
|
intel_sideband.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_sprite.o
|
2014-03-18 15:43:56 +07:00
|
|
|
i915-$(CONFIG_ACPI) += intel_acpi.o intel_opregion.o
|
2015-08-10 18:34:08 +07:00
|
|
|
i915-$(CONFIG_DRM_FBDEV_EMULATION) += intel_fbdev.o
|
2014-03-07 15:17:21 +07:00
|
|
|
|
|
|
|
# modesetting output/encoder code
|
|
|
|
i915-y += dvo_ch7017.o \
|
DRM: i915: add mode setting support
This commit adds i915 driver support for the DRM mode setting APIs.
Currently, VGA, LVDS, SDVO DVI & VGA, TV and DVO LVDS outputs are
supported. HDMI, DisplayPort and additional SDVO output support will
follow.
Support for the mode setting code is controlled by the new 'modeset'
module option. A new config option, CONFIG_DRM_I915_KMS controls the
default behavior, and whether a PCI ID list is built into the module for
use by user level module utilities.
Note that if mode setting is enabled, user level drivers that access
display registers directly or that don't use the kernel graphics memory
manager will likely corrupt kernel graphics memory, disrupt output
configuration (possibly leading to hangs and/or blank displays), and
prevent panic/oops messages from appearing. So use caution when
enabling this code; be sure your user level code supports the new
interfaces.
A new SysRq key, 'g', provides emergency support for switching back to
the kernel's framebuffer console; which is useful for testing.
Co-authors: Dave Airlie <airlied@linux.ie>, Hong Liu <hong.liu@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-08 05:24:08 +07:00
|
|
|
dvo_ch7xxx.o \
|
|
|
|
dvo_ivch.o \
|
2012-07-19 00:22:30 +07:00
|
|
|
dvo_ns2501.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
dvo_sil164.o \
|
|
|
|
dvo_tfp410.o \
|
2018-07-05 20:49:33 +07:00
|
|
|
icl_dsi.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_crt.o \
|
|
|
|
intel_ddi.o \
|
2016-04-05 21:10:52 +07:00
|
|
|
intel_dp_aux_backlight.o \
|
2015-10-23 17:01:48 +07:00
|
|
|
intel_dp_link_training.o \
|
2014-05-02 11:02:48 +07:00
|
|
|
intel_dp_mst.o \
|
2015-07-24 18:55:10 +07:00
|
|
|
intel_dp.o \
|
2018-10-15 21:27:50 +07:00
|
|
|
intel_dsi.o \
|
2016-04-26 20:14:25 +07:00
|
|
|
intel_dsi_dcs_backlight.o \
|
2017-03-06 21:31:29 +07:00
|
|
|
intel_dsi_vbt.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_dvo.o \
|
2019-05-02 22:02:47 +07:00
|
|
|
intel_gmbus.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_hdmi.o \
|
2016-10-14 21:26:49 +07:00
|
|
|
intel_lspcon.o \
|
2014-03-07 15:17:21 +07:00
|
|
|
intel_lvds.o \
|
|
|
|
intel_panel.o \
|
|
|
|
intel_sdvo.o \
|
2018-07-05 20:25:07 +07:00
|
|
|
intel_tv.o \
|
|
|
|
vlv_dsi.o \
|
2018-11-30 02:38:27 +07:00
|
|
|
vlv_dsi_pll.o \
|
|
|
|
intel_vdsc.o
|
2013-10-09 14:18:51 +07:00
|
|
|
|
2016-10-12 16:05:18 +07:00
|
|
|
# Post-mortem debug and GPU hang state capture
|
|
|
|
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
|
2017-02-14 00:15:12 +07:00
|
|
|
i915-$(CONFIG_DRM_I915_SELFTEST) += \
|
|
|
|
selftests/i915_random.o \
|
2018-05-05 16:10:13 +07:00
|
|
|
selftests/i915_selftest.o \
|
2018-11-30 15:02:53 +07:00
|
|
|
selftests/igt_flush_test.o \
|
2019-04-26 23:33:36 +07:00
|
|
|
selftests/igt_gem_utils.o \
|
2019-01-22 05:20:47 +07:00
|
|
|
selftests/igt_live_test.o \
|
2018-12-03 19:50:11 +07:00
|
|
|
selftests/igt_reset.o \
|
2018-11-30 15:02:53 +07:00
|
|
|
selftests/igt_spinner.o
|
2016-10-12 16:05:18 +07:00
|
|
|
|
2015-02-10 18:05:47 +07:00
|
|
|
# virtual gpu code
|
|
|
|
i915-y += i915_vgpu.o
|
|
|
|
|
drm/i915: Add i915 perf infrastructure
Adds base i915 perf infrastructure for Gen performance metrics.
This adds a DRM_IOCTL_I915_PERF_OPEN ioctl that takes an array of uint64
properties to configure a stream of metrics and returns a new fd usable
with standard VFS system calls including read() to read typed and sized
records; ioctl() to enable or disable capture and poll() to wait for
data.
A stream is opened something like:
uint64_t properties[] = {
/* Single context sampling */
DRM_I915_PERF_PROP_CTX_HANDLE, ctx_handle,
/* Include OA reports in samples */
DRM_I915_PERF_PROP_SAMPLE_OA, true,
/* OA unit configuration */
DRM_I915_PERF_PROP_OA_METRICS_SET, metrics_set_id,
DRM_I915_PERF_PROP_OA_FORMAT, report_format,
DRM_I915_PERF_PROP_OA_EXPONENT, period_exponent,
};
struct drm_i915_perf_open_param parm = {
.flags = I915_PERF_FLAG_FD_CLOEXEC |
I915_PERF_FLAG_FD_NONBLOCK |
I915_PERF_FLAG_DISABLED,
.properties_ptr = (uint64_t)properties,
.num_properties = sizeof(properties) / 16,
};
int fd = drmIoctl(drm_fd, DRM_IOCTL_I915_PERF_OPEN, ¶m);
Records read all start with a common { type, size } header with
DRM_I915_PERF_RECORD_SAMPLE being of most interest. Sample records
contain an extensible number of fields and it's the
DRM_I915_PERF_PROP_SAMPLE_xyz properties given when opening that
determine what's included in every sample.
No specific streams are supported yet so any attempt to open a stream
will return an error.
v2:
use i915_gem_context_get() - Chris Wilson
v3:
update read() interface to avoid passing state struct - Chris Wilson
fix some rebase fallout, with i915-perf init/deinit
v4:
s/DRM_IORW/DRM_IOW/ - Emil Velikov
Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161107194957.3385-2-robert@sixbynine.org
2016-11-08 02:49:47 +07:00
|
|
|
# perf code
|
2016-11-08 02:49:51 +07:00
|
|
|
i915-y += i915_perf.o \
|
2017-06-13 18:23:02 +07:00
|
|
|
i915_oa_hsw.o \
|
|
|
|
i915_oa_bdw.o \
|
|
|
|
i915_oa_chv.o \
|
|
|
|
i915_oa_sklgt2.o \
|
|
|
|
i915_oa_sklgt3.o \
|
|
|
|
i915_oa_sklgt4.o \
|
2017-06-13 18:23:08 +07:00
|
|
|
i915_oa_bxt.o \
|
|
|
|
i915_oa_kblgt2.o \
|
2017-06-13 18:23:09 +07:00
|
|
|
i915_oa_kblgt3.o \
|
2017-09-18 18:21:24 +07:00
|
|
|
i915_oa_glk.o \
|
2017-11-11 02:08:40 +07:00
|
|
|
i915_oa_cflgt2.o \
|
2017-11-11 02:08:43 +07:00
|
|
|
i915_oa_cflgt3.o \
|
2018-03-26 20:39:48 +07:00
|
|
|
i915_oa_cnl.o \
|
|
|
|
i915_oa_icl.o
|
drm/i915: Add i915 perf infrastructure
Adds base i915 perf infrastructure for Gen performance metrics.
This adds a DRM_IOCTL_I915_PERF_OPEN ioctl that takes an array of uint64
properties to configure a stream of metrics and returns a new fd usable
with standard VFS system calls including read() to read typed and sized
records; ioctl() to enable or disable capture and poll() to wait for
data.
A stream is opened something like:
uint64_t properties[] = {
/* Single context sampling */
DRM_I915_PERF_PROP_CTX_HANDLE, ctx_handle,
/* Include OA reports in samples */
DRM_I915_PERF_PROP_SAMPLE_OA, true,
/* OA unit configuration */
DRM_I915_PERF_PROP_OA_METRICS_SET, metrics_set_id,
DRM_I915_PERF_PROP_OA_FORMAT, report_format,
DRM_I915_PERF_PROP_OA_EXPONENT, period_exponent,
};
struct drm_i915_perf_open_param parm = {
.flags = I915_PERF_FLAG_FD_CLOEXEC |
I915_PERF_FLAG_FD_NONBLOCK |
I915_PERF_FLAG_DISABLED,
.properties_ptr = (uint64_t)properties,
.num_properties = sizeof(properties) / 16,
};
int fd = drmIoctl(drm_fd, DRM_IOCTL_I915_PERF_OPEN, ¶m);
Records read all start with a common { type, size } header with
DRM_I915_PERF_RECORD_SAMPLE being of most interest. Sample records
contain an extensible number of fields and it's the
DRM_I915_PERF_PROP_SAMPLE_xyz properties given when opening that
determine what's included in every sample.
No specific streams are supported yet so any attempt to open a stream
will return an error.
v2:
use i915_gem_context_get() - Chris Wilson
v3:
update read() interface to avoid passing state struct - Chris Wilson
fix some rebase fallout, with i915-perf init/deinit
v4:
s/DRM_IORW/DRM_IOW/ - Emil Velikov
Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161107194957.3385-2-robert@sixbynine.org
2016-11-08 02:49:47 +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
|
|
|
ifeq ($(CONFIG_DRM_I915_GVT),y)
|
|
|
|
i915-y += intel_gvt.o
|
|
|
|
include $(src)/gvt/Makefile
|
|
|
|
endif
|
|
|
|
|
2017-01-25 05:57:49 +07:00
|
|
|
# LPE Audio for VLV and CHT
|
|
|
|
i915-y += intel_lpe_audio.o
|
|
|
|
|
2016-08-19 22:54:28 +07:00
|
|
|
obj-$(CONFIG_DRM_I915) += i915.o
|
2018-12-07 15:16:53 +07:00
|
|
|
obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o
|