[PATCH 1/1] drm/amd/amdgpu: get maximum and used UVD handles (v3)

2016-12-16 Thread Grazvydas Ignotas
On Thu, Dec 15, 2016 at 4:12 PM, Christian König wrote: > > Regarding which error code to return I think that Emil has the right idea > here. > > Returning -EINVAL usually means that userspace provided an invalid value, > but in this case it doesn't matter which value the UMD provide all of them

[Intel-gfx] [PATCH] drm: Convert all helpers to drm_connector_list_iter

2016-12-16 Thread kbuild test robot
-helpers-to-drm_connector_list_iter/20161216-061508 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: i386-randconfig-x005-201650 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make

[Intel-gfx] [PATCH] drm: Convert all helpers to drm_connector_list_iter

2016-12-16 Thread kbuild test robot
-helpers-to-drm_connector_list_iter/20161216-061508 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: i386-randconfig-x003-201650 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make

[RFC v2 00/11] vb2: Handle user cache hints, allow drivers to choose cache coherency

2016-12-16 Thread Laurent Pinchart
Hello, This is a rebased version of the vb2 cache hints support patch series posted by Sakari more than a year ago. The patches have been modified as needed by the upstream changes and received the occasional small odd fix but are otherwise not modified. Please see the individual commit messages

[RFC v2 04/11] v4l: Unify cache management hint buffer flags

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The V4L2_BUF_FLAG_NO_CACHE_INVALIDATE and V4L2_BUF_FLAG_NO_CACHE_CLEAN buffer flags are currently not used by the kernel. Replace the definitions by a single V4L2_BUF_FLAG_NO_CACHE_SYNC flag to be used by further patches. Different cache architectures should not be visible to

[RFC v2 08/11] vb2: dma-contig: Don't warn on failure in obtaining scatterlist

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus vb2_dc_get_base_sgt() which obtains the scatterlist already prints information on why the scatterlist could not be obtained. Also, remove the useless warning of a failed kmalloc(). Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart --- drivers/media/v4l2-core/videob

[RFC v2 05/11] v4l2-core: Don't sync cache for a buffer if so requested

2016-12-16 Thread Laurent Pinchart
From: Samu Onkalo The user may request to the driver (vb2) to skip the cache maintenance operations in case the buffer does not need cache synchronisation, e.g. in cases where the buffer is passed between hardware blocks without it being touched by the CPU. Also document that the prepare and fin

[RFC v2 06/11] vb2: Improve struct vb2_mem_ops documentation; alloc and put are for MMAP

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The alloc() and put() ops are for MMAP buffers only. Document it. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- Changes since v1: - Fixed typo in documentation --- include/media/videobuf2-core.h | 20 ++-- 1 file chan

[RFC v2 03/11] vb2: Move cache synchronisation from buffer done to dqbuf handler

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The cache synchronisation may be a time consuming operation and thus not best performed in an interrupt which is a typical context for vb2_buffer_done() calls. This may consume up to tens of ms on some machines, depending on the buffer size. Signed-off-by: Sakari Ailus --- Ch

[RFC v2 07/11] vb2: dma-contig: Remove redundant sgt_base field

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The struct vb2_dc_buf contains two struct sg_table fields: sgt_base and dma_sgt. The former is used by DMA-BUF buffers whereas the latter is used by USERPTR. Unify the two, leaving dma_sgt. MMAP buffers do not need cache flushing since they have been allocated using dma_alloc

[RFC v2 09/11] vb2: dma-contig: Move vb2_dc_get_base_sgt() up

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus Just move the function up. It'll be soon needed earlier than previously. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 40 +- 1 file changed, 20 insertions(+), 20 deletions(-) diff --g

[RFC v2 01/11] vb2: Rename confusingly named internal buffer preparation functions

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus Rename __qbuf_*() functions which are specific to a buffer type as __prepare_*() which matches with what they do. The naming was there for historical reasons; the purpose of the functions was changed without renaming them. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil R

[RFC v2 11/11] vb2: dma-contig: Add WARN_ON_ONCE() to check for potential bugs

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The scatterlist should always be present when the cache would need to be flushed. Each buffer type has its own means to provide that. Add WARN_ON_ONCE() to check the scatterist exists. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 ++

