aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
AgeCommit message (Collapse)AuthorFilesLines
2016-12-06drm/amdgpu: Also call cursor_move_locked when the cursor size changesMichel Dänzer4-16/+20
The cursor size also affects the register programming. Cc: [email protected] Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu: Store CRTC relative amdgpu_crtc->cursor_x/y valuesMichel Dänzer4-11/+12
We were storing viewport relative coordinates. However, crtc_cursor_set2 and cursor_reset pass amdgpu_crtc->cursor_x/y as the x/y parameters of cursor_move_locked, which would break if the CRTC isn't located at (0, 0). Cc: [email protected] Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amd/amdgpu: enable GUI idle INT after enabling CGCGArindam Nath1-9/+9
GUI idle interrupts should be enabled only after we have enabled coarse grain clock gating (CGCG). This prevents GFX engine generating idle interrupt even though CGCG is not completely enabled. Most of the time this goes un-noticed, but on some Stoney ASICs this results in GFX engine hang after system resumes from suspend. The issue is not particular to Stoney though and could have occured on any ASIC. The patch fixes this issue. Reviewed-by: Alex Deucher <[email protected]> Reported-by: Sunil Uttarwar <[email protected]> Signed-off-by: Arindam Nath <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
2016-12-06drm/amdgpu: enable VCE clockgating in Polaris-10/11Maruthi Srinivas Bayyavarapu2-3/+5
VCE clocks are set to be disabled, when not in use. Signed-off-by: Maruthi Bayyavarapu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu: fix CI bug uvd status not true in debugfs.Rex Zhu1-1/+1
can't get uvd's state by uvd_enabled. uvd_enabled is used for request higher mclk. in multi-display case, mclk has been in highest clock, no matter uvd's state changed, uvd_enabled will not be changed. Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu: remove error message when loading driverXiangliang Yu1-2/+4
Forget to check UCODE_ID_STORAGE case and will cause to print error message when loading driver, correct it. Signed-off-by: Xiangliang Yu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amd/powerplay: fix firmware loading failureXiangliang Yu1-1/+1
For virtualization, firmware loading need the firmware version info, and will load the right firmware. So, transfer fw_version to toc. Signed-off-by: Frank Min <[email protected]> Signed-off-by: Monk Liu <[email protected]> Signed-off-by: Xiangliang Yu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu: fix bug mclk can't change on PolarisRex Zhu2-3/+8
the root cause is we gate the clock to uvd vcpu. mclk's change should need the response from uvd if it is power on. Signed-off-by: Rex Zhu <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu: refine uvd 6.0 clock gate feature.Rex Zhu1-20/+92
Signed-off-by: Rex Zhu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/amdgpu/gfx8: move eop programming per queueAlex Deucher1-30/+19
It's per queue not per pipe. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06Revert "drm/amdgpu: use the kernel zone memory size as the max remote memory ↵Alex Deucher5-27/+8
in amdgpu" This reverts commit a693e050edfe794fea81d7cfe72429a406aa380b. This breaks on systems with huge amounts of system memory as we do not have enough vram to store the page tables. Additionally, this is less of an issue with the recent gtt manager changes. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2016-12-06drm/atomic: doc: remove old comment about nonblocking commitsGustavo Padovan1-3/+0
We now support nonblocking commits on drm_atomic_helper_commit() so the comment is not valid anymore. Signed-off-by: Gustavo Padovan <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-06drm/panel: simple: Add support for AUO G185HAN01Lucas Stach1-0/+32
This adds support for the AU Optronics G185HAN01 18.5" LVDS FullHD TFT LCD panel, which can be supported by the simple panel driver. Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/panel: simple: Add support for AUO G133HAN01Lucas Stach1-0/+32
This adds support for the AU Optronics G133HAN01 13.3" LVDS FullHD TFT LCD panel, which can be supported by the simple panel driver. Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/panel: simple: Add more properties to Innolux G121I1-L01Lucas Stach1-13/+17
Convert from a single mode to display timings, which allow to describe the minimum/maximium blanking and clock rates, add enable/disable delays and provide the bus format. Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/panel: simple: Add bits-per-component for Sharp LQ123P1JX31zain wang1-0/+1
The Sharp LQ123P1JX31 panel support 8 bits per component. Signed-off-by: zain wang <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/panel: simple: Check against num_timings when setting preferred for timingChen-Yu Tsai1-1/+1
In the loop on .timings, we should check .num_timings to see if it's the only mode specified, not .num_modes, which should be used with .modes. Fixes: cda553725c92 ("drm/panel: simple: Set appropriate mode type") Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/panel: Add support for Chunghwa CLAA070WP03XG panelRandy Li1-0/+27
The Chunghwa CLAA070WP03XG is a 7" 1280x800 panel, which can be supported by the simple panel driver. Signed-off-by: Randy Li <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
2016-12-06drm/i915: Use memcpy_from_wc for GPU error captureChris Wilson1-13/+37
On all platforms we now always read the contents of buffers via the GTT, i.e. using WC cpu access. Reads are slow, but they can be accelerated with an internal read buffer using sse4.1 (movntqda). This is our i915_memcpy_from_wc() routine which also checks for sse4.1 support and so we can fallback to using a regular slow memcpy if we need to. When compressing the pages, the reads are currently done inside zlib's fill_window() routine and so we must copy the page into a temporary which is then already inside the CPU cache and fast for zlib's compression. When not compressing the pages, we don't need a temporary and can just use the accelerated read from WC into the destination. v2: Use zstream locals to reduce diff and allocate the additional temporary storage only if sse4.1 is supported. v3: Use length=0 for the sse4.1 support check Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Tvrtko Ursulin <[email protected]>
2016-12-06drm: Don't block the kworker waiting for mode_config.mutex in output_poll()Chris Wilson1-1/+5
If we cannot acquire the mode_config.mutex immediately, just back off and queue a new attempt after the poll interval. This is mostly to stop the hung task spam when the system is deadlocked, but it will also lessen the load (in such extreme cases). Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> [danvet:s/lock/mutex/ per Eric's comment.] Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-06drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driverMichel Dänzer1-9/+15
This is an attempt to make the previous fix a bit more robust going forward. v2: * Only allow DRM_CAP_TIMESTAMP_MONOTONIC with UMS drivers (Daniel Vetter, Alex Deucher) * Different logic to keep DRM_CAP_TIMESTAMP_MONOTONIC separate from the other caps (Daniel Vetter) Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-06Merge remote-tracking branch 'airlied/drm-next' into drm-misc-nextDaniel Vetter320-6581/+69446
Backmerge v4.9-rc8 to get at commit e94bd1736f1f60e916a85a80c0b0ebeaae36cce5 Author: Michel Dänzer <[email protected]> Date: Wed Nov 30 17:30:01 2016 +0900 drm: Don't call drm_for_each_crtc with a non-KMS driver so I can apply Michel's follow-up patch. Signed-off-by: Daniel Vetter <[email protected]>
2016-12-06drm/amdgpu: don't add files at control minor debugfs directoryNicolai Stange1-6/+0
Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a struct drm_device's ->control member is always NULL. In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses ->control->debugfs_root though. This results in a NULL pointer dereference. Fix this by omitting the drm_debugfs_create_files() call for the control minor debugfs directory which is now non-existent anyway. Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes") Signed-off-by: Nicolai Stange <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915 Reviewed-by: Alex Deucher <[email protected]> Tested-by: Mike Lothian <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-06drm: allow changing DPMS modeMarta Lofstedt1-2/+2
The drm_atomic_helper_connector_dpms will set the connector back the old DPMS state before returning. This makes it impossible to change DPMS state of the connector. Fixes: 0853695c3ba46f97dfc0b5885f7b7e640ca212dd v2: edit of commit message Cc: Chris Wilson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Eric Engestrom <[email protected]> Cc: Sean Paul <[email protected]> Cc: [email protected] Cc: <[email protected]> Signed-off-by: Marta Lofstedt <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-06drm: Add new driver for MXSFB controllerMarek Vasut9-0/+1007
Add new driver for the MXSFB controller found in i.MX23/28/6SX . The MXSFB controller is a simple framebuffer controller with one parallel LCD output. Unlike the MXSFB fbdev driver that is used on these systems now, this driver uses the DRM/KMS framework. Signed-off-by: Marek Vasut <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Shawn Guo <[email protected]>
2016-12-06Merge branch 'exynos-drm-next' of ↵Dave Airlie6-106/+47
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Just refactoring HDMI driver by using infoframe helper function, fixing GSC Kconfig dependency issue and including trivial cleanups. * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: drm/exynos: Use VIDEO_SAMSUNG_EXYNOS_GSC=n as GSC Kconfig dependency drm/exynos: gsc: fix spelling mistakes exynos-drm: Fix error messages to print flags and size drm/exynos/hdmi: refactor infoframe code
2016-12-06Merge branch 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie66-1205/+55685
into drm-next - lots of code cleanup - lots of bug fixes - expose rpm based fan info via hwmon - lots of clock and powergating fixes - SI register header cleanup and conversion to common format used by newer asics * 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux: (54 commits) drm/amdgpu: drop is_display_hung from display funcs drm/amdgpu/uvd: reduce IB parsing overhead on UVD5+ (v2) drm/amdgpu/uvd: consolidate code for fetching addr from ctx drm/amdgpu: Disable DPM in virtualization drm/amdgpu: use AMDGPU_GEM_CREATE_VRAM_CLEARED for VM PD/PTs (v2) drm/amdgpu: improve AMDGPU_GEM_CREATE_VRAM_CLEARED handling (v2) drm/amdgpu: fix error handling in amdgpu_bo_create_restricted drm/amdgpu: fix amdgpu_fill_buffer (v2) drm/amdgpu: remove amdgpu_irq_get_delayed amdgpu: Wrap dev_err() calls on vm faults with printk_ratelimit() amdgpu: Use dev_err() over vanilla printk() in vm_decode_fault() drm/amd/amdgpu: port of DCE v6 to new headers (v3) drm/amdgpu: cleanup unused iterator members for sdma v2.4 drm/amdgpu: cleanup unused iterator members for sdma v3 drm/amdgpu:impl vgt_flush for VI(V5) drm/amdgpu: enable uvd mgcg for Fiji. drm/amdgpu: refine cz uvd clock gate logic. drm/amdgpu: change log level to KERN_INFO in ci_dpm.c drm/amdgpu: always un-gate UVD REGS path. drm/amdgpu/sdma: fix typo in packet setup ...
2016-12-06Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux into ↵Dave Airlie7-7/+83
drm-next - fix dma-buf export path to return correct SG table - trivially implement direct dma-buf mapping - allow DRAW_INSTANCED commands in validator - make the driver work on i.MX6SX, yielding a working 2D/3D stack together with Mareks MXS DRM driver * 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux: MAINTAINERS: add etnaviv mailinglist drm/etnaviv: move linear window on MC1.0 parts if necessary drm/etnaviv: don't invoke OOM killer from dump code drm/etnaviv: fix gem_prime_get_sg_table to return new SG table drm/etnaviv: Allow DRAW_INSTANCED commands drm/etnaviv: implement dma-buf mmap
2016-12-06Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-nextDave Airlie26-154/+167
- BIT_PERF_PTRS uses 32-bit pointers to its subtables, we were parsing them as 16-bit, causing various issues on newer boards. - Support for MXM on GM20x and up. - More display-related fixes. * 'linux-4.10' of git://github.com/skeggsb/linux: drm/nouveau/mxm: warn more loudly on unsupported DCB version drm/nouveau/mxm: handle DCB 4.1 modification drm/nouveau/bios/mxm: handle digital connector table 1.1 drm/nouveau: Queue hpd_work on (runtime) resume drm/nouveau: Rename acpi_work to hpd_work drm/nouveau/kms/nv50: Fix atomic pageflip events. drm/nouveau/fb/ram/gp100-: fix memory detection where FBP_NUM != FBPA_NUM drm/nouveau/bios/volt: pointers are 32-bit drm/nouveau/bios/vmap: pointers are 32-bit drm/nouveau/bios/timing: pointers are 32-bit drm/nouveau/bios/therm: pointers are 32-bit drm/nouveau/bios/perf: pointers are 32-bit drm/nouveau/bios/iccsense: pointers are 32-bit drm/nouveau/bios/fan: pointers are 32-bit drm/nouveau/bios/cstep: pointers are 32-bit drm/nouveau/bios/boost: pointers are 32-bit
2016-12-06drm/nouveau/mxm: warn more loudly on unsupported DCB versionBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <[email protected]>
2016-12-06drm/nouveau/mxm: handle DCB 4.1 modificationBen Skeggs1-1/+1
Allows MXM DCB modification to be handled on GM20x and newer boards. Signed-off-by: Ben Skeggs <[email protected]>
2016-12-06drm/nouveau/bios/mxm: handle digital connector table 1.1Ben Skeggs1-1/+1
I suspect the version bump is just to signify that the table now specifies pad macro/links instead of SOR/sublinks. For our usage of the table, just recognising the new version is enough. Signed-off-by: Ben Skeggs <[email protected]>
2016-12-05drm/i915: allow GEM_BUG_ON expr checking with !DEBUG_GEMMatthew Auld1-1/+1
Use BUILD_BUG_ON_INVALID(expr) in GEM_BUG_ON when building without DEBUG_GEM. This means the compiler can now check the validity of expr without generating any code, in turn preventing us from inadvertently breaking the build when DEBUG_GEM is not enabled. Cc: Chris Wilson <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]>
2016-12-05drm/i915/execlists: Use list_safe_reset_next() instead of opencodingChris Wilson1-1/+1
list.h provides a macro for updating the next element in a safe list-iter, so let's use it so that it is hopefully clearer to the reader about the unusual behaviour, and also easier to grep. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Enable swfence debugobject support for i915.koChris Wilson1-2/+2
Only once the debugobject symbols are exported can we enable support for debugging swfences when i915 is built as a module. Requires commit 2617fdca3f68 ("lib/debugobjects: export for use in modules") Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Implement local atomic_state_free callbackChris Wilson1-0/+12
As we use debugobjects to track the lifetime of fences within our atomic state, we ideally want to mark those objects as freed along with their containers. This merits us hookin into config->funcs->atomic_state_free for this purpose. This allows us to enable debugobjects for sw-fences without triggering known issues. Fixes: fc1584059d6c ("drm/i915: Integrate i915_sw_fence with debugobjects") Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Tidy i915_gem_valid_gtt_space()Chris Wilson1-12/+14
We can replace a couple of tests with an assertion that the passed in node is already allocated (as matches the existing call convention) and by a small bit of refactoring we can bring the line lengths to under 80cols. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Fix i915_gem_evict_for_vma (soft-pinning)Chris Wilson5-27/+111
Soft-pinning depends upon being able to check for availabilty of an interval and evict overlapping object from a drm_mm range manager very quickly. Currently it uses a linear list, and so performance is dire and not suitable as a general replacement. Worse, the current code will oops if it tries to evict an active buffer. It also helps if the routine reports the correct error codes as expected by its callers and emits a tracepoint upon use. For posterity since the wrong patch was pushed (i.e. that missed these key points and had known bugs), this is the changelog that should have been on commit 506a8e87d8d2 ("drm/i915: Add soft-pinning API for execbuffer"): Userspace can pass in an offset that it presumes the object is located at. The kernel will then do its utmost to fit the object into that location. The assumption is that userspace is handling its own object locations (for example along with full-ppgtt) and that the kernel will rarely have to make space for the user's requests. This extends the DRM_IOCTL_I915_GEM_EXECBUFFER2 to do the following: * if the user supplies a virtual address via the execobject->offset *and* sets the EXEC_OBJECT_PINNED flag in execobject->flags, then that object is placed at that offset in the address space selected by the context specifier in execbuffer. * the location must be aligned to the GTT page size, 4096 bytes * as the object is placed exactly as specified, it may be used by this execbuffer call without relocations pointing to it It may fail to do so if: * EINVAL is returned if the object does not have a 4096 byte aligned address * the object conflicts with another pinned object (either pinned by hardware in that address space, e.g. scanouts in the aliasing ppgtt) or within the same batch. EBUSY is returned if the location is pinned by hardware EINVAL is returned if the location is already in use by the batch * EINVAL is returned if the object conflicts with its own alignment (as meets the hardware requirements) or if the placement of the object does not fit within the address space All other execbuffer errors apply. Presence of this execbuf extension may be queried by passing I915_PARAM_HAS_EXEC_SOFTPIN to DRM_IOCTL_I915_GETPARAM and checking for a reported value of 1 (or greater). v2: Combine the hole/adjusted-hole ENOSPC checks v3: More color, more splitting, more blurb. Fixes: 506a8e87d8d2 ("drm/i915: Add soft-pinning API for execbuffer") Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Mark all non-vma being inserted into the address spacesChris Wilson5-9/+16
We need to distinguish between full i915_vma structs and simple drm_mm_nodes when considering eviction (i.e. we must be careful not to treat a mere drm_mm_node as a much larger i915_vma causing memory corruption, if we are lucky). To do this, color these not-a-vma with -1 (I915_COLOR_UNEVICTABLE). v2...v200: New name for -1. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915/dsi: Do not clear DPOUNIT_CLOCK_GATE_DISABLE from ↵Hans de Goede1-1/+12
vlv_init_display_clock_gating On my Cherrytrail CUBE iwork8 Air tablet PIPE-A would get stuck on loading i915 at boot 1 out of every 3 boots, resulting in a non functional LCD. Once the i915 driver has successfully loaded, the panel can be disabled / enabled without hitting this issue. The getting stuck is caused by vlv_init_display_clock_gating() clearing the DPOUNIT_CLOCK_GATE_DISABLE bit in DSPCLK_GATE_D when called from chv_pipe_power_well_ops.enable() on driver load, while a pipe is enabled driving the DSI LCD by the BIOS. Clearing this bit while DSI is in use is a known issue and intel_dsi_pre_enable() / intel_dsi_post_disable() already set / clear it as appropriate. This commit modifies vlv_init_display_clock_gating() to leave the DPOUNIT_CLOCK_GATE_DISABLE bit alone fixing the pipe getting stuck. Changes in v2: -Replace PIPE-A with "a pipe" or "the pipe" in the commit msg and comment Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97330 Cc: [email protected] Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Ville Syrjälä <[email protected]>
2016-12-05drm/qxl: fix use of uninitialized variablePan Bian1-1/+1
In function qxl_release_alloc(), when kmalloc() returns a NULL pointer, it returns value 0 and parameter *ret is uninitialized. 0 means no error to the callers of qxl_release_alloc(). The callers keep going and will try to reference the uninitialized variable. This patch fixes the bug, returning "-ENOMEM" when kmalloc() fails. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188911 Signed-off-by: Pan Bian <[email protected]> [seanpaul fixed up subject prefix] Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2016-12-05drm/i915: Pass crtc state to vlv_compute_wm_level()Ville Syrjälä1-9/+11
Rather than accessing crtc->config in vlv_compute_wm_level() let's pass in the crtc state explicitly. One step closer to atomic. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Clean up vlv_program_watermarks()Ville Syrjälä1-18/+26
Add small helpers to make the intent of the staggered enable/disable sequence in vlv_program_watermarks() easier on the eyes. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Write all DDL registers in one goVille Syrjälä1-9/+10
We'll want to decouple the vlv/chv wm register reprogramming from any single pipe. So let's just write all the DDL registers in one go. We already write all the wm registers anyway since the bits are sprinkled all over the place and so writing them for just a single pipe would have been too messy anyway. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Zero out HOWM registers before writing new WM/HOWM register valuesVille Syrjälä1-6/+11
On VLV/CHV some of the watermark values are split across two registers: low order bits in one, and high order bits in another. So we may not be able to update a single watermark value atomically, and thus we must be careful that we don't temporarily introduce out of bounds values during the reprogramming. To prevent this we can simply zero out all the high order bits initially, then we update the low order bits, and finally we update the high order bits with the final value. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Skip vblank wait if cxsr was already offVille Syrjälä3-14/+29
Before we attempt to turn any planes on or off we must first exit csxr. That's due to cxsr effectively making the plane enable bits read-only. Currently we achieve that with a vblank wait right after toggling the cxsr enable bit. We do the vblank wait even if cxsr was already off, which seems wasteful, so let's try to only do it when absolutely necessary. We could start tracking the cxsr state fully somewhere, but for now it seems easiest to just have intel_set_memory_cxsr() return the previous cxsr state. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Protect cxsr state with wm_mutexVille Syrjälä2-6/+10
Let's protect the cxsr state with the wm_mutex, since it might get poked from multiple places if there's a parallel plane update happening with a pipe getting enable/disabled. It's still pretty racy for the old platforms, but for vlv/chv it should work, I think. If not, we'll improve it later anyway. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Pass around dev_priv in vlv wm functionsVille Syrjälä1-13/+11
Passing dev_priv instead of dev is the future. Let's make the vlv/chv wm functions respect that idea. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Introduce vlv_invert_wm_value()Ville Syrjälä1-4/+17
Add a small helper to do invert the vlv/chv values. Less fragile perhaps, and let's us clearly mark all overlarge wateramarks as disabled (by just making them all USHRT_MAX). Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
2016-12-05drm/i915: Organize vlv/chv watermarks by plane_idVille Syrjälä2-133/+92
Store the vlv/chv watermark values in straight up arrays indexed by enum plane_id. Avoids a lot of useless checks for the plane type when we don't have to think which structure member we need to access. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>