1
0
Fork 0
Commit Graph

507941 Commits (4a11248856933f33ca061ed55470ea7e1783b40b)

Author SHA1 Message Date
Dave Airlie 4a11248856 Merge tag 'topic/drm-misc-2015-04-15' of git://anongit.freedesktop.org/drm-intel into drm-next
One more drm-misch pull for 4.1 with mostly simple stuff and boring
refactoring. Even the cursor fix from Matt is just to make a really anal
igt happy.

* tag 'topic/drm-misc-2015-04-15' of git://anongit.freedesktop.org/drm-intel:
  drm: fix trivial typo mistake
  drm: Make integer overflow checking cover universal cursor updates (v2)
  drm: make crtc/encoder/connector/plane helper_private a const pointer
  drm/armada: constify struct drm_encoder_helper_funcs pointer
  drm/radeon: constify more struct drm_*_helper funcs pointers
  drm/edid: add #defines for ELD versions
  drm/atomic: Add for_each_{connector,crtc,plane}_in_state helper macros
  drm: Use kref_put_mutex in drm_gem_object_unreference_unlocked
  drm/drm: constify all struct drm_*_helper funcs pointers
  drm/qxl: constify all struct drm_*_helper funcs pointers
  drm/nouveau: constify all struct drm_*_helper funcs pointers
  drm/radeon: constify all struct drm_*_helper funcs pointers
  drm/gma500: constify all struct drm_*_helper funcs pointers
  drm/mgag200: constify all struct drm_*_helper funcs pointers
  drm/exynos: constify all struct drm_*_helper funcs pointers
  drm: Fix some typos
2015-04-16 08:34:24 +10:00
Dave Airlie 52139bdea1 Merge branch 'drm-dwhdmi-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next
This set of patches adjust the setup of the HDMI CTS/N values for audio
support to be compliant with the work-around given in the iMX6 errata
documentation as part of the preparation for integrating audio support
for this driver, and also update the HDMI phy configuration for Rockchip
devices to improve the HDMI eye pattern.

* 'drm-dwhdmi-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  drm: rockchip/dw_hdmi-rockchip: improve for HDMI electrical test
  drm: bridge/dw_hdmi: separate VLEVCTRL settting into platform driver
  drm: bridge/dw_hdmi: fixed codec style
  drm: bridge/dw_hdmi: adjust n/cts setting order
  drm: bridge/dw_hdmi: protect n/cts setting with a mutex
  drm: bridge/dw_hdmi: combine hdmi_set_clock_regenerator_n() and hdmi_regenerate_cts()

Conflicts:
	drivers/gpu/drm/imx/dw_hdmi-imx.c
2015-04-16 08:33:30 +10:00
Dave Airlie fc16fc4d69 Merge branch 'drm-next-4.1' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some final bits for 4.1.  Some fixes for userptrs and allow a new
packet for VCE to enable some new features in mesa.

* 'drm-next-4.1' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: allow creating overlapping userptrs
  drm/radeon: add userptr config option
  drm/radeon: add video usability info support for VCE
2015-04-16 08:00:06 +10:00
Dave Airlie 665ae581ae Merge branch 'linux-4.1' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
- gk20a iommu support
- gm107 graphics support without needing proprietary ucode
- various random fixes
- more gm20x bring-up, fifo/ce are ok, gr is mostly complete with the
exception of ctxsw ucode.. nvidia aren't playing nice yet so there's
not much more that can be done at this point...

I spent a lot of time trying to find a viable way of doing gr ctxsw
without signed firmware, but the "security" restrictions on the
fecs/gpccs falcons are excessive and go beyond what'd be necessary to
protect the host from malicious firmware.  This newer nvidia hw is
VERY open-source unfriendly.

I have some experimental host-based ctxsw work that could be a viable
(albeit unsatisfactory and slow) workaround in the meantime, but it
needs some more work and i'd like to get the 3d driver working
properly before i commit to pushing it.