[RFC v2 10/11] vb2: dma-contig: Let drivers decide DMA attrs of MMAP and USERPTR bufs

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The desirable DMA attributes are not generic for all devices using Videobuf2 contiguous DMA ops. Let the drivers decide. This change also results in MMAP buffers always having an sg_table (dma_sgt field). Also arrange the header files alphabetically. As a result, also the DM

[RFC v2 02/11] vb2: Move buffer cache synchronisation to prepare from queue

2016-12-16 Thread Laurent Pinchart
From: Sakari Ailus The buffer cache should be synchronised in buffer preparation, not when the buffer is queued to the device. Fix this. Mmap buffers do not need cache synchronisation since they are always coherent. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/videobuf2-core.c | 20

[PATCH V2] drm/i915: relax uncritical udelay_range()

2016-12-16 Thread Nicholas Mc Guire
udelay_range(1, 2) is inefficient and as discussions with Jani Nikula unnecessary here. This replaces this tight setting with a relaxed delay of min=20 and max=50 which helps the hrtimer subsystem optimize timer handling. Fixes: commit be4fc046bed3 ("drm/i915: add VLV DSI PLL Calculations") Link

[PATCH V2] drm/i915: relax uncritical udelay_range() settings

2016-12-16 Thread Nicholas Mc Guire
udelay_range(2, 3) is inefficient and as discussions with Jani Nikula unnecessary here. This replaces this tight setting with a relaxed delay of min=20 and max=50. which helps the hrtimer subsystem optimize timer handling. Link: http://lkml.org/lkml/2016/12/15/127 Fixes: commit 37ab0810c9b7 ("drm

[PATCH 3/5] drm/amd/amdgpu: add amdgpu_bo_gpu_accessible helper function

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:10, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Signed-off-by: Nicolai Hähnle Reviewed-by: Chunming Zhou > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_obj

[PATCH 2/5] drm/amd/amdgpu: move eviction counting to amdgpu_bo_move_notify

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:10, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > This catches evictions of shadow page tables from the GART. Since shadow > page tables are always stored in system memory, amdgpu_bo_move is never > called for them. > > This fixes a crash during command submission th

[PATCH v2] drm/amd/amdgpu: add check that shadow page tables are GPU-accessible

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:59, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Skip amdgpu_gem_va_update_vm otherwise. Also clean up the check for the > non-shadow page tables using the new helper function. > > This fixes a crash with the stack trace: > > amdgpu_gem_va_update_vm > -> amdgpu_vm_u

[PATCH 4/5] drm/amd/amdgpu: add check that shadow page directory is GPU-accessible

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:10, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Skip amdgpu_gem_va_update_vm when shadow the page directory is swapped out. > Clean up the check for non-shadow BOs as well using the new helper function. > > This fixes a crash with the stack trace: > > amdgpu_gem_va

[PATCH 1/5] drm/ttm: add evict parameter to ttm_bo_driver::move_notify

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:10, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Ensure that the driver can listen to evictions even when they don't take the > path through ttm_bo_driver::move. > > This is crucial for amdgpu, which relies on an eviction counter to skip > re-binding page tables whe

[PATCH 5/5] drm/amd/amdgpu: add check that shadow page tables are GPU-accessible

2016-12-16 Thread zhoucm1
On 2016年12月16日 01:10, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Skip amdgpu_gem_va_update_vm otherwise. Also clean up the check for the > non-shadow page tables using the new helper function. > > This fixes a crash with the stack trace: > > amdgpu_gem_va_update_vm > -> amdgpu_vm_u

[Intel-gfx] [PATCH] drm: Convert all helpers to drm_connector_list_iter

2016-12-16 Thread Daniel Vetter
] > [also build test ERROR on next-20161215] > [cannot apply to v4.9] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-Convert-all-helpers-t

[PATCH] kref: prefer atomic_inc_not_zero to atomic_add_unless

2016-12-16 Thread Daniel Vetter
On Thu, Dec 15, 2016 at 06:01:10AM +0100, Jason A. Donenfeld wrote: > On most platforms, there exists this ifdef: > > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > > This makes this patch functionally useless. However, on PPC, there is > actually an explicit definition of atomic_

[PATCH] kref: prefer atomic_inc_not_zero to atomic_add_unless

2016-12-16 Thread Daniel Vetter
On Thu, Dec 15, 2016 at 11:10:49AM -0800, Greg KH wrote: > On Thu, Dec 15, 2016 at 07:55:54PM +0100, Jason A. Donenfeld wrote: > > On most platforms, there exists this ifdef: > > > > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > > > > This makes this patch functionally useless. H

