summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_ringbuffer.c (follow)
Commit message (Collapse)AuthorAge
* drm/msm: Move memptrs to msm_gpu and reorganizeJordan Crouse2017-06-19
| | | | | | | | | | | | | | | | Since most of the heavy lifting for managing submits lives in the msm_gpu domain it makes sense to move the memptrs so that they are globally visible and we can use them without relying on function pointers. Additionally, instead of having a single struct full of per-ring arrays, reorganize the structure and assign a sub-allocation to each ring. This simplifies all of the various macros and other bits and allows us to make the size of the allocation dependent on the acutal number of rings for the implementation. Change-Id: Ic0dedbadc18ba1dc786c82b082c5030e13ff8012 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: Simplify ringbuffer cleanupJordan Crouse2017-06-19
| | | | | | | | Cleanup and consolidate sanity checking on the ringbuffer cleanup code. Change-Id: Ic0dedbad551d36ca8ed3db56a4366a5008768791 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: Use per-ring submit listsJordan Crouse2017-06-12
| | | | | | | | | To make it easier to determine what submit(s) are currently active on any given ring, store the active submits in per-ring lists instead of a master list. Change-Id: Ic0dedbadb331cd8e4e85dfcfa51cb1ceabe6efa9 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: Separate locking of buffer resources from struct_mutexSushmita Susheelendra2017-05-31
| | | | | | | | | | | | | Buffer object specific resources like pages, domains, sg list need not be protected with struct_mutex. They can be protected with a buffer object level lock. This simplifies locking and makes it easier to avoid potential recursive locking scenarios for SVM involving mmap_sem and struct_mutex. This also removes unnecessary serialization when creating buffer objects, and also between buffer object creation and GPU command submission. Change-Id: I40cb437d0186c3d9aac365c9baba0aa4792f0aa1 Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
* drm/msm: Implement preemption for A5XX targetsJordan Crouse2017-02-22
| | | | | | | | | Implement preemption for A5XX targets - this allows multiple ringbuffers for different priorities with automatic preemption of a lower priority ringbuffer if a higher one is ready. Change-Id: Ic0dedbad428360d23768d52b585021237c6bc3d3 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: Shadow current pointer in the ring until command is completeJordan Crouse2017-02-22
| | | | | | | | | | | | | | | | | | | | | | Add a shadow pointer to track the current command being written into the ring. Don't commit it as 'cur' until the command is submitted. Because 'cur' is used to construct the software copy of the wptr this ensures that somebody peeking in on the ring doesn't assume that a command is inflight while it is being written. This isn't a huge deal with a single ring (though technically the hangcheck could assume the system is prematurely busy when it isn't) but it will be rather important for preemption where the decision to preempt is based on a non-empty ringbuffer. Without a shadow an aggressive preemption scheme could assume that the ringbuffer is non empty and switch to it before the CPU is done writing the command and boom. Even though preemption won't be supported for all targets because of the way the code is organized it is simpler to make this generic for all targets. The extra load for non-preemption targets should be minimal. Change-Id: Ic0dedbad83247c3e77de6f4f24bbb97db10e5edd Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: Add support for multiple ringbuffersJordan Crouse2017-02-22
| | | | | | | Add the infrastructure for supporting multiple ringbuffers. Change-Id: Ic0dedbada90ec5c4c8074ffce33c3fe275b0cda1 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
* drm/msm: fix locking inconsistencies in gpu->destroy()Rob Clark2015-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In error paths, this was being called without struct_mutex held. Leading to panics like: msm 1a00000.qcom,mdss_mdp: No memory protection without IOMMU Kernel panic - not syncing: BUG! CPU: 0 PID: 1409 Comm: cat Not tainted 4.0.0-dirty #4 Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT) Call trace: [<ffffffc000089c78>] dump_backtrace+0x0/0x118 [<ffffffc000089da0>] show_stack+0x10/0x20 [<ffffffc0006686d4>] dump_stack+0x84/0xc4 [<ffffffc0006678b4>] panic+0xd0/0x210 [<ffffffc0003e1ce4>] drm_gem_object_free+0x5c/0x60 [<ffffffc000402870>] adreno_gpu_cleanup+0x60/0x80 [<ffffffc0004035a0>] a3xx_destroy+0x20/0x70 [<ffffffc0004036f4>] a3xx_gpu_init+0x84/0x108 [<ffffffc0004018b8>] adreno_load_gpu+0x58/0x190 [<ffffffc000419dac>] msm_open+0x74/0x88 [<ffffffc0003e0a48>] drm_open+0x168/0x400 [<ffffffc0003e7210>] drm_stub_open+0xa8/0x118 [<ffffffc0001a0e84>] chrdev_open+0x94/0x198 [<ffffffc000199f88>] do_dentry_open+0x208/0x310 [<ffffffc00019a4c4>] vfs_open+0x44/0x50 [<ffffffc0001aa26c>] do_last.isra.14+0x2c4/0xc10 [<ffffffc0001aac38>] path_openat+0x80/0x5e8 [<ffffffc0001ac354>] do_filp_open+0x2c/0x98 [<ffffffc00019b60c>] do_sys_open+0x13c/0x228 [<ffffffc00019b72c>] SyS_openat+0xc/0x18 CPU1: stopping But there isn't any particularly good reason to hold struct_mutex for teardown, so just standardize on calling it without the mutex held and use the _unlocked() versions for GEM obj unref'ing Signed-off-by: Rob Clark <robdclark@gmail.com>
* drm/msm: add a3xx gpu supportRob Clark2013-08-24
Add initial support for a3xx 3d core. So far, with hardware that I've seen to date, we can have: + zero, one, or two z180 2d cores + a3xx or a2xx 3d core, which share a common CP (the firmware for the CP seems to implement some different PM4 packet types but the basics of cmdstream submission are the same) Which means that the eventual complete "class" hierarchy, once support for all past and present hw is in place, becomes: + msm_gpu + adreno_gpu + a3xx_gpu + a2xx_gpu + z180_gpu This commit splits out the parts that will eventually be common between a2xx/a3xx into adreno_gpu, and the parts that are even common to z180 into msm_gpu. Note that there is no cmdstream validation required. All memory access from the GPU is via IOMMU/MMU. So as long as you don't map silly things to the GPU, there isn't much damage that the GPU can do. Signed-off-by: Rob Clark <robdclark@gmail.com>