Re: [PATCH 2/5] drm/syncobj: add sync obj wait interface. (v4)

2017-06-01 Thread Chris Wilson
> + ret = -EFAULT; > + goto err_free_handles; > + } > + > + fences = kcalloc(args->count_handles, > + sizeof(struct dma_fence *), GFP_KERNEL); if (!fences) /* blah */ > + > + for (i = 0; i < args->count_

Re: [PATCH 3/5] drm/syncobj: add sync_file interaction. (v1.2)

2017-06-01 Thread Chris Wilson
> This should only be used to interact with sync files where necessary. > > v1.1: fence put fixes (Chris), drop fence from ioctl names (Chris) > fixup for new fence replace API. > > Reviewed-by: Sean Paul > Signed-off-by: Dave Airlie Reviewed-by: Chris Wilson -Chris -- Chr

Re: [PATCH] drm: Fix oops + Xserver hang when unplugging USB drm devices

2017-06-01 Thread Chris Wilson
es drm_unplug_dev by not only reverting > commit a39be606f99d ("drm: Do a full device unregister when unplugging") > but by also adding a call to drm_modeset_unregister_all before the > drm_minor_unregister calls to make sure all sysfs entries are removed > before calling dev

Re: [PATCH v11] drm: Unplug drm device when unregistering it (v8)

2017-06-01 Thread Chris Wilson
On Thu, Jun 01, 2017 at 02:13:28PM +0200, Hans de Goede wrote: > Hi, > > On 31-05-17 04:39, jeffy wrote: > >Hi Hans, > > > >thanx for investigating :) > > > >On 05/30/2017 03:06 PM, Hans de Goede wrote: > >>Hi, > >> > >>On 29-0

[PATCH] drm: Add deprecation warnings to the old midlayer callbacks

2017-06-01 Thread Chris Wilson
Daniel started a crusade a few years back to move control over the initialisation and teardown into the driver rather than drm core, for greater control and far fewer surprises. Help in that fight by adding compiler warnings to the stale functions. Signed-off-by: Chris Wilson --- This is not as

Re: [PATCH v11] drm: Unplug drm device when unregistering it (v8)

2017-06-01 Thread Chris Wilson
On Thu, Jun 01, 2017 at 02:26:01PM +0200, Hans de Goede wrote: > Hi, > > On 01-06-17 14:22, Chris Wilson wrote: > >On Thu, Jun 01, 2017 at 02:13:28PM +0200, Hans de Goede wrote: > >>Hi, > >> > >>On 31-05-17 04:39, jeffy wrote: > >>>Hi Hans,

[Intel-gfx] [PATCH v2] drm: Pass along the hotplug connector to the uevent

2016-10-21 Thread Chris Wilson
On Fri, Oct 21, 2016 at 02:45:41PM +0200, Daniel Vetter wrote: > On Fri, Oct 21, 2016 at 10:14:21AM +0100, Chris Wilson wrote: > > If we know which connector was plugged/unplugged or > > connected/disconnected, we can pass that information along to userspace > > inside the

[PATCH] drm/fb-helper: Don't call dirty callback for untouched clips

2016-10-21 Thread Chris Wilson
drm_mode_dirtyfb_ioctl(struct drm_device *dev, } if (num_clips && clips_ptr) { + int i; + if (num_clips < 0 || num_clips > DRM_MODE_FB_DIRTY_MAX_CLIPS) { ret = -EINVAL; goto out_err1; } + clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); if (!clips) { ret = -ENOMEM; @@ -520,6 +523,14 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, ret = -EFAULT; goto out_err2; } + + for (i = 0; i < num_clips; i++) { + if (clips[i].x2 < clips[i].x1 || + clips[i].y2 < clips[i].y1) { + ret = -EINVAL; + goto out_err2; + } + } } if (fb->funcs->dirty) -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] drm: Add timestamp of last modification to GETCONNECTOR ioctl

2016-10-21 Thread Chris Wilson
good position to know which outputs need to be reprobed (since it has just responded to the hardware notification) and can convey this information to userspace by tracking the timestamp of the last connector change onto the GETCONNECTOR query. Signed-off-by: Chris Wilson --- Adding an epoch

[PATCH] drm: Use u64 for intermediate dotclock calculations

2016-10-21 Thread Chris Wilson
integer overflow: [ 48.728503] 2240 * 100 cannot be represented in type 'int' Reported-by: Martin Liška Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98372 Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_modes.c | 8 ++-- 1 file changed, 6 insertions(+), 2

[PATCH] drm/fb-helper: Don't call dirty callback for untouched clips

2016-10-21 Thread Chris Wilson
On Fri, Oct 21, 2016 at 08:19:03PM +0200, Daniel Vetter wrote: > On Fri, Oct 21, 2016 at 01:57:28PM +0100, Chris Wilson wrote: > > I think of a use for sending an empty clip: where you don't want to > > push any new pixel data, but you do want to be sure that the pipeline

[Intel-gfx] [PATCH 1/1] drm/i915/dsi: silence a warning about uninitialized return value

