aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
AgeCommit message (Collapse)AuthorFilesLines
2015-12-21drm/amdgpu: mv amdgpu_acpi.h to amd/include/amd_acpi.hRex Zhu3-4/+4
This will be shared with the new powerplay module. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: mv some definition from amdgpu_acpi.c to amdgpu_acpi.hRex Zhu2-60/+53
These will be shared with the new powerplay module. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: share struct amdgpu_pm_state_type with powerplay moduleRex Zhu3-30/+27
rename amdgpu_pm_state_type to amd_pm_state_type Signed-off-by: Rex Zhu <[email protected]> Acked-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: Fix off-by-one errors in amdgpu_vm_bo_mapFelix Kuehling1-5/+5
eaddr is sometimes treated as the last address inside the address range, and sometimes as the first address outside the range. This was resulting in errors when a test filled up the entire address space. Make it consistent to always be the last address within the range. Signed-off-by: Felix.Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Cc: [email protected]
2015-12-21drm/amdgpu: fix dp link rate selection (v2)Alex Deucher1-60/+36
Need to properly handle the max link rate in the dpcd. This prevents some cases where 5.4 Ghz is selected when it shouldn't be. v2: simplify logic, add array bounds check Reviewed-by: Tom St Denis <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-18drm/amdgpu: keep the PTs validation list in the VM v2Christian König4-47/+27
This avoids allocating it on the fly. v2: fix grammar in comment Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
2015-12-18drm/amdgpu: split VM PD and PT handling during CSChristian König4-29/+51
This way we avoid the extra allocation for the page directory entry. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
2015-12-18drm/amdgpu: put VM page tables directly into duplicates listChristian König4-9/+12
They share the reservation object with the page directory anyway. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
2015-12-18drm/amdgpu: restrict the sched jobs number to power of twoChunming Zhou2-2/+11
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> CC: [email protected]
2015-12-17drm/amdgpu: limit visible vram if it's smaller than the BARAlex Deucher2-0/+8
In some cases the amount of vram may be less than the BAR size, if so, limit visible vram to the amount of actual vram, not the BAR size. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-16drm/amdgpu: fix user fence handlingChristian König2-22/+44
This fixes a random corruption under memory pressure. We need to fence the BO for the user fence as well, otherwise it might be swapped out and the GPU could write the fence value to an undesired location. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-12-14drm/amdgpu: change default sched jobs to 32Chunming Zhou1-2/+2
Change the default scheduler queue size from 16 to 32. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-14drm/amdgpu: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobsChunming Zhou2-10/+20
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-14drm/amdgpu: handle error case for ctxChunming Zhou1-2/+5
Properly handle ctx init failure. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-14drm/amdgpu: add entity only when first job comeChunming Zhou1-5/+8
umd somtimes will create a context for every ring, that means some entities wouldn't be used at all. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-11drm/amdgpu: add more debugging output for driver failuresAlex Deucher1-16/+57
Add more fine grained debugging output for init/fini/suspend/ resume failures. Signed-off-by: Alex Deucher <[email protected]>
2015-12-11drm/amdgpu: update rev id register for VIFlora Cui1-6/+3
Change-Id: I2ae9bb4a929f7c0c8783e0be563ae04be77596e2 Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-11drm/amdgpu/gfx8: update PA_SC_RASTER_CONFIG:PKR_MAP onlyFlora Cui1-1/+1
Use default value as a base. Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
2015-12-11drm/amdgpu/gfx8: Enable interrupt on ME1_PIPE3Flora Cui1-0/+5
Otherwise FW cannot see the RLC ACK for the memory clean request It's for Stoney. Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
2015-12-11drm: Pass 'name' to drm_encoder_init()Ville Syrjälä3-21/+21
Done with coccinelle for the most part. However, it thinks '...' is part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder in its place and got rid of it with sed afterwards. @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4; @@ drm_encoder_init(E1, E2, E3, E4 + ,NULL ) v2: Add ', or NULL...' to @name kernel doc (Jani) Annotate the function with __printf() attribute (Jani) Signed-off-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-12-09drm/amdgpu: fix the lost duplicates checkingChunming Zhou1-0/+8
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Cc: [email protected]
2015-12-08drm: Move LEAVE/ENTER_ATOMIC_MODESET to fbdev helpersDaniel Vetter1-0/+1
This is only used for kgdb (and previously panic) handlers in the fbdev emulation, so belongs there. Note that this means we'll leave behind a forward declaration, but once all the helper vtables are consolidated (in the next patch) that will make more sense. v2: fixup radone/amdgpu. Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Thierry Reding <[email protected]> (v2)
2015-12-08Back merge tag 'v4.4-rc4' into drm-nextDave Airlie15-50/+188
We've picked up a few conflicts and it would be nice to resolve them before we move onwards.
2015-12-04drm/amdgpu: Fixup hw vblank counter/ts for new drm_update_vblank_count() (v3)Alex Deucher6-30/+140
commit 4dfd6486 "drm: Use vblank timestamps to guesstimate how many vblanks were missed" introduced in Linux 4.4-rc1 makes the drm core more fragile to drivers which don't update hw vblank counters and vblank timestamps in sync with firing of the vblank irq and essentially at leading edge of vblank. This exposed a problem with radeon-kms/amdgpu-kms which do not satisfy above requirements: The vblank irq fires a few scanlines before start of vblank, but programmed pageflips complete at start of vblank and vblank timestamps update at start of vblank, whereas the hw vblank counter increments only later, at start of vsync. This leads to problems like off by one errors for vblank counter updates, vblank counters apparently going backwards or vblank timestamps apparently having time going backwards. The net result is stuttering of graphics in games, or little hangs, as well as total failure of timing sensitive applications. See bug #93147 for an example of the regression on Linux 4.4-rc: https://bugs.freedesktop.org/show_bug.cgi?id=93147 This patch tries to align all above events better from the viewpoint of the drm core / of external callers to fix the problem: 1. The apparent start of vblank is shifted a few scanlines earlier, so the vblank irq now always happens after start of this extended vblank interval and thereby drm_update_vblank_count() always samples the updated vblank count and timestamp of the new vblank interval. To achieve this, the reporting of scanout positions by radeon_get_crtc_scanoutpos() now operates as if the vblank starts radeon_crtc->lb_vblank_lead_lines before the real start of the hw vblank interval. This means that the vblank timestamps which are based on these scanout positions will now update at this earlier start of vblank. 2. The driver->get_vblank_counter() function will bump the returned vblank count as read from the hw by +1 if the query happens after the shifted earlier start of the vblank, but before the real hw increment at start of vsync, so the counter appears to increment at start of vblank in sync with the timestamp update. 3. Calls from vblank irq-context and regular non-irq calls are now treated identical, always simulating the shifted vblank start, to avoid inconsistent results for queries happening from vblank irq vs. happening from drm_vblank_enable() or vblank_disable_fn(). 4. The radeon_flip_work_func will delay mmio programming a pageflip until the start of the real vblank iff it happens to execute inside the shifted earlier start of the vblank, so pageflips now also appear to execute at start of the shifted vblank, in sync with vblank counter and timestamp updates. This to avoid some races between updates of vblank count and timestamps that are used for swap scheduling and pageflip execution which could cause pageflips to execute before the scheduled target vblank. The lb_vblank_lead_lines "fudge" value is calculated as the size of the display controllers line buffer in scanlines for the given video mode: Vblank irq's are triggered by the line buffer logic when the line buffer refill for a video frame ends, ie. when the line buffer source read position enters the hw vblank. This means that a vblank irq could fire at most as many scanlines before the current reported scanout position of the crtc timing generator as the number of scanlines the line buffer can maximally hold for a given video mode. This patch has been successfully tested on a RV730 card with DCE-3 display engine and on a evergreen card with DCE-4 display engine, in single-display and dual-display configuration, with different video modes. A similar patch is needed for amdgpu-kms to fix the same problem. Limitations: - Maybe replace the udelay() in the flip_work_func() by a suitable usleep_range() for a bit better efficiency? Will try that. - Line buffer sizes in pixels are hard-coded on < DCE-4 to a value i just guessed to be high enough to work ok, lacking info on the true sizes atm. Probably fixes: fdo#93147 Port of Mario's radeon fix to amdgpu. Signed-off-by: Alex Deucher <[email protected]> (v1) Reviewed-by: Mario Kleiner <[email protected]> (v2) Refine amdgpu_flip_work_func() for better efficiency. In amdgpu_flip_work_func, replace the busy waiting udelay(5) with event lock held by a more performance and energy efficient usleep_range() until at least predicted true start of hw vblank, with some slack for scheduler happiness. Release the event lock during waits to not delay other outputs in doing their stuff, as the waiting can last up to 200 usecs in some cases. Also small fix to code comment and formatting in that function. (v2) Signed-off-by: Mario Kleiner <[email protected]> (v3) Fix crash in crtc disabled case
2015-12-04drm/amdgpu: add spin lock to protect freed list in vm (v2)jimqu2-3/+15
there is a protection fault about freed list when OCL test. add a spin lock to protect it. v2: drop changes in vm_fini Signed-off-by: JimQu <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-04drm/amdgpu: partially revert "drm/amdgpu: fix ↵Christian König2-2/+2
VM_CONTEXT*_PAGE_TABLE_END_ADDR" v2 The gtt_end is already inclusive, we don't need to subtract one here. v2 (chk): keep the fix for the VM code, cause here it really applies. Signed-off-by: Christian König <[email protected]> Signed-off-by: Anatoli Antonovitch <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Alex Deucher <[email protected]>
2015-12-04drm/amdgpu: take a BO reference for the user fenceChristian König1-2/+4
No need for a GEM reference here. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-04drm/amdgpu: take a BO reference in the display codeChristian König1-3/+3
No need for the GEM reference here. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-04drm/amdgpu: set snooped flags only on system addresses v2Christian König1-3/+4
Not necessary for VRAM. v2: no need to check if ttm is NULL. Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-04drm/amdgpu: add spin lock to protect freed list in vm (v2)jimqu2-3/+15
there is a protection fault about freed list when OCL test. add a spin lock to protect it. v2: drop changes in vm_fini Signed-off-by: JimQu <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-04amdgpu/gfxv8: Remove magic numbers from function ↵Tom St Denis1-2/+2
gfx_v8_0_tiling_mode_table_init() Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-04drm/amdgpu: fix race condition in amd_sched_entity_push_jobNicolai Hähnle1-2/+3
As soon as we leave the spinlock after the job has been added to the job queue, we can no longer rely on the job's data to be available. I have seen a null-pointer dereference due to sched == NULL in amd_sched_wakeup via amd_sched_entity_push_job and amd_sched_ib_submit_kernel_helper. Since the latter initializes sched_job->sched with the address of the ring scheduler, which is guaranteed to be non-NULL, this race appears to be a likely culprit. Signed-off-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/attachment.cgi?bugid=93079 Reviewed-by: Christian König <[email protected]>
2015-12-04drm/amdgpu: add err check for pin userptrChunming Zhou1-3/+7
Missing error check if the operation failed. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-04amdgpu/gfxv8: Simplification in gfx_v8_0_enable_gui_idle_interrupt()Tom St Denis1-11/+5
Simplified the function by folding the two paths into one. Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-04amdgpu/gfxv8: Simplification of gfx_v8_0_create_bitmask()Tom St Denis1-7/+1
Simplification of the function gfx_v8_0_create_bitmask(). Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-04amdgpu/gfxv8: Cleanup of gfx_v8_0_tiling_mode_table_init() (v2)Tom St Denis1-1388/+898
Simplification and LOC reduction of function gfx_v8_0_tiling_mode_table_init() v2: remove spurious break bug: https://bugs.freedesktop.org/show_bug.cgi?id=93236 Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-02amdgpu/gfxv8: Add missing break to switch statement from states init codeTom St Denis1-0/+1
Signed-off-by: Tom St Denis <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-02drm/amd: abstract kernel rq and normal rq to priority of run queueChunming Zhou5-15/+23
Allows us to set priorities in the scheduler. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
2015-12-02drm/amdgpu: add EDC support for CZ (v3)Alex Deucher1-1/+330
This adds EDC support for CZ. EDC = Error Correction and Detection This code properly initializes the EDC hardware and resets the error counts. This is done in late_init since it requires the IB pool which is not initialized during hw_init. v2: fix the IB size as noted by Felix, fix shader pgm register programming v3: use the IB for the shaders as suggested by Christian Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amd: add new gfx8 register definitions for EDCAlex Deucher1-0/+13
EDC is a RAS feature for on chip memory. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: fix race condition in amd_sched_entity_push_jobNicolai Hähnle1-2/+3
As soon as we leave the spinlock after the job has been added to the job queue, we can no longer rely on the job's data to be available. I have seen a null-pointer dereference due to sched == NULL in amd_sched_wakeup via amd_sched_entity_push_job and amd_sched_ib_submit_kernel_helper. Since the latter initializes sched_job->sched with the address of the ring scheduler, which is guaranteed to be non-NULL, this race appears to be a likely culprit. Signed-off-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/attachment.cgi?bugid=93079 Reviewed-by: Christian König <[email protected]>
2015-12-02drm/amdgpu: add err check for pin userptrChunming Zhou1-3/+7
Missing error check if the operation failed. Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-02drm/amdgpu: Use unlocked gem unreferencingDaniel Vetter1-1/+1
For drm_gem_object_unreference callers are required to hold dev->struct_mutex, which these paths don't. Enforcing this requirement has become a bit more strict with commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663 Author: Daniel Vetter <[email protected]> Date: Thu Oct 15 09:36:25 2015 +0200 drm/gem: Check locking in drm_gem_object_unreference Cc: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: Use new read bios from rom callbackmonk.liu1-8/+50
Read the vbios directly from the rom. In some cases, e.g., virtualization, the rom is not available via the BAR or other means. Access it directly. This is an updated version of Monks original patch which uses family specific callbacks and unifies some of the validation checking. Reviewed-by: Christian König <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Signed-off-by: Monk Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: add read_bios_from_rom callback for VI partsAlex Deucher1-0/+33
Read the vbios image directly from the rom. Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Monk Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: add read_bios_from_rom callback for CI partsAlex Deucher1-0/+32
Read the vbios image directly from the rom. Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Monk Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: add a callback for reading the bios from the rom directlyAlex Deucher1-0/+3
This is necessary when the vbios image is not directly accessible via the rom BAR or legacy vga location. Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Monk Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: use $(src) in Makefile (v2)Jammy Zhou1-4/+6
This can solve the path problem when compile amdgpu with DKMS. v2: agd: rebase on current drm-next Signed-off-by: Jammy Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-02drm/amdgpu: call hpd_irq_event on resumeAlex Deucher1-0/+1
Need to call this on resume if displays changes during suspend in order to properly be notified of changes. Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-12-01Merge tag 'topic/drm-misc-2015-11-26' of ↵Dave Airlie3-4/+3
git://anongit.freedesktop.org/drm-intel into drm-next Here's the first drm-misc pull, with really mostly misc stuff all over. Somewhat invasive is only Ville's change to mark the arg struct for fb_create const - that might conflict with a new driver pull. So better to get in fast. * tag 'topic/drm-misc-2015-11-26' of git://anongit.freedesktop.org/drm-intel: drm/mm: use list_next_entry drm/i915: fix potential dangling else problems in for_each_ macros drm: fix potential dangling else problems in for_each_ macros drm/sysfs: Send out uevent when connector->force changes drm/atomic: Small documentation fix. drm/mm: rewrite drm_mm_for_each_hole drm/sysfs: Grab lock for edid/modes_show drm: Print the src/dst/clip rectangles in error in drm_plane_helper drm: Add "prefix" parameter to drm_rect_debug_print() drm: Keep coordinates in the typical x, y, w, h order instead of x, y, h, w drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create() drm: modes: replace simple_strtoul by kstrtouint drm: Describe the Rotation property bits. drm: Remove unused fbdev_list members GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob() drm/dp: add eDP DPCD backlight control bit definitions drm/tegra: Remove local fbdev emulation Kconfig option drm/imx: Remove local fbdev emulation Kconfig option drm/gem: Update/Polish docs drm: Update GEM refcounting docs