aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
AgeCommit message (Collapse)AuthorFilesLines
2016-01-22drm/amd/amdgpu: Improve amdgpu_dpm* macros to avoid unexpected result (v2)Eric Huang1-22/+22
The two macros returns are values which probably are used in the expression of calculation. Without the brackets the result of the expression may be wrong. v2: agd: squash both patches together Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Eric Huang <[email protected]>
2016-01-13drm/amdgpu: move VM page tables to the LRU end on CS v2Christian König1-0/+2
This makes it less likely to run into an ENOMEM because VM page tables are evicted last. v2: move the BOs in the LRU tail after validation Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-24Backmerge drm-fixes merge into Linus's tree into drm-next.Dave Airlie1-1/+2
This merges '5b726e06d6e8309e5c9ef4109a32caf27c71dfc8' into drm-next Just to resolve some merges to make Daniel's life easier. Signed-off-by: DAve Airlie <[email protected]>
2015-12-23Merge branch 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie1-47/+91
into drm-next [airlied: fixup build problems on arm - added errno.h include] * 'drm-next-4.5' of git://people.freedesktop.org/~agd5f/linux: (152 commits) amd/powerplay: fix copy paste typo in hardwaremanager.c amd/powerplay: disable powerplay by default initially amd/powerplay: don't enable ucode fan control if vbios has no fan table drm/amd/powerplay: show gpu load when print gpu performance for Cz. (v2) drm/amd/powerplay: check whether need to enable thermal control. (v2) drm/amd/powerplay: add point check to avoid NULL point hang. drm/amdgpu/powerplay: Program a calculated value as Deep Sleep clock. drm/amd/powerplay: Don't return an error if fan table is missing drm/powerplay/hwmgr: log errors in tonga_hwmgr_backend_init drm/powerplay: add debugging output to processpptables.c drm/powerplay: add debugging output to tonga_processpptables.c amd/powerplay: Add structures required to report configuration change amd/powerplay: Fix get dal power level amd\powerplay Implement get dal power level drm/amd/powerplay: display gpu load when print performance for tonga. drm/amdgpu/powerplay: enable sysfs and debugfs interfaces late drm/amd/powerplay: move shared function of vi to hwmgr. (v2) drm/amd/powerplay: check whether enable dpm in powerplay. drm/amd/powerplay: fix bug that dpm funcs in debugfs/sysfs missing. drm/amd/powerplay: fix boolreturn.cocci warnings ...
2015-12-21drm/amd/powerplay: export interface to DAL to init/change display configuration.Rex Zhu1-0/+1
Signed-off-by: Rex Zhu <[email protected]> Signed-off-by: David Rokhvarg <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Jammy Zhou <[email protected]>
2015-12-21drm/amdgpu: store pcie gen mask and link widthAlex Deucher1-0/+4
We'll need this later for pcie dpm. Reviewed-by: Jammy Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: support per device powerplay enablement (v2)Jammy Zhou1-35/+36
The amdgu_powerplay variable is global for multiple GPU instances. v2: fold in Flora's module option change, protect adev reference in macros Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-12-21drm/amdgpu: export fan control functions to amdgpuRex Zhu1-5/+25
Hook up the amdgpu thermal control callbacks for powerplay. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: export amd_powerplay_func to amdgpu and other ip blockRex Zhu1-6/+40
Update amdgpu to deal with the new powerplay module properly. v2: squash in fixes v3: squash in Rex's power state reporting fix Signed-off-by: Rex Zhu <[email protected]> Acked-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amd/powerplay: add basic powerplay frameworkAlex Deucher1-0/+5
amdgpu_pp_ip_funcs is introduced to handle the two code paths, the legacy one and the new powerplay implementation. CONFIG_DRM_AMD_POWERPLAY kernel configuration option is introduced for the powerplay component. v4: squash in fixes v3: register debugfs file when powerplay module enable v2: add amdgpu_ucode_init_bo in hw init when amdgpu_powerplay enable. Signed-off-by: Rex Zhu <[email protected]> Signed-off-by: Jammy Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-12-21drm/amdgpu: share struct amdgpu_pm_state_type with powerplay moduleRex Zhu1-26/+2
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-18drm/amdgpu: keep the PTs validation list in the VM v2Christian König1-5/+3
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önig1-4/+6
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önig1-1/+2
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-16drm/amdgpu: fix user fence handlingChristian König1-1/+2
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: unify AMDGPU_CTX_MAX_CS_PENDING and amdgpu_sched_jobsChunming Zhou1-3/+2
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-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)jimqu1-0/+2
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: add spin lock to protect freed list in vm (v2)jimqu1-0/+2
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-02drm/amd: abstract kernel rq and normal rq to priority of run queueChunming Zhou1-1/+1
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 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-11-30drm/amdgpu: fix VM page table reference countingChristian König1-0/+1
We use the reservation object of the page directory for the page tables as well, because of this the page directory should be freed last. Ensure that by keeping a reference from the page tables to the directory. Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2015-11-20drm/amdgpu: remove vm->mutexChunming Zhou1-2/+0
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-11-20drm/amdgpu: add mutex for ba_va->valids/invalidsChunming Zhou1-0/+1
Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-11-18drm/amdgpu: add lock for interval tree in vmChunming Zhou1-0/+2
Change-Id: I62b892a22af37b32e6b4aefca80a25cf45426ed2 Signed-off-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-11-18drm/amdgpu: keep the owner for VMIDsChristian König1-3/+5
We don't need the last VM use any more, keep the owner directly. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]>
2015-11-18drm/amdgpu: move VM manager clean into the VM code againChristian König1-0/+1
It's not a good idea to duplicate that code. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-18drm/amdgpu: cleanup VM coding styleChristian König1-50/+48
Fix the indentation and move the VM functions to the structures. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-18drm/amdgpu: remove unused VM manager fieldChristian König1-2/+0
Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
2015-11-18drm/amdgpu: cleanup scheduler command submissionChristian König1-0/+1
Unify the two code path again, cause they do pretty much the same thing. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
2015-11-16drm/amdgpu: fix incorrect mutex usage v3Christian König1-1/+1
Before this patch the scheduler fence was created when we push the job into the queue, so we could only get the fence after pushing it. The mutex now was necessary to prevent the thread pushing the jobs to the hardware from running faster than the thread pushing the jobs into the queue. Otherwise the thread pushing jobs into the queue would have accessed possible freed up memory when it tries to get a reference to the fence. So what you get in the end is thread A: mutex_lock(&job->lock); ... Kick of thread B. ... mutex_unlock(&job->lock); And thread B: mutex_lock(&job->lock); .... mutex_unlock(&job->lock); kfree(job); I'm actually not sure if I'm still up to date on this, but this usage pattern used to be not allowed with mutexes. See here as well https://lwn.net/Articles/575460/. v2: remove unrelated changes, fix missing owner v3: rebased, add more commit message Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-16drm/amdgpu: cleanup amdgpu_cs_parser handlingChristian König1-5/+0
No need any more to allocate that structure dynamically, just put it on the stack. This is a start to cleanup some of the scheduler fallouts. Signed-off-by: Christian König <[email protected]> Reviewed-by: Junwei Zhang <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-16drm/amdgpu: use common fence for amdgpu_vm_fenceChristian König1-1/+1
Just cleanup the function parameters. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-16drm/amdgpu: use a timer for fence fallbackChristian König1-2/+1
Less overhead than a work item and also adds proper cleanup handling. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Acked-by: Alex Deucher <[email protected]>
2015-11-10Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds1-73/+31
Pull drm updates from Dave Airlie: "I Was Almost Tempted To Capitalise Every Word, but then I decided I couldn't read it myself! I've also got one pull request for the sti driver outstanding. It relied on a commit in Greg's tree and I didn't find out in time, that commit is in your tree now so I might send that along once this is merged. I also had the accidental misfortune to have access to a Skylake on my desk for a few days, and I've had to encourage Intel to try harder, which seems to be happening now. Here is the main drm-next pull request for 4.4. Highlights: New driver: vc4 driver for the Rasberry Pi VPU. (From Eric Anholt at Broadcom.) Core: Atomic fbdev support Atomic helpers for runtime pm dp/aux i2c STATUS_UPDATE handling struct_mutex usage cleanups. Generic of probing support. Documentation: Kerneldoc for VGA switcheroo code. Rename to gpu instead of drm to reflect scope. i915: Skylake GuC firmware fixes HPD A support VBT backlight fallbacks Fastboot by default for some systems FBC work BXT/SKL workarounds Skylake deeper sleep state fixes amdgpu: Enable GPU scheduler by default New atombios opcodes GPUVM debugging options Stoney support. Fencing cleanups. radeon: More efficient CS checking nouveau: gk20a instance memory handling improvements. Improved PGOB detection and GK107 support Kepler GDDR5 PLL statbility improvement G8x/GT2xx reclock improvements new userspace API compatiblity fixes. virtio-gpu: Add 3D support - qemu 2.5 has it merged for it's gtk backend. msm: Initial msm88896 (snapdragon 8200) exynos: HDMI cleanups Enable mixer driver byt default Add DECON-TV support vmwgfx: Move to using memremap + fixes. rcar-du: Add support for R8A7793/4 DU armada: Remove support for non-component mode Improved plane handling Power savings while in DPMS off. tda998x: Remove unused slave encoder support Use more HDMI helpers Fix EDID read handling dwhdmi: Interlace video mode support for ipu-v3/dw_hdmi Hotplug state fixes Audio driver integration imx: More color formats support. tegra: Minor fixes/improvements" [ Merge fixup: remove unused variable 'dev' that had all uses removed in commit 4e270f088011: "drm/gem: Drop struct_mutex requirement from drm_gem_mmap_obj" ] * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (764 commits) drm/vmwgfx: Relax irq locking somewhat drm/vmwgfx: Properly flush cursor updates and page-flips drm/i915/skl: disable display side power well support for now drm/i915: Extend DSL readout fix to BDW and SKL. drm/i915: Do graphics device reset under forcewake drm/i915: Skip fence installation for objects with rotated views (v4) vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT drm/amdgpu: group together common fence implementation drm/amdgpu: remove AMDGPU_FENCE_OWNER_MOVE drm/amdgpu: remove now unused fence functions drm/amdgpu: fix fence fallback check drm/amdgpu: fix stoping the scheduler timeout drm/amdgpu: cleanup on error in amdgpu_cs_ioctl() drm/i915: Fix locking around GuC firmware load drm/amdgpu: update Fiji's Golden setting drm/amdgpu: update Fiji's rev id drm/amdgpu: extract common code in vi_common_early_init drm/amd/scheduler: don't oops on failure to load drm/amdgpu: don't oops on failure to load (v2) drm/amdgpu: don't VT switch on suspend ...
2015-11-05Merge branch 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie1-52/+6
into drm-next - Updated register headers for GFX 8.1 for Stoney - Add some new CZ revisions - minor pageflip optimizations - Fencing clean up - Warning fix - More fence cleanup - oops fix - Fiji fixes * 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux: (29 commits) drm/amdgpu: group together common fence implementation drm/amdgpu: remove AMDGPU_FENCE_OWNER_MOVE drm/amdgpu: remove now unused fence functions drm/amdgpu: fix fence fallback check drm/amdgpu: fix stoping the scheduler timeout drm/amdgpu: cleanup on error in amdgpu_cs_ioctl() drm/amdgpu: update Fiji's Golden setting drm/amdgpu: update Fiji's rev id drm/amdgpu: extract common code in vi_common_early_init drm/amd/scheduler: don't oops on failure to load drm/amdgpu: don't oops on failure to load (v2) drm/amdgpu: don't VT switch on suspend drm/amdgpu: Make amdgpu_mn functions inline drm/amdgpu: remove amdgpu_fence_ref/unref drm/amdgpu: use common fence for sync drm/amdgpu: use the new fence_is_later drm/amdgpu: use common fences for VMID management v2 drm/amdgpu: move ring_from_fence to common code drm/amdgpu: switch to common fence_wait_any_timeout v2 drm/amdgpu: remove unneeded fence functions ...
2015-11-04drm/amdgpu: remove AMDGPU_FENCE_OWNER_MOVEChristian König1-1/+0
Moves are exclusive operations anyway, just use the undefined owner for those. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-04drm/amdgpu: remove now unused fence functionsChristian König1-39/+0
Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-11-02drm/amdgpu: Make amdgpu_mn functions inlineHarry Wentland1-2/+2
Unused amdgpu_mn functions threw warnings for every file that includes amdgpu.h. It makes sense to inline this amdgpu_mn stubs to avoid the warning. Signed-off-by: Harry Wentland <[email protected]> Reviewed-by: Christian König <[email protected]> Cc: [email protected]
2015-10-30drm/amdgpu: remove amdgpu_fence_ref/unrefChristian König1-3/+0
Just move the remaining users to fence_put/get. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-30drm/amdgpu: use common fence for syncChristian König1-1/+1
Stop using the driver internal functions. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-30drm/amdgpu: use common fences for VMID management v2Christian König1-2/+2
v2: add missing NULL check. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-30drm/amdgpu: move ring_from_fence to common codeChristian König1-0/+1
Going to need that elsewhere as well. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
2015-10-30drm/amdgpu: switch to common fence_wait_any_timeout v2Christian König1-4/+0
No need to duplicate the functionality any more. v2: fix handling if no fence is available. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1)
2015-10-30Merge branch 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie1-10/+1
into drm-next More amdgpu and radeon stuff for drm-next. Stoney support is the big change. The rest is just bug fixes and code cleanups. The Stoney stuff is pretty low impact with respect to existing chips. * 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux: drm/amdgpu: change VM size default to 64GB drm/amdgpu: add Stoney pci ids drm/amdgpu: update the core VI support for Stoney drm/amdgpu: add VCE support for Stoney (v2) drm/amdgpu: add UVD support for Stoney drm/amdgpu: add GFX support for Stoney (v2) drm/amdgpu: add SDMA support for Stoney (v2) drm/amdgpu: add DCE support for Stoney drm/amdgpu: Update SMC/DPM for Stoney drm/amdgpu: add GMC support for Stoney drm/amdgpu: add Stoney chip family drm/amdgpu: fix the broken vm->mutex V2 drm/amdgpu: remove the unnecessary parameter adev for amdgpu_fence_wait_any() drm/amdgpu: remove the exclusive lock drm/amdgpu: remove old lockup detection infrastructure drm: fix trivial typos drm/amdgpu/dce: simplify suspend/resume drm/amdgpu/gfx8: set TC_WB_ACTION_EN in RELEASE_MEM packet drm/radeon: Use rdev->gem.mutex to protect hyperz/cmask owners
2015-10-23drm/amdgpu: don't try to recreate sysfs entries on resumeAlex Deucher1-0/+1
Fixes an error on resume caused by: fa022a9b65d2886486a022fd66b20c823cd76ad9 Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2015-10-21drm/amdgpu: remove the unnecessary parameter adev for amdgpu_fence_wait_any()Junwei Zhang1-2/+1
Signed-off-by: Junwei Zhang <[email protected]> Reviewed-by: Christian König <[email protected]>
2015-10-21drm/amdgpu: remove the exclusive lockChristian König1-1/+0
Finally getting rid of it. Signed-off-by: Christian König <[email protected]>
2015-10-21drm/amdgpu: remove old lockup detection infrastructureChristian König1-7/+0
It didn't worked to well anyway. Signed-off-by: Christian König <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Junwei Zhang <[email protected]>
2015-10-16Merge tag 'topic/drm-misc-2015-10-08' of ↵Dave Airlie1-4/+4
git://anongit.freedesktop.org/drm-intel into drm-next Another round of drm-misc. Unfortunately the DRM_UNLOCKED removal for DRIVER_MODESET isn't complete yet for lack of review on 1-2 patches. Otherwise just various stuff all over. * tag 'topic/drm-misc-2015-10-08' of git://anongit.freedesktop.org/drm-intel: drm: Stop using drm_vblank_count() as the hw frame counter drm/irq: Use unsigned int pipe in public API drm: Use DRM_ROTATE_MASK and DRM_REFLECT_MASK drm: Add DRM_ROTATE_MASK and DRM_REFLECT_MASK vga_switcheroo: Add missing locking vgaarb: use kzalloc in vga_arbiter_add_pci_device() drm: Don't zero vblank timestamps from the irq handler drm: Hack around CONFIG_AGP=m build failures drm/i915: Remove setparam ioctl drm: Remove dummy agp ioctl wrappers drm/vmwgfx: Stop checking for DRM_UNLOCKED drm/drm_ioctl.c: kerneldoc drm: Define a drm_invalid_op ioctl implementation drm: Remove __OS_HAS_AGP drm/doc: Update docs about device instance setup
2015-10-14drm/amdgpu: add option to clear VM page tables after every submitChristian König1-0/+1
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]>