2016-10-23 Thread Chris Wilson
return the garbage. Not only should we fix the error handling here, but you also need to fix the error handling in drivers/video/backlight/backlight.c as despite many callees returning an error, it assumes that bd->ops->get_brightness() never returns an error... -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v2] drm/edid: Only print the bad edid when aborting

2016-10-24 Thread Chris Wilson
the valid extensions. References: https://bugs.freedesktop.org/show_bug.cgi?id=98228 Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_edid.c | 78 -- 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers

[PATCH v2] drm/edid: Only print the bad edid when aborting

2016-10-24 Thread Chris Wilson
On Mon, Oct 24, 2016 at 12:33:41PM +0100, Chris Wilson wrote: > for (j = 1; j <= edid[0x7e]; j++) { > - u8 *block = edid + (valid_extensions + 1) * EDID_LENGTH; > + u8 *block = edid + j * EDID_LENGTH; > > fo

[PATCH v3] drm/edid: Only print the bad edid when aborting

2016-10-24 Thread Chris Wilson
the valid extensions. v3: Fix invalid/valid extension fumble. References: https://bugs.freedesktop.org/show_bug.cgi?id=98228 Signed-off-by: Chris Wilson Cc: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 79 -- 1 file changed, 56 insertions(+), 23

[PATCH] dma-buf/fence: add an lockdep_assert_held()

2016-10-24 Thread Chris Wilson
On Mon, Oct 24, 2016 at 03:57:10PM -0400, Rob Clark wrote: > Signed-off-by: Rob Clark Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] drm: Release reference from blob lookup after replacing property

2016-10-25 Thread Chris Wilson
during drm_atomic_helper_legacy_gamma_set(). Based on a patch by Felix Monninger Reported-by: Felix Monninger References: https://bugs.freedesktop.org/show_bug.cgi?id=98420 Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_atomic.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions

[PATCH v2] drm: Release reference from blob lookup after replacing property

2016-10-25 Thread Chris Wilson
=98420 Signed-off-by: Felix Monninger Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_atomic.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 1b5a32df9a9a..e0760c138355 100644 --- a/drivers/gpu/drm

[Intel-gfx] [PATCH] drm: Release reference from blob lookup after replacing property

2016-10-25 Thread Chris Wilson
On Tue, Oct 25, 2016 at 05:27:21PM -0400, Sean Paul wrote: > On Tue, Oct 25, 2016 at 3:46 PM, Chris Wilson > wrote: > > drm_property_lookup_blob() returns a reference to the returned blob, and > > drm_atomic_replace_property_blob() takes a references to the blob it > >

[PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Chris Wilson
i915_perf_open_ioctl_locked(struct drm_i915_private > *dev_priv, > + /* we avoid simply assigning stream->sample_flags = props->sample_flags > + * to have _stream_init check the combination of sample flags more > + * thoroughly, but still this is the expected result at this point. >*/ > - DRM_ERROR("Unsupported i915 perf stream configuration\n"); > - ret = -EINVAL; > - goto err_alloc; > + BUG_ON(stream->sample_flags != props->sample_flags); if (WARN_ON(...)) { ret = -ENODEV; goto err_alloc; } just to avoid checkpatch complaining. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Chris Wilson
On Wed, Oct 26, 2016 at 12:05:44AM +0100, Chris Wilson wrote: > On Tue, Oct 25, 2016 at 12:19:29AM +0100, Robert Bragg wrote: > > + /* So that we don't have to worry about updating the context ID > > +* in OACONTOL on the fly we make sure to pin the context > &

[PATCH v3] dma-buf: Rename struct fence to dma_fence

2016-10-25 Thread Chris Wilson
| - trace_fence_emit + trace_dma_fence_emit | - FENCE_TRACE + DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson Reviewed-by: Gustavo Padovan Acked-by: Sumit Semwal Acked-by: Christian König --- Documentation/sync_file.txt

[PATCH v4] dma-buf: Rename struct fence to dma_fence

2016-10-25 Thread Chris Wilson
+ dma_fence_is_array | - trace_fence_emit + trace_dma_fence_emit | - FENCE_TRACE + DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson Reviewed-by: Gustavo Padovan Acked-by: Sumit Semwal Acked-by: Christian König

[PATCH v2] dma-buf: Rename struct fence to dma_fence

2016-10-25 Thread Chris Wilson
+ DMA_FENCE_TRACE | - FENCE_WARN + DMA_FENCE_WARN | - FENCE_ERR + DMA_FENCE_ERR ) ( ... ) Signed-off-by: Chris Wilson Reviewed-by: Gustavo Padovan Acked-by: Sumit Semwal Acked-by: Christian König --- Documentation/sync_file.txt| 8 +- drivers/base/Kconfig

[PATCH 1/4] dma-buf/fence: make timeout handling in fence_default_wait consistent

2016-10-26 Thread Chris Wilson
. When we report to userspace, we convert the timeout into an error, usually EBUSY or ETIME. Applying that same convention here makes this all much cleaner... -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Chris Wilson
mmetry, keeping the vma you pinned and unpinning the same later makes its ownership much clearer. (And I do want the owner of each pin to be clear, for when we start enabling debug to catch the VMA leaks.) -Chris -- Chris Wilson, Intel Open Source Technology Centre

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

2016-10-26 Thread Chris Wilson
en if there have not been any changes in the mode list > > or connector status. > > > > Cc: dri-devel at lists.freedesktop.org > > Cc: Jani Nikula > > Cc: Daniel Vetter > > Cc: Ville Syrjala > > Cc: Chris Wilson > > Signed-off-by: Manasi Navar

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

2016-10-26 Thread Chris Wilson
for this idea was that this could serve as the failure notification path for nonblocking modesets (well modesets in general since it appears returning the error is not going to happen). -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 1/4] drm/fb-helper: Fix connector ref leak on error

2016-10-26 Thread Chris Wilson
> Cc: Carlos Santa > Cc: Kirill A. Shutemov > Tested-by: Carlos Santa > Tested-by: Kirill A. Shutemov > Signed-off-by: Ville Syrjälä Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 2/4] drm/fb-helper: Keep references for the current set of used connectors

2016-10-26 Thread Chris Wilson
; + drm_connector_unreference(modeset->connectors[j]); > + modeset->connectors[j] = NULL; > + } > + Don't we also need a similar cleanup loop in drm_fb_helper_crtc_free()? -Chris -- Chris Wilson, Intel Open Source Technology Centre

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

2016-10-26 Thread Chris Wilson
On Wed, Oct 26, 2016 at 02:17:16PM +0300, Ville Syrjälä wrote: > On Wed, Oct 26, 2016 at 12:51:41PM +0300, Jani Nikula wrote: > > On Wed, 26 Oct 2016, Chris Wilson wrote: > > > On Wed, Oct 26, 2016 at 07:52:26AM +0200, Daniel Vetter wrote: > > >> I'd go fur

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

2016-10-26 Thread Chris Wilson
On Wed, Oct 26, 2016 at 04:15:39PM +0300, Ville Syrjälä wrote: > On Wed, Oct 26, 2016 at 02:11:00PM +0100, Chris Wilson wrote: > > On Wed, Oct 26, 2016 at 02:17:16PM +0300, Ville Syrjälä wrote: > > > On Wed, Oct 26, 2016 at 12:51:41PM +0300, Jani Nikula wrote: > >

[PATCH v2 2/4] drm/fb-helper: Keep references for the current set of used connectors

2016-10-26 Thread Chris Wilson
ut for now I just slapped on a FIXME. > > v2: Cleanup things drm_fb_helper_crtc_free() too (Chris) > > Cc: Chris Wilson > Cc: stable at vger.kernel.org > Cc: Carlos Santa > Cc: Kirill A. Shutemov > Tested-by: Carlos Santa (v1) > Tested-by: Kirill A. Shutemov (v1) >

[PATCH] dma-buf/sw_sync: put fence reference from the fence creation

2016-10-26 Thread Chris Wilson
rrect reference accounting. > > Signed-off-by: Gustavo Padovan Fixes: 30cd85dd6edc ("dma-buf/sync_file: hold reference to fence when creating sync_file") Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 1/2] drm: Track drm_mm allocators and show leaks on shutdown

2016-10-29 Thread Chris Wilson
We can use the kernel's stack tracer and depot to record the allocation site of every drm_mm user and then on shutdown as well as warning that allocated nodes still reside with the drm_mm range manager, we can also display who allocated them to aide tracking down the leak. Signed-off-by:

[PATCH 2/2] drm/i915: Enable drm_mm debug when enabling DRM_I915_DEBUG

2016-10-29 Thread Chris Wilson
A frequent issue that arises on shutdown is the drm_mm range manager complaining of a leak. To aide debugging those, drm can now track the allocation callsite and print those for the leaks. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/Kconfig.debug | 1 + 1 file changed, 1 insertion

[PATCH v2] drm: Track drm_mm allocators and show leaks on shutdown

2016-10-31 Thread Chris Wilson
so it lies underneath the DRM options submenu. Signed-off-by: Chris Wilson Reviewed-by: Christian König --- drivers/gpu/drm/Kconfig | 13 + drivers/gpu/drm/drm_mm.c | 74 ++-- include/drm/drm_mm.h | 6 3 files changed, 90 insertions(

[PATCH libdrm] add libsync.h helper

2016-10-31 Thread Chris Wilson
name, int fd1, int fd2) > +{ > + struct sync_merge_data data = {}; > + int err; What I liked was doing if (fd2 < 0) return dup(fd1); if (fd1 < 0) return dup(fd2); That makes accumulating the fences in the caller much easier (i.e. they start with batch.fence_in = -1; then batch.fence_in = sync_merge(batch.fence_in, fence); finished by execbuf(&batch); close(batch.fence_in); batch.fence_in = -1; -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH libdrm] add libsync.h helper

2016-10-31 Thread Chris Wilson
On Mon, Oct 31, 2016 at 10:30:23AM -0400, Rob Clark wrote: > On Mon, Oct 31, 2016 at 9:55 AM, Chris Wilson > wrote: > > What I liked was doing > > > > if (fd2 < 0) > > return dup(fd1); > > > > if (fd1 < 0) > > return dup(f

[PATCH libdrm] add libsync.h helper

2016-10-31 Thread Chris Wilson
On Mon, Oct 31, 2016 at 10:57:16AM -0400, Rob Clark wrote: > On Mon, Oct 31, 2016 at 10:38 AM, Chris Wilson > wrote: > > Which discards the synchronisation on the new fence if there's an error, > > are we meant to flag a GL_ERROR? > > The error checking should alr

[PATCH] add libsync.h helper

2016-10-31 Thread Chris Wilson
int fd) > + *{ > + * if (sync_accumulate("foo", &batch.fence_fd, fd)) { > + * ... error ... > + * } > + *} > + */ > +static inline int sync_accumulate(const char *name, int *fd1, int fd2) > +{ > + int ret; > + > + assert(fd2 >= 0); > + > + if (*fd1 < 0) { > + *fd1 = dup(fd2); > + return 0; > + } > + > + ret = sync_merge(name, *fd1, fd2); > + if (ret < 0) { > + /* leave *fd1 as it is */ > + return ret; > + } > + > + close(*fd1); > + *fd1 = ret; > + > + return 0; > +} Lgtm, matches how we want to use it. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] drm/nouveau: Skip fence context seqno check if notifies are enabled

2016-09-07 Thread Chris Wilson
If the fence context has notifies enabled, each of the fences' FENCE_FLAG_SIGNALED_BIT will be updated from the interrupt. We can rely on this status for reporting the current fence_is_signaled() and so avoid an expensive uncached read. Signed-off-by: Chris Wilson Cc: Ben Skeggs Cc: dri-

[PATCH] drm/nouveau: Skip fence context seqno check if notifies are enabled

2016-09-07 Thread Chris Wilson
On Wed, Sep 07, 2016 at 09:21:05PM +0100, Chris Wilson wrote: > If the fence context has notifies enabled, each of the fences' > FENCE_FLAG_SIGNALED_BIT will be updated from the interrupt. We can rely > on this status for reporting the current fence_is_signaled() and so > a

[PATCH] drm/i915: Before pageflip, also wait for shared dmabuf fences.

2016-09-08 Thread Chris Wilson
ng. No. Fix the root cause as this affects not just flips but copies - this implies that everybody using the resv object must wait for all fences. The resv object is not just used for prime, but all fencing, so this breaks the ability to schedule parallel operations across engine. -Chris -- Chris W

[PATCH v3] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-08 Thread Chris Wilson
; mutex_lock(&item->mutex); > if (item->refcount == 0) { > - item->object = kzalloc(ref->size, GFP_KERNEL); > - if (unlikely(item->object == NULL)) { > + ref->object = kzalloc(ref->size, GFP_KERNEL); So the item

[PATCH v3] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-08 Thread Chris Wilson
On Thu, Sep 08, 2016 at 03:22:48PM +0800, Huang Rui wrote: > On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: > > On Wed, Sep 07, 2016 at 10:07:57PM -0400, Huang Rui wrote: > > > In previous drm_global_item_ref, there are two times of writing > > > ref->

[PATCH v3] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-08 Thread Chris Wilson
On Thu, Sep 08, 2016 at 09:43:52AM +0200, Christian König wrote: > Am 08.09.2016 um 09:35 schrieb Chris Wilson: > >On Thu, Sep 08, 2016 at 03:22:48PM +0800, Huang Rui wrote: > >>On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: > >>>On Wed, Sep 07, 2016

[PATCH] drm/i915: Before pageflip, also wait for shared dmabuf fences.

2016-09-08 Thread Chris Wilson
On Thu, Sep 08, 2016 at 05:21:42PM +0200, Mario Kleiner wrote: > On 09/08/2016 08:30 AM, Chris Wilson wrote: > >On Thu, Sep 08, 2016 at 02:14:43AM +0200, Mario Kleiner wrote: > >>amdgpu-kms uses shared fences for its prime exported dmabufs, > >>instead of an exclusive

[PATCH] drm/i915: Before pageflip, also wait for shared dmabuf fences.

2016-09-13 Thread Chris Wilson
On Tue, Sep 13, 2016 at 10:44:11AM +0200, Christian König wrote: > Am 09.09.2016 um 03:15 schrieb Michel Dänzer: > >On 09/09/16 01:23 AM, Chris Wilson wrote: > >>On Thu, Sep 08, 2016 at 05:21:42PM +0200, Mario Kleiner wrote: > >>>On 09/08/2016 08:30 AM, Chris Wils

[PATCH 06/18] drm: Add reference counting to drm_atomic_state

2016-09-14 Thread Chris Wilson
beneficial when the lifetime of the state becomes more convoluted than being passed to a single worker thread for the commit. v2: Double check !intel atomic_commit functions for missing gets v3: Update kerneldocs Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org

[PATCH] dma-buf/sync_file: Always increment refcount when merging fences.

2016-09-14 Thread Chris Wilson
fences[i++] = fence_get(a_fences[0]); That ensures the sync_file inherits the signaled status without having to keep all fences. I think there still seems to be a memory leak when calling sync_file_set_fence() here with i == 1. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] 4.8-rc1: it is now common that machine needs re-run of xrandr after resume

2016-09-14 Thread Chris Wilson
as delme, kernel log as delme2. Nothing too > suspicious :-(. [ 234.547] (EE) intel(0): failed to set mode: Permission denied upon resume. There is a VT switch so there should be a DropMaster, SetMaster combo across resume, but that didn't flag any errors. I couldn't see any sign of logi

[PATCH] dma-buf/sync_file: Always increment refcount when merging fences.

2016-09-14 Thread Chris Wilson
On Wed, Sep 14, 2016 at 11:04:01AM -0300, Gustavo Padovan wrote: > 2016-09-14 Chris Wilson : > > I think there still seems to be a memory leak when calling > > sync_file_set_fence() here with i == 1. > > I think that is something we discussed already, we don't hold an ex

[PATCH] dma-buf/sync_file: Increment refcount of fence when all are signaled.

2016-09-15 Thread Chris Wilson
al expired fence's refcount go to zero. > Testcase: igt/sw_sync/...? > Signed-off-by: Rafael Antognolli Lgtm, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH v3 5/5] drm/i915: squash lines for simple wrapper functions

2016-09-16 Thread Chris Wilson
struct intel_engine_cs *engine) > { > - int ret; > - > - ret = intel_engine_init_breadcrumbs(engine); > - if (ret) > - return ret; > - > - return 0; > + return intel_engine_init_breadcrumbs(engine); These are written like this for consistency and ease of change. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 25/38] drm: Add reference counting to drm_atomic_state

2016-09-20 Thread Chris Wilson
beneficial when the lifetime of the state becomes more convoluted than being passed to a single worker thread for the commit. v2: Double check !intel atomic_commit functions for missing gets v3: Update kerneldocs Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org

[PATCH] dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)

2016-09-21 Thread Chris Wilson
On Wed, Sep 21, 2016 at 10:26:25AM +0300, Gustavo Padovan wrote: > Hi Rafael, > > 2016-09-14 Rafael Antognolli : > > > Hi Chris and Gustavo, > > > > On Mon, Aug 29, 2016 at 07:16:13PM +0100, Chris Wilson wrote: > > > If we being polled with a timeout of z

[PATCH] dma-buf/sync_file: free fences array in num_fences is 1

2016-09-21 Thread Chris Wilson
_array is not created instead we just assigned the > fence to sync_file->fence. Then we do not use the fences array anymore nor > does free it. > > This patch frees the array. > > Signed-off-by: Gustavo Padovan > Reported-by: Chris Wilson > --- > drivers/dma-b

[PATCH] drm: Convert prime dma-buf <-> handle to rhashtable

2016-09-22 Thread Chris Wilson
!). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94631 Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_prime.c | 94 +++-- include/drm/drmP.h | 5 ++- 2 files changed, 77 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm

[Linaro-mm-sig] [PATCH 10/11] dma-buf: Use seqlock to close RCU race in test_signaled_single

2016-09-23 Thread Chris Wilson
On Fri, Sep 23, 2016 at 03:49:26PM +0200, Daniel Vetter wrote: > On Mon, Aug 29, 2016 at 08:08:33AM +0100, Chris Wilson wrote: > > With the seqlock now extended to cover the lookup of the fence and its > > testing, we can perform that testing solely under the seqlock guard an

[Intel-gfx] [PATCH 11/11] dma-buf: Do a fast lockless check for poll with timeout=0

2016-09-23 Thread Chris Wilson
On Fri, Sep 23, 2016 at 03:50:44PM +0200, Daniel Vetter wrote: > On Mon, Aug 29, 2016 at 08:08:34AM +0100, Chris Wilson wrote: > > Currently we install a callback for performing poll on a dma-buf, > > irrespective of the timeout. This involves taking a spinlock, as well as >

[Intel-gfx] [PATCH 11/11] dma-buf: Do a fast lockless check for poll with timeout=0

2016-09-23 Thread Chris Wilson
On Fri, Sep 23, 2016 at 03:50:44PM +0200, Daniel Vetter wrote: > On Mon, Aug 29, 2016 at 08:08:34AM +0100, Chris Wilson wrote: > > Currently we install a callback for performing poll on a dma-buf, > > irrespective of the timeout. This involves taking a spinlock, as well as >

