The NetBSD Project

CVS log for src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / external / bsd / drm2 / dist / drm / i915

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.18.18.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:23 2020 UTC (18 months, 1 week ago) by martin
Branch: phil-wifi
Changes since 1.18.18.1: +15 -39 lines
Diff to previous 1.18.18.1 (colored) to branchpoint 1.18 (colored) next main 1.19 (colored)

Merge changes from current as of 20200406

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:20:13 2020 UTC (19 months, 2 weeks ago) by ad
Branch: ad-namecache
Changes since 1.28: +13 -37 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

Sync with head.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Feb 14 04:36:56 2020 UTC (20 months ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, HEAD
Changes since 1.30: +2 -6 lines
Diff to previous 1.30 (colored)

Reduce diffs by nixing DRM_SUSER macro, deleted upstream long ago.

Instead stub Linux capable(CAP_SYS_ADMIN).

Revision 1.30 / (download) - annotate - [select for diffs], Fri Feb 14 04:36:11 2020 UTC (20 months ago) by riastradh
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

Undo the `enum pipe' -> `enum i915_pipe' rename.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Feb 14 04:35:19 2020 UTC (20 months ago) by riastradh
Branch: MAIN
Changes since 1.28: +12 -32 lines
Diff to previous 1.28 (colored)

Use a header file hack to cope with Linux/NetBSD namespace clashes.

Currently serves for:

ALIGN
mutex_init
mutex_destroy

Revision 1.27.4.1 / (download) - annotate - [select for diffs], Thu Dec 12 21:00:32 2019 UTC (22 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored) next main 1.28 (colored)

Pull up following revision(s) (requested by maya in ticket #548):

	sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.28
	sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.30
	sys/external/bsd/common/include/linux/bitops.h: revision 1.9
	sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: revision 1.11
	sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h: revision 1.8
	sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c: revision 1.16
	sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: revision 1.9
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.28
	sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.19
	sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.20
	sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: revision 1.11
	sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h: revision 1.7
	sys/external/bsd/drm2/dist/drm/i915/i915_reg.h: revision 1.14
	sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.20
	sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c: revision 1.10
	sys/external/bsd/drm2/dist/drm/i915/i915_drv.c: revision 1.17

Add what appears to be the fixes to CVE-2019-0154, CVE-2019-0155.

This commit requires review, but I'd also like it to be tested by others
while it is being reviewed.
CVE-2019-0155:

It was discovered that the Intel i915 graphics chipsets allowed userspace
to modify page table entries via writes to MMIO from the Blitter Command
Streamer and expose kernel memory information. A local attacker could use
this to expose sensitive information or possibly elevate privileges.

CVE-2019-0154:
It was discovered that the Intel i915 graphics chipsets could cause
a system hang when userspace performed a read from GT memory mapped
input output (MMIO) when the product is in certain low power states.
A local attacker could use this to cause a denial of service.
From upstream commits to linux-4.4.y:
-------------------
From 6d0cfddc7afc715835f0e17827106f832b14dd2a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Thu, 12 Jul 2018 19:53:10 +0100
Subject: [PATCH] drm/i915/gtt: Add read only pages to gen8_pte_encode
We can set a bit inside the ppGTT PTE to indicate a page is read-only;
writes from the GPU will be discarded. We can use this to protect pages
and in particular support read-only userptr mappings (necessary for
importing PROT_READ vma).
-------------------
From 774b68aa2105c70b40c3b1777feb7ab500d716dd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Mon, 6 Aug 2018 14:10:48 -0700
Subject: [PATCH] drm/i915/gtt: Read-only pages for insert_entries on bdw+
Hook up the flags to allow read-only ppGTT mappings for gen8+
v2: Include a selftest to check that writes to a readonly PTE are
dropped
v3: Don't duplicate cpu_check() as we can just reuse it, and even worse
don't wholesale copy the theory-of-operation comment from igt_ctx_exec
without changing it to explain the intention behind the new test!
v4: Joonas really likes magic mystery values
-------------------
From 3fd1c2e65c60c1c513155e1d1d74138b141aa8a3 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris%chris-wilson.co.uk@localhost>
Date: Thu, 12 Jul 2018 19:53:12 +0100
Subject: [PATCH] drm/i915/gtt: Disable read-only support under GVT
GVT is not propagating the PTE bits, and is always setting the
read-write bit, thus breaking read-only support.
-------------------
From e5e3c0154c19f2d8213e0af88b7a10d9de7fbafd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Fri, 20 Apr 2018 14:26:01 -0700
Subject: [PATCH] drm/i915: Rename gen7 cmdparser tables
We're about to introduce some new tables for later gens, and the
current naming for the gen7 tables will no longer make sense.
v2: rebase
-------------------
From 3122671a5df3ee13f5cf22b7bdacf422b7b4319a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Fri, 8 Jun 2018 08:53:46 -0700
Subject: [PATCH] drm/i915: Disable Secure Batches for gen6+
Retroactively stop reporting support for secure batches
through the api for gen6+ so that older binaries trigger
the fallback path instead.
Older binaries use secure batches pre gen6 to access resources
that are not available to normal usermode processes. However,
all known userspace explicitly checks for HAS_SECURE_BATCHES
before relying on the secure batch feature.
Since there are no known binaries relying on this for newer gens
we can kill secure batches from gen6, via I915_PARAM_HAS_SECURE_BATCHES.
v2: rebase (Mika)
v3: rebase (Mika)
-------------------
From 544fd7d9d4cfe32357beab2f1dc543637d42e69f Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Fri, 8 Jun 2018 10:05:26 -0700
Subject: [PATCH] drm/i915: Remove Master tables from cmdparser
The previous patch has killed support for secure batches
on gen6+, and hence the cmdparsers master tables are
now dead code. Remove them.
-------------------
From 17e89f38212d8b3cba470efca91b997ac03c592c Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Wed, 1 Aug 2018 09:33:59 -0700
Subject: [PATCH] drm/i915: Add support for mandatory cmdparsing
The existing cmdparser for gen7 can be bypassed by specifying
batch_len=0 in the execbuf call. This is safe because bypassing
simply reduces the cmd-set available.
In a later patch we will introduce cmdparsing for gen9, as a
security measure, which must be strictly enforced since without
it we are vulnerable to DoS attacks.
Introduce the concept of 'required' cmd parsing that cannot be
bypassed by submitting zero-length bb's.
v2: rebase (Mika)
v2: rebase (Mika)
v3: fix conflict on engine flags (Mika)
-------------------
From 77524398bccea3592a25cbe92a9a54fa555013af Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Tue, 22 May 2018 13:59:06 -0700
Subject: [PATCH] drm/i915: Support ro ppgtt mapped cmdparser shadow buffers
For Gen7, the original cmdparser motive was to permit limited
use of register read/write instructions in unprivileged BB's.
This worked by copying the user supplied bb to a kmd owned
bb, and running it in secure mode, from the ggtt, only if
the scanner finds no unsafe commands or registers.
For Gen8+ we can't use this same technique because running bb's
from the ggtt also disables access to ppgtt space. But we also
do not actually require 'secure' execution since we are only
trying to reduce the available command/register set. Instead we
will copy the user buffer to a kmd owned read-only bb in ppgtt,
and run in the usual non-secure mode.
Note that ro pages are only supported by ppgtt (not ggtt), but
luckily that's exactly what we need.
Add the required paths to map the shadow buffer to ppgtt ro for Gen8+
v2: IS_GEN7/IS_GEN (Mika)
v3: rebase
v4: rebase
v5: rebase
-------------------
From 2ac501479a1325d00aca5012887ebfece8358032 Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Wed, 1 Aug 2018 09:45:50 -0700
Subject: [PATCH] drm/i915: Allow parsing of unsized batches
In "drm/i915: Add support for mandatory cmdparsing" we introduced the
concept of mandatory parsing. This allows the cmdparser to be invoked
even when user passes batch_len=0 to the execbuf ioctl's.
However, the cmdparser needs to know the extents of the buffer being
scanned. Refactor the code to ensure the cmdparser uses the actual
object size, instead of the incoming length, if user passes 0.
-------------------
From 57c2c8f58ca07e8045f020e4e2548ac3bc3a5aab Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Mon, 23 Apr 2018 11:12:15 -0700
Subject: [PATCH] drm/i915: Add gen9 BCS cmdparsing
For gen9 we enable cmdparsing on the BCS ring, specifically
to catch inadvertent accesses to sensitive registers
Unlike gen7/hsw, we use the parser only to block certain
registers. We can rely on h/w to block restricted commands,
so the command tables only provide enough info to allow the
parser to delineate each command, and identify commands that
access registers.
Note: This patch deliberately ignores checkpatch issues in
favour of matching the style of the surrounding code. We'll
correct the entire file in one go in a later patch.
v3: rebase (Mika)
v4: Add RING_TIMESTAMP registers to whitelist (Jon)
-------------------
From d88d2d3fc6076760e903e78135f5bef028e6e813 Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Fri, 21 Sep 2018 13:18:09 -0700
Subject: [PATCH] drm/i915/cmdparser: Add support for backward jumps
To keep things manageable, the pre-gen9 cmdparser does not
attempt to track any form of nested BB_START's. This did not
prevent usermode from using nested starts, or even chained
batches because the cmdparser is not strictly enforced pre gen9.
Instead, the existence of a nested BB_START would cause the batch
to be emitted in insecure mode, and any privileged capabilities
would not be available.
For Gen9, the cmdparser becomes mandatory (for BCS at least), and
so not providing any form of nested BB_START support becomes
overly restrictive. Any such batch will simply not run.
We make heavy use of backward jumps in igt, and it is much easier
to add support for this restricted subset of nested jumps, than to
rewrite the whole of our test suite to avoid them.
Add the required logic to support limited backward jumps, to
instructions that have already been validated by the parser.
Note that it's not sufficient to simply approve any BB_START
that jumps backwards in the buffer because this would allow an
attacker to embed a rogue instruction sequence within the
operand words of a harmless instruction (say LRI) and jump to
that.
We introduce a bit array to track every instr offset successfully
validated, and test the target of BB_START against this. If the
target offset hits, it is re-written to the same offset in the
shadow buffer and the BB_START cmd is allowed.
Note: This patch deliberately ignores checkpatch issues in the
cmdtables, in order to match the style of the surrounding code.
We'll correct the entire file in one go in a later patch.
v2: set dispatch secure late (Mika)
v3: rebase (Mika)
v4: Clear whitelist on each parse
Minor review updates (Chris)
v5: Correct backward jump batching
v6: fix compilation error due to struct eb shuffle (Mika)
-------------------
From 362917ebcfacbd9c2b5172d5a5fe8cbef3ab838f Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield%intel.com@localhost>
Date: Thu, 20 Sep 2018 09:45:10 -0700
Subject: [PATCH] drm/i915/cmdparser: Ignore Length operands during command
 matching
Some of the gen instruction macros (e.g. MI_DISPLAY_FLIP) have the
length directly encoded in them. Since these are used directly in
the tables, the Length becomes part of the comparison used for
matching during parsing. Thus, if the cmd being parsed has a
different length to that in the table, it is not matched and the
cmd is accepted via the default variable length path.
Fix by masking out everything except the Opcode in the cmd tables
-------------------
From 1433b8d41b1aa346e100b839c19fc033871ac5a6 Mon Sep 17 00:00:00 2001
From: Uma Shankar <uma.shankar%intel.com@localhost>
Date: Tue, 7 Aug 2018 21:15:35 +0530
Subject: [PATCH] drm/i915: Lower RM timeout to avoid DSI hard hangs
In BXT/APL, device 2 MMIO reads from MIPI controller requires its PLL
to be turned ON. When MIPI PLL is turned off (MIPI Display is not
active or connected), and someone (host or GT engine) tries to read
MIPI registers, it causes hard hang. This is a hardware restriction
or limitation.
Driver by itself doesn't read MIPI registers when MIPI display is off.
But any userspace application can submit unprivileged batch buffer for
execution. In that batch buffer there can be mmio reads. And these
reads are allowed even for unprivileged applications. If these
register reads are for MIPI DSI controller and MIPI display is not
active during that time, then the MMIO read operation causes system
hard hang and only way to recover is hard reboot. A genuine
process/application won't submit batch buffer like this and doesn't
cause any issue. But on a compromised system, a malign userspace
process/app can generate such batch buffer and can trigger system
hard hang (denial of service attack).
The fix is to lower the internal MMIO timeout value to an optimum
value of 950us as recommended by hardware team. If the timeout is
beyond 1ms (which will hit for any value we choose if MMIO READ on a
DSI specific register is performed without PLL ON), it causes the
system hang. But if the timeout value is lower than it will be below
the threshold (even if timeout happens) and system will not get into
a hung state. This will avoid a system hang without losing any
programming or GT interrupts, taking the worst case of lowest CDCLK
frequency and early DC5 abort into account.
-------------------
From 284d38667f7ed7171fd8f168c42490f9087c824c Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak%intel.com@localhost>
Date: Mon, 9 Jul 2018 18:24:27 +0300
Subject: [PATCH] drm/i915/gen8+: Add RC6 CTX corruption WA
In some circumstances the RC6 context can get corrupted. We can detect
this and take the required action, that is disable RC6 and runtime PM.
The HW recovers from the corrupted state after a system suspend/resume
cycle, so detect the recovery and re-enable RC6 and runtime PM.
v2: rebase (Mika)
v3:
- Move intel_suspend_gt_powersave() to the end of the GEM suspend
  sequence.
- Add commit message.
v4:
- Rebased on intel_uncore_forcewake_put(i915->uncore, ...) API
  change.
v5: rebased on gem/gt split (Mika)
-------------------
From 6dd52bae8a01af77236b88917e84e84dbcfe06db Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben%decadent.org.uk@localhost>
Date: Mon, 11 Nov 2019 08:13:24 -0800
Subject: [PATCH] drm/i915/cmdparser: Fix jump whitelist clearing
When a jump_whitelist bitmap is reused, it needs to be cleared.
Currently this is done with memset() and the size calculation assumes
bitmaps are made of 32-bit words, not longs.  So on 64-bit
architectures, only the first half of the bitmap is cleared.
If some whitelist bits are carried over between successive batches
submitted on the same context, this will presumably allow embedding
the rogue instructions that we're trying to reject.
Use bitmap_zero() instead, which gets the calculation right.
Use the original linux function rather than my wrong translation.

 -

...Include the header to have it.
Thanks Riastradh!

Revision 1.28 / (download) - annotate - [select for diffs], Thu Dec 5 20:03:09 2019 UTC (22 months, 1 week ago) by maya
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored)

Add what appears to be the fixes to CVE-2019-0154, CVE-2019-0155.
This commit requires review, but I'd also like it to be tested by others
while it is being reviewed.

CVE-2019-0155:
It was discovered that the Intel i915 graphics chipsets allowed userspace
to modify page table entries via writes to MMIO from the Blitter Command
Streamer and expose kernel memory information. A local attacker could use
this to expose sensitive information or possibly elevate privileges.

CVE-2019-0154:
It was discovered that the Intel i915 graphics chipsets could cause
a system hang when userspace performed a read from GT memory mapped
input output (MMIO) when the product is in certain low power states.
A local attacker could use this to cause a denial of service.

From upstream commits to linux-4.4.y:

-------------------
From 6d0cfddc7afc715835f0e17827106f832b14dd2a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Thu, 12 Jul 2018 19:53:10 +0100
Subject: [PATCH] drm/i915/gtt: Add read only pages to gen8_pte_encode

We can set a bit inside the ppGTT PTE to indicate a page is read-only;
writes from the GPU will be discarded. We can use this to protect pages
and in particular support read-only userptr mappings (necessary for
importing PROT_READ vma).
-------------------
From 774b68aa2105c70b40c3b1777feb7ab500d716dd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Mon, 6 Aug 2018 14:10:48 -0700
Subject: [PATCH] drm/i915/gtt: Read-only pages for insert_entries on bdw+

Hook up the flags to allow read-only ppGTT mappings for gen8+

v2: Include a selftest to check that writes to a readonly PTE are
dropped
v3: Don't duplicate cpu_check() as we can just reuse it, and even worse
don't wholesale copy the theory-of-operation comment from igt_ctx_exec
without changing it to explain the intention behind the new test!
v4: Joonas really likes magic mystery values
-------------------
From 3fd1c2e65c60c1c513155e1d1d74138b141aa8a3 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu, 12 Jul 2018 19:53:12 +0100
Subject: [PATCH] drm/i915/gtt: Disable read-only support under GVT

GVT is not propagating the PTE bits, and is always setting the
read-write bit, thus breaking read-only support.
-------------------
From e5e3c0154c19f2d8213e0af88b7a10d9de7fbafd Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Fri, 20 Apr 2018 14:26:01 -0700
Subject: [PATCH] drm/i915: Rename gen7 cmdparser tables

We're about to introduce some new tables for later gens, and the
current naming for the gen7 tables will no longer make sense.

v2: rebase
-------------------
From 3122671a5df3ee13f5cf22b7bdacf422b7b4319a Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Fri, 8 Jun 2018 08:53:46 -0700
Subject: [PATCH] drm/i915: Disable Secure Batches for gen6+

Retroactively stop reporting support for secure batches
through the api for gen6+ so that older binaries trigger
the fallback path instead.

Older binaries use secure batches pre gen6 to access resources
that are not available to normal usermode processes. However,
all known userspace explicitly checks for HAS_SECURE_BATCHES
before relying on the secure batch feature.

Since there are no known binaries relying on this for newer gens
we can kill secure batches from gen6, via I915_PARAM_HAS_SECURE_BATCHES.

v2: rebase (Mika)
v3: rebase (Mika)
-------------------
From 544fd7d9d4cfe32357beab2f1dc543637d42e69f Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Fri, 8 Jun 2018 10:05:26 -0700
Subject: [PATCH] drm/i915: Remove Master tables from cmdparser

The previous patch has killed support for secure batches
on gen6+, and hence the cmdparsers master tables are
now dead code. Remove them.
-------------------
From 17e89f38212d8b3cba470efca91b997ac03c592c Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Wed, 1 Aug 2018 09:33:59 -0700
Subject: [PATCH] drm/i915: Add support for mandatory cmdparsing

The existing cmdparser for gen7 can be bypassed by specifying
batch_len=0 in the execbuf call. This is safe because bypassing
simply reduces the cmd-set available.

In a later patch we will introduce cmdparsing for gen9, as a
security measure, which must be strictly enforced since without
it we are vulnerable to DoS attacks.

Introduce the concept of 'required' cmd parsing that cannot be
bypassed by submitting zero-length bb's.

v2: rebase (Mika)
v2: rebase (Mika)
v3: fix conflict on engine flags (Mika)
-------------------
From 77524398bccea3592a25cbe92a9a54fa555013af Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Tue, 22 May 2018 13:59:06 -0700
Subject: [PATCH] drm/i915: Support ro ppgtt mapped cmdparser shadow buffers

For Gen7, the original cmdparser motive was to permit limited
use of register read/write instructions in unprivileged BB's.
This worked by copying the user supplied bb to a kmd owned
bb, and running it in secure mode, from the ggtt, only if
the scanner finds no unsafe commands or registers.

For Gen8+ we can't use this same technique because running bb's
from the ggtt also disables access to ppgtt space. But we also
do not actually require 'secure' execution since we are only
trying to reduce the available command/register set. Instead we
will copy the user buffer to a kmd owned read-only bb in ppgtt,
and run in the usual non-secure mode.

Note that ro pages are only supported by ppgtt (not ggtt), but
luckily that's exactly what we need.

Add the required paths to map the shadow buffer to ppgtt ro for Gen8+

v2: IS_GEN7/IS_GEN (Mika)
v3: rebase
v4: rebase
v5: rebase
-------------------
From 2ac501479a1325d00aca5012887ebfece8358032 Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Wed, 1 Aug 2018 09:45:50 -0700
Subject: [PATCH] drm/i915: Allow parsing of unsized batches

In "drm/i915: Add support for mandatory cmdparsing" we introduced the
concept of mandatory parsing. This allows the cmdparser to be invoked
even when user passes batch_len=0 to the execbuf ioctl's.

However, the cmdparser needs to know the extents of the buffer being
scanned. Refactor the code to ensure the cmdparser uses the actual
object size, instead of the incoming length, if user passes 0.
-------------------
From 57c2c8f58ca07e8045f020e4e2548ac3bc3a5aab Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Mon, 23 Apr 2018 11:12:15 -0700
Subject: [PATCH] drm/i915: Add gen9 BCS cmdparsing

For gen9 we enable cmdparsing on the BCS ring, specifically
to catch inadvertent accesses to sensitive registers

Unlike gen7/hsw, we use the parser only to block certain
registers. We can rely on h/w to block restricted commands,
so the command tables only provide enough info to allow the
parser to delineate each command, and identify commands that
access registers.

Note: This patch deliberately ignores checkpatch issues in
favour of matching the style of the surrounding code. We'll
correct the entire file in one go in a later patch.

v3: rebase (Mika)
v4: Add RING_TIMESTAMP registers to whitelist (Jon)
-------------------
From d88d2d3fc6076760e903e78135f5bef028e6e813 Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Fri, 21 Sep 2018 13:18:09 -0700
Subject: [PATCH] drm/i915/cmdparser: Add support for backward jumps

To keep things manageable, the pre-gen9 cmdparser does not
attempt to track any form of nested BB_START's. This did not
prevent usermode from using nested starts, or even chained
batches because the cmdparser is not strictly enforced pre gen9.

Instead, the existence of a nested BB_START would cause the batch
to be emitted in insecure mode, and any privileged capabilities
would not be available.

For Gen9, the cmdparser becomes mandatory (for BCS at least), and
so not providing any form of nested BB_START support becomes
overly restrictive. Any such batch will simply not run.

We make heavy use of backward jumps in igt, and it is much easier
to add support for this restricted subset of nested jumps, than to
rewrite the whole of our test suite to avoid them.

Add the required logic to support limited backward jumps, to
instructions that have already been validated by the parser.

Note that it's not sufficient to simply approve any BB_START
that jumps backwards in the buffer because this would allow an
attacker to embed a rogue instruction sequence within the
operand words of a harmless instruction (say LRI) and jump to
that.

We introduce a bit array to track every instr offset successfully
validated, and test the target of BB_START against this. If the
target offset hits, it is re-written to the same offset in the
shadow buffer and the BB_START cmd is allowed.

Note: This patch deliberately ignores checkpatch issues in the
cmdtables, in order to match the style of the surrounding code.
We'll correct the entire file in one go in a later patch.

v2: set dispatch secure late (Mika)
v3: rebase (Mika)
v4: Clear whitelist on each parse
Minor review updates (Chris)
v5: Correct backward jump batching
v6: fix compilation error due to struct eb shuffle (Mika)
-------------------
From 362917ebcfacbd9c2b5172d5a5fe8cbef3ab838f Mon Sep 17 00:00:00 2001
From: Jon Bloomfield <jon.bloomfield@intel.com>
Date: Thu, 20 Sep 2018 09:45:10 -0700
Subject: [PATCH] drm/i915/cmdparser: Ignore Length operands during command
 matching

Some of the gen instruction macros (e.g. MI_DISPLAY_FLIP) have the
length directly encoded in them. Since these are used directly in
the tables, the Length becomes part of the comparison used for
matching during parsing. Thus, if the cmd being parsed has a
different length to that in the table, it is not matched and the
cmd is accepted via the default variable length path.

Fix by masking out everything except the Opcode in the cmd tables
-------------------
From 1433b8d41b1aa346e100b839c19fc033871ac5a6 Mon Sep 17 00:00:00 2001
From: Uma Shankar <uma.shankar@intel.com>
Date: Tue, 7 Aug 2018 21:15:35 +0530
Subject: [PATCH] drm/i915: Lower RM timeout to avoid DSI hard hangs

In BXT/APL, device 2 MMIO reads from MIPI controller requires its PLL
to be turned ON. When MIPI PLL is turned off (MIPI Display is not
active or connected), and someone (host or GT engine) tries to read
MIPI registers, it causes hard hang. This is a hardware restriction
or limitation.

Driver by itself doesn't read MIPI registers when MIPI display is off.
But any userspace application can submit unprivileged batch buffer for
execution. In that batch buffer there can be mmio reads. And these
reads are allowed even for unprivileged applications. If these
register reads are for MIPI DSI controller and MIPI display is not
active during that time, then the MMIO read operation causes system
hard hang and only way to recover is hard reboot. A genuine
process/application won't submit batch buffer like this and doesn't
cause any issue. But on a compromised system, a malign userspace
process/app can generate such batch buffer and can trigger system
hard hang (denial of service attack).

The fix is to lower the internal MMIO timeout value to an optimum
value of 950us as recommended by hardware team. If the timeout is
beyond 1ms (which will hit for any value we choose if MMIO READ on a
DSI specific register is performed without PLL ON), it causes the
system hang. But if the timeout value is lower than it will be below
the threshold (even if timeout happens) and system will not get into
a hung state. This will avoid a system hang without losing any
programming or GT interrupts, taking the worst case of lowest CDCLK
frequency and early DC5 abort into account.
-------------------
From 284d38667f7ed7171fd8f168c42490f9087c824c Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@intel.com>
Date: Mon, 9 Jul 2018 18:24:27 +0300
Subject: [PATCH] drm/i915/gen8+: Add RC6 CTX corruption WA

In some circumstances the RC6 context can get corrupted. We can detect
this and take the required action, that is disable RC6 and runtime PM.
The HW recovers from the corrupted state after a system suspend/resume
cycle, so detect the recovery and re-enable RC6 and runtime PM.

v2: rebase (Mika)
v3:
- Move intel_suspend_gt_powersave() to the end of the GEM suspend
  sequence.
- Add commit message.
v4:
- Rebased on intel_uncore_forcewake_put(i915->uncore, ...) API
  change.
v5: rebased on gem/gt split (Mika)
-------------------
From 6dd52bae8a01af77236b88917e84e84dbcfe06db Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 11 Nov 2019 08:13:24 -0800
Subject: [PATCH] drm/i915/cmdparser: Fix jump whitelist clearing

When a jump_whitelist bitmap is reused, it needs to be cleared.
Currently this is done with memset() and the size calculation assumes
bitmaps are made of 32-bit words, not longs.  So on 64-bit
architectures, only the first half of the bitmap is cleared.

If some whitelist bits are carried over between successive batches
submitted on the same context, this will presumably allow embedding
the rogue instructions that we're trying to reject.

Use bitmap_zero() instead, which gets the calculation right.

Revision 1.18.18.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:08:05 2019 UTC (2 years, 4 months ago) by christos
Branch: phil-wifi
Changes since 1.18: +584 -1277 lines
Diff to previous 1.18 (colored)

Sync with HEAD

Revision 1.18.16.2 / (download) - annotate - [select for diffs], Sun Sep 30 01:45:53 2018 UTC (3 years ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.18.16.1: +5 -4 lines
Diff to previous 1.18.16.1 (colored) to branchpoint 1.18 (colored) next main 1.19 (colored)

Ssync with HEAD

Revision 1.27 / (download) - annotate - [select for diffs], Fri Sep 21 11:49:16 2018 UTC (3 years ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, netbsd-9-base, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Avoid stack protector violation

'const int' is not a real constant in C and it cannot be used to define an
array with a number of elements, as it's turned into a variable length
array.

Triggered by GCC when building with more debug options.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Sep 13 08:25:55 2018 UTC (3 years, 1 month ago) by mrg
Branch: MAIN
Changes since 1.25: +4 -3 lines
Diff to previous 1.25 (colored)

add support for kabylake and skylake GT4 (untested) GPUs.
largely taken from openbsd and linux 4.13 trees (which
have this code identical), with mimimal porting to netbsd.

i have not installed (and thus tested) the newer referenced
firmware files.

only real local change is to fix IS_BROXTON() macro to check
the things valid in this era of drm.  previous match would
attach on KBL, and then a loop would never exit.

tested on kabylake P630.  needs mesa 11.x or newer for GL
to work.

ok @riastradh.

Revision 1.18.16.1 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:16 2018 UTC (3 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.18: +583 -1277 lines
Diff to previous 1.18 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.25 / (download) - annotate - [select for diffs], Tue Aug 28 03:41:38 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.24: +4 -0 lines
Diff to previous 1.24 (colored)

Rework PCI and AGP conditionalization.

- Push drm_pci_set_unique into driver callback.
- Eliminate drm_pci_set_unique_hook.
- Gather all drm_agp_* functions into struct drm_agp_hooks.
- Replace the nonsensical old atomic garbage by serious locking.
- Make drm_agpsupport.c its own module.
- Eliminate NDRMKMS_PCI.
- Use NAGP from "agp.h" only in drm_module.c for horrible hack.
  => See comment in file for rationale.
- Always define CONFIG_PCI=1 and CONFIG_AGP=1.
- Always go through the drm_agp_* function hooks.
- Ifdef out nouveau agp stuff that doesn't go through drm_agp_*
  for reasons that I'm too frustrated to figure out tonight.
- pci_iomap no longer automagically does agp_i810_borrow.
  => Use drm_agp_borrow instead.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Aug 27 14:47:02 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.23: +3 -0 lines
Diff to previous 1.23 (colored)

Work around ioctl ABI mistake in i915 drm.

A flags argument was added to the I915_GEM_MMAP ioctl.  The version
of xf86-video-intel we imported was compiled to use the new ioctl
structure including the flags argument, but without initializing the
flags argument, so it would be userland stack garbage causing
i915_gem_mmap_ioctl to fail.

Newer xf86-video-intel will query the mmap version first before
trying to use either the older ioctl structure, with the original
shorter argument and thus no stack garbage (which will be padded with
to the full length in the kernel by drm_ioctl), or the newer ioctl
structure, with the argument initialized.

libdrm does not appear to be affected by this -- it zeroes the longer
structure before passing it in.

Patch from mrg@, diagnosis and explanation by me.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 27 13:43:39 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.22: +0 -2 lines
Diff to previous 1.22 (colored)

Fold local intel_uncore_destroy into upstream intel_uncore_fini.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Aug 27 07:18:18 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.21: +0 -4 lines
Diff to previous 1.21 (colored)

Add some shrinker and oom notifier stubs.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Aug 27 07:04:11 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

tyop

Revision 1.20 / (download) - annotate - [select for diffs], Mon Aug 27 06:19:05 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.19: +4 -0 lines
Diff to previous 1.19 (colored)

provide pr_notice
avoid needing unregister_oom_notifier
use intel_register_dsm_handler(dev), as older drm does
provide dummy async_schedule
provide atomic_or
match side-loading


Author: coypu <coypu@sdf.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>

Revision 1.19 / (download) - annotate - [select for diffs], Mon Aug 27 04:58:23 2018 UTC (3 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.18: +571 -1270 lines
Diff to previous 1.18 (colored)

merge linux-drm-v4-4-143

Revision 1.1.1.3 / (download) - annotate - [select for diffs] (vendor branch), Mon Aug 27 01:34:53 2018 UTC (3 years, 1 month ago) by riastradh
Branch: LINUX
CVS Tags: linux-drm-v4-4-143
Changes since 1.1.1.2: +552 -1206 lines
Diff to previous 1.1.1.2 (colored)

Import drm from Linux v4.4.143 (commit a8ea6276d00555387deaaa5eaeb380cd5c17bdc9).

   drivers/gpu/drm      -> sys/external/bsd/drm2/dist/drm
   include/drm          -> sys/external/bsd/drm2/dist/include/drm
   include/uapi/drm     -> sys/external/bsd/drm2/dist/uapi/drm

GPL sources excluded.

Revision 1.10.4.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:52 2017 UTC (3 years, 10 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.10.4.2: +23 -7 lines
Diff to previous 1.10.4.2 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored)

update from HEAD

Revision 1.10.2.5 / (download) - annotate - [select for diffs], Thu Feb 11 23:23:11 2016 UTC (5 years, 8 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.10.2.4: +4 -4 lines
Diff to previous 1.10.2.4 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1091):
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revisions 1.17, 1.18
Zero out the guard for bus_space_unmap before calling i915_dma_cleanup() which
calls i915_free_hws(), which then tries to unmap. Perhaps this fixes PR/50060.
--
fix the same bug on the linux side, print the error, and return the -tive
error to mimick linux.

Revision 1.12.2.2 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:00 2015 UTC (5 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.12.2.1: +4 -4 lines
Diff to previous 1.12.2.1 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 10 19:35:15 2015 UTC (6 years ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-base, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

fix the same bug on the linux side, print the error, and return the -tive
error to mimick linux.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 10 19:29:44 2015 UTC (6 years ago) by christos
Branch: MAIN
Changes since 1.16: +1 -1 lines
Diff to previous 1.16 (colored)

Zero out the guard for bus_space_unmap before calling i915_dma_cleanup() which
calls i915_free_hws(), which then tries to unmap. Perhaps this fixes PR/50060.

Revision 1.10.2.4 / (download) - annotate - [select for diffs], Thu Apr 23 07:31:17 2015 UTC (6 years, 5 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Changes since 1.10.2.3: +7 -0 lines
Diff to previous 1.10.2.3 (colored) to branchpoint 1.10 (colored)

Pull up following revision(s) (requested by mrg in ticket #718):
	sys/arch/x86/include/pmap.h: revision 1.56
	sys/arch/x86/x86/pmap.c: revision 1.188
	sys/dev/pci/agp_amd64.c: revision 1.8
	sys/dev/pci/agp_i810.c: revision 1.118
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
	sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
	sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
	sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
	sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
	sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
	sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
	sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
	sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
	sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated.  (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support.  it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect.  Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub.  Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started.  my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized.  PR 49833

Revision 1.12.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:15 2015 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.12: +14 -2 lines
Diff to previous 1.12 (colored)

Sync with HEAD

Revision 1.16 / (download) - annotate - [select for diffs], Fri Apr 3 01:06:05 2015 UTC (6 years, 6 months ago) by riastradh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.15: +7 -0 lines
Diff to previous 1.15 (colored)

Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html

Revision 1.10.2.3 / (download) - annotate - [select for diffs], Fri Mar 6 21:39:08 2015 UTC (6 years, 7 months ago) by snj
Branch: netbsd-7
Changes since 1.10.2.2: +7 -2 lines
Diff to previous 1.10.2.2 (colored) to branchpoint 1.10 (colored)

Pull up following revision(s) (requested by mrg in ticket #573):
	sys/external/bsd/common/include/linux/kernel.h: 1.5, 1.6
	sys/external/bsd/drm2/dist/drm/drm_ioctl.c: 1.4
	sys/external/bsd/drm2/dist/drm/drm_irq.c: 1.6-1.8
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: 1.13-1.15
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.23-1.27
	sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c: 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_display.c: 1.14, 1.15
	sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: 1.10
	sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: 1.8
	sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c: 1.8-1.13
	sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: 1.6
	sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c: 1.5, 1.6
	sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c: 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nvc0.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/device.h: 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/mc.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/pwr.h: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/os.h: 1.4, 1.5
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_base.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bios/nouveau_subdev_bios_pll.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_base.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/fbmem.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/devinit/nouveau_subdev_devinit_nv04.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nv50.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nouveau_subdev_fb_nvc0.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nv50.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/fb/nvc0.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mc/nouveau_subdev_mc_base.c: 1.2, 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/mxm/nouveau_subdev_mxm_nv50.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/pwr/nouveau_subdev_pwr_base.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/therm/nouveau_subdev_therm_ic.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/timer/nouveau_subdev_timer_nv04.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_base.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv04.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nouveau_subdev_vm_nv44.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/vm/nv04.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h: 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c: 1.4, 1.5
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c: 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: 1.3
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.h: 1.2
	sys/external/bsd/drm2/dist/drm/nouveau/nouveau_vga.h: 1.2
	sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c: 1.6-1.8
	sys/external/bsd/drm2/dist/drm/radeon/radeon_pm.c: 1.3
	sys/external/bsd/drm2/dist/drm/radeon/rs400.c: 1.3
	sys/external/bsd/drm2/dist/drm/via/via_dmablit.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/via/via_drv.h: 1.3
	sys/external/bsd/drm2/dist/drm/via/via_irq.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/drm/via/via_video.c: 1.3, 1.4
	sys/external/bsd/drm2/dist/include/drm/drmP.h: 1.10
	sys/external/bsd/drm2/dist/include/drm/drm_crtc.h: 1.4
	sys/external/bsd/drm2/dist/include/drm/drm_modes.h: 1.3
	sys/external/bsd/drm2/dist/uapi/drm/i915_drm.h: 1.2
	sys/external/bsd/drm2/drm/drm_cache.c: 1.4-1.6
	sys/external/bsd/drm2/drm/drm_drv.c: 1.14
	sys/external/bsd/drm2/drm/drm_module.c: 1.10
	sys/external/bsd/drm2/drm/drm_sysctl.c: 1.5
	sys/external/bsd/drm2/drm/drm_vma_manager.c: 1.2
	sys/external/bsd/drm2/drm/drmfb.c: 1.1
	sys/external/bsd/drm2/drm/files.drmkms: 1.10, 1.11
	sys/external/bsd/drm2/i2c/drm_encoder_slave.c: 1.1
	sys/external/bsd/drm2/i915drm/files.i915drmkms: 1.7, 1.10
	sys/external/bsd/drm2/i915drm/intelfb.c: 1.11, 1.12
	sys/external/bsd/drm2/include/asm/io.h: 1.4
	sys/external/bsd/drm2/include/asm/unaligned.h: 1.2, 1.3
	sys/external/bsd/drm2/include/drm/drm_encoder_slave.h: 1.1
	sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: 1.7-1.11
	sys/external/bsd/drm2/include/drm/drmfb.h: 1.1
	sys/external/bsd/drm2/include/drm/drmfb_pci.h: 1.1, 1.2
	sys/external/bsd/drm2/include/linux/bitops.h: 1.9
	sys/external/bsd/drm2/include/linux/i2c.h: 1.7, 1.8
	sys/external/bsd/drm2/include/linux/io-mapping.h: 1.5
	sys/external/bsd/drm2/include/linux/moduleparam.h: 1.5
	sys/external/bsd/drm2/include/linux/pci.h: 1.12-1.15
	sys/external/bsd/drm2/include/linux/pm.h: 1.4
	sys/external/bsd/drm2/include/linux/reboot.h: 1.2
	sys/external/bsd/drm2/include/linux/slab.h: 1.5
	sys/external/bsd/drm2/include/linux/string.h: 1.4
	sys/external/bsd/drm2/include/linux/vgaarb.h: 1.3
	sys/external/bsd/drm2/include/linux/ww_mutex.h: 1.10
	sys/external/bsd/drm2/linux/files.drmkms_linux: 1.8
	sys/external/bsd/drm2/linux/linux_i2c.c: 1.3
	sys/external/bsd/drm2/linux/linux_ww_mutex.c: 1.1
	sys/external/bsd/drm2/nouveau/files.nouveau: 1.5-1.8
	sys/external/bsd/drm2/nouveau/nouveau_pci.c: 1.1-1.3
	sys/external/bsd/drm2/nouveau/nouveau_pci.h: 1.1
	sys/external/bsd/drm2/nouveau/nouveau_sysfs.c: 1.1
	sys/external/bsd/drm2/nouveau/nouveau_vga.c: 1.1
	sys/external/bsd/drm2/nouveau/nouveaufb.c: 1.1
	sys/external/bsd/drm2/nouveau/nouveaufb.h: 1.1
	sys/external/bsd/drm2/pci/drm_pci.c: 1.10-1.12
	sys/external/bsd/drm2/pci/drm_pci_module.c: 1.4
	sys/external/bsd/drm2/pci/drmfb_pci.c: 1.1-1.3
	sys/external/bsd/drm2/pci/files.drmkms_pci: 1.5
	sys/external/bsd/drm2/radeon/radeon_pci.c: 1.5-1.7
	sys/modules/drmkms/Makefile: 1.8, 1.9
	sys/modules/drmkms_linux/Makefile: 1.6
	sys/modules/drmkms_pci/Makefile: 1.5
sync drm2 with HEAD.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 28 18:25:39 2015 UTC (6 years, 7 months ago) by riastradh
Branch: MAIN
Changes since 1.14: +1 -8 lines
Diff to previous 1.14 (colored)

New macro DRM_SPIN_WAIT_ON better reflects DRM_WAIT_ON.

We still need to adapt all waits from upstream to use an interlock,
so we can't implement DRM_WAIT_ON verbatim, but this more closely
reflects the API of DRM_WAIT_ON than DRM_*WAIT*_UNTIL do.

Major difference is that this polls every tick, like DRM_WAIT_ON,
unlike DRM_*WAIT*_UNTIL.  So it will mask missing wakeups, but it
wouldn't surprise me if there were such things upstream.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 28 03:06:46 2015 UTC (6 years, 7 months ago) by riastradh
Branch: MAIN
Changes since 1.13: +6 -0 lines
Diff to previous 1.13 (colored)

And another timeout return value mistake.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 25 13:06:13 2015 UTC (6 years, 7 months ago) by riastradh
Branch: MAIN
Changes since 1.12: +6 -0 lines
Diff to previous 1.12 (colored)

Initialize mchdev_lock earlier.  Fixes i915drmkms boot on Ironlake.

Derived from a patch sent to me by degroote@ longer ago than I care
to admit.

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Tue Nov 11 09:06:32 2014 UTC (6 years, 11 months ago) by martin
Branch: netbsd-7
Changes since 1.10.2.1: +4 -0 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored)

Pull up following revision(s) (requested by nonaka in ticket #197):
	sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.10
	sys/external/bsd/drm2/include/linux/pci.h: revision 1.10
	sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c: revision 1.7
	sys/external/bsd/drm2/include/linux/acpi.h: revision 1.3
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.12
	sys/external/bsd/drm2/i915drm/files.i915drmkms: revision 1.8
i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X
(Clevo W330SU2).
Fix compilation (debug)
pci_attach_args of pci_find_device and match function is not the same thing.
fix PR/49372.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Mon Nov 10 19:45:54 2014 UTC (6 years, 11 months ago) by martin
Branch: netbsd-7
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored)

Pull up following revision(s) (requested by snj in ticket #191):
	sys/external/bsd/drm2/include/linux/io-mapping.h: revision 1.4
	sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_panel.c: revision 1.5
	sys/external/bsd/drm2/dist/uapi/drm/drm.h: revision 1.6
	sys/external/bsd/drm2/dist/drm/i915/intel_drv.h: revision 1.7
	sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.7
	sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: revision 1.8
	sys/external/bsd/drm2/dist/drm/i915/i915_ums.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.9
	sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c: revision 1.4
	sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c: revision 1.3
	sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.11
	sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.12
	sys/external/bsd/drm2/include/asm/processor.h: revision 1.3
	sys/external/bsd/drm2/dist/drm/i915/intel_crt.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/intel_tv.c: revision 1.5
	sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.11
	sys/external/bsd/drm2/dist/drm/i915/i915_irq.c: revision 1.10
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.16
	sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.17
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.6
	sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.7
	sys/external/bsd/drm2/drm/drm_module.c: revision 1.8
	sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/i915/intel_dsi_cmd.c: revision 1.2
	sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.10
	sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c: revision 1.2
	sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c: revision 1.6
	sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c: revision 1.6
Code cleanup and minor bugfixes for drm2.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Nov 5 23:46:09 2014 UTC (6 years, 11 months ago) by nonaka
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.11: +4 -0 lines
Diff to previous 1.11 (colored)

i915drmkms(4): Enable CONFIG_ACPI if NACPICA > 0.
Now brightness can be adjusted via hotkey on Mouse Computer LB-J300X (Clevo W330SU2).

Revision 1.11 / (download) - annotate - [select for diffs], Sun Sep 7 23:03:11 2014 UTC (7 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored)

Change enum pipe to enum i915_pipe
(enum pipe uses too global of a tag and conflicts with struct pipe).

Revision 1.10.4.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:09 2014 UTC (7 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.10.4.1: +2124 -0 lines
Diff to previous 1.10.4.1 (colored) to branchpoint 1.10 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:29 2014 UTC (7 years, 2 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.4: +419 -341 lines
Diff to previous 1.4 (colored) next main 1.5 (colored)

Rebase.

Revision 1.10.4.1, Wed Jul 16 23:25:18 2014 UTC (7 years, 3 months ago) by tls
Branch: tls-maxphys
Changes since 1.10: +0 -2124 lines
FILE REMOVED

file i915_dma.c was added on branch tls-maxphys on 2014-08-20 00:04:09 +0000

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jul 16 23:25:18 2014 UTC (7 years, 3 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: tls-maxphys, netbsd-7
Changes since 1.9: +2 -0 lines
Diff to previous 1.9 (colored)

Get suspend/resume sorta working for i915drm.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 16 20:56:24 2014 UTC (7 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.8: +31 -70 lines
Diff to previous 1.8 (colored)

Make it build and boot on my test machines.

Screen blanks on boot on the Ivy Bridge system with

   DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK.  Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 16 20:03:56 2014 UTC (7 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.7: +404 -293 lines
Diff to previous 1.7 (colored)

fix merge conflicts

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Wed Jul 16 19:35:25 2014 UTC (7 years, 3 months ago) by riastradh
Branch: LINUX
CVS Tags: linux-3-15-drm-bsd
Changes since 1.1.1.1: +355 -236 lines
Diff to previous 1.1.1.1 (colored)

Import drm from Linux 3.15 (commitid 1860e379875dfe7271c649058aeddffe5afd9d0d).

   drivers/gpu/drm      -> sys/external/bsd/drm2/dist/drm
   include/drm          -> sys/external/bsd/drm2/dist/include/drm
   include/uapi/drm     -> sys/external/bsd/drm2/dist/uapi/drm

GPL sources excluded.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 6 15:47:36 2014 UTC (7 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.6: +3 -0 lines
Diff to previous 1.6 (colored)

Call teardown_timer in i915_driver_unload.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jun 12 19:11:51 2014 UTC (7 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.5: +1 -0 lines
Diff to previous 1.5 (colored)

Mark another place in i915drmkms where paddr constraints are set.

Revision 1.5.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:40:53 2014 UTC (7 years, 4 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.5.2.1: +2046 -0 lines
Diff to previous 1.5.2.1 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.1.1.1.4.3 / (download) - annotate - [select for diffs], Sun May 18 17:46:00 2014 UTC (7 years, 5 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.1.1.1.4.2: +174 -2 lines
Diff to previous 1.1.1.1.4.2 (colored) to branchpoint 1.1.1.1 (colored) next main 1.1.1.2 (colored)

sync with head

Revision 1.5.2.1, Sat Apr 26 20:26:26 2014 UTC (7 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.5: +0 -2046 lines
FILE REMOVED

file i915_dma.c was added on branch yamt-pagecache on 2014-05-22 11:40:53 +0000

Revision 1.5 / (download) - annotate - [select for diffs], Sat Apr 26 20:26:26 2014 UTC (7 years, 5 months ago) by riastradh
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Branch point for: yamt-pagecache
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Convert pending_flip_lock to spin lock -- interrupt handlers take it.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Apr 4 15:16:29 2014 UTC (7 years, 6 months ago) by riastradh
Branch: MAIN
Branch point for: tls-earlyentropy
Changes since 1.3: +0 -2 lines
Diff to previous 1.3 (colored)

Don't ifdef out unmapping of the GTT on NetBSD.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Mar 18 21:36:52 2014 UTC (7 years, 7 months ago) by riastradh
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

Fix unused variable warnings in drm2.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Mar 18 18:20:42 2014 UTC (7 years, 7 months ago) by riastradh
Branch: MAIN
Changes since 1.1: +173 -1 lines
Diff to previous 1.1 (colored)

Merge riastradh-drm2 to HEAD.

Revision 1.1.1.1.2.35 / (download) - annotate - [select for diffs], Wed Jan 15 13:53:32 2014 UTC (7 years, 9 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.34: +5 -1 lines
Diff to previous 1.1.1.1.2.34 (colored) to branchpoint 1.1.1.1 (colored) next main 1.1.1.2 (colored)

Use dev_priv->irq_lock for ring->irq_queue, not dev->struct_mutex.

We need to use a spin lock here, because we need to exclude interrupt
handlers.

Revision 1.1.1.1.2.34 / (download) - annotate - [select for diffs], Mon Dec 30 04:52:02 2013 UTC (7 years, 9 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.33: +0 -11 lines
Diff to previous 1.1.1.1.2.33 (colored) to branchpoint 1.1.1.1 (colored)

flush_workqueue should work now, so don't work around it i915 unload.

Revision 1.1.1.1.2.33 / (download) - annotate - [select for diffs], Mon Dec 30 04:51:53 2013 UTC (7 years, 9 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.32: +0 -1 lines
Diff to previous 1.1.1.1.2.32 (colored) to branchpoint 1.1.1.1 (colored)

i915_gem_context_close destroys the idr; i915_driver_postclose needn't.

Revision 1.1.1.1.2.32 / (download) - annotate - [select for diffs], Mon Dec 30 04:51:35 2013 UTC (7 years, 9 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.31: +2 -0 lines
Diff to previous 1.1.1.1.2.31 (colored) to branchpoint 1.1.1.1 (colored)

Initialize and destroy the pending flip lock.

Revision 1.1.1.1.2.31 / (download) - annotate - [select for diffs], Sun Sep 8 16:28:27 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.30: +3 -2 lines
Diff to previous 1.1.1.1.2.30 (colored) to branchpoint 1.1.1.1 (colored)

Still more error branch cleanup.

Revision 1.1.1.1.2.30 / (download) - annotate - [select for diffs], Sun Sep 8 16:27:15 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.29: +0 -8 lines
Diff to previous 1.1.1.1.2.29 (colored) to branchpoint 1.1.1.1 (colored)

Hook up some GTT logic again in i915_driver_load.

Revision 1.1.1.1.2.29 / (download) - annotate - [select for diffs], Sun Sep 8 16:22:29 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.28: +14 -16 lines
Diff to previous 1.1.1.1.2.28 (colored) to branchpoint 1.1.1.1 (colored)

Use the cached mmio bar information to map the GTT.

Revision 1.1.1.1.2.28 / (download) - annotate - [select for diffs], Sun Sep 8 16:03:21 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.27: +1 -1 lines
Diff to previous 1.1.1.1.2.27 (colored) to branchpoint 1.1.1.1 (colored)

Use dev->struct_mutex, not drm_global_mutex, for ring->irq_queue.

Revision 1.1.1.1.2.27 / (download) - annotate - [select for diffs], Sun Sep 8 16:01:22 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.26: +8 -0 lines
Diff to previous 1.1.1.1.2.26 (colored) to branchpoint 1.1.1.1 (colored)

More little error branch cleanup.

Revision 1.1.1.1.2.26 / (download) - annotate - [select for diffs], Sun Sep 8 16:00:22 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.25: +8 -1 lines
Diff to previous 1.1.1.1.2.25 (colored) to branchpoint 1.1.1.1 (colored)

Fix a bunch of i915 error branches.

Some of these fixes are necessary only on NetBSD because we require
mutex_destroy, while Linux doesn't.

Revision 1.1.1.1.2.25 / (download) - annotate - [select for diffs], Sun Sep 8 15:54:20 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.24: +0 -15 lines
Diff to previous 1.1.1.1.2.24 (colored) to branchpoint 1.1.1.1 (colored)

Adapt the Intel ringbuffer code to NetBSD.

Revision 1.1.1.1.2.24 / (download) - annotate - [select for diffs], Sun Sep 8 15:34:06 2013 UTC (8 years, 1 month ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.23: +5 -0 lines
Diff to previous 1.1.1.1.2.23 (colored) to branchpoint 1.1.1.1 (colored)

Destroy context_idr and mm.lock in i915_driver_postclose.

Revision 1.1.1.1.4.2 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:33 2013 UTC (8 years, 1 month ago) by rmind
Branch: rmind-smpnet
Changes since 1.1.1.1.4.1: +1874 -0 lines
Diff to previous 1.1.1.1.4.1 (colored) to branchpoint 1.1.1.1 (colored)

sync with head

Revision 1.1.1.1.2.23 / (download) - annotate - [select for diffs], Wed Jul 24 04:05:34 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.22: +1 -1 lines
Diff to previous 1.1.1.1.2.22 (colored) to branchpoint 1.1.1.1 (colored)

Use PCI_BAR(m), not PCI_MAPREG_START + m, which is wrong.

Revision 1.1.1.1.2.22 / (download) - annotate - [select for diffs], Wed Jul 24 04:05:18 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.21: +0 -2 lines
Diff to previous 1.1.1.1.2.21 (colored) to branchpoint 1.1.1.1 (colored)

Don't cancel rps.work or hotplug_work in i915_driver_unload.

These are cancelled in intel_modeset_cleanup.

Revision 1.1.1.1.2.21 / (download) - annotate - [select for diffs], Wed Jul 24 04:04:16 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.20: +8 -0 lines
Diff to previous 1.1.1.1.2.20 (colored) to branchpoint 1.1.1.1 (colored)

Destroy locks in i915_driver_unload.

Revision 1.1.1.1.2.20 / (download) - annotate - [select for diffs], Wed Jul 24 04:04:01 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.19: +2 -0 lines
Diff to previous 1.1.1.1.2.19 (colored) to branchpoint 1.1.1.1 (colored)

Ifdef out gtt unmapping for now in i915_driver_unload.

Revision 1.1.1.1.2.19 / (download) - annotate - [select for diffs], Wed Jul 24 04:02:28 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.18: +0 -2 lines
Diff to previous 1.1.1.1.2.18 (colored) to branchpoint 1.1.1.1 (colored)

Don't redundantly cancel mm.retire_work or error_work.

Revision 1.1.1.1.2.18 / (download) - annotate - [select for diffs], Wed Jul 24 04:00:51 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.17: +8 -0 lines
Diff to previous 1.1.1.1.2.17 (colored) to branchpoint 1.1.1.1 (colored)

Stub out intel_gtt initialization until we' ready for gem stuff.

Revision 1.1.1.1.2.17 / (download) - annotate - [select for diffs], Wed Jul 24 03:57:49 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.16: +2 -1 lines
Diff to previous 1.1.1.1.2.16 (colored) to branchpoint 1.1.1.1 (colored)

Offset mmio_bar by PCI_MAPREG_START in i915_dma_attach.

Revision 1.1.1.1.2.16 / (download) - annotate - [select for diffs], Wed Jul 24 03:24:21 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.15: +0 -4 lines
Diff to previous 1.1.1.1.2.15 (colored) to branchpoint 1.1.1.1 (colored)

Restore usage of pci_get_bus_and_slot in i915_get_bridge_dev.

Revision 1.1.1.1.2.15 / (download) - annotate - [select for diffs], Wed Jul 24 03:19:18 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.14: +15 -0 lines
Diff to previous 1.1.1.1.2.14 (colored) to branchpoint 1.1.1.1 (colored)

Kludgily work around flush_workqueue in i915_driver_unload.

Revision 1.1.1.1.2.14 / (download) - annotate - [select for diffs], Wed Jul 24 03:19:02 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.13: +6 -0 lines
Diff to previous 1.1.1.1.2.13 (colored) to branchpoint 1.1.1.1 (colored)

Use drm_io_mapping_create_wc in i915_driver_load.

Revision 1.1.1.1.2.13 / (download) - annotate - [select for diffs], Wed Jul 24 03:12:48 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.12: +16 -0 lines
Diff to previous 1.1.1.1.2.12 (colored) to branchpoint 1.1.1.1 (colored)

Replace dma_set_coherent_mask by drm_limit_dma_space in i915_dma.c.

Revision 1.1.1.1.2.12 / (download) - annotate - [select for diffs], Wed Jul 24 03:07:05 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.11: +12 -0 lines
Diff to previous 1.1.1.1.2.11 (colored) to branchpoint 1.1.1.1 (colored)

Convert i915_driver_load to linux_mutex_init, and destory in unload.

Revision 1.1.1.1.2.11 / (download) - annotate - [select for diffs], Wed Jul 24 03:06:48 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.10: +4 -0 lines
Diff to previous 1.1.1.1.2.10 (colored) to branchpoint 1.1.1.1 (colored)

Convert i915_get_bridge_dev to use pci_kludgey_find_dev.

Revision 1.1.1.1.2.10 / (download) - annotate - [select for diffs], Wed Jul 24 03:06:33 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.9: +4 -0 lines
Diff to previous 1.1.1.1.2.9 (colored) to branchpoint 1.1.1.1 (colored)

Convert capable(CAP_SYS_ADMIN) to DRM_SUSER() in i915_getparam.

Revision 1.1.1.1.2.9 / (download) - annotate - [select for diffs], Wed Jul 24 03:06:16 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.8: +5 -0 lines
Diff to previous 1.1.1.1.2.8 (colored) to branchpoint 1.1.1.1 (colored)

Use dev->irq_enabled, not dev->pdev->irq, in i915_getparam.

The drm irq establishment code maintains dev->irq_enabled, and this
way we need not maintain it separately in the pci layer.

Revision 1.1.1.1.2.8 / (download) - annotate - [select for diffs], Wed Jul 24 03:06:00 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.7: +6 -0 lines
Diff to previous 1.1.1.1.2.7 (colored) to branchpoint 1.1.1.1 (colored)

Convert struct intel_ringbuffer::irq_queue to drm waitqueues.

Revision 1.1.1.1.2.7 / (download) - annotate - [select for diffs], Wed Jul 24 03:05:41 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.6: +15 -0 lines
Diff to previous 1.1.1.1.2.6 (colored) to branchpoint 1.1.1.1 (colored)

Add bool virtual_start_mapped to struct intel_ring_buffer.

The nullable pointer virtual_start was replaced by a struct
drm_local_map, which can't be null (well, perhaps we could abuse one
of the fields in it for that purpose, but this is cleaner), so
virtual_start_mapped will be maintained in the place of the
possibility of a null virtual_start to indicate whether the mapping
is present.

Revision 1.1.1.1.2.6 / (download) - annotate - [select for diffs], Wed Jul 24 03:05:24 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.5: +35 -0 lines
Diff to previous 1.1.1.1.2.5 (colored) to branchpoint 1.1.1.1 (colored)

Convert dri1 gfx_hws_cpu from ioremap to drm_ioremap.

Revision 1.1.1.1.2.5 / (download) - annotate - [select for diffs], Wed Jul 24 03:05:07 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.4: +12 -0 lines
Diff to previous 1.1.1.1.2.4 (colored) to branchpoint 1.1.1.1 (colored)

Ifdef out Linux vga stuff from i915_dma.c.

Revision 1.1.1.1.2.4 / (download) - annotate - [select for diffs], Wed Jul 24 03:04:50 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.3: +12 -0 lines
Diff to previous 1.1.1.1.2.3 (colored) to branchpoint 1.1.1.1 (colored)

Ifdef out Linux framebuffer stuff from i915_dma.c.

Revision 1.1.1.1.2.3 / (download) - annotate - [select for diffs], Wed Jul 24 02:59:14 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.2: +29 -0 lines
Diff to previous 1.1.1.1.2.2 (colored) to branchpoint 1.1.1.1 (colored)

Replace i915 private regs from pci_ioremap to drm_ioremap.

Replace read/write{b,l,w} by DRM_READ/WRITE{8,16,32} in i915_drv.c.

Revision 1.1.1.1.2.2 / (download) - annotate - [select for diffs], Tue Jul 23 21:28:22 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1.2.1: +1874 -0 lines
Diff to previous 1.1.1.1.2.1 (colored) to branchpoint 1.1.1.1 (colored)

sync with HEAD and actually get the drm2 import

Revision 1.1.1.1.4.1, Tue Jul 23 02:13:11 2013 UTC (8 years, 2 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.1.1.1: +0 -1874 lines
FILE REMOVED

file i915_dma.c was added on branch rmind-smpnet on 2013-08-28 23:59:33 +0000

Revision 1.1.1.1.2.1, Tue Jul 23 02:13:11 2013 UTC (8 years, 2 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.1.1.1: +0 -1874 lines
FILE REMOVED

file i915_dma.c was added on branch riastradh-drm2 on 2013-07-23 21:28:22 +0000

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Tue Jul 23 02:13:11 2013 UTC (8 years, 2 months ago) by riastradh
Branch: LINUX
CVS Tags: riastradh-drm2-base3, riastradh-drm2-base2, linux-3-6-rc8-drm2-bsd
Branch point for: rmind-smpnet, riastradh-drm2
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import drm sources from Linux v3.8-rc6.
(commit id 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7)

Linux                   NetBSD
drivers/gpu/drm         sys/external/bsd/drm2/dist/drm
include/drm             sys/external/bsd/drm2/dist/include/drm
include/uapi/drm        sys/external/bsd/drm2/dist/uapi/drm

Files/subtrees excluded because of licence issues, to be either
revisited later (particularly nouveau and radeon, which are mostly
permissively licensed but a number of whose files have no licence
statements), rewritten/ignored, or imported later as kernel modules
under external/gpl2 instead:

   include/drm/drm_fb_cma_helper.h
   include/drm/drm_gem_cma_helper.h
   include/drm/drm_os_linux.h
   include/drm/drm_pciids.h
   include/drm/drm_sysfs.h
   include/drm/drm_usb.h
   include/drm/exynos_drm.h
   include/drm/gma_drm.h
   include/drm/intel-gtt.h
   drm/cirrus
   drm/drm_edid_load.c
   drm/drm_fb_cma_helper.c
   drm/drm_gem_cma_helper.c
   drm/drm_sysfs.c
   drm/drm_trace.h
   drm/drm_trace_points.c
   drm/drm_usb.c
   drm/exynos
   drm/gma500
   drm/i915/i915_trace.h
   drm/i915/i915_trace_points.c
   drm/i915/intel_acpi.c
   drm/mgag200
   drm/nouveau
   drm/radeon
   drm/shmobile
   drm/tegra
   drm/udl
   uapi/exynos_drm.h

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jul 23 02:13:11 2013 UTC (8 years, 2 months ago) by riastradh
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>