* 'linux-4.1' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (40 commits)
  drm/nouveau/bios: fix fetching from acpi on certain systems
  drm/nouveau/gr/gm206: initial init+ctx code
  drm/nouveau/ce/gm206: enable support via gm204 code
  drm/nouveau/fifo/gm206: enable support via gm204 code
  drm/nouveau/gr/gm204: initial init+ctx code
  drm/nouveau: support for buffer moves via MaxwellDmaCopyA
  drm/nouveau/ce/gm204: initial support
  drm/nouveau: add support for gm20x fifo channels
  drm/nouveau/fifo/gm204: initial support
  drm/nouveau/gr/gk104-: prevent reading non-existent regs in intr handler
  drm/nouveau/gr/gm107: very slightly demagic part of attrib cb setup
  drm/nouveau/gr/gk104-: correct crop/zrop num_active_fbps setting
  drm/nouveau/gr/gf100-: add symbolic names for classes
  drm/nouveau/gr/gm107: support tpc "strand" ctxsw in gpccs ucode
  drm/nouveau/gr/gf100-: support mmio access with gpc offset from gpccs ucode
  drm/nouveau/gr: fix engine name, cosmetic search+replace mistake
  drm/nouveau/pmu/gk20a: add some missing statics
  drm/nouveau/platform: fix probe error path
  drm/nouveau/platform: release IOMMU's mm upon exit
  drm/nouveau/gr/gk104-gk20a: call pmu to disable any power-gating before ctor()
  ...
2015-04-15 12:47:29 +10:00
John Hunter 2b1193d528 drm: fix trivial typo mistake
Signed-off-by: John Hunter <zhjwpku@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-14 12:41:03 +02:00
Matt Roper 3968be946a drm: Make integer overflow checking cover universal cursor updates (v2)
Our legacy SetPlane updates perform integer overflow checking on a
plane's destination rectangle in drm_mode_setplane(), and atomic updates
handled as part of a drm_atomic_state transaction do the same checking
in drm_atomic_plane_check().  However legacy cursor updates that get
routed through universal plane interfaces may bypass this overflow
checking if the driver's .update_plane is serviced by the transitional
plane helpers rather than the full atomic plane helpers.

Move the check for destination rectangle integer overflow from the
drm_mode_setplane() to __setplane_internal() so that it also covers
cursor operations.

This fixes an issue first noticed with i915 commit:

        commit ff42e093e9
        Author: Daniel Vetter <daniel.vetter@ffwll.ch>
        Date:   Mon Mar 2 16:35:20 2015 +0100

            Revert "drm/i915: Switch planes from transitional helpers to full
            atomic helpers"

The above revert switched us from full atomic helpers back to the
transitional helpers, and in doing so we lost the overflow checking here
for universal cursor updates.  Even though such extreme cursor positions
are unlikely to actually happen in the wild, we still don't want there
to be a change of behavior when drivers switch from transitional helpers
to full helpers.

v2: Move check from setplane ioctl to setplane_internal rather than
    adding an additional copy of the checks to the transitional plane
    helpers.  (Daniel)

Cc: Daniel Vetter <daniel@ffwll.ch>
Testcase: igt/kms_cursor_crc
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84269
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-14 09:07:46 +02:00
Jan Vesely 4195f40685 drm/nouveau/bios: fix fetching from acpi on certain systems
nvbios_extend() returns 1 to indicate "extended the array" and 0 to
indicate the array is already big enough.  This is used by the core
shadowing code to prevent re-fetching chunks of the image that have
already been shadowed.

The ACPI fetching code may possibly need to extend this further due
to requiring fetches to happen in 4KiB chunks.

Under certain circumstances (that happen if the total image size is
a multiple of 4KiB), the memory allocated to store the shadow will
already be big enough, causing the ACPI code's nvbios_extend() call
to return 0, which is misinterpreted as a failure.

The fix is simple, accept >= 0 as a successful condition here.  The
core will have already made sure that we're not re-fetching data we
already have.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89047

v2 (Ben Skeggs):
- dropped hunk which would cause unnecessary re-fetching
- more descriptive explanation

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:59 +10:00
Ben Skeggs 426b20e42e drm/nouveau/gr/gm206: initial init+ctx code
Uncertain whether the GPC pack change is due to a newer driver version,
or a legitimate difference from GM204.  My GM204 has broken vram, so
can't currently try a newer binary driver on it to confirm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:58 +10:00
Ben Skeggs 985826bccd drm/nouveau/ce/gm206: enable support via gm204 code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:58 +10:00
Ben Skeggs 5dd7fb771a drm/nouveau/fifo/gm206: enable support via gm204 code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:57 +10:00
Ben Skeggs 3fed3ea9fd drm/nouveau/gr/gm204: initial init+ctx code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:57 +10:00
Ben Skeggs 990b454704 drm/nouveau: support for buffer moves via MaxwellDmaCopyA
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:57 +10:00
Ben Skeggs b44881e453 drm/nouveau/ce/gm204: initial support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:56 +10:00
Ben Skeggs a1020afe88 drm/nouveau: add support for gm20x fifo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:56 +10:00
Ben Skeggs 89025bd458 drm/nouveau/fifo/gm204: initial support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:55 +10:00
Ben Skeggs 91c772ec12 drm/nouveau/gr/gk104-: prevent reading non-existent regs in intr handler
Under certain circumstances the trapped address will contain subc 7,
which GK104 GR doesn't have anymore.