[Intel-gfx] [PATCH 11/11] dma-buf: Do a fast lockless check for poll with timeout=0

2016-09-23 Thread Chris Wilson
On Fri, Sep 23, 2016 at 03:50:44PM +0200, Daniel Vetter wrote: > On Mon, Aug 29, 2016 at 08:08:34AM +0100, Chris Wilson wrote: > > Currently we install a callback for performing poll on a dma-buf, > > irrespective of the timeout. This involves taking a spinlock, as well as >

[PATCH] dma-buf/fence-array: get signaled state when signaling is disabled

2016-09-26 Thread Chris Wilson
rt part? Adding and propagating: diff --git a/include/linux/fence.h b/include/linux/fence.h index 0d763053f97a..ed5e88d2b664 100644 --- a/include/linux/fence.h +++ b/include/linux/fence.h @@ -56,6 +56,7 @@ struct fence_cb; * * FENCE_FLAG_SIGNALED_BIT - fence is already signaled * FENCE_FL

[PATCH 2/2] drm: Simplify drm_printk to reduce object size quite a bit

2016-09-26 Thread Chris Wilson
reducing the call size for DRM_DEBUG is a definite improvement. Reviewed-by: Chris Wilson > > Miscellanea: > > o Convert args... to ##__VA_ARGS__ > o The equivalent DRM_DEV_ macros are rarely used and not > worth conversion Today. I would rather see us to migrate to DRM_DE