[kbuild-all] [Intel-gfx] [PATCH] drm: Convert all helpers to drm_connector_list_iter

2016-12-16 Thread Fengguang Wu
OR on next-20161215] >> [cannot apply to v4.9] >> [if your patch is applied to the wrong git tree, please drop us a note to >> help improve the system] >> >> url: >> https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-Convert-all-helpers-to-drm_c

drm_mm range manager fixes, take 2

2016-12-16 Thread Chris Wilson
The goal of this series is to fix top-down allocations to be allocated from the top and aligned correctly, introduce bottom-up allocations, and speed up searches and tighten evictions. More polish on the test cases to reduce code duplication and to improve expectation checking. And a little more p

[PATCH v2 02/40] drm/i915: Simplify i915_gtt_color_adjust()

2016-12-16 Thread Chris Wilson
If we remember that node_list is a circular list containing the fake head_node, we can use a simple list_next_entry() and skip the NULL check for the allocated check against the head_node. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++---

[PATCH v2 03/40] drm: Add drm_mm_for_each_node_safe()

2016-12-16 Thread Chris Wilson
A complement to drm_mm_for_each_node(), wraps list_for_each_entry_safe() for walking the list of nodes safe against removal. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 9 - include/drm/drm_mm.h | 19 --- 2 files changed,

[PATCH v2 08/40] drm: Add a simple prime number generator

2016-12-16 Thread Chris Wilson
Prime numbers are interesting for testing components that use multiplies and divides, such as testing struct drm_mm alignment computations. Signed-off-by: Chris Wilson --- drivers/gpu/drm/Kconfig | 4 + drivers/gpu/drm/Makefile| 1 + drivers/gpu/drm/lib/drm_pr

[PATCH v2 04/40] drm: Constify the drm_mm API

2016-12-16 Thread Chris Wilson
Mark up the pointers as constant through the API where appropriate. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c| 24 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- include/drm/drm_mm.h| 27 +-- 3 files change

[PATCH v2 20/40] drm: kselftest for drm_mm and color eviction

2016-12-16 Thread Chris Wilson
Check that after applying the driver's color adjustment, eviction scanning find a suitable hole. Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 159 +++ 2 files changed, 160 insertions(+

[PATCH v2 14/40] drm: kselftest for drm_mm_insert_node_in_range()

2016-12-16 Thread Chris Wilson
Exercise drm_mm_insert_node_in_range(), check that we only allocate from the specified range. v2: Use all allocation flags Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 246 +++ 2 file

[PATCH v2 21/40] drm: kselftest for drm_mm and restricted color eviction

2016-12-16 Thread Chris Wilson
Check that after applying the driver's color adjustment, restricted eviction scanning find a suitable hole. Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 119 ++- 2 files changed, 116 i

[PATCH v2 23/40] drm: Promote drm_mm alignment to u64

2016-12-16 Thread Chris Wilson
In places (e.g. i915.ko), the alignment is exported to userspace as u64 and there now exists hardware for which we can indeed utilize a u64 alignment. As such, we need to keep 64bit integers throughout when handling alignment. Testcase: igt/drm_mm/align64 Testcase: igt/gem_exec_alignment Signed-of

[PATCH v2 32/40] drm: Compute tight evictions for drm_mm_scan

2016-12-16 Thread Chris Wilson
Compute the minimal required hole during scan and only evict those nodes that overlap. This enables us to reduce the number of nodes we need to evict to the bare minimum. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c| 60 ++

[PATCH v2 07/40] drm: Add a simple generator of random permutations

2016-12-16 Thread Chris Wilson
When testing, we want a random but yet reproducible order in which to process elements. Here we create an array which is a random (using the Tausworthe PRNG) permutation of the order in which to execute. v2: Tidier code by David Herrmann Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: David

[PATCH v2 33/40] drm: Optimise power-of-two alignments in drm_mm_scan_add_block()

2016-12-16 Thread Chris Wilson
For power-of-two alignments, we can avoid the 64bit divide and do a simple bitwise add instead. v2: s/alignment_mask/remainder_mask/ Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 9 - include/drm/drm_mm.h | 1 + 2 files changed, 9 insertion

[PATCH v2 09/40] drm: kselftest for drm_mm_init()

2016-12-16 Thread Chris Wilson
Simple first test to just exercise initialisation of struct drm_mm. Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 114 +++ 2 files changed, 115 insertions(+) diff --git a/drivers/gpu/d