Notice this case to avoid causing additional priv ring faults.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:55 +10:00
Ben Skeggs ddec1a2b4c drm/nouveau/gr/gm107: very slightly demagic part of attrib cb setup
No idea if "3" is a constant or derived from something else, but the
value is unchanged in the limited traces of gm107/gm204 I have here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:54 +10:00
Ben Skeggs 6eb7082621 drm/nouveau/gr/gk104-: correct crop/zrop num_active_fbps setting
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:54 +10:00
Ben Skeggs 3740c82590 drm/nouveau/gr/gf100-: add symbolic names for classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:54 +10:00
Ben Skeggs 8fd4b7d438 drm/nouveau/gr/gm107: support tpc "strand" ctxsw in gpccs ucode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:53 +10:00
Ben Skeggs 2a19b3ed65 drm/nouveau/gr/gf100-: support mmio access with gpc offset from gpccs ucode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:53 +10:00
Ben Skeggs 7b03ac2ce0 drm/nouveau/gr: fix engine name, cosmetic search+replace mistake
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:52 +10:00
Alexandre Courbot 7120908d12 drm/nouveau/pmu/gk20a: add some missing statics
Make static a few functions and structures that should be.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:52 +10:00
Alexandre Courbot bbf2e92f91 drm/nouveau/platform: fix probe error path
A "return 0" found its way in the middle of the error path of
nouveau_platform_probe(), remove it as it will make the kernel crash if
we try to unload the module afterwards.

While we are at it, also remove the IOMMU domain if it has been created,
as we should.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:51 +10:00
Alexandre Courbot 25eb3a924f drm/nouveau/platform: release IOMMU's mm upon exit
nvkm_mm_fini() was not called when exiting the driver, resulting in a
memory leak. Fix this.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:51 +10:00
Ben Skeggs ed22e68462 drm/nouveau/gr/gk104-gk20a: call pmu to disable any power-gating before ctor()
On some of these chipsets, reading NV_PGRAPH_GPC_GPM_PD_PES_TPC_ID_MASK
can trigger a PRI fault and return an error code instead of a TPC mask,
unless PGOB has been disabled first.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:51 +10:00
Ben Skeggs f02a0e849d drm/nouveau/pmu/gk208: implement gr power-up magic with gk110_pmu_pgob()
Before we moved gk110's implementation of this to pmu, the functions were
identical.  This commit just switches GK208 to use the new (more complete)
implementation of the power-up sequence.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:50 +10:00
Ben Skeggs e1fc44fb9d drm/nouveau/pmu/gk110: implement gr power-up magic like PGOB on earlier chips
Turns out the PTHERM part of this dance is bracketed by the same PMU
fiddling that occurs on GK104/6, let's assume it's also PGOB.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:50 +10:00
Roy Spliet d9da545e10 drm/nouveau/pbus/hwsq: Make code size u16
So we can actually use the full 512 byte code space

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:49 +10:00
Roy Spliet 3834b632b2 drm/nouveau/pbus/hwsq: Support strided register writes
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:49 +10:00
Alexandre Courbot df16896b86 drm/nouveau/instmem/gk20a: fix crash during error path
If a memory allocation fails when using the DMA allocator,
gk20a_instobj_dtor_dma() will be called on the failed instmem object.
At this time, node->handle might not be NULL despite the call to
dma_alloc_attrs() having failed. node->cpuaddr is the right member to
check for such a failure, so use it instead.

Reported-by: Vince Hsu <vinceh@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:49 +10:00
Ben Skeggs b03eaa4d34 drm/nouveau/disp/gf110-: fix base channel update debug/error output
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:48 +10:00
Ben Skeggs 963e965033 drm/nouveau/disp/nv50-: fix push buffers in vram
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:47 +10:00
Ben Skeggs 824527551c drm/nouveau: bump driver patchlevel for coherent flag
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:47 +10:00
Alexandre Courbot 996f545fbb drm/nouveau/gem: allow user-space to specify an object should be coherent
User-space use mappable BOs notably for fences, and expects that a
value update by the GPU will be immediatly visible through the
user-space mapping.

ARM has a property that may prevent this from happening though: memory
can be mapped multiple times only if the different mappings share the
same caching properties. However all the lowmem memory is already
identity-mapped into the kernel with cache enabled, so when user-space
requests an uncached mapping, we actually get an "undefined caching
policy" one and this has strange side-effects described on Freedesktop
bug 86690.