[PATCH] drm: Convert prime dma-buf <-> handle to rbtree

2016-09-26 Thread Chris Wilson
rhashtable Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94631 Signed-off-by: Chris Wilson Cc: Sean Paul Cc: David Herrmann --- drivers/gpu/drm/drm_prime.c | 85 +++-- include/drm/drmP.h | 5 +-- 2 files changed, 77 insertions(+), 13

[PATCH] drm: Restore lost drm_framebuffer_unreference in drm_mode_page_flip_ioctl

2016-09-28 Thread Chris Wilson
Commit 43968d7b806d ("drm: Extract drm_plane.[hc]") was not the simple cut'n'paste we presumed, somehow it introduced a leak of the page flip target's framebuffer. Fixes: 43968d7b806d ("drm: Extract drm_plane.[hc]") Signed-off-by: Chris Wilson Cc: Daniel Vett

[PATCH] drm/prime: Passing the right owner through to dma_buf_export()

2016-09-30 Thread Chris Wilson
driver passes the struct module to the helper. Testcase: igt/vgem_reload_basic Reported-by: Petri Latvala Signed-off-by: Chris Wilson Cc: Petri Latvala Cc: stable at vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 3 ++- drivers/gpu/drm/arc/arcpgu_drv.c| 4

[PATCH v2 1/2] drm/prime: Passing the right owner through to dma_buf_export()

2016-09-30 Thread Chris Wilson
driver passes the struct module to the helper. v2: Use C99 initializers to zero out unset elements of dma_buf_export_info Testcase: igt/vgem_reload_basic Reported-by: Petri Latvala Signed-off-by: Chris Wilson Cc: Petri Latvala Cc: stable at vger.kernel.org --- drivers/gpu/drm/amd/amdgpu

[PATCH v2 2/2] drm/prime: Take a ref on the drm_dev when exporting a dma_buf

2016-09-30 Thread Chris Wilson
: Daniel Vetter Signed-off-by: Chris Wilson Cc: Petri Latvala Cc: Daniel Vetter Cc: stable at vger.kernel.org --- drivers/gpu/drm/armada/armada_gem.c| 9 +++-- drivers/gpu/drm/drm_prime.c| 10 +- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 1 + drivers/gpu/drm/tegra/gem.c

[Intel-gfx] [PATCH] drm/i915: Fix build when !CONFIG_DEBUG_FS

2016-09-30 Thread Chris Wilson
c_source(struct drm_crtc *crtc, const char *source_name, > size_t *values_cnt); > +#else > +static inline int intel_crtc_set_crc_source(struct drm_crtc *crtc, > + const char *source_name, > +

[Intel-gfx] [PATCH v2] drm/i915: Fix build when !CONFIG_DEBUG_FS

2016-09-30 Thread Chris Wilson
0253d97a ("drm/i915: Use new CRC debugfs API") Reveiwed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v3 1/3] drm/prime: Pass the right module owner through to dma_buf_export()

2016-09-30 Thread Chris Wilson
device->fops instead. v2: Use C99 initializers to zero out unset elements of dma_buf_export_info v3: Extract the right module from dev->fops. Testcase: igt/vgem_basic/unload Reported-by: Petri Latvala Signed-off-by: Chris Wilson Cc: Petri Latvala Cc: Christian König Cc: sta

[PATCH v3 3/3] drm/vgem: Keep a reference to the dmabuf when mmaped

2016-09-30 Thread Chris Wilson
...); close(dmabuf); persists across module-unload as well as device closure. Testcase: igt/vgem_basic/unload Signed-off-by: Chris Wilson Cc: Petri Latvala --- drivers/gpu/drm/vgem/vgem_drv.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v3 2/3] drm/prime: Take a ref on the drm_dev when exporting a dma_buf

2016-09-30 Thread Chris Wilson
/vgem_basic/unload Suggested-by: Daniel Vetter Signed-off-by: Chris Wilson Cc: Petri Latvala Cc: Daniel Vetter Cc: stable at vger.kernel.org Tested-by: Petri Latvala --- drivers/gpu/drm/armada/armada_gem.c| 9 +++-- drivers/gpu/drm/drm_prime.c| 10 +- drivers/gpu/drm

