Dave Airlie [Fri, 28 Mar 2014 03:03:48 +0000 (13:03 +1000)]
drm/i915: fix build warning on 32-bit (v2)
/ssd/git/drm-next/drivers/gpu/drm/i915/i915_cmd_parser.c: In function ‘i915_parse_cmds’:
/ssd/git/drm-next/drivers/gpu/drm/i915/i915_cmd_parser.c:405:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
DRM_DEBUG_DRIVER("CMD: Command length exceeds batch length: 0x%08X length=%d batchlen=%ld\n",
^
That first comma looks weird as we already have ']' as a separator.
Remove it.
If anyone sees this commit message and also thinks that auth=1 isn't the
most useful info to have here, let's just say I'd happily review a patch
removing it. If I don't get annoyed enough to submit a patch, that is.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Lespiau, Damien [Mon, 24 Mar 2014 15:53:16 +0000 (15:53 +0000)]
drm: drm_ut_debug_printk() isn't called with NULL anywmore
The DRM_LOG* macros where the only sites where drm_ut_debug_printk was
called with NULL arguments for prefix and function_name. Now that they
are gone, we can remove that case.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Lespiau, Damien [Mon, 24 Mar 2014 15:53:15 +0000 (15:53 +0000)]
drm: Pull the test on drm_debug in the logging macros
In the logging code, we are currently checking is we need to output in
drm_ut_debug_printk(). This is too late. The problem is that when we write
something like:
DRM_DEBUG_DRIVER("ELD on [CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
connector->base.id,
drm_get_connector_name(connector),
connector->encoder->base.id,
drm_get_encoder_name(connector->encoder));
We start by evaluating the arguments (so call drm_get_connector_name() and
drm_get_connector_name()) before ending up in drm_ut_debug_printk() which will
then does nothing.
This means we execute a lot of instructions (drm_get_connector_name(), in turn,
calls snprintf() for example) to happily discard them in the normal case,
drm.debug=0.
So, let's put the test on drm_debug earlier, in the macros themselves.
Sprinkle an unlikely() as well for good measure.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Lespiau, Damien [Mon, 24 Mar 2014 15:53:13 +0000 (15:53 +0000)]
staging: imx-drm: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()
There are only a few users of the DRM_LOG_KMS() macro. We can simplify
the DRM code a bit by replacing them by DRM_DEBUG_KMS().
Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Lespiau, Damien [Mon, 24 Mar 2014 15:53:08 +0000 (15:53 +0000)]
drm: Refresh the explanation of debug categories
That comment wasn't super-readable, so I tried to improve it:
- Put the comment before the values it's documenting
- Add a mention to PRIME
- Reword things a bit to be a lighter read
- Add a note about the option to set the debug value at run-time
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Arnd Bergmann [Tue, 25 Mar 2014 11:06:46 +0000 (12:06 +0100)]
drm/bridge: PTN3460 needs DRM_KMS_HELPER
The recently added PTN3460 device driver uses interfaces that
are provided by the KMS helper infrastructure, so we should
explicitly select that to avoid this linker error:
Dave Airlie [Wed, 26 Mar 2014 04:34:16 +0000 (14:34 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
- first stage of (ongoing) gpu fault recovery work
- initial support for maxwell (binary driver fw needed)
- various random fixes across the board
* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (87 commits)
drm/nouveau: fix missing newline
drm/nouveau/bios: fetch the vbios from PROM using only aligned 32-bit accesses
drm/nouveau/therm: let the vbios decide on the automatic fan management mode
drm/nvd7/therm: handle another kind of PWM fans
drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
drm/nouveau: fix small thinko in vblank timestamping.
drm/nouveau/therm: check for sensor presence with requested mode, not current
drm/nouveau/disp/dp: allow 540MHz data rate
drm/nouveau: recognise higher link rate for available dp bw calculations
drm/nouveau/disp: limit dp capabilities as per dcb
drm/nva3/fbram: restrict training pattern setup to GT218
drm/nva3/devinit: restrict script access to some PFB regs
drm/nouveau/devinit: add interface to check if a mmio access by scripts is ok
drm/nouveau/bios: have strap reads show on devinit spam debug level
drm/nv50/gpio: fixup reset for gpios >= 16
drm/nv50/gpio: exclude sense value from mask when changing registers
drm/gk104/gr: therm magic needed on some kepler boards
drm/gm107/gr: initial support
drm/gf100-/gf: fix a stupid typo, waiting on wrong signal for mmctx
drm/nouveau/bios: parsing of some random table needed to bring up gr
...
Martin Peres [Wed, 19 Feb 2014 00:04:56 +0000 (01:04 +0100)]
drm/nouveau/therm: let the vbios decide on the automatic fan management mode
This should fix automatic fan management on fermi cards who do not have
0x46 entries in the thermal table.
On my nve6, the blob sets the default linear range from 40°C to 100°C
but my nvcf's default values are 40°C to 85°C. Let's keep 85 as a default
for everyone.
Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Timothée Ravier <tim@siosm.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Thu, 13 Mar 2014 23:26:52 +0000 (00:26 +0100)]
drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
This should fix a deadlock that has been reported to us where fan_update()
would hold the fan lock and try to grab the alarm_program_lock to reschedule
an update. On an other CPU, the alarm_program_lock would have been taken
before calling fan_update(), leading to a deadlock.
We should Cc: <stable@vger.kernel.org> # 3.9+
Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com> Tested-by: Timothée Ravier <tim@siosm.fr> Tested-by: Boris Fersing (IRC nick fersingb, no public email address) Signed-off-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Mario Kleiner [Wed, 19 Mar 2014 09:02:11 +0000 (10:02 +0100)]
drm/nouveau: fix small thinko in vblank timestamping.
*hpos horizontal scanout position doesn't need to be corrected
to count the pixels between hactive end and htotal negative.
That is only needed for *vpos to count lines until end of
vblank for the vblank timestamping.
Use hpos as is without correction.
Removes occassional spikes in timestamps of up to 1 scanline
duration, thereby improves accuracy to about +/- 2 usecs instead
of +/- 12 usecs, wrt. true onset time as measured with high
precision equipment on NV-A5.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ilia Mirkin [Wed, 19 Mar 2014 14:45:55 +0000 (10:45 -0400)]
drm/nouveau/disp/dp: allow 540MHz data rate
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76319 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 3 Mar 2014 06:18:56 +0000 (16:18 +1000)]
drm/nouveau: fix fbcon not being accelerated after suspend
This does *not* (and is not intended to) fix the issue reported by
Christoph Rudorff on the nouveau mailinglist.
The patch proposed (which is similar to this one, but also reorders
whether we disable accel or call fb_set_suspend first), papers over
another problem entirely by avoiding touching the framebuffer.
Ben Skeggs [Wed, 26 Feb 2014 00:14:15 +0000 (10:14 +1000)]
drm/nouveau/bios: add more checks to PRAMIN image fetching
Prevents an attempt to access VRAM on an un-posted board, which, on a
particular system with a GRID K1 installed, causes a MCE and chokes
the entire system.
Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead
of PCI to which Nouveau is tightly dependent. This patch allows Nouveau
to handle platform devices by:
- abstracting PCI-dependent functions that were typically used for
resource querying and page mapping,
- introducing a nv_device_is_pci() function that allows to make
PCI-dependent code conditional,
- providing a nouveau_drm_platform_probe() function that takes a GPU
platform device to be probed.
Core code as well as engine/subdev drivers are updated wherever possible
to make use of these functions. Some older drivers are too dependent on
PCI to be properly updated, but all newer code on which future chips may
depend should at least be runnable with platform devices.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Dave Airlie [Wed, 26 Mar 2014 04:00:53 +0000 (14:00 +1000)]
Merge branch 'drm-next-3.15' of git://people.freedesktop.org/~deathsimple/linux into drm-next
this is the third pull request for 3.15 radeon changes. Highlights this time:
- More DP work from Alex, especially making use of the new DP aux helpers
- Marek's 1D and linear tiling fixes for CIK
* 'drm-next-3.15' of git://people.freedesktop.org/~deathsimple/linux:
drm/radeon: set PIPE_CONFIG for 1D and linear tiling modes on CIK
drm/radeon: use drm_dp_dpcd_read_link_status()
drm/radeon: use the new drm helpers for dp aux
drm/dp: make aux retries less chatty
drm/radeon: clarify special handling in i2c over aux
drm/radeon/atom: rework encoder enable/disable sequence
drm/radeon/dp: move sink power control to a separate function
drm/radeon/dp: use i2c_get_adapdata rather than casting
Ilia Mirkin [Fri, 14 Feb 2014 02:35:14 +0000 (21:35 -0500)]
drm/nouveau: use nv_debug for NV_DEBUG, make DRM a separate subflag
It's really confusing for NV_DEBUG's printing to be controlled via
drm.debug while everything else is controlled via nouveau.debug. These
messages can be turned on with nouveau.debug=DRM=debug.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ilia Mirkin [Thu, 13 Feb 2014 08:39:50 +0000 (03:39 -0500)]
drm/nouveau: make hdmi device finding failure prints debug level
The hdmi device is required for runtime pm. However it is not available
on many esp older devices, which were all seeing these error messages.
Take this opportunity to also convert to nv_debug instead of the DRM_*
messages, like the rest of nouveau does.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
pm_runtime_get*() may return -EACCES to indicate a device does not have
runtime PM enabled. This is currently the case with platform devices
on Nouveau, and is not an error in that context. Handle this case
without failure.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ilia Mirkin [Sun, 9 Feb 2014 20:51:24 +0000 (15:51 -0500)]
drm/nouveau: replace ffsll with __ffs64
The ffsll function is a lot slower than the __ffs64 built-in which
compiles to a single instruction on 64-bit. It's also nice to avoid
custom versions of standard functions. Note that __ffs == ffs - 1.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>