aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-30drm/msm: Replace PTR_RET with PTR_ERR_OR_ZEROGustavo A. R. Silva1-1/+1
PTR_RET is deprecated, use PTR_ERR_OR_ZERO instead. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm: mark PM functions as __maybe_unusedArnd Bergmann1-2/+2
The suspend/resume functions are not referenced when power management is disabled: drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c:1288:12: error: 'dpu_runtime_resume' defined but not used [-Werror=unused-function] drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c:1261:12: error: 'dpu_runtime_suspend' defined but not used [-Werror=unused-function] This marks them as __maybe_unused to let the compiler drop the functions without complaining. Fixes: 591225291ca2 ("drm/msm: Add SDM845 DPU support") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/dpu: fix mismatch in function argument.zhong jiang1-1/+1
Fix the sparse error. the dpu_rm_init declaration is not consistent with the implement. Signed-off-by: zhong jiang <[email protected]> [robclark un-typo'd subject line] Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: avoid deprecated do_gettimeofdayArnd Bergmann3-4/+4
All users of do_gettimeofday() have been removed, but this one recently crept in, along with an incorrect printing of the microseconds portion. This converts it to using ktime_get_real_timespec64() as a direct replacement, and adds the leading zeroes. I considered using monotonic times (ktime_get()) instead, but as this timestamp appears to only be used for humans rather than compared with other timestamps, the real time domain is probably good enough. Fixes: e43b045e2c82 ("drm/msm/gpu: Capture the state of the GPU") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm: dsi: Handle dual-channel for 6G as wellSean Paul1-37/+35
This fixes up a collision between introducing dual-channel support and the dsi refactors. This patch applies the same dual-channel considerations and pclk calculations to both v2 and 6G, with a bit of abstracting for good measure. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm: dpu: Use clock-names instead of assigned-clock-namesSean Paul1-3/+2
In these cases, we want to enumerate _all_ clocks, not just the ones that are assigned a rate. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm: dpu: Use 'vsync' instead of 'vsync_clk' in cmdmode encoderSean Paul1-1/+1
Should work with the legacy handling in of, but we shouldn't rely on that. Signed-off-by: Sean Paul <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: Add the buffer objects from the submit to the crash dumpJordan Crouse4-13/+116
For hangs, dump copy out the contents of the buffer objects attached to the guilty submission and print them in the crash dump report. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/adreno: Add a5xx specific registers for the GPU stateJordan Crouse6-31/+252
HLSQ, SP and TP registers are only accessible from a special aperture and to make matters worse the aperture is blocked from the CPU on targets that can support secure rendering. Luckily the GPU hardware has its own purpose built register dumper that can access the registers from the aperture. Add a5xx specific code to program the crashdumper and retrieve the wayward registers and dump them for the crash state. Also, remove a block of registers the regular CPU accessible list that aren't useful for debug which helps reduce the size of the crash state file by a goodly amount. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/adreno: Add ringbuffer data to the GPU stateJordan Crouse3-0/+48
Add the contents of each ringbuffer to the GPU state and dump the data in the crash file encoded with ascii85. To save space only the used portions of the ringbuffer are dumped. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/adreno: Convert the show/crash file formatJordan Crouse2-8/+84
Convert the format of the 'show' debugfs file and the crash dump to a format resembling YAML. This should be easier to parse and be more flexible for future changes and expansions. v2: Use a standard .rst for the msm crashdump documentation Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: Capture the GPU state on a GPU hangJordan Crouse9-23/+154
Capture the GPU state on a GPU hang and store it for later playback via the devcoredump facility. Only one crash state is stored at a time on the assumption that the first hang is usually the most interesting. The existing crash state can be cleared after capturing it and then a new one will be captured on the next hang. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: Rearrange the code that collects the task during a hangJordan Crouse1-9/+11
Do a bit of cleanup to prepare for upcoming changes to pass the hanging task comm and cmdline to the crash dump function. v2: Use GFP_ATOMIC while holding the rcu lock per Chris Wilson Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: Convert the GPU show function to use the GPU stateJordan Crouse7-65/+104
Convert the existing GPU show function to use the GPU state to dump the information rather than reading it directly from the hardware. This will require an additional step to capture the state before dumping it for the existing nodes but it will greatly facilitate reusing the same code for dumping a previously captured state from a GPU hang. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/msm/gpu: Capture the state of the GPUJordan Crouse6-0/+129
Add the infrastructure to capture the current state of the GPU and store it in memory so that it can be dumped later. For now grab the same basic ringbuffer information and registers that are provided by the debugfs 'gpu' node but obviously this should be extended to capture a much larger set of GPU information. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm: Add puts callback for the coredump printerJordan Crouse2-35/+51
Add a puts function for the coredump printer to bypass printf() for constant strings for a speed boost. Reorganize the coredump printf callback to share as much code as possible. v2: Try to reuse code between print and puts as suggested by Chris Wilson Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm: Add a -puts() function for the seq_file printerJordan Crouse2-0/+8
Add a puts() function to use seq_puts() to help speed up up print time for constant strings. Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm: Add drm_puts() to complement drm_printf()Jordan Crouse2-0/+19
Add drm_puts() for a much faster path to print constant strings into a drm_printer object with memcpy and friends. This can have seconds off of really large outputs such as GPU dumps. If the drm_printer object supports a custom puts function then use that otherwise fall back to the slower legacy printf call. v2: Add documentation for drm_puts() per Daniel Vetter Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Jordan Crouse <[email protected]> [robclark fix minor htmldocs warning] Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm: drm_printer: Add printer for devcoredumpJordan Crouse2-0/+139
Add a drm printer suitable for use with the read callback for devcoredump or other suitable buffer based output format that isn't otherwise covered by seq_file. v2: Add improved documentation per Daniel Vetter Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30include: Move ascii85 functions from i915 to linux/ascii85.hJordan Crouse2-30/+42
The i915 DRM driver very cleverly used ascii85 encoding for their GPU state file. Move the encode functions to a general header file to support other drivers that might be interested in the same functionality. v4: Make the return value const char * as suggested by Chris Wilson v3: Fix error_puts -> err_puts pointed out by the 01.org bot v2: Update API to be cleaner for the caller as suggested by Chris Wilson Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2018-07-30drm/armada: remove obsolete fb unreferencing kfifo and workqueueRussell King2-42/+0
Remove the obsolete fb unreferencing system that is no longer used since we've transitioned to atomic modeset. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove unnecessary armada_plane structureRussell King4-26/+7
We no longer require a private armada_plane structure, so eliminate it, and use the drm_plane structure directly. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove unnecessary armada_ovl_plane structureRussell King1-25/+9
We no longer need a private plane structure, so get rid of it. Use the drm_plane structure directly. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: update primary framebuffer parameters on mode changeRussell King1-2/+4
The framebuffer base address and toggling mode needs to be updated when the interlaced flag for mode changes is updated. Arrange to reprogram these parameters when only the mode has changed. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: update planes after the dumb frame is completeRussell King2-19/+28
Write out the plane updates after the dumb frame has completed, but just before the blank period. This allows all the plane updates to be performed in a flicker-free non-tearing manner. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch overlay plane to atomic modesetRussell King3-248/+32
Switch the overlay plane away from the transitional helpers and legacy methods, and use atomic helpers instead to implement the legacy set_plane ioctl methods. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch primary plane to atomic modesetRussell King2-117/+3
Switch the primary plane away from the transitional helpers, and use the atomic helpers instead to implement the legacy set_plane ioctl call for this plane. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch legacy modeset to atomic modesetRussell King2-103/+1
Switch the legacy set_config() method to use the atomic modeset helper, which allows us to get rid of the legacy dpms, prepare, commit, mode_set, mode_set_base and disable helper methods. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: enable atomic modeset supportRussell King2-5/+7
Enable atomic modeset helpers, and internal DRM use of atomic modeset with armada-drm. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: implement atomic_enable()/atomic_disable() methodsRussell King1-0/+71
Implement the atomic_enable()/atomic_disable() methods used by the atomic modeset helpers. atomic_disable() will need some transitional code during conversion to ensure proper ordering is maintained. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: unhook dpms state from armada_drm_crtc_update()Russell King1-6/+5
Explicitly pass in the desired enable/disable state into armada_drm_crtc_update() rather than having it use the DPMS state stored in our crtc structure. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: push responsibility for clock management to backendRussell King3-13/+27
Push responsibility for managing the clock during DPMS down into the variant backend, rather than the CRTC layer having knowledge of its state. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: handle atomic modeset crtc eventsRussell King2-0/+34
Prepare handling for atomic modeset CRTC events. Currently, using the transition helpers, CRTC events do not exist, but once we switch to proper atomic modeset, they have to be handled. We queue an event for the next vblank in two places: - armada_drm_crtc_atomic_flush() provided we aren't doing an atomic modeset. - armada_drm_crtc_commit() if we are committing a modeset. This ensures that the event is sent at the correct time (after all updates have been written to the hardware and after the following vblank.) Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: clean up SPU_ADV_REGRussell King3-9/+8
Rather than writing all bits of SPU_ADV_REG on modeset, only write what we need to change, and initialise the register in the variant initialisation. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: update debug in armada_drm_crtc_mode_set_nofb()Russell King1-10/+9
Update debug to use KMS level, and print the mode using the standard format for mode lines, but print the adjusted CRTC parameters as that's what we will be programming for. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move sync signal polarity to mode_set_nofb() methodRussell King2-26/+22
For atomic modeset, we need to set the sync signal polarities from the CRTC state structure rather than the legacy mode structure stored in CRTC. In any case, we should update this from our mode_set_nofb() method, rather than the commit() method. Move it there, and ensure that armada_drm_crtc_update() will not overwrite these bits. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: push interlace calculation into armada_drm_plane_calc()Russell King3-28/+30
Push the interlaced frame calculation down into armada_drm_plane_calc() which needs to apply the same correction for both the overlay and primary planes. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: provide pitches from armada_drm_plane_calc_addrs()Russell King3-13/+20
Provide the framebuffer pitches from armada_drm_plane_calc_addrs() as well as the base addresses for each plane. Since this is now about more than just addresses, rename to armada_drm_plane_calc(). Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: pass plane state into armada_drm_plane_calc_addrs()Russell King3-18/+16
armada_drm_plane_calc_addrs() gets all its information from the plane state, so it makes sense to pass the plane state pointer down into this function, rather than extracting the information in identical ways, sometimes a couple of layers up. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move armada_drm_mode_config_funcs to armada_drv.cRussell King5-11/+11
Move the armada_drm_mode_config_funcs to armada_drv.c, since this now has less to do with FBs than it does with general mode configuration. In doing so, we need to make armada_fb_create() visible to armada_drv.c, which reveals a function name clash with armada_fbdev.c. Rename the version in armada_fbdev.c. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: add plane colorspace propertiesRussell King1-1/+32
Use the DRM standard plane properties for specifying the YUV colour encoding parameter. Our colour range is fixed at limited range. Since we are transitioning to atomic modeset, we need to explicitly add handling of these properties to our atomic_set_property() method, but once the transition is complete, these will be removed. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove crtc YUV colourspace propertiesRussell King3-122/+0
Remove the unused CRTC colourspace properties - userspace does not make use of these. In any case, these are not a property of the CRTC, since they demonstrably only affect the video (overlay) plane, irrespective of the format of the graphics (primary) plane. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move colorkey properties into overlay plane stateRussell King1-119/+132
Move the overlay plane colorkey properties into the plane state, keeping the existing driver behaviour to avoid breaking userspace. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move CBSH properties into overlay plane stateRussell King2-29/+136
Move the contrast, brightness, and saturation properties to the overlay plane state structure, and call our overlay commit function to update the hardware via the planes atomic_update() method. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move plane works to overlayRussell King3-12/+8
Only overlay makes use of these now, so move these to the overlay code. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move primary plane to separate fileRussell King6-283/+318
Split out the primary plane support; this is now entirely separate from the CRTC support. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: use old_state for update tracking in atomic_update()Russell King3-173/+144
Rather than tracking the register state, we can now check the previous state and decide which registers need updating from that since the old plane state indicates the previous state which was programmed into the hardware. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove temporary crtc stateRussell King1-6/+6
Now that we have the CRTC using the atomic modeset transitional helper, there is no need to build a temporary crtc state anymore - we can use the CRTC atomic state directly. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: convert overlay plane to atomic stateRussell King3-120/+145
The overlay plane support updates asynchronously to the request, but the drm_plane_helper_update() transitional helper waits for a vblank event before releasing the framebuffer. Using the transitional helper would make the call block, which would introduce a performance regression. Convert the overlay plane update to use the atomic state structures and methods for the plane, but implement our own legacy update method rather than the transitional helper. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: convert page_flip to use primary plane atomic_update()Russell King1-26/+55
page_flip requests happen asynchronously, so we can't wait on the vblank event before returning to userspace, as the transitional plane update helper would do. Craft our own implementation that keeps the asynchronous behaviour of this request, while making use of the atomic infrastructure for the primary plane update. Signed-off-by: Russell King <[email protected]>