[PATCH v2 15/40] drm: kselftest for drm_mm and alignment

2016-12-16 Thread Chris Wilson
Check that we can request alignment to any power-of-two or prime using a plain drm_mm_node_insert(), and also handle a reasonable selection of primes. v2: Exercise all allocation flags Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h |

[PATCH v2 25/40] drm: Detect overflow in drm_mm_reserve_node()

2016-12-16 Thread Chris Wilson
Protect ourselves from a caller passing in node.start + node.size that will overflow and trick us into reserving that node. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm

[PATCH v2 12/40] drm: kselftest for drm_mm_insert_node()

2016-12-16 Thread Chris Wilson
Exercise drm_mm_insert_node(), check that we can't overfill a range and that the lists are correct after reserving/removing. v2: Extract helpers for the repeated tests v3: Iterate over all allocation flags Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + dri

[PATCH v2 24/40] drm: Fix kerneldoc for drm_mm_scan_remove_block()

2016-12-16 Thread Chris Wilson
The nodes must be removed in the *reverse* order. This is correct in the overview, but backwards in the function description. Whilst here add Intel's copyright statement and tweak some formatting. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c | 34 ++ i

[PATCH v2 35/40] drm: Apply tight eviction scanning to color_adjust

2016-12-16 Thread Chris Wilson
Using mm->color_adjust makes the eviction scanner much tricker since we don't know the actual neighbours of the target hole until after it is created (after scanning is complete). To work out whether we need to evict the neighbours because they impact upon the hole, we have to then check the hole a

[PATCH v2 40/40] drm: kselftest for drm_mm and bottom-up allocation

2016-12-16 Thread Chris Wilson
Check that if we request bottom-up allocation from drm_mm_insert_node() we receive the next available hole from the bottom. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 102 +

[PATCH v2 05/40] drm: Compile time enabling for asserts in drm_mm

2016-12-16 Thread Chris Wilson
Use CONFIG_DRM_DEBUG_MM to conditionally enable the internal and validation checking using BUG_ON. Ideally these paths should all be exercised by CI selftests (with the asserts enabled). Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 45 +

[PATCH v2 27/40] drm: Add asserts to catch overflow in drm_mm_init() and drm_mm_init_scan()

2016-12-16 Thread Chris Wilson
A simple assert to ensure that we don't overflow start + size when initialising the drm_mm, or its scanner. In future, we may want to switch to tracking the value of ranges (rather than size) so that we can cover the full u64, for example like resource tracking. Signed-off-by: Chris Wilson ---

[PATCH v2 17/40] drm: kselftest for drm_mm and range restricted eviction

2016-12-16 Thread Chris Wilson
Check that we add arbitrary blocks to a restrited eviction scanner in order to find the first minimal hole that matches our request. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c |

[PATCH v2 13/40] drm: kselftest for drm_mm_replace_node()

2016-12-16 Thread Chris Wilson
Reuse drm_mm_insert_node() with a temporary node to exercise drm_mm_replace_node(). We use the previous test in order to exercise the various lists following replacement. v2: Check that we copy across the important (user) details of the node. The internal details (such as lists and hole tracking)

[PATCH v2 39/40] drm: Improve drm_mm search (and fix topdown allocation) with rbtrees

2016-12-16 Thread Chris Wilson
The drm_mm range manager claimed to support top-down insertion, but it was neither searching for the top-most hole that could fit the allocation request nor fitting the request to the hole correctly. In order to search the range efficiently, we create a secondary index for the holes using either t

[PATCH v2 36/40] drm: Wrap drm_mm_node.hole_follows

2016-12-16 Thread Chris Wilson
Insulate users from changed to the internal hole tracking within struct drm_mm_node by using an accessor for hole_follows. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c| 12 ++-- drivers/gpu/drm/i915/i915_vma.c | 4 ++-- drivers/gpu/drm/selftests/test-

[PATCH v2 01/40] drm/i915: Use the MRU stack search after evicting

