aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu
AgeCommit message (Collapse)AuthorFilesLines
2015-10-14drm/amdgpu: add VM CS mapping trace pointChristian König2-1/+19
Output all VM mappings a command submission uses. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: add option to clear VM page tables after every submitChristian König3-1/+21
This makes it much easier to find when userspace misses to send some buffers. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: add option to stop on VM faultChristian König4-6/+80
Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: only print meaningful VM faultsChristian König2-4/+12
Port of radeon commit 9b7d786b900baf7c0d1a7e211570aef1cb27590f. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: also trace already allocated VMIDsChristian König1-1/+3
Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h>Lukas Wunner2-2/+0
This was added to two radeon files even though they don't use any vga_switcheroo symbols, the amdgpu fork inherited them: Added to amdgpu_acpi.c by commit d7a2952f1ade ("drm/radeon: Add support for the ATIF ACPI method to the radeon driver"). Added to amdgpu_bios.c by commit 6a9ee8af344e ("vga_switcheroo: initial implementation (v15)"). Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: clean up pageflip interrupt handlingAlex Deucher3-159/+51
Check to make sure we aren't touching a non-existent display controller and simplify the code. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: rework sdma structuresAlex Deucher9-258/+245
Rework the sdma structures in the driver to consolidate all of the sdma info into a single structure and allow for asics that may have different numbers of sdma instances. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu: unpin cursor BOs on suspend and pin them again on resumeAlex Deucher1-1/+30
Everything is evicted from VRAM before suspend, so we need to make sure all BOs are unpinned and re-pinned after resume. Fixes broken mouse cursor after resume introduced by commit b9729b17. Port of radeon commit: f3cbb17bcf676a2fc6aedebe9fbebd59e550c51a Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce8: Fold set_cursor() into show_cursor()Alex Deucher1-13/+5
Port of radeon commit: 8991668ab4e26f985a8485719bce5d6d0623a644 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce8: Clean up reference counting and pinning of the cursor BOsAlex Deucher1-37/+24
Take a GEM reference for and pin the new cursor BO, unpin and drop the GEM reference for the old cursor BO in dce8 crtc_cursor_set2, and use amdgpu_crtc->cursor_addr in dce8 set_cursor. This fixes dce8 cursor_reset accidentally incrementing the cursor BO pin count, and cleans up the code a little. Port of radeon commit: cd404af0c930104462aa91344f07d002cf8248ed Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce8: Move hotspot handling out of set_cursorAlex Deucher1-19/+17
It's only needed in dce8 crtc_cursor_set2. Port of radeon commit: 2e007e611bc0a46dfed1547e0228a57f800e703d Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce8: Re-show the cursor after a modeset (v2)Alex Deucher1-24/+57
Setting a mode seems to clear the cursor registers, so we need to re-program them to make sure the cursor is visible. Port of radeon commit: 6d3759fac636028849f3bbec80c4b77e9bfdb1d2 v2: change radeon reference in error message Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce8: Use cursor_set2 hook for enabling / disabling the HW cursorAlex Deucher1-23/+51
The cursor_set2 hook provides the cursor hotspot position within the cursor image. When the hotspot position changes, we can adjust the cursor position such that the hotspot doesn't move on the screen. This prevents the cursor from appearing to intermittently jump around on the screen when the position of the hotspot within the cursor image changes. Port of radeon commits: 78b1a6010b46a69bcd47b723a80f92693f26d17b 3feba08d79c32777a845c3c8a4ab93092bdf6f19 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce11: Fold set_cursor() into show_cursor()Alex Deucher1-13/+5
Port of radeon commit: 8991668ab4e26f985a8485719bce5d6d0623a644 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce11: Clean up reference counting and pinning of the cursor BOsAlex Deucher1-37/+24
Take a GEM reference for and pin the new cursor BO, unpin and drop the GEM reference for the old cursor BO in dce11 crtc_cursor_set2, and use amdgpu_crtc->cursor_addr in dce11 set_cursor. This fixes dce11 cursor_reset accidentally incrementing the cursor BO pin count, and cleans up the code a little. Port of radeon commit: cd404af0c930104462aa91344f07d002cf8248ed Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce11: Move hotspot handling out of set_cursorAlex Deucher1-19/+17
It's only needed in dce11 crtc_cursor_set2. Port of radeon commit: 2e007e611bc0a46dfed1547e0228a57f800e703d Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce11: Re-show the cursor after a modeset (v2)Alex Deucher1-24/+57
Setting a mode seems to clear the cursor registers, so we need to re-program them to make sure the cursor is visible. Port of radeon commit: 6d3759fac636028849f3bbec80c4b77e9bfdb1d2 v2: change radeon reference in error output Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce11: Use cursor_set2 hook for enabling / disabling the HW cursorAlex Deucher1-23/+51
The cursor_set2 hook provides the cursor hotspot position within the cursor image. When the hotspot position changes, we can adjust the cursor position such that the hotspot doesn't move on the screen. This prevents the cursor from appearing to intermittently jump around on the screen when the position of the hotspot within the cursor image changes. Port of radeon commits: 78b1a6010b46a69bcd47b723a80f92693f26d17b 3feba08d79c32777a845c3c8a4ab93092bdf6f19 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce10: Fold set_cursor() into show_cursor()Alex Deucher1-13/+5
Port of radeon commit: 8991668ab4e26f985a8485719bce5d6d0623a644 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce10: Clean up reference counting and pinning of the cursor BOsAlex Deucher1-37/+24
Take a GEM reference for and pin the new cursor BO, unpin and drop the GEM reference for the old cursor BO in dce10 crtc_cursor_set2, and use amdgpu_crtc->cursor_addr in dce10 set_cursor. This fixes dce10 cursor_reset accidentally incrementing the cursor BO pin count, and cleans up the code a little. Port of radeon commit: cd404af0c930104462aa91344f07d002cf8248ed Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce10: Move hotspot handling out of set_cursorAlex Deucher1-19/+17
It's only needed in dce10 crtc_cursor_set2. Port of radeon commit: 2e007e611bc0a46dfed1547e0228a57f800e703d Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce10: Re-show the cursor after a modeset (v2)Alex Deucher1-24/+57
Setting a mode seems to clear the cursor registers, so we need to re-program them to make sure the cursor is visible. Port of radeon commit: 6d3759fac636028849f3bbec80c4b77e9bfdb1d2 v2: change radeon reference in error message Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/dce10: Use cursor_set2 hook for enabling / disabling the HW cursorAlex Deucher2-23/+55
The cursor_set2 hook provides the cursor hotspot position within the cursor image. When the hotspot position changes, we can adjust the cursor position such that the hotspot doesn't move on the screen. This prevents the cursor from appearing to intermittently jump around on the screen when the position of the hotspot within the cursor image changes. Port of radeon commits: 78b1a6010b46a69bcd47b723a80f92693f26d17b 3feba08d79c32777a845c3c8a4ab93092bdf6f19 Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/atom: add support for new div32 opcodes (v3)Alex Deucher2-2/+25
Better precision than the regular div opcode. v2: drop 64 bit divide v3: fix op handling. This actually is a 64 bit divide. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/atom: add support for new mul32 opcodes (v2)Alex Deucher2-2/+18
Better precision than the regular mul opcode. v2: handle big endian properly. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/atom: add support for process ds opcodeAlex Deucher1-1/+10
Just skips a data section. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-14drm/amdgpu/atom: implement debug opcodeAlex Deucher1-1/+2
Basically a nop. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-08drm/amdgpu: fix memory leak in amdgpu_vm_update_page_directorySudip Mukherjee1-1/+3
If amdgpu_ib_get() fails we returned the error code but we missed freeing ib. Cc: "Christian König" <[email protected]> Cc: Jammy Zhou <[email protected]> Cc: Chunming Zhou <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "monk.liu" <[email protected]> Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-07drm/amdgpu: disable hw semaphores by defaultAlex Deucher1-2/+2
These are buggy on some asics and not really used anymore now that the GPU schedular is enabled. Change-Id: I67182b409d64de308392a15d1a0a15018071dc0b Signed-off-by: Alex Deucher <[email protected]>
2015-10-07drm/amdgpu: enable scheduler by defaultChunming Zhou1-2/+2
Change-Id: Idce64f63e8422324996fc5d583d0bc9a5ac60d0c Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-10-07drm/amdgpu: add TOPDOWN flag to the whole vramChunming Zhou1-0/+2
need to decrease visible vram usage by default. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: monk.liu <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-10-07drm/amdgpu: add vram usage into debugfsChunming Zhou1-0/+5
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-10-07drm/amdgpu: split gfx8 gpu init into sw and hw partsAlex Deucher1-190/+197
Calculate the driver state in sw_init and program the registers in hw init. Acked-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-07drm/amdgpu: fix 32-bit compiler warningArnd Bergmann1-3/+3
The new amdgpu driver passes a user space pointer in a 64-bit structure member, which is the correct way to do it, but it attempts to directly cast it to a __user pointer in the kernel, which causes a warning in three places: drm/amd/amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_parser_init': drm/amd/amdgpu/amdgpu_cs.c:180:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] chunk_array_user = (uint64_t __user *)(cs->in.chunks); This changes all three to add an intermediate cast to 'unsigned long' as other drivers do. This avoids the warning and works correctly on both 32-bit and 64-bit architectures. Fixes: e60b344f6c0eff ("drm/amdgpu: optimize amdgpu_parser_init") Reviewed-by: Christian König <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-06drm/amdgpu: flag iceland as experimentalAlex Deucher1-5/+5
These have not been tested very extensively and generally seem to be problematic. Mark them as experimental for now. bug: https://bugs.freedesktop.org/show_bug.cgi?id=92270 Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-06drm/amdgpu: check before checking pci bridge registersAlex Deucher2-0/+6
Make sure we are not the root device before attempting to read the pcie bridge registers to check the pcie gen speeed. Fixes a crash when the device is passed through to a VM. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-06drm/irq: Use unsigned int pipe in public APIThierry Reding4-31/+31
This continues the pattern started in commit cc1ef118fc09 ("drm/irq: Make pipe unsigned and name consistent"). This is applied to the public APIs and driver callbacks, so pretty much all drivers need to be updated to match the new prototypes. Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Russell King <[email protected]> Cc: Inki Dae <[email protected]> Cc: Jianwei Wang <[email protected]> Cc: Alison Wang <[email protected]> Cc: Patrik Jakobsson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: David Airlie <[email protected]> Cc: Rob Clark <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Mark Yao <[email protected]> Cc: Benjamin Gaignard <[email protected]> Cc: Vincent Abriou <[email protected]> Cc: Thomas Hellstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-05drm/amdgpu: fix num_crtc on CZAlex Deucher1-1/+1
Hw only has 3 crtcs. copy paste typo. Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-05drm/amdgpu: restore the fbdev mode in lastcloseAlex Deucher3-1/+21
restore the fbdev state if a drm app like X is killed. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-10-02drm/amdgpu: add pm sysfs files lateAlex Deucher3-10/+17
They were added relatively early in the driver init process which meant that in some cases the driver was not finished initializing before external tools tried to use them which could result in a crash depending on the timing. Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-02drm/amdgpu: Spell vga_switcheroo consistentlyLukas Wunner3-3/+3
Currently everyone and their dog has their own favourite spelling for vga_switcheroo. This makes it hard to grep dmesg for log entries relating to vga_switcheroo. It also makes it hard to find related source files in the tree. vga_switcheroo.c uses pr_fmt "vga_switcheroo". Use that everywhere. Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-09-30drm/amdgpu: only print meaningful VM faultsChristian König2-4/+12
Port of radeon commit 9b7d786b900baf7c0d1a7e211570aef1cb27590f. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-09-30drm/amdgpu/cgs: remove import_gpu_memAlex Deucher1-39/+0
It was added for completeness, but we don't have any users for it yet. Daniel noted that it may be racy. Remove it. Change-Id: I5f5546f8911a4f294008a62dc86a73f3face38d1 Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-09-30Merge tag 'topic/drm-misc-2015-09-25' of ↵Dave Airlie3-7/+9
git://anongit.freedesktop.org/drm-intel into drm-next Another attempt at drm-misc for 4.4 ... - better atomic helpers for runtime pm drivers - atomic fbdev - dp aux i2c STATUS_UPDATE handling (for short i2c replies from the sink) - bunch of constify patches - inital kerneldoc for vga switcheroo - some vblank code cleanups from Ville and Thierry - various polish all over * tag 'topic/drm-misc-2015-09-25' of git://anongit.freedesktop.org/drm-intel: (57 commits) drm/irq: Add drm_crtc_vblank_count_and_time() drm/irq: Rename drm_crtc -> crtc drm: drm_atomic_crtc_get_property should be static drm/gma500: Remove DP_LINK_STATUS_SIZE redefinition vga_switcheroo: Set active attribute to false for audio clients drm/core: Preserve the fb id on close. drm/core: Preserve the framebuffer after removing it. drm: Use vblank timestamps to guesstimate how many vblanks were missed drm: store_vblank() is never called with NULL timestamp drm: Clean up drm_calc_vbltimestamp_from_scanoutpos() vbl_status drm: Limit the number of .get_vblank_counter() retries drm: Pass flags to drm_update_vblank_count() drm/i915: Fix vblank count variable types drm: Kill pixeldur_ns drm: Stop using linedur_ns and pixeldur_ns for vblank timestamps drm: Move timestamping constants into drm_vblank_crtc drm/fbdev: Update legacy plane->fb refcounting for atomic restore drm: fix kernel-doc warnings in drm_crtc.h vga_switcheroo: Sort headers alphabetically drm: Spell vga_switcheroo consistently ...
2015-09-29drm/amdgpu: Restore LCD backlight level on resumeAlex Deucher1-2/+1
Instead of only enabling the backlight (which seems to set it to max brightness), just re-set the current backlight level, which also takes care of enabling the backlight if necessary. Port of radeon commit: drm/radeon: Restore LCD backlight level on resume (>= R5xx) Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-09-29drm/amdgpu: signedness bug in amdgpu_cs_parser_init()Dan Carpenter1-1/+2
The "i" variable should be signed or it leads to a crash in the error handling code. Fixes: 1d263474c441 ('drm/amdgpu: unwind properly in amdgpu_cs_parser_init()') Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-09-24drm: Stop using linedur_ns and pixeldur_ns for vblank timestampsVille Syrjälä2-6/+8
linedur_ns, and especially pixeldur_ns are becoming rather inaccurate to be used for the vblank timestamp correction. With 4k@60 the pixel duration is already below 2ns, so the amount of error due to the truncation to nanoseconds is introducing quite a bit of error. We can avoid such problems if we instead calculate the timestamp delta_ns directly from the dislay timings, avoiding the use of these intermediate truncated values. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> [danvet: Squash in fixup from Thierry Reding for amdgpu.] Signed-off-by: Daniel Vetter <[email protected]>
2015-09-24drm: Move timestamping constants into drm_vblank_crtcVille Syrjälä1-1/+1
Collect the timestamping constants alongside the rest of the relevant stuff under drm_vblank_crtc. We can now get rid of the 'refcrtc' parameter to drm_calc_vbltimestamp_from_scanoutpos(). Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-09-23drm/amdgpu: Sprinkle drm_modeset_lock_all to appease locking checksAlex Deucher1-0/+4
In commit 7a3f3d6667f5f9ffd1517f6b21d64bbf5312042c Author: Daniel Vetter <[email protected]> Date: Thu Jul 9 23:44:28 2015 +0200 drm: Check locking in drm_for_each_connector I added locking checks to drm_for_each_connector but failed that through drm_helper_connector_dpms -> drm_helper_choose_encoder_dpms it's used in a few more places in the amdgpu resume/suspend code. Fix them up. Note that we could use the connector iterator macros in there too, but that's for the future. Port of radeon commit: drm/radeon: Sprinkle drm_modeset_lock_all to appease locking checks Signed-off-by: Alex Deucher <[email protected]>