To prevent this from happening, allow user-space to explicitly specify
which objects should be coherent, and create such objects with the
TTM_PL_FLAG_UNCACHED flag. This will make TTM allocate memory using the
DMA API, which will fix the identify mapping and allow us to safely map
the objects to user-space uncached.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:46 +10:00
Alexandre Courbot a7f6da6e75 drm/nouveau/instmem/gk20a: add IOMMU support
Let GK20A's instmem take advantage of the IOMMU if it is present. Having
an IOMMU means that instmem is no longer allocated using the DMA API,
but instead obtained through page_alloc and made contiguous to the GPU
by IOMMU mappings.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:45 +10:00
Alexandre Courbot 58fd9375c2 drm/nouveau/platform: probe IOMMU if present
Tegra SoCs have an IOMMU that can be used to present non-contiguous
physical memory as contiguous to the GPU and maximize the use of large
pages in the GPU MMU, leading to performance gains. This patch adds
support for probing such a IOMMU if present and make its properties
available in the nouveau_platform_gpu structure so subsystems can take
advantage of it.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:44 +10:00
Alexandre Courbot 5dc240bcfe drm/nouveau/instmem/gk20a: use DMA attributes
instmem for GK20A is allocated using dma_alloc_coherent(), which
provides us with a coherent CPU mapping that we never use because
instmem objects are accessed through PRAMIN. Switch to
dma_alloc_attrs() which gives us the option to dismiss that CPU mapping
and free up some CPU virtual space.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:44 +10:00
Alexandre Courbot 1452087675 drm/nouveau/gk20a: remove RAM device
Now that Nouveau can operate even when there is no RAM device, remove
the dummy one used by GK20A.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:43 +10:00
Alexandre Courbot a6ff85d386 drm/nouveau/instmem/gk20a: move memory allocation to instmem
GK20A does not have dedicated RAM, thus having a RAM device for it does
not make sense. Move the contiguous physical memory allocation to
instmem.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:42 +10:00
Alexandre Courbot eaecf0326f make RAM device optional
Having a RAM device does not make sense for chips like GK20A which have
no dedicated video memory. The dummy RAM device that we used so far
works as a temporary band-aid, but in the longer term it is desirable
for the driver to be able to work without any kind of VRAM.

This patch adds a few conditionals in places where a RAM device was
assumed to be present and allows some more objects to be allocated from
the TT domain, allowing Nouveau to handle GPUs for which
pfb->ram == NULL.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:42 +10:00
Lauri Peltonen c6a7b026a3 drm/nouveau/gr/gf100: Clear notify interrupt
Notify interrupt is only used for cyclestats. We can just clear it and
avoid an "unknown stat" error that gets printed to dmesg otherwise.

Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:41 +10:00
Lauri Peltonen 3d951c3800 drm/nouveau/graph/nvc0: Fix engine pointer retrieval
Other methods in this file suggest this is the correct way to retrieve
the engine pointer.

Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 17:00:40 +10:00
Ben Skeggs 30489c230a drm/nouveau/devinit/nv04: change owner to int
We use -1 to mean "not read from hw yet"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 16:59:21 +10:00
Dan Carpenter 5dfe7a0179 drm/nouveau/mxm: indent an if statement
This if statement is correct but it wasn't indented, so it looked like
some code was missing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 16:59:21 +10:00
Martin Peres 3e5ede1def drm/nouveau/fuse/gm107: simplify the return logic
Spotted by coccinelle:
drivers/gpu/drm/nouveau/core/subdev/fuse/gm107.c:50:5-8: WARNING: end returns can be simpified

Signed-off-by: Martin Peres <martin.peres@free.fr>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-04-14 16:59:21 +10:00
Christian König 49ecb10e01 drm/radeon: allow creating overlapping userptrs
Similar to the Intel implementation, but instead of just falling back to a
global linear list when we have an overlapping userptr request we accumulate
all overlapping userptrs in a local list.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-13 11:17:59 -04:00
Christian König c6a1fc725a drm/radeon: add userptr config option
This allows selecting CONFIG_MMU_NOTIFIER if it isn't already selected.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-04-13 11:17:58 -04:00
Jani Nikula 9a436ee6c3 drm: make crtc/encoder/connector/plane helper_private a const pointer
They're only used to store const pointers anyway. This helps to keep
Ville and the compiler happy.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-13 15:00:13 +02:00
Jani Nikula 0d4d936f49 drm/armada: constify struct drm_encoder_helper_funcs pointer
Not to be modified.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-13 15:00:13 +02:00