2016-12-16 Thread Chris Wilson
When we evict from the GTT to make room for an object, the hole we create is put onto the MRU stack inside the drm_mm range manager. On the next search pass, we can speed up a PIN_HIGH allocation by referencing that stack for the new hole. v2: Pull together the 3 identical implements (ahem, a coup

[PATCH v2 18/40] drm: kselftest for drm_mm and top-down allocation

2016-12-16 Thread Chris Wilson
Check that if we request top-down allocation from drm_mm_insert_node() we receive the next available hole from the top. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 123 +

[PATCH v2 30/40] drm: Unconditionally do the range check in drm_mm_scan_add_block()

2016-12-16 Thread Chris Wilson
Doing the check is trivial (low cost in comparison to overall eviction) and helps simplify the code. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 53 +++ drivers/gpu/drm/i915/i915_gem_evict.c | 10 ++- i

[PATCH v2 22/40] drm/i915: Build DRM range manager selftests for CI

2016-12-16 Thread Chris Wilson
Build the struct drm_mm selftests so that we can trivially run them within our CI. "Enable debug, become developer." - Joonas Lahtinen Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu

[PATCH v2 31/40] drm: Fix application of color vs range restriction when scanning drm_mm

2016-12-16 Thread Chris Wilson
The range restriction should be applied after the color adjustment, or else we may inadvertently apply the color adjustment to the restricted hole (and not against its neighbours). Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 15 +-- 1 file

[PATCH v2 10/40] drm: kselftest for drm_mm_debug()

2016-12-16 Thread Chris Wilson
Simple test to just exercise calling the debug dumper on the drm_mm. Signed-off-by: Chris Wilson --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm/selftests/test-drm_mm.c | 35 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/dr

[PATCH v2 19/40] drm: kselftest for drm_mm and color adjustment

2016-12-16 Thread Chris Wilson
Check that after applying the driver's color adjustment, fitting of the node and its alignment are still correct. v2: s/no_color_touching/separate_adjacent_colors/ Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + drivers/gpu/drm

[PATCH v2 37/40] drm: Apply range restriction after color adjustment when allocation

2016-12-16 Thread Chris Wilson
mm->color_adjust() compares the hole with its neighbouring nodes. They only abutt before we restrict the hole, so we have to apply color_adjust before we apply the range restriction. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c | 16 ++-- 1 file changed, 6 insertions(+),

[PATCH v2 34/40] drm: Simplify drm_mm scan-list manipulation

2016-12-16 Thread Chris Wilson
Since we mandate a strict reverse-order of drm_mm_scan_remove_block() after drm_mm_scan_add_block() we can further simplify the list manipulations when generating the temporary scan-hole. v2: Highlight the games being played with the lists to track the scan holes without allocation. Signed-off-by

[PATCH v2 26/40] drm: Simplify drm_mm_clean()

2016-12-16 Thread Chris Wilson
Since commit ea7b1dd44867 ("drm: mm: track free areas implicitly"), to test whether there are any nodes allocated within the range manager, we merely have to ask whether the node_list is empty. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 19 +-

[PATCH v2 16/40] drm: kselftest for drm_mm and eviction

2016-12-16 Thread Chris Wilson
Check that we add arbitrary blocks to the eviction scanner in order to find the first minimal hole that matches our request. v2: Refactor out some common eviction code for later Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1 + d

[PATCH v2 06/40] drm: Add some kselftests for the DRM range manager (struct drm_mm)

2016-12-16 Thread Chris Wilson
First we introduce a smattering of infrastructure for writing selftests. The idea is that we have a test module that exercises a particular portion of the exported API, and that module provides a set of tests that can either be run as an ensemble via kselftest or individually via an igt harness (in

[PATCH v2 11/40] drm: kselftest for drm_mm_reserve_node()

2016-12-16 Thread Chris Wilson
Exercise drm_mm_reserve_node(), check that we can't reserve an already occupied range and that the lists are correct after reserving/removing. v2: Check for invalid node reservation. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/selftests/drm_mm_selftests.h | 1

[PATCH v2 29/40] drm: Rename prev_node to hole in drm_mm_scan_add_block()

2016-12-16 Thread Chris Wilson
Acknowledging that we were building up the hole was more useful to me when reading the code, than knowing the relationship between this node and the previous node. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) dif

[PATCH v2 38/40] drm: Use drm_mm_insert_node_in_range_generic() for everyone

2016-12-16 Thread Chris Wilson
Remove a superfluous helper as drm_mm_insert_node is equivalent to insert_node_in_range with a range of (0, U64_MAX). Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_mm.c | 166 --- include/drm/drm_mm.h | 90 +++-- 2 files

[PATCH v2 28/40] drm: Extract struct drm_mm_scan from struct drm_mm

2016-12-16 Thread Chris Wilson
The scan state occupies a large proportion of the struct drm_mm and is rarely used and only contains temporary state. That makes it suitable to moving to its struct and onto the stack of the callers. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c

[Intel-gfx] [bug report] drm/i915: Small compaction of the engine init code

2016-12-16 Thread Tvrtko Ursulin
On 15/12/2016 20:54, Chris Wilson wrote: > On Thu, Dec 15, 2016 at 11:44:13PM +0300, Dan Carpenter wrote: >> Hello Tvrtko Ursulin, >> >> The patch a19d6ff29a82: "drm/i915: Small compaction of the engine >> init code" from Jun 23, 2016, leads to the following static checker >> warning: >> >> d

[PATCH v4 3/5] drm: bridge: Link encoder and bridge in core code

2016-12-16 Thread Archit Taneja
Hi, On 12/14/2016 03:29 PM, Laurent Pinchart wrote: > Instead of linking encoders and bridges in every driver (and getting it > wrong half of the time, as many drivers forget to set the drm_bridge > encoder pointer), do so in core code. The drm_bridge_attach() function > needs the encoder and opti

[Intel-gfx] [bug report] drm/i915: Small compaction of the engine init code

2016-12-16 Thread Tvrtko Ursulin
On 16/12/2016 08:02, Tvrtko Ursulin wrote: > > On 15/12/2016 20:54, Chris Wilson wrote: >> On Thu, Dec 15, 2016 at 11:44:13PM +0300, Dan Carpenter wrote: >>> Hello Tvrtko Ursulin, >>> >>> The patch a19d6ff29a82: "drm/i915: Small compaction of the engine >>> init code" from Jun 23, 2016, leads to t

[PATCH v2 01/40] drm/i915: Use the MRU stack search after evicting

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > When we evict from the GTT to make room for an object, the hole we > create is put onto the MRU stack inside the drm_mm range manager. On the > next search pass, we can speed up a PIN_HIGH allocation by referencing > that stack for the new hol

[PATCH v2 03/40] drm: Add drm_mm_for_each_node_safe()

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > A complement to drm_mm_for_each_node(), wraps list_for_each_entry_safe() > for walking the list of nodes safe against removal. > Most of the diff is about __drm_mm_nodes(mm), which could be split into own patch and keep the R-b's. Regards,

[PATCH v4 3/5] drm: bridge: Link encoder and bridge in core code

2016-12-16 Thread Jyri Sarha
On 12/14/16 11:59, Laurent Pinchart wrote: > Instead of linking encoders and bridges in every driver (and getting it > wrong half of the time, as many drivers forget to set the drm_bridge > encoder pointer), do so in core code. The drm_bridge_attach() function > needs the encoder and optional previ

[PATCH V2] drm/i915: relax uncritical udelay_range()

2016-12-16 Thread Jani Nikula
On Fri, 16 Dec 2016, Nicholas Mc Guire wrote: > udelay_range(1, 2) is inefficient and as discussions with Jani Nikula > unnecessary here. This replaces this > tight setting with a relaxed delay of min=20 and max=50 which helps > the hrtimer subsystem optimize timer handling. > > Fixes: commit be4

[Bug 98869] Electronic Super Joy graphic artefacts (regression)

2016-12-16 Thread bugzilla-dae...@freedesktop.org
tronicSuperJoy -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/756ee6ae/attachment.html>

[PATCH v2 08/40] drm: Add a simple prime number generator

2016-12-16 Thread Lukas Wunner
On Fri, Dec 16, 2016 at 07:46:46AM +, Chris Wilson wrote: > Prime numbers are interesting for testing components that use multiplies > and divides, such as testing struct drm_mm alignment computations. > > Signed-off-by: Chris Wilson > --- > drivers/gpu/drm/Kconfig | 4 + >

[PATCH v2 07/40] drm: Add a simple generator of random permutations

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > When testing, we want a random but yet reproducible order in which to > process elements. Here we create an array which is a random (using the > Tausworthe PRNG) permutation of the order in which to execute. > > v2: Tidier code by David Herrm

[PATCH v2 09/40] drm: kselftest for drm_mm_init()

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > Simple first test to just exercise initialisation of struct drm_mm. > > Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen Regards, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation

[PATCH v2 08/40] drm: Add a simple prime number generator

2016-12-16 Thread Chris Wilson
On Fri, Dec 16, 2016 at 10:31:17AM +0100, Lukas Wunner wrote: > On Fri, Dec 16, 2016 at 07:46:46AM +, Chris Wilson wrote: > > Prime numbers are interesting for testing components that use multiplies > > and divides, such as testing struct drm_mm alignment computations. > > > > Signed-off-by: C

[Bug 98869] Electronic Super Joy graphic artefacts (regression)

2016-12-16 Thread bugzilla-dae...@freedesktop.org
ee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/f1096310/attachment.html>

[PATCH v2 10/40] drm: kselftest for drm_mm_debug()

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > Simple test to just exercise calling the debug dumper on the drm_mm. > > Signed-off-by: Chris Wilson This is rather meta already. Not entirely sure how good of a selftest this is when we do not validate the generated output, or do you at th

[Bug 98869] Electronic Super Joy graphic artefacts (regression)

2016-12-16 Thread bugzilla-dae...@freedesktop.org
bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/4475bcd8/attachment.html>

Radeon X200M device suspend problem

2016-12-16 Thread Michel Dänzer
On 16/12/16 01:29 AM, Dmitriy Kryuk wrote: > I have a laptop with a Radeon X200M card in it. I use Radeon DRM driver > for graphics, and it makes the system hang with display off when trying > to suspend (either to disk or to RAM). Using /sys/power/pm_test > interface revealed that it freezes when

[PATCH v2 10/40] drm: kselftest for drm_mm_debug()

2016-12-16 Thread Chris Wilson
On Fri, Dec 16, 2016 at 11:44:39AM +0200, Joonas Lahtinen wrote: > On pe, 2016-12-16 at 07:46 +, Chris Wilson wrote: > > Simple test to just exercise calling the debug dumper on the drm_mm. > > > > Signed-off-by: Chris Wilson > > This is rather meta already. Not entirely sure how good of a s

[PATCH v2 08/40] drm: Add a simple prime number generator

2016-12-16 Thread Lukas Wunner
On Fri, Dec 16, 2016 at 09:43:54AM +, Chris Wilson wrote: > On Fri, Dec 16, 2016 at 10:31:17AM +0100, Lukas Wunner wrote: > > On Fri, Dec 16, 2016 at 07:46:46AM +, Chris Wilson wrote: > > > Prime numbers are interesting for testing components that use multiplies > > > and divides, such as t

[PATCH v2 24/40] drm: Fix kerneldoc for drm_mm_scan_remove_block()

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:47 +, Chris Wilson wrote: > The nodes must be removed in the *reverse* order. This is correct in the > overview, but backwards in the function description. Whilst here add > Intel's copyright statement and tweak some formatting. > > Signed-off-by: Chris Wilson It's li

[PATCH v2 25/40] drm: Detect overflow in drm_mm_reserve_node()

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:47 +, Chris Wilson wrote: > Protect ourselves from a caller passing in node.start + node.size that > will overflow and trick us into reserving that node. > > Signed-off-by: Chris Wilson I was about to suggest an additional check (but didn't). A combined check is much

[PATCH v2 08/40] drm: Add a simple prime number generator

2016-12-16 Thread Chris Wilson
On Fri, Dec 16, 2016 at 11:08:10AM +0100, Lukas Wunner wrote: > On Fri, Dec 16, 2016 at 09:43:54AM +, Chris Wilson wrote: > > On Fri, Dec 16, 2016 at 10:31:17AM +0100, Lukas Wunner wrote: > > > On Fri, Dec 16, 2016 at 07:46:46AM +, Chris Wilson wrote: > > > > Prime numbers are interesting f

[PATCH 0/2] drm: link status property and DP link training failure handling

2016-12-16 Thread Jani Nikula
The two remaining patches from [1], rebased. BR, Jani. [1] http://mid.mail-archive.com/1480984058-552-1-git-send-email-manasi.d.navare at intel.com Manasi Navare (2): drm: Add a new connector atomic property for link status drm/i915: Implement Link Rate fallback on Link training failure

[PATCH 1/2] drm: Add a new connector atomic property for link status

2016-12-16 Thread Jani Nikula
From: Manasi Navare At the time userspace does setcrtc, we've already promised the mode would work. The promise is based on the theoretical capabilities of the link, but it's possible we can't reach this in practice. The DP spec describes how the link should be reduced, but we can't reduce the li

[PATCH 2/2] drm/i915: Implement Link Rate fallback on Link training failure

2016-12-16 Thread Jani Nikula
From: Manasi Navare If link training at a link rate optimal for a particular mode fails during modeset's atomic commit phase, then we let the modeset complete and then retry. We save the link rate value at which link training failed, update the link status property to "BAD" and use a lower link r

[RFC v2 00/11] vb2: Handle user cache hints, allow drivers to choose cache coherency

2016-12-16 Thread Hans Verkuil
On 16/12/16 02:24, Laurent Pinchart wrote: > Hello, > > This is a rebased version of the vb2 cache hints support patch series posted > by Sakari more than a year ago. The patches have been modified as needed by > the upstream changes and received the occasional small odd fix but are > otherwise not

[PATCH v4 19/22] drm: omapdrm: Simplify IRQ wait implementation

2016-12-16 Thread Tomi Valkeinen
gs); > - } > + list_for_each_entry_safe(wait, n, &priv->wait_list, node) { > + if (wait->irqmask & irqstatus) > + omap_irq_wait_irq(wait); > } > spin_unlock_irqrestore(&list_lock, flags); > > @@ -275,7 +251,7 @@ int omap_drm_irq_install(struct drm_device *dev) > unsigned int i; > int ret; > > - INIT_LIST_HEAD(&priv->irq_list); > + INIT_LIST_HEAD(&priv->wait_list); > > priv->irq_mask = DISPC_IRQ_OCP_ERR; > > With the function rename change: Reviewed-by: Tomi Valkeinen Tomi -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/b8d02d52/attachment.sig>