NULL pointer dereference in i915_gem_request_alloc()

2017-01-02 Thread Chris Wilson
c() states that ctx shall be > NULL and that an appropriate context will be chosen automatically. This > is not what is currently implemented. Comment is wrong. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 1/2] dma-fence: Clear fence->status during dma_fence_init()

2017-01-03 Thread Chris Wilson
off-by: Chris Wilson --- drivers/dma-buf/dma-fence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 3444f293ad4a..9130f790ebf3 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -534,6 +53

[PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang

2017-01-03 Thread Chris Wilson
-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 204c4a673bf3..bc99c0e292d8 100644 --- a/drivers/gpu/drm

[Intel-gfx] [PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang

2017-01-03 Thread Chris Wilson
On Tue, Jan 03, 2017 at 11:34:45AM +, Tvrtko Ursulin wrote: > > On 03/01/2017 11:05, Chris Wilson wrote: > >The struct dma_fence carries a status field exposed to userspace by > >sync_file. This is inspected after the fence is signaled and can convey > >whether or n

[Intel-gfx] [PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang

2017-01-03 Thread Chris Wilson
On Tue, Jan 03, 2017 at 11:57:44AM +, Tvrtko Ursulin wrote: > > On 03/01/2017 11:46, Chris Wilson wrote: > >On Tue, Jan 03, 2017 at 11:34:45AM +, Tvrtko Ursulin wrote: > >> > >>On 03/01/2017 11:05, Chris Wilson wrote: > >>>The struct dma_fence c

[Intel-gfx] [PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang

2017-01-03 Thread Chris Wilson
On Tue, Jan 03, 2017 at 12:34:16PM +, Tvrtko Ursulin wrote: > > On 03/01/2017 12:13, Chris Wilson wrote: > >On Tue, Jan 03, 2017 at 11:57:44AM +, Tvrtko Ursulin wrote: > >> > >>On 03/01/2017 11:46, Chris Wilson wrote: > >>>On Tue, Jan 03, 2017

[Intel-gfx] [PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang

2017-01-03 Thread Chris Wilson
On Tue, Jan 03, 2017 at 01:17:19PM +, Tvrtko Ursulin wrote: > > On 03/01/2017 12:38, Chris Wilson wrote: > >On Tue, Jan 03, 2017 at 12:34:16PM +, Tvrtko Ursulin wrote: > >> > >>On 03/01/2017 12:13, Chris Wilson wrote: > >>>On Tue, Jan 03, 2017

[Intel-gfx] [PATCH 1/2] dma-fence: Clear fence->status during dma_fence_init()

2017-01-04 Thread Chris Wilson
On Wed, Jan 04, 2017 at 10:15:01AM +0100, Daniel Vetter wrote: > On Tue, Jan 03, 2017 at 02:04:44PM +, Tvrtko Ursulin wrote: > > > > On 03/01/2017 11:05, Chris Wilson wrote: > > > As the fence->status is an optional field that may be set before > > > dm

[PATCH 1/2] drm: Document drm_cache interface

2017-01-04 Thread Chris Wilson
tml docs > ;-) How close are we to having the spine of the kernelbook described in Documentation/ and the indiviual chapter.rst next to the source in drivers/gpu/drm/ etc? Something like: Documentation/gpu/drm.rst: include drivers/gpu/drm/*.rst ? -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 1/2] dma-fence: Clear fence->status during dma_fence_init()

2017-01-04 Thread Chris Wilson
On Wed, Jan 04, 2017 at 10:37:32AM +0100, Daniel Vetter wrote: > On Wed, Jan 04, 2017 at 09:24:27AM +0000, Chris Wilson wrote: > > On Wed, Jan 04, 2017 at 10:15:01AM +0100, Daniel Vetter wrote: > > > On Tue, Jan 03, 2017 at 02:04:44PM +, Tvrtko Ursulin wrote: > > >

[Intel-gfx] [PATCH 1/2] dma-fence: Clear fence->status during dma_fence_init()

2017-01-04 Thread Chris Wilson
On Wed, Jan 04, 2017 at 11:18:58AM +0100, Daniel Vetter wrote: > On Wed, Jan 04, 2017 at 09:43:51AM +0000, Chris Wilson wrote: > > On Wed, Jan 04, 2017 at 10:37:32AM +0100, Daniel Vetter wrote: > > > On Wed, Jan 04, 2017 at 09:24:27AM +, Chris Wilson wrote: > > > &

[PATCH] drm/atomic: Fix outdated comment.

2017-01-04 Thread Chris Wilson
a bit more. > > Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state") > Cc: # v4.10-rc1+ > Cc: Chris Wilson > Signed-off-by: Maarten Lankhorst > --- > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > index

[PATCH 1/3] dma-fence: Clear fence->status during dma_fence_init()

2017-01-04 Thread Chris Wilson
off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- drivers/dma-buf/dma-fence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 3444f293ad4a..9130f790ebf3 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fenc

[PATCH 2/3] dma-fence: Wrap querying the fence->status

2017-01-04 Thread Chris Wilson
et_status(). Signed-off-by: Chris Wilson --- drivers/dma-buf/dma-fence.c | 25 + drivers/dma-buf/sync_debug.c | 17 - drivers/dma-buf/sync_file.c | 6 ++ include/linux/dma-fence.h| 24 4 files changed, 59 insertions(+), 13

[PATCH 3/3] dma-fence: Introduce drm_fence_set_error() helper

2017-01-04 Thread Chris Wilson
adjust the error field. Signed-off-by: Chris Wilson --- drivers/dma-buf/dma-fence.c | 2 +- include/linux/dma-fence.h | 30 +- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index

[PATCH 1/3] dma-fence: Clear fence->status during dma_fence_init()

2017-01-06 Thread Chris Wilson
On Wed, Jan 04, 2017 at 09:23:34PM +0530, Sumit Semwal wrote: > Hi Chris, > > Thanks for your patches! > > On 4 January 2017 at 20:40, Daniel Vetter wrote: > > On Wed, Jan 04, 2017 at 02:12:20PM +, Chris Wilson wrote: > >> As the fence->status is an opti

[Intel-gfx] [PATCH 06/10] drm/i915/psr: set CHICKEN_TRANS for psr2

2017-01-07 Thread Chris Wilson
eaningful? More meaningful than chicken |= BIT(15); ? > + I915_WRITE(CHICKEN_TRANS(TRANS_EDP), chicken_trans); > } else { > /* set up vsc header for psr1 */ > hsw_psr_setup_vsc(intel_dp); > -- > 1.9.

[PATCH 3/3] dma-fence: Introduce drm_fence_set_error() helper

2017-01-09 Thread Chris Wilson
On Mon, Jan 09, 2017 at 08:13:11PM +0530, Sumit Semwal wrote: > Hi Chris, > > On 4 January 2017 at 19:42, Chris Wilson wrote: > > The dma_fence.error field (formerly known as dma_fence.status) is an > > optional field that may be set by drivers before calling > > dm

DRM range manger test failures

2017-01-10 Thread Chris Wilson
to demonstrate the bugs, the actual fix is still queued. -Chris -- Chris Wilson, Intel Open Source Technology Centre

DRM range manger test failures

2017-01-10 Thread Chris Wilson
On Tue, Jan 10, 2017 at 02:51:17PM +0100, Daniel Vetter wrote: > On Tue, Jan 10, 2017 at 12:45:04PM +0000, Chris Wilson wrote: > > On Tue, Jan 10, 2017 at 01:41:54PM +0100, Geert Uytterhoeven wrote: > > > Hi Chris, Laurent, > > > > > > On R-Car Gen2 (Koelsch

[bug report] drm: kselftest for drm_mm and eviction

2017-01-10 Thread Chris Wilson
On Tue, Jan 10, 2017 at 05:17:46PM +0300, Dan Carpenter wrote: > Hello Chris Wilson, > > The patch 560b32842912: "drm: kselftest for drm_mm and eviction" from > Dec 22, 2016, leads to the following static checker warning: > > drivers/gpu/drm/selftests/test-dr

[PATCH] drm: Fix error handling in drm_mm eviction kselftest

2017-01-10 Thread Chris Wilson
iterate over the full list, but we only want to report the error once and once we have an error we can return early. Reported-by: Dan Carpenter Fixes: 560b32842912 ("drm: kselftest for drm_mm and eviction") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Daniel Vetter --- drive

[Intel-gfx] [PATCH] drm/probe-helpers: Drop locking from poll_enable

2017-01-10 Thread Chris Wilson
+ if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) goto out; if (!mutex_trylock(&dev->mode_config.mutex)) { The connector list is locked, but the other reads are all racy (connector->polled, delayed_event). Those races seem intrinsic and handled by e.g. intel_hotplug.c. Since the locking here was only covering the connector list and that now has its own lock, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH] drm/probe-helpers: Drop locking from poll_enable

2017-01-10 Thread Chris Wilson
On Tue, Jan 10, 2017 at 05:34:08PM +0100, Daniel Vetter wrote: > On Tue, Jan 10, 2017 at 03:17:44PM +0000, Chris Wilson wrote: > > On Tue, Jan 10, 2017 at 03:29:10PM +0100, Daniel Vetter wrote: > > > -void drm_kms_helper_poll_enable_locked(struct drm_device

Re: [PATCH] intel: update global_name before HASH_ADD

2017-01-15 Thread Chris Wilson
On Fri, Jan 13, 2017 at 04:07:00PM -0800, Dongwon Kim wrote: > bo->global_name should be updated first before a hash value > for the entry is calculated with it by HASH_ADD macro. > > Signed-off-by: Dongwon Kim Thanks for the fix! Pushed, -Chris -- Chris Wilson, Intel Open So

<    5   6   7   8   9   10   11   12   13   14   >