aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-28drm/ttm: Add a ttm_ref_object_exists functionThomas Hellstrom2-0/+50
A function to be used to check whether a caller has put a ref object (opened) a struct ttm_base_object Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm/vmwgfx: Tighten security around surface sharing v2Thomas Hellstrom1-0/+24
If using legacy (non-prime) surface sharing, only allow surfaces to be shared between clients with the same master. This will block malicious clients from peeking at contents at surfaces from other (possibly vt-switched) masters. v2: s/legacy_client/primary_client/ Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm/vmwgfx: Allow prime fds in the surface reference ioctlsThomas Hellstrom2-36/+81
Allow prime fds and at the same time block legacy handles for render-nodes in the surface reference ioctls. This means these ioctls can be used directly from prime-aware clients, and that they can be called from render-nodes. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm/vmwgfx: Drop authentication requirement on UNREF ioctlsThomas Hellstrom1-5/+5
These ioctls will anyway only succeed if the client previously opened referenced the object. Furthermore, closing the client would implicitly execute the same action. This prevents clients from blocking on UNREF if their master dropped, and will allow masters to UNREF after dropping master privileges. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm/vmwgfx: Reinstate and tighten security around legacy master modelThomas Hellstrom1-5/+89
The following restrictions affect clients connecting using legacy nodes: *) Masters that have dropped master privilieges are not considered authenticated until they regain master privileges. *) Clients whose master have dropped master privileges block interruptibly on ioctls requiring authentication until their master regains master privileges. If their master exits, they are killed. This is primarily designed to prevent clients authenticated with one master to access data from clients authenticated with another master. (Think fast user-switching or data sniffers enabled while X is vt-switched). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm/vmwgfx: Use a per-device semaphore for reservation protectionThomas Hellstrom11-58/+46
Don't use a per-master semaphore (ttm lock) for reservation protection, but rather a per-device semaphore. This is needed since clients connecting using render nodes aren't master aware. The ttm lock used should probably be replaced with a reader-write semaphore once the function down_xx_interruptible() is available. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm: Add a function to get the ioctl flagsThomas Hellstrom2-0/+19
Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm: Protect the master management with a drm_device::master_mutex v3Thomas Hellstrom3-47/+64
The master management was previously protected by the drm_device::struct_mutex. In order to avoid locking order violations in a reworked dropped master security check in the vmwgfx driver, break it out into a separate master_mutex. Locking order is master_mutex -> struct_mutex. Also remove drm_master::blocked since it's not used. v2: Add an inline comment about what drm_device::master_mutex is protecting. v3: Remove unneeded struct_mutex locks. Fix error returns in drm_setmaster_ioctl(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: David Herrmann <[email protected]> Acked-by: Daniel Vetter <[email protected]>
2014-03-28drm: Remove the minor master listThomas Hellstrom2-7/+0
It doesn't appear to be used anywhere. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: David Herrmann <[email protected]>
2014-03-28drm: Improve on minor type helpers v3Thomas Hellstrom3-7/+10
Add a drm_is_legacy() helper, constify argument to drm_is_render_client(), and use / change helpers where appropriate. v2: s/drm_is_legacy/drm_is_legacy_client/ and adapt to new code context. v3: s/legacy_client/primary_client/ Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
2014-03-28drm: Make control nodes master-less v3Thomas Hellstrom3-5/+13
Like for render-nodes, there is no point in maintaining the master concept for control nodes, so set the struct drm_file::master pointer to NULL. At the same time, make sure DRM_MASTER | DRM_CONTROL_ALLOW ioctls are always allowed when called through the control node. Previously the caller also needed to be master. v2: Adapt to refactoring of ioctl permission check. v3: Formatting of logical expression. Use drm_is_control_client() instead of drm_is_control(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: David Herrmann <[email protected]>
2014-03-28drm: Break out ioctl permission check to a separate function v2Thomas Hellstrom1-38/+75
Helps reviewing and understanding these checks. v2: Remove misplaced newlines. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: David Herrmann <[email protected]>
2014-03-28drm: Have the crtc code only reference master from legacy nodes v2Thomas Hellstrom1-6/+8
control- and render nodes are intended to be master-less. v2: Replace tests for !legacy with tests for !mode_group for readability. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: David Herrmann <[email protected]>
2014-03-28drm/i915: fix build warning on 32-bit (v2)Dave Airlie1-1/+1
/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", ^ Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Remove the ', ' after the function name in debug logsLespiau, Damien1-1/+1
Right now a debug message looks like: [drm:drm_ioctl], pid=860, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCRTC 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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Remove the prefix argument of drm_ut_debug_printk()Lespiau, Damien2-15/+8
This is always DRM_NAME, so we can just make it part of the format string instead of asking prink to do it for us. Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: drm_ut_debug_printk() isn't called with NULL anywmoreLespiau, Damien1-5/+1
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Pull the test on drm_debug in the logging macrosLespiau, Damien2-26/+27
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Remove the now unused DRM_LOG* macrosLespiau, Damien1-19/+0
Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28staging: imx-drm: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()Lespiau, Damien1-1/+1
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 <[email protected]> Cc: Lucas Stach <[email protected]> Signed-off-by: Damien Lespiau <[email protected]> Acked-by: Philipp Zabel <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm/i915: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()Lespiau, Damien5-39/+39
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(). Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm/gma500: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()Lespiau, Damien1-10/+10
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: Patrik Jakobsson <[email protected]> Signed-off-by: Damien Lespiau <[email protected]> Acked-by: Patrik Jakobsson <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm/exynos: Replace DRM_LOG_KMS() by DRM_DEBUG_KMS()Lespiau, Damien2-2/+2
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: Inki Dae <[email protected]> Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Remove the unused (and unusable) DRM_LOG_MODE()Lespiau, Damien1-6/+0
This macro was trying to use the non existing DRM_UT_MODE debug category and looks like it should be covered by DRM_LOG_KMS(). Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-28drm: Refresh the explanation of debug categoriesLespiau, Damien1-30/+27
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-27drm/bridge: PTN3460 needs DRM_KMS_HELPERArnd Bergmann1-1/+2
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: ERROR: "drm_helper_probe_single_connector_modes" [drivers/gpu/drm/bridge/ptn3460.ko] undefined! ERROR: "drm_helper_connector_dpms" [drivers/gpu/drm/bridge/ptn3460.ko] undefined! We have to drop the I2C dependency to avoid a circular dependency chain, but that's ok because DRM already selects I2C. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-03-26Merge branch 'drm-nouveau-next' of ↵Dave Airlie154-4412/+10033
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 ...
2014-03-26drm/nouveau: fix missing newlineAlexandre Courbot1-1/+1
Add a missing newline at the end of a DRM_INFO message. Signed-off-by: Alexandre Courbot <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/bios: fetch the vbios from PROM using only aligned 32-bit accessesMartin Peres1-14/+19
Other kind of accesses are unreliable on Kepler cards. As advised by NVIDIA, let's only use 32-bit accesses to fetch the vbios from PROM. This fixes vbios fetching on my nve7 which failed in certain specific conditions. I suggest we Cc stable, for all kernels they still maintain after the big rewrite. Suggested-by: Christian Zander <[email protected]> Signed-off-by: Martin Peres <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/therm: let the vbios decide on the automatic fan management modeMartin Peres4-8/+25
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 <[email protected]> Tested-by: Timothée Ravier <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nvd7/therm: handle another kind of PWM fansMartin Peres6-16/+35
This should fix fan management on many nvd7+ chipsets. Signed-off-by: Martin Peres <[email protected]> Tested-by: Timothée Ravier <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/pm/fan: drop the fan lock in fan_update() before reschedulingMartin Peres1-6/+13
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: <[email protected]> # 3.9+ Reported-by: Marcin Slusarz <[email protected]> Tested-by: Timothée Ravier <[email protected]> Tested-by: Boris Fersing (IRC nick fersingb, no public email address) Signed-off-by: Martin Peres <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau: fix small thinko in vblank timestamping.Mario Kleiner1-1/+1
*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 <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/therm: check for sensor presence with requested mode, not currentBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/disp/dp: allow 540MHz data rateIlia Mirkin1-1/+1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76319 Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau: recognise higher link rate for available dp bw calculationsBen Skeggs1-1/+4
I should resurrect/merge that cleanup branch to remove the weird duplication.. One day. Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/disp: limit dp capabilities as per dcbBen Skeggs2-1/+36
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nva3/fbram: restrict training pattern setup to GT218Ben Skeggs1-15/+17
It doesn't look like the others have the registers. Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nva3/devinit: restrict script access to some PFB regsBen Skeggs2-0/+51
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/devinit: add interface to check if a mmio access by scripts is okBen Skeggs4-3/+11
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/bios: have strap reads show on devinit spam debug levelBen Skeggs7-11/+13
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nv50/gpio: fixup reset for gpios >= 16Ben Skeggs1-2/+3
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nv50/gpio: exclude sense value from mask when changing registersBen Skeggs1-1/+1
Shouldn't effect anything, was just momentarily confusing while looking at traces. Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/gk104/gr: therm magic needed on some kepler boardsBen Skeggs1-1/+24
Not needed everywhere, and potentially not safe to do depending on how the rest of PTHERM is configured... Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/gm107/gr: initial supportBen Skeggs13-7/+2942
Our ucode only partially works at this point, so requiring binary fw image for now. Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/gf100-/gf: fix a stupid typo, waiting on wrong signal for mmctxBen Skeggs11-11/+11
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau/bios: parsing of some random table needed to bring up grBen Skeggs3-0/+133
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nv50/bar: fix plymouth issues on certain efi macbooksBen Skeggs1-1/+3
Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/nouveau: fix fbcon not being accelerated after suspendBen Skeggs1-2/+2
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. Signed-off-by: Ben Skeggs <[email protected]>
2014-03-26drm/gf100-/gr: split ppc state into its subunitsBen Skeggs10-44/+62
Signed-off-by: Ben Skeggs <[email protected]>