[alsa-lib][PATCH] ASoC: hdmi-codec: use unsigned type to structure members with bit-field instead of signed type

2016-12-16 Thread Mark Brown
s.freedesktop.org/archives/dri-devel/attachments/20161216/8509a187/attachment.sig>

[PATCH v4 20/22] drm: omapdrm: Remove global variables

2016-12-16 Thread Tomi Valkeinen
guess the current implementation is better. Reviewed-by: Tomi Valkeinen Tomi -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/16a89e89/attachment-0001.sig>

Applied "ASoC: hdmi-codec: use unsigned type to structure members with bit-field" to the asoc tree

2016-12-16 Thread Mark Brown
The patch ASoC: hdmi-codec: use unsigned type to structure members with bit-field has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the ne

[PATCH v4 22/22] drm: omapdrm: Perform initialization/cleanup at probe/remove time

2016-12-16 Thread Tomi Valkeinen
_free_priv: > + destroy_workqueue(priv->wq); > + kfree(priv); > +err_disconnect_dssdevs: > + omap_disconnect_dssdevs(); > +err_crtc_uninit: > + omap_crtc_pre_uninit(); > + return ret; > } > > -static int pdev_remove(struct platform_device *device) > +static int pdev_remove(struct platform_device *pdev) > { > + struct drm_device *ddev = platform_get_drvdata(pdev); > + struct omap_drm_private *priv = ddev->dev_private; > + > DBG(""); > > - drm_put_dev(platform_get_drvdata(device)); > + drm_dev_unregister(ddev); > + > + drm_kms_helper_poll_fini(ddev); > + > + if (priv->fbdev) > + omap_fbdev_free(ddev); > + > + drm_mode_config_cleanup(ddev); > + > + omap_drm_irq_uninstall(ddev); > + omap_gem_deinit(ddev); > + > + drm_dev_unref(ddev); > + > + destroy_workqueue(priv->wq); > + kfree(priv); > > omap_disconnect_dssdevs(); > omap_crtc_pre_uninit(); > The old code calls drm_vblank_cleanup(), and the probe's error handling calls that, but not remove. Is that correct? Tomi -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161216/7cdff755/attachment.sig>

[PATCH v2 37/40] drm: Apply range restriction after color adjustment when allocation

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:47 +, Chris Wilson wrote: > mm->color_adjust() compares the hole with its neighbouring nodes. They > only abutt before we restrict the hole, so we have to apply color_adjust > before we apply the range restriction. > > Signed-off-by: Chris Wilson Reviewed-by: Joonas L

[PATCH v2 38/40] drm: Use drm_mm_insert_node_in_range_generic() for everyone

2016-12-16 Thread Joonas Lahtinen
On pe, 2016-12-16 at 07:47 +, Chris Wilson wrote: > Remove a superfluous helper as drm_mm_insert_node is equivalent to > insert_node_in_range with a range of (0, U64_MAX). > > Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen Regards, Joonas -- Joonas Lahtinen Open Source Technolog

  1   2   3   >