aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-11-06drm/ttm: Handle in-memory region copiesJakob Bornecrantz1-1/+3
Fix the case where the ttm pointer may be NULL causing a NULL pointer dereference. Signed-off-by: Jakob Bornecrantz <[email protected]> Signed-off-by: Thomas Hellström <[email protected]> Cc: [email protected]
2013-11-06drm/ttm: Make NO_EVICT bos available to shrinkers pending destructionThomas Hellstrom1-1/+13
NO_EVICT bos that are not idle when all references are dropped are put on the delayed destroy list. However, since they are not on LRU lists, they are not available to shrinkers at that point, and buffers on the delayed destroy list are not checked very often for idle. So when these buffers are put on the delayed destroy list, clear the NO_EVICT flag and put them on the right LRU list. This way they are immediately available for eviction or shrinkers and will not cause false OOMS. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
2013-11-06drm/ttm: Allow vm fault retriesThomas Hellstrom1-12/+50
Make use of the FAULT_FLAG_ALLOW_RETRY flag to allow dropping the mmap_sem while waiting for bo idle. FAULT_FLAG_ALLOW_RETRY appears to be primarily designed for disk waits but should work just as fine for GPU waits.. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
2013-11-06drm/vmwgfx: Use the linux DMA api to get valid device addresses of pagesThomas Hellstrom4-94/+620
The code handles three different cases: 1) physical page addresses. The ttm page array is used. 2) DMA subsystem addresses. A scatter-gather list is used. 3) Coherent pages. The ttm dma pool is used, together with the dma_ttm array os dma_addr_t Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
2013-11-06drm/ttm: Enable the dma page pool also for intel IOMMUsThomas Hellstrom3-6/+14
Used by the vmwgfx driver Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Konrad Rzeszutek Wilk <[email protected]>
2013-11-06drm/i915/vlv: use PIPE_START_VBLANK interrupts on VLVJesse Barnes1-1/+1
This fixes a mismatch between our vblank enable code and our IRQ handler. Also, since vblank start events come in before page flips reliably, it also fixes the kms_flip plain-flip test on my BYT system. Spotted-by: Ville Syrjälä <[email protected]> Signed-off-by: Jesse Barnes <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2013-11-06qxl: add a connector property to denote hotplug should rescan modes.Dave Airlie2-0/+20
So GNOME userspace has an issue with when it rescans for modes on hotplug events, if the monitor has no EDID it assumes that nothing has changed on EDID as with real hw we'd never have new modes without a new EDID, and they kind off rely on the behaviour now, however with virtual GPUs we would like to rescan the modes and get a new preferred mode on hotplug events to handle dynamic guest resizing (where you resize the host window and the guest resizes with it). This is a simple property we can make userspace watch for to trigger new behaviour based on it, and can be used to replaced EDID hacks in virtual drivers. Acked-by: Marc-André Lureau <[email protected]> (on irc) Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: delay minor destruction to drm_dev_free()David Herrmann1-3/+7
Instead of freeing minors in drm_dev_unregister(), we only unplug them and delay the free to drm_dev_free(). Note that if drm_dev_register() has never been called, minors are NULL and this has no effect. This change is needed to allow early device unregistration. If we want to call drm_dev_unregister() on live devices, we need to guarantee that minors are still valid (but unplugged). This way, any open file can still access file_priv->minor->dev to get the DRM device. However, the minor is unplugged so no new users can occur. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: remove minor-id during unplugDavid Herrmann1-3/+1
Don't delay minor removal to drm_put_minor(). Otherwise, user-space can still open the minor and cause the kernel to oops. Instead, remove the minor during unplug so any new open() will fail to access this minor. Note that open() and drm_unplug_minor() are both protected by the global DRM mutex so we're fine. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: cleanup debugfs in drm_unplug_minor()David Herrmann1-4/+4
There is no reason to delay debugfs-cleanup to drm_put_minor(). We should forbid any access to debugfs files once the device is dead. Chances they oops once a card was unplugged are very high, anyway. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: make drm_get_minor() staticDavid Herrmann2-9/+11
drm_get_minor() is only used in one file. Make it static and add a kernel-doc comment which documents the current semantics. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: simplify drm_put_minor()David Herrmann2-19/+13
Allow passing NULL as minor to simplify DRM destruction paths. Also remove the double-pointer reset as it is no longer needed. drm_put_minor() is only called when the underlying object is destroyed. Hence, resetting minors to NULL is not necessary. As drm_put_minor() is no longer used by other DRM files, we can make it static, too. Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: call drm_unplug_minor() from drm_put_minor()David Herrmann1-9/+24
This protects drm_unplug_minor() against repeated calls so we can use it in drm_put_minor(). This allows us to further simplify it in follow-ups as we no longer do minor-destruction in both functions but only in drm_unplug_minor(). Also add kernel-doc comments about what these calls do. [airlied: fixup for changes to kdev stuff] Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: eliminate bit-copy restoration of crtcIlija Hadzic1-25/+8
Bit-copying restoration of CRTC structure in failure-recovery path of drm_crtc_helper_set_config function evokes a subtle and rare, but very dangerous, corruption of CRTC mutex structure. Namely, if drm_crtc_helper_set_config takes the path under 'fail:' label *and* some other process has attempted to grab the crtc mutex (and got blocked), restoring the CRTC structure by bit-copying it will overwrite the CRTC mutex state and the waiters list pointer within the mutex structure. Consequently the blocked process will never be scheduled. This patch fixes the issue by eliminating the bit-copy restoration. The elimination is possible because previous patches have cleaned up the resoration path so that only the fields touched by the drm_crtc_helper_set_config function are saved and restored if necessary. Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: do not set crtc enabled field twiceIlija Hadzic1-2/+1
There is no need to set crtc->enabled field in drm_crtc_helper_set_config. This is already done (and properly restored in case of failure) in drm_crtc_helper_set_mode that is called by drm_crtc_helper_set_config. Doing it at only one place makes restoration in case of failure easier. Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: fix error recovery path in drm_crtc_helper_set_modeIlija Hadzic1-4/+7
There is no need to save or restore hwmode field, because by the time this function sets this field, it cannot fail any more. However, we should save old enabled field because if the function fails, we want to return with unchanged CRTC. Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: restore crtc origin if mode_set_base failsIlija Hadzic1-0/+2
Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: eliminate old_fb from drm_crtc_helper_set_configIlija Hadzic1-8/+4
Old framebuffer is stored in save_set.fb and it is the same value that is later stored in old_fb. This makes old_fb redundant so we can replace it with save_set.fb. Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: remove redundant if statementIlija Hadzic1-2/+1
Signed-off-by: Ilija Hadzic <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Compact booleans within struct drm_fileChris Wilson1-7/+6
Replace the sparse array of booleans with a bitfield. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Do not drop root privileges for a fancier younger processChris Wilson2-2/+4
When a second process opens the device and master transferrence is complete, we walk the list of open devices and remove their authentication. This also revokes our root privilege. Instead of simply dropping the authentication, this patch reverts the authenticated state back to its original value. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06nouveau: drop interrupt busy setting.Dave Airlie1-3/+0
This causes problems with never going busy due to ptherm polling, and after talking to Ben I can't see it being required. Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/sysfs: Remove stale comments about calling drm_sysfs_connector_add() ↵Ville Syrjälä1-6/+0
multiple times drm_connector_sysfs_add() explicitly checks if connector->kdev is already populated and returns success. So it clearly now allows being called multiple times. Remove some stale comments to the contrary. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/radeon: fix radeon_fence_wait_empty_lockedChristian König1-0/+3
Don't block forever if there is nothing to wait for. Signed-off-by: Christian König <[email protected]> Tested-by: Rafa? Mi?ecki <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/qxl: add some surface memory loggingGerd Hoffmann2-3/+9
Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/qxl: support 64bit surface barGerd Hoffmann1-7/+25
qxl devices can have a 64bit surface bar, which is quite handy if you need a bit more surface memory. So try to use it if it is present. Note that this bar might be mapped above 4g. QEMU command line to check that out: qemu-system-x86_64 -m 4g \ -vga qxl -global qxl-vga.vram64_size_mb=512 \ $otheroptions Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/cirrus: use drm_set_preferred_modeGerd Hoffmann1-6/+5
Explicitly set 1024x768 as default mode, so the display doesn't come up with the largest supported mode. While being at it drop first three drm_add_modes_noedid calls. As drm_add_modes_noedid fills the mode list with modes from the database *up to* the specified size it is pretty pointless to call it multiple times with different sizes. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: add drm_set_preferred_modeGerd Hoffmann2-0/+15
New helper function to set the preferred video mode. Can be called after drm_add_modes_noedid if you don't want the largest supported video mode be used by default. Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Pretty print pixel format in drm_fb_get_bpp_depth() and format_check()Ville Syrjälä1-1/+4
drm_fb_get_bpp_depth() likes to complain about unsupported pixel formats but doesn't bother telling us what the format was. Also format_check() just returns an error when it encouters an invalid format, leaving the user scratching his head trying to figure out why addfb failed. Make life a bit easier by using drm_get_format_name() in both places. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/edid: Yank a helpful comment about EST modes from xf86EdidModes.cVille Syrjälä1-0/+9
I got very confused when I tried to compare the EST modes with the spec. Bring over a comment from xf86EdidModes.c that actually describes some of history where these things came from. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/edid: Don't skip every eighth EST III modeVille Syrjälä1-1/+1
Also check the est3 modes whose presence is indicated by bit 0. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/edid: Fix the 1792x1344-75 EST III modeVille Syrjälä1-1/+1
The correct refresh rate for this mode is 75, not 85. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/vmwgfx: Return -ENOENT when a framebuffer can't be foundVille Syrjälä1-2/+2
Let's be a bit more consistent with our error values. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/vmwgfx: Return -ENOENT when a mode object can't be foundVille Syrjälä1-1/+1
Let's be a bit more consistent with our error values. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/radeon: Return -ENOENT when a mode object can't be foundVille Syrjälä2-2/+2
Let's be a bit more consistent with our error values. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/i915: Return -ENOENT when a mode object can't be foundVille Syrjälä2-3/+3
Let's be a bit more consistent with our error values. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/gma500: Return -ENOENT when a mode object can't be foundVille Syrjälä2-3/+3
Let's be a bit more consistent with our error values. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Return -ENOENT when a framebuffer can't be foundVille Syrjälä1-5/+7
Return -ENOENT for framebuffers like we do for other mode objects that can't be found. Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Consistently return -ENOENT when a mode object can't be foundVille Syrjälä1-14/+18
We tend to return -EINVAL for everything. Let's try to help poor userland developers a bit by at least returning -ENONET for missing objects. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Pass pointers to virt_to_page()Ben Hutchings2-3/+3
Most architectures define virt_to_page() as a macro that casts its argument such that an argument of type unsigned long will be accepted without complaint. However, the proper type is void *, and passing unsigned long results in a warning on MIPS. Compile-tested only. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Do not include page offset in argument to virt_to_page()Ben Hutchings1-1/+1
By definition, the page offset will not affect the result. Compile-tested only. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: delete unconsumed pending event list in drm_events_releaseYoungJun Cho1-1/+3
When there are unconsumed pending events, the events are destroyed by calling destroy callback, but the events list are remained, because there is no list_del(). It is possible that the page flip request is handled after drm_events_release() is called and before drm_fb_release(). In this case a drm_pending_event is remained not freed. So exynos driver checks again to remove it in its post close routine. But the file_priv->event_list contains undeleted ones, this can make oops for accessing invalid memory. Signed-off-by: YoungJun Cho <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/i915: Make the debugfs structures constLespiau, Damien1-2/+2
Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Make drm_debugfs_list constLespiau, Damien1-1/+1
Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Remove drm_debugfs_node and drm_debugfs_listLespiau, Damien1-21/+0
Those structures are not used anywhere. Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: Constify struct drm_info_list * argumentsLespiau, Damien2-6/+7
Those functions are just reading data from those pointers. Signed-off-by: Damien Lespiau <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06DRM: Armada: convert to use simple_open()Duan Jiong1-7/+1
This removes an open coded simple_open() function and replaces file operations references to the function with simple_open() instead. Signed-off-by: Duan Jiong <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm: shmobile: Add dependency on BACKLIGHT_CLASS_DEVICELaurent Pinchart1-0/+1
The driver registers a backlight device and thus requires BACKLIGHT_CLASS_DEVICE to be selected to avoid compilation breakages. Cc: [email protected] Reported-by: Russell King <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/intel: Push get_scanout_position() timestamping into kms driver.Mario Kleiner1-11/+43
Move the ktime_get() clock readouts and potential preempt_disable() calls from drm core into kms driver to make it compatible with the api changes in the drm core. The intel-kms driver needs to take the uncore.lock inside i915_get_crtc_scanoutpos() and intel_pipe_in_vblank(). This is incompatible with the preempt_disable() on a PREEMPT_RT patched kernel, as regular spin locks must not be taken within a preempt_disable'd section. Lock contention on the uncore.lock also introduced too much uncertainty in vblank timestamps. Push the ktime_get() timestamping for scanoutpos queries and potential preempt_disable_rt() into i915_get_crtc_scanoutpos(), so these problems can be avoided: 1. First lock the uncore.lock (might sleep on a PREEMPT_RT kernel). 2. preempt_disable_rt() (will be added by the rt-linux folks). 3. ktime_get() a timestamp before scanout pos query. 4. Do all mmio reads as fast as possible without grabbing any new locks! 5. ktime_get() a post-query timestamp. 6. preempt_enable_rt() 7. Unlock the uncore.lock. This reduces timestamp uncertainty on a low-end HP Atom Mini netbook with Intel GMA-950 nicely: Before: 3-8 usecs with spikes > 20 usecs, triggering query retries. After : Typically 1 usec (98% of all samples), occassionally 2 usecs (2% of all samples), with maximum of 3 usecs (a handful). v2: Fix formatting of new multi-line code comments. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2013-11-06drm/radeon: Push get_scanout_position() timestamping into kms driver.Mario Kleiner4-6/+26
Move the ktime_get() clock readouts and potential preempt_disable() calls from drm core into kms driver to make it compatible with the api changes in the drm core. This should not introduce any change in functionality or behaviour in radeon-kms, just a reshuffling of code. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]>