Re: [PATCH] drm: add drm_get_connector_force_name

2017-02-17 Thread Chris Wilson
@@ int drm_debugfs_cleanup(struct drm_minor *minor) > static int connector_show(struct seq_file *m, void *data) > { > - seq_puts(m, status); > + seq_puts(m, drm_get_connector_force_name(connector->force)); Loses the trailing '\n'. It's not required, but it loo

[PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any

2017-02-17 Thread Chris Wilson
Indicate that the fence array will be signaled on the first completion (signal-on-any mode) as opposed to waiting for all to be signaled. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Daniel Vetter Cc: "Christian König" --- drivers/dma-buf/dma-fence-a

[PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array

2017-02-17 Thread Chris Wilson
the first in *that* set. Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_gem_request.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index

Re: [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array

2017-02-20 Thread Chris Wilson
On Mon, Feb 20, 2017 at 01:32:42PM +0200, Joonas Lahtinen wrote: > On pe, 2017-02-17 at 18:35 +0000, Chris Wilson wrote: > > The code currently assumes that all fence arrays it sees are the normal > > signal-on-all variety, and decomposes the array into its individual > >

[PATCH] dma-buf/reservation: Wrap ww_mutex_trylock

2017-02-21 Thread Chris Wilson
In a similar fashion to reservation_object_lock() and reservation_object_unlock(), ww_mutex_trylock is also useful and so is worth wrapping for consistency. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Joonas Lahtinen Cc: Daniel Vetter --- include/linux/reservation.h | 20

Re: [PATCH] drm: kselftest: fix spelling mistake: "misalinged" -> "misaligned"

2017-02-22 Thread Chris Wilson
On Thu, Feb 23, 2017 at 12:07:17AM +, Colin King wrote: > From: Colin Ian King > > trivial fix to spelling mistake in pr_err message > > Signed-off-by: Colin Ian King Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Te

[PATCH] drm: Wrap direct calls to driver->gem_free_object from CMA

2016-05-31 Thread Chris Wilson
upport BO freeing without dev->struct_mutex). Reported-by: Robert Foss Fixes: 9f0ba539d13ae (drm/gem: support BO freeing without dev->struct_mutex) Signed-off-by: Chris Wilson Cc: Robert Foss Cc: Daniel Vetter Cc: Eric Anholt Cc: Alex Deucher Cc: Lucas Stach Cc: stable at vge

[PATCH] drm: Restore double clflush on the last partial cacheline

2016-05-01 Thread Chris Wilson
This effectively reverts commit afcd950cafea6e27b739fe7772cbbeed37d05b8b Author: Chris Wilson Date: Wed Jun 10 15:58:01 2015 +0100 drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range() as we have observed issues with serialisation of the clflush operations on

[PATCH v8 11/12] drm/i915: Add more Haswell OA metric sets

2016-11-01 Thread Chris Wilson
nter_regs_len = > + ARRAY_SIZE(b_counter_config_compute_basic); > + > + return 0; > int > i915_perf_register_sysfs_hsw(struct drm_i915_private *dev_priv) > { > @@ -178,9 +685,49 @@ i915_perf_register_sysfs_hsw(struct drm_i915_private > *dev_priv) > if (ret) > goto error_render_basic; > } > + if (get_compute_basic_mux_config(dev_priv, &mux_len)) { Why not use the derived state in dev_priv->perf.oa.mux_regs? Then we only expose what is initialised. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 1/2] drm/i915: Remove redundant reprobe in i915_drm_resume

2016-11-03 Thread Chris Wilson
also depends upon us actually reseting the connector->status to unknown in drm_mode_config_reset(), Daniel! -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 1/2] drm/i915: Remove redundant reprobe in i915_drm_resume

2016-11-03 Thread Chris Wilson
On Thu, Nov 03, 2016 at 12:11:55PM -0400, Lyude Paul wrote: > On Thu, 2016-11-03 at 12:11 -0400, Lyude Paul wrote: > > On Thu, 2016-11-03 at 16:02 +0000, Chris Wilson wrote: > > > > > > On Thu, Nov 03, 2016 at 11:42:37AM -0400, Lyude wrote: > > > > &g

[PATCH] dma-buf/fence-array: enable_signaling from wq

2016-11-03 Thread Chris Wilson
(fence); int num_pending = atomic_read(&array->num_pending); int i; for (i = 0; i < array->num_fences; i++) if (is_signaled(array->fences[i]) && !--num_pending) { atomic_set(&array->num_pending, 0); return false; } dma_fence_get(&array->base); queue_work(system_unbound_wq, &array->enable_signaling_worker); } -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] dma-buf/fence-array: enable_signaling from wq

2016-11-03 Thread Chris Wilson
On Thu, Nov 03, 2016 at 07:34:02PM -0400, Rob Clark wrote: > On Thu, Nov 3, 2016 at 5:41 PM, Chris Wilson > wrote: > > static bool dma_fence_array_enable_signaling(struct dma_fence *fence) > > { > > struct dma_fence_array *array = to_dma_fence_array(fence); >

redraw issues on i915 since 4.9-rc

2016-11-04 Thread Chris Wilson
m-intel/ #drm-intel-nightly contains one interesting patch wrt to the partial vma->pages https://cgit.freedesktop.org/drm-intel/commit/?h=drm-intel-next-queued&id=d2a84a76a3b970fa32e6eda3d85e7782f831379e Do you mind testing -nightly to see if I'm barking up the wrong tree? -Chris -- Chr

redraw issues on i915 since 4.9-rc

2016-11-04 Thread Chris Wilson
/drm-intel/commit/?h=drm-intel-next-queued&id=d2a84a76a3b970fa32e6eda3d85e7782f831379e > > Do you want me to test this patch only on top of master? (If it applies!!!) It won't apply directly, but you could try testing that commit and its parent to see if my hunch was correct. Thanks

redraw issues on i915 since 4.9-rc

2016-11-05 Thread Chris Wilson
osed to the highest version). Since my guess was wrong, any clues you can find to point me in the direction will be very useful. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v7 0/3] drm: add explict fencing

2016-11-08 Thread Chris Wilson
about these operations, they are not included in the explicit fence they provide, at which point we can't trust their fence to the exclusion of the implicit fences... -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v7 0/3] drm: add explict fencing

2016-11-08 Thread Chris Wilson
On Tue, Nov 08, 2016 at 12:32:56PM +0100, Daniel Vetter wrote: > On Tue, Nov 08, 2016 at 10:35:08AM +0000, Chris Wilson wrote: > > On Tue, Nov 08, 2016 at 03:54:47PM +0900, Gustavo Padovan wrote: > > > From: Gustavo Padovan > > > > > > Hi, > > >

[PATCH] drm: Add stackdepot include for DRM_DEBUG_MM

2016-11-08 Thread Chris Wilson
0day found that stackdepot.h doesn't get automatically included on all architectures, so remember to add our #include. Reported-by: kbuild test robot Fixes: 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown") Signed-off-by: Chris Wilson Cc: Daniel Vetter -

[PATCH v7 0/3] drm: add explict fencing

2016-11-08 Thread Chris Wilson
On Tue, Nov 08, 2016 at 01:43:40PM +0100, Daniel Vetter wrote: > On Tue, Nov 08, 2016 at 11:45:51AM +0000, Chris Wilson wrote: > > On Tue, Nov 08, 2016 at 12:32:56PM +0100, Daniel Vetter wrote: > > > On Tue, Nov 08, 2016 at 10:35:08AM +, Chris Wilson wrote: > > > &

[PATCH] drm: Add stackdepot include for DRM_DEBUG_MM

2016-11-08 Thread Chris Wilson
On Tue, Nov 08, 2016 at 01:46:15PM +0100, Daniel Vetter wrote: > On Tue, Nov 08, 2016 at 11:56:01AM +0000, Chris Wilson wrote: > > 0day found that stackdepot.h doesn't get automatically included on all > > architectures, so remember to add our #include. > > > >

[PATCH 1/2] drm/i915: Restrict DRM_DEBUG_MM automatic selection

2016-11-08 Thread Chris Wilson
DRM_DEBUG_MM is only valid if the DRM.ko is builtin as currently depot_save_stack is not exported. Fixes: 5c7fcf2db027 ("drm/i915: Enable drm_mm debug when enabling DRM_I915_DEBUG") Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/Kconfig.debug | 2 +- 1 file changed, 1 inser

[PATCH 2/2] drm: Restrict stackdepot usage to builtin drm.ko

2016-11-08 Thread Chris Wilson
Fixes: 5705670d0463 ("drm: Track drm_mm allocators and show leaks on shutdown") Signed-off-by: Chris Wilson --- drivers/gpu/drm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 25e8e3793d29..d6ee0592b

[PATCH] drm/i915: avoid harmless empty-body warning

2016-11-08 Thread Chris Wilson
f9 ("drm/i915: Queue the idling context switch after all > other timelines") > Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[drm-intel:topic/drm-misc 1/2] backtracetest.c:undefined reference to `save_stack_trace'

2016-11-09 Thread Chris Wilson
.c:(.text+0x16be82): undefined reference to `save_stack_trace' Anyone got an idea for this one? m68k is missing save_stack_trace(). There's no arch CONFIG_HAS_SAVE_STACK_TRACE, it looks like an oversight in arch/m68k. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] drm: Make DRM_DEBUG_MM depend on STACKTRACE_SUPPORT

2016-11-09 Thread Chris Wilson
0day continues to complain about trying to save a stacktrace for the users of the drm_mm range allocator. This time, it is that m68k has no save_stack_trace(), which is apparently guarded by STACKTRACE_SUPPORT. Make it depend so! Reported-by: kbuild test robot Signed-off-by: Chris Wilson Cc

4.9-rc1 lockdep warning suggesting a deadlock between nouveau and i915 with prime video outputs active

2016-11-09 Thread Chris Wilson
P.h +++ b/include/drm/drmP.h @@ -808,6 +808,7 @@ struct drm_device { /** \name Locks */ /*@{ */ + struct lock_class_key struct_mutex_class; struct mutex struct_mutex; /**< For others */ struct mutex master_mutex; /**< For drm_minor::master and

[PATCH v2] drm: Add missing mutex_destroy in drm_dev_init/release

2016-11-10 Thread Chris Wilson
On Thu, Nov 10, 2016 at 03:50:35PM +0200, Joonas Lahtinen wrote: > Add 3 missing mutex_destroy to drm_dev_init teardown and > drm_dev_release. > > v2: > - Also include drm_dev_release > > Signed-off-by: Joonas Lahtinen Reviewed-by: Chris Wilson -Chris -- Chris Wils

[PATCH 2/2] drm/i915: Update i915_driver_load kerneldoc

2016-11-11 Thread Chris Wilson
On Thu, Nov 10, 2016 at 03:36:34PM +0200, Joonas Lahtinen wrote: > Update i915_driver_load kerneldoc to match code. > > Cc: Chris Wilson > Signed-off-by: Joonas Lahtinen Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] dma-buf: Replace reservation shared fence array with a compressed radix tree

2016-11-14 Thread Chris Wilson
ocation. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: Daniel Vetter Cc: Jani Nikula Cc: Rob Clark Cc: Ben Skeggs Cc: Chunming Zhou Cc: Ken Wang Cc: Monk Liu Cc

[PATCH] dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence

2016-11-14 Thread Chris Wilson
ing it back to the caller. (Note the fix only requires using dma_fence_get_rcu() and correct handling, but we may as well use the helper rather than inline equivalent code.) Signed-off-by: Chris Wilson Cc: Sumit Semwal seq); + + if (!rcu_access_pointer(obj->fence_excl)) + re

[PATCH] dma-buf: Use fence_get_rcu_safe() for retrieving the exclusive fence

2016-11-14 Thread Chris Wilson
On Mon, Nov 14, 2016 at 11:55:40AM +, Chris Wilson wrote: > The current code is subject to a race where we may try to acquire a > reference on a stale fence: >From i915.ko pov, this Fixes: d07f0e59b2c7 ("drm/i915: Move GEM activity tracking into a common struct reservation_o

[PATCH v11 2/3] drm/fence: add fence timeline to drm_crtc

2016-11-15 Thread Chris Wilson
ops when initializing fences. > + */ > +extern const struct dma_fence_ops drm_crtc_fence_ops; > + > +static inline struct drm_crtc *fence_to_crtc(struct dma_fence *fence) > +{ > + BUG_ON(fence->ops != &drm_crtc_fence_ops); > + return container_of(fence->lock, struct drm_crtc, fence_lock); > +} If you are planning to export this for use by drivers, you are missing the EXPORT_SYMBOL(drm_crtc_fence_ops). -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH v11 2/3] drm/fence: add fence timeline to drm_crtc

2016-11-15 Thread Chris Wilson
On Tue, Nov 15, 2016 at 08:25:55AM +, Chris Wilson wrote: > On Tue, Nov 15, 2016 at 10:57:35AM +0900, Gustavo Padovan wrote: > > /** > > + * dma_crtc_fence_ops - fence ops for the drm_crtc timeline > > + * > > + * It contains the dma_fence_ops that should

[PATCH v11 2/3] drm/fence: add fence timeline to drm_crtc

2016-11-15 Thread Chris Wilson
On Tue, Nov 15, 2016 at 05:42:35PM +0900, Gustavo Padovan wrote: > 2016-11-15 Chris Wilson : > > > On Tue, Nov 15, 2016 at 10:57:35AM +0900, Gustavo Padovan wrote: > > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > > > index 11780a9..0870de1

[Intel-gfx] [PATCH 04/10] drm: Extract drm_drv.h

2016-11-15 Thread Chris Wilson
; - > /* Debugfs support */ > #if defined(CONFIG_DEBUG_FS) > extern int drm_debugfs_create_files(const struct drm_info_list *files, > @@ -1064,18 +779,6 @@ extern void drm_pci_free(struct drm_device *dev, struct > drm_dma_handle * dmah); > extern void drm_sysfs_hotplug_event(struct drm_device *dev); > > > -struct drm_device *drm_dev_alloc(struct drm_driver *driver, > - struct device *parent); > -int drm_dev_init(struct drm_device *dev, > - struct drm_driver *driver, > - struct device *parent); > -void drm_dev_ref(struct drm_device *dev); > -void drm_dev_unref(struct drm_device *dev); > -int drm_dev_register(struct drm_device *dev, unsigned long flags); > -void drm_dev_unregister(struct drm_device *dev); > - > -struct drm_minor *drm_minor_acquire(unsigned int minor_id); > -void drm_minor_release(struct drm_minor *minor); > > /*@}*/ > > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h > new file mode 100644 > index ..98f930a76e6d > --- /dev/null > +++ b/include/drm/drm_drv.h > @@ -0,0 +1,337 @@ > +/* > + * Copyright 2016 Intel Corp. Careful, it's a mix of some new and lots old. To be on the safe side, it should retain all the copyright statements of the original. Otherwise, pretty sure it was mechanical, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 06/10] drm: Consolidate dumb buffer docs

2016-11-15 Thread Chris Wilson
On Mon, Nov 14, 2016 at 12:58:21PM +0100, Daniel Vetter wrote: > Put the callback docs into struct drm_driver, and the small overview > into a DOC comment. > > Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 08/10] drm: Extract drm_mode_config.[hc]

2016-11-15 Thread Chris Wilson
> + > /* drm_dumb_buffers.c */ > +int drm_modeset_register_all(struct drm_device *dev); > +void drm_modeset_unregister_all(struct drm_device *dev); > I was worried for a moment. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 10/10] drm: Drop externs from drm_crtc.h

2016-11-15 Thread Chris Wilson
On Mon, Nov 14, 2016 at 12:58:25PM +0100, Daniel Vetter wrote: > Just noise. > > Signed-off-by: Daniel Vetter Sometimes it is interesting. Practice across the kernel is mixed, but convergence on not putting extern. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Op

[Intel-gfx] [PATCH 05/10] drm: Clean up kerneldoc for struct drm_driver

2016-11-15 Thread Chris Wilson
On Mon, Nov 14, 2016 at 12:58:20PM +0100, Daniel Vetter wrote: > Just cleans up what's there, still plenty missing. > > Signed-off-by: Daniel Vetter I read it, seems to match my limited understanding of kerneldoc. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Sou

[Intel-gfx] [PATCH 07/10] drm/print: Move kerneldoc next to definition

2016-11-15 Thread Chris Wilson
t; > Fixes: d8187177b0b1 ("drm: add helper for printing to log or seq_file") > Cc: Rob Clark > Cc: Sean Paul > Signed-off-by: Daniel Vetter Oh well, I liked the practice of having interface descriptions in the headers. If they are in the body, I may as well just read the

[PATCH 09/10] drm: Move tile group code into drm_connector.c

2016-11-15 Thread Chris Wilson
up and entirely > documented. > > Signed-off-by: Daniel Vetter Code motion looks ok, placement inside the rst I'll take you at your word. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 01/10] drm: Extract drm_dumb_buffers.c

2016-11-15 Thread Chris Wilson
mode_create_dumb_ioctl(struct drm_device *dev, > +void *data, struct drm_file *file_priv); > +int drm_mode_mmap_dumb_ioctl(struct drm_device *dev, > + void *data, struct drm_file *file_priv); > +int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, > + void *data, struct drm_file *file_priv); > + > /* drm_color_mgmt.c */ > > /* IOCTLs */ > diff --git a/drivers/gpu/drm/drm_dumb_buffers.c > b/drivers/gpu/drm/drm_dumb_buffers.c > new file mode 100644 > index ..4b4364b61c8d > --- /dev/null > +++ b/drivers/gpu/drm/drm_dumb_buffers.c > @@ -0,0 +1,135 @@ > +/* > + * Copyright (c) 2016 Intel Corporation I've mentioned this elsewhere, but we should also retain the original copyright statements for the code we are copying. Otherwise, Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 02/10] drm/i915: Fixup kerneldoc includes

2016-11-15 Thread Chris Wilson
GNORE_DOCBOOKS=1 SPHINXOPTS=-W htmldocs" is that outdated? I don't often run it since it is too slow when checking hundreds of patches. Any chance of an incremental patch checker? > Fixes: b42fe9ca0a1e ("drm/i915: Split out i915_vma.c") > Cc: Tvrtko Ursulin > Cc: Chris Wi

[PATCH 03/10] doc/dma-buf: Fix up include directives

2016-11-15 Thread Chris Wilson
d1867005c ("dma-buf: Rename struct fence to dma_fence") > Cc: Chris Wilson > Cc: Gustavo Padovan > Cc: Sumit Semwal > Cc: Christian König > Signed-off-by: Daniel Vetter Weird, I caught some of the stale Documents/, obviously that didn't trigger a warning that I ne

[Intel-gfx] [PATCH 01/10] drm: Extract drm_dumb_buffers.c

2016-11-15 Thread Chris Wilson
On Tue, Nov 15, 2016 at 12:47:31PM +0100, Daniel Vetter wrote: > On Tue, Nov 15, 2016 at 10:42:08AM +0000, Chris Wilson wrote: > > On Mon, Nov 14, 2016 at 12:58:16PM +0100, Daniel Vetter wrote: > > > diff --git a/drivers/gpu/drm/drm_dumb_buffers.c > > > b/drivers

[PATCH] dma-buf: Provide wrappers for reservation's lock

2016-11-15 Thread Chris Wilson
Joonas complained that writing ww_mutex_lock(&resv->lock, ctx) was too intrusive compared to reservation_object_lock(resv, ctx); Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Joonas Lahtinen --- include/linux/reservation.h | 34 ++ 1 file chan

[PATCH v12 3/3] drm/fence: add out-fences support

2016-11-16 Thread Chris Wilson
- } > - } > - > - e->base.fence = fence; > - > return e; > } > > @@ -1793,6 +1809,165 @@ void drm_atomic_clean_old_fb(struct drm_device *dev, > } > EXPORT_SYMBOL(drm_atomic_clean_old_fb); > > +static struct dma_fence *get_crtc_fence(struct drm

[PATCH v2 1/4] drm: Define drm_mm_for_each_node_in_range()

2016-11-17 Thread Chris Wilson
Some clients would like to iterate over every node within a certain range. Make a nice little macro for them to hide the mixing of the rbtree search and linear walk. Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org --- drivers/gpu/drm/drm_mm.c | 11

[PATCH] drm: Define drm_mm_for_each_node_in_range()

2016-11-17 Thread Chris Wilson
Some clients would like to iterate over every node within a certain range. Make a nice little macro for them to hide the mixing of the rbtree search and linear walk. v2: Blurb Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org --- drivers/gpu/drm/drm_mm.c

[Intel-gfx] [PATCH 3/3] drm/dp/mst: Track available time slots in DP Multi-Stream Transport Packet

2016-11-18 Thread Chris Wilson
il_slots) { > + ret = -ENOSPC; > + goto out; > + } You are not atomically reducing the mgr->avail_slots, leading to possible overallocation of multiple streams? -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH] drm/vgem: Allow root to inject hanging fences onto dmabufs

2016-11-18 Thread Chris Wilson
On Wed, Jul 20, 2016 at 08:39:43PM +0100, Chris Wilson wrote: > When performing driver testing, one factor we want to test is how we > handle a foreign fence that is never signaled. We can wait on that fence > indefinitely, in which case the driver appears hung, or we can take some &

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

2016-11-18 Thread Chris Wilson
r now we will revert the change and enable signaling everytime time > poll is called with timeout=0 as well. > > Cc: Chris Wilson > Signed-off-by: Gustavo Padovan Acked-by: Chris Wilson I have some patches to use a bit on fence_array->flags to indicate where we can use this shortcu

[Intel-gfx] [PATCH] drm/vgem: Allow root to inject hanging fences onto dmabufs

2016-11-18 Thread Chris Wilson
On Fri, Nov 18, 2016 at 10:40:02AM +0100, Daniel Vetter wrote: > On Fri, Nov 18, 2016 at 08:49:37AM +0000, Chris Wilson wrote: > > On Wed, Jul 20, 2016 at 08:39:43PM +0100, Chris Wilson wrote: > > > When performing driver testing, one factor we want to test is how we > >

[Intel-gfx] v4.9-rc3: graphical artefacts in X

2016-11-18 Thread Chris Wilson
ks it, > depending in how fast I switch. (Yes, strange). The fix should have landed in v4.9-rc5 -Chris -- Chris Wilson, Intel Open Source Technology Centre

[PATCH 2/5] drm: Set DRM connector link status property

2016-11-19 Thread Chris Wilson
l code. For example it might be worth explaining why link_status is duplicated on the connector and in its property (i.e. that is near impossible to retrieve the value from the property). > + connector->link_status = link_status; > + drm_object_property_set_value(&connector->base, > + dev->mode_config.link_status_property, > + link_status); > +} > +EXPORT_SYMBOL(drm_mode_connector_set_link_status_property); -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed

2016-11-21 Thread Chris Wilson
t; > > > > Definitely need to document this properly in the property docs, no > > > > matter > > > > what we decide. > > > > > > Hmm. I think I kinda like this idea of userspace clear the state back > > > to good explicitly, if it happens with the same prop. So it's like > > > Maarten's retrain_link prop idea, but without having to add the second > > > prop to the mix. > > > > > > It would also save me from pointing out (for the nth time) that the > > > link status should really be cleared to good during the commit state > > > swap and not at some random point during the commit ;) > > > > > > > Okay, so change 1 is to make the userspace clear the state back to Good for > > the property.. > > Then Change 2 is to set connector_changed flag in crtc_state to true if > > this property changed > > from BAD to GOOD. I am not quite how and where to change this to state > > connector_changed to true. > > Without this the full modeset will not happen and the whole design of > > retrianing is lost. > > To make this work we need a few more bits: > > - link-status needs to become a full-blown atomic property. This means we > need to move link_status into drm_connector_state, mark the property as > type ATOMIC and wire up the get/set stuff. > > - once that's done it's also pretty easy to set crtc->connectors_changed > from the atomic helpers. You can just compare old and new link_status in > drm_connector_state, similar to how we compare old/new CRTC in > drm_connector_state->crtc already. > > - Another fallout is that legacy clients will no longer see the > link-status property. And they won't be able to set it through the > SETCRTC ioctl, which would kinda defaut the point. I think the best > solution would be to check for link_status == BAD in > drm_atomic_helper_set_config, and reset it to good automatically for > legacy clients. Then how do they know that the kernel demands the modeset? Both a legacy and atomic property? -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 3/5] drm/i915: Update CRTC state if connector link status property changed

2016-11-21 Thread Chris Wilson
On Mon, Nov 21, 2016 at 11:00:52AM -0800, Manasi Navare wrote: > On Mon, Nov 21, 2016 at 04:48:07PM +0100, Daniel Vetter wrote: > > On Mon, Nov 21, 2016 at 11:10:45AM +0100, Daniel Vetter wrote: > > > On Mon, Nov 21, 2016 at 09:42:57AM +, Chris Wilson wrote: > > > &

[Intel-gfx] [PATCH 07/12] lib/igt_kms: Add support for the OUT_FENCE_PTR property

2016-11-22 Thread Chris Wilson
gt; >@@ -110,6 +110,7 @@ enum igt_atomic_crtc_properties { > > IGT_CRTC_GAMMA_LUT, > > IGT_CRTC_MODE_ID, > > IGT_CRTC_ACTIVE, > >+ IGT_CRTC_OUT_FENCE_PTR, > > IGT_NUM_CRTC_PROPS > >}; > > > >@@ -298,6 +299,7 @@ struct igt_pipe { > > > > uint64_t mode_blob; > > bool mode_changed; > >+uint64_t out_fence_ptr; > > IMO this should be: > > int64_t *out_fence_ptr; In userspace, fences are *fd*, a plain int. It is only the uabi that we pass pointers as u64 to the kernel, and indeed that should be limited to the uabi wrapper. -Chris -- Chris Wilson, Intel Open Source Technology Centre

[Intel-gfx] [PATCH 07/12] lib/igt_kms: Add support for the OUT_FENCE_PTR property

2016-11-22 Thread Chris Wilson
On Tue, Nov 22, 2016 at 11:54:57AM +, Brian Starkey wrote: > On Tue, Nov 22, 2016 at 11:06:00AM +0000, Chris Wilson wrote: > >On Tue, Nov 22, 2016 at 10:53:51AM +, Brian Starkey wrote: > >>Hi Gustavo, > >> > >>A little late to the party her

[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-23 Thread Chris Wilson
-by: Chris Wilson --- drivers/gpu/drm/drm_fb_helper.c | 73 ++--- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 14547817566d..d13c85682891 100644 --- a/drivers/gpu/

[PATCH 2/3] drm: Pull together probe + setup for drm_fb_helper

2016-11-23 Thread Chris Wilson
drm_fb_helper_probe_connector_modes() is always called before drm_setup_crtcs(), so just move the call into drm_setup_crtcs for a small bit of code compaction. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_fb_helper.c | 37 +++-- 1 file changed, 11

[PATCH 3/3] drm: Protect fb_helper list manipulation with a mutex

2016-11-23 Thread Chris Wilson
Though we only walk the kernel_fb_helper_list inside a panic (or single thread debugging), we still need to protect the list manipulation on creating/removing a framebuffer device in order to prevent list corruption. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_fb_helper.c | 5 + 1

[PATCH 1/5] drm: Define drm_mm_for_each_node_in_range()

2016-11-23 Thread Chris Wilson
Some clients would like to iterate over every node within a certain range. Make a nice little macro for them to hide the mixing of the rbtree search and linear walk. v2: Blurb Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org Reviewed-by: Joonas Lahtinen

[PATCH 2/5] drm: Check against color expansion in drm_mm_reserve_node()

2016-11-23 Thread Chris Wilson
Use the color_adjust callback when reserving a node to check if inserting a node into this hole requires any additional space, and so if that space then conflicts with an existing allocation. Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: dri-devel at lists.freedesktop.org Reviewed-by

[PATCH] drm: Fixup kernel doc for driver->gem_create_object

2016-11-25 Thread Chris Wilson
Silences ./include/drm/drm_drv.h:295: warning: Incorrect use of kernel-doc format Signed-off-by: Chris Wilson --- include/drm/drm_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index aad8bbacd1f0..52bf44e2b5cc 100644 --- a/include/drm

[PATCH 1/3] drm/i915: Use helper for setting plane->state->fb

2016-11-25 Thread Chris Wilson
We are told not to set plane_state->fb directly, but use drm_atomic_set_fb_for_plane() instead. Using the helper, means one less piece of code that needs fixing should the interface change... Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_display.c | 6 +- 1 file changed

[PATCH 3/3] drm: Track framebuffer references at the point of assignment

2016-11-25 Thread Chris Wilson
it to the reference handling to prevent invalid use. Signed-off-by: Chris Wilson --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c| 9 + drivers/gpu/drm/bochs/bochs_kms.c | 2 +- drivers/gpu/drm/drm_atomic.c| 44

[PATCH 2/3] drm: Introduce drm_framebuffer_assign()

2016-11-25 Thread Chris Wilson
In a couple of places currently, and with the intent to add more, we update a pointer to a framebuffer to hold a new fb reference (evicting the old). Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_atomic.c | 8 ++-- include/drm/drm_framebuffer.h | 18 ++ 2 files

[PATCH] drm: Fix conflicting macro parameter in drm_mm_for_each_node_in_range()

2016-11-27 Thread Chris Wilson
ed start! Fixes: 522e85dd8677 ("drm: Define drm_mm_for_each_node_in_range()") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen --- include/drm/drm_mm.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 6add455c651b.

[PATCH 1/2] drm: Add some kselftests for the DRM range manager (struct drm_mm)

2016-11-27 Thread Chris Wilson
A set of test cases to capture some annoying bugs and to ensure that correct behaviour does not regress whilst fixing those! Signed-off-by: Chris Wilson --- drivers/gpu/drm/Kconfig | 13 + drivers/gpu/drm/Makefile | 2 + drivers/gpu/drm/test-drm_mm.c | 829

[PATCH 2/2] drm/i915: Build DRM range manager selftests for CI

2016-11-27 Thread Chris Wilson
Build the struct drm_mm selftests so that we can trivially run them within our CI. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug index f0e769290e0b

[PATCH 1/3] drm: Use u64_to_user_ptr() helper for blob ioctls

2016-11-27 Thread Chris Wilson
Remove the ugly sparse casts by using the helper u64_to_user_ptr() instead. Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_property.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index

[PATCH 3/3] drm: Fix shift operations for drm_fb_helper::drm_target_preferred()

2016-11-27 Thread Chris Wilson
smatch correctly warns: drivers/gpu/drm/drm_fb_helper.c:1960 drm_target_preferred() warn: should '1 << i' be a 64 bit type? drivers/gpu/drm/drm_fb_helper.c:2001 drm_target_preferred() warn: should '1 << i' be a 64 bit type? Signed-off-by: Ch

[PATCH 2/3] drm: Avoid NULL dereference for DRM_LEGACY debug message

2016-11-27 Thread Chris Wilson
smatch warns: drivers/gpu/drm/drm_lock.c:188 drm_legacy_lock() warn: variable dereferenced before check 'master->lock.hw_lock' (see line 177) Signed-off-by: Chris Wilson --- drivers/gpu/drm/drm_lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

[PATCH] drm: Promote drm_mm alignment to u64

2016-11-27 Thread Chris Wilson
-off-by: Chris Wilson Cc: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 37 + include/drm/drm_mm.h | 16 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 025dcd8cadcb

[PATCH 3/3] drm: Protect fb_helper list manipulation with a mutex

2016-11-28 Thread Chris Wilson
On Mon, Nov 28, 2016 at 08:55:58AM +0100, Daniel Vetter wrote: > On Wed, Nov 23, 2016 at 02:04:17PM +0000, Chris Wilson wrote: > > Though we only walk the kernel_fb_helper_list inside a panic (or single > > thread debugging), we still need to protect the list manipulation on > &

[PATCH 3/3] drm: Track framebuffer references at the point of assignment

2016-11-28 Thread Chris Wilson
On Mon, Nov 28, 2016 at 08:48:34AM +0100, Daniel Vetter wrote: > On Fri, Nov 25, 2016 at 03:32:31PM +0000, Chris Wilson wrote: > > --- a/drivers/gpu/drm/drm_atomic.c > > +++ b/drivers/gpu/drm/drm_atomic.c > > @@ -1253,7 +1253,7 @@ drm_atomic_set_fb_for_plane(s

[PATCH 3/3] drm: Track framebuffer references at the point of assignment

2016-11-28 Thread Chris Wilson
On Mon, Nov 28, 2016 at 03:15:12PM +0100, Daniel Vetter wrote: > On Mon, Nov 28, 2016 at 08:46:11AM +0000, Chris Wilson wrote: > > On Mon, Nov 28, 2016 at 08:48:34AM +0100, Daniel Vetter wrote: > > > On Fri, Nov 25, 2016 at 03:32:31PM +, Chris Wilson wrote: > > &

[PATCH 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-28 Thread Chris Wilson
On Mon, Nov 28, 2016 at 08:26:07AM +0100, Daniel Vetter wrote: > On Wed, Nov 23, 2016 at 02:04:15PM +0000, Chris Wilson wrote: > > +#define drm_fb_helper_for_each_connector(fbh, i__) \ > > + for (({lockdep_assert_held(&(fbh)->dev->mode_config.mutex); 1;}), \ > &g

[PATCH v2 1/3] drm: Hold mode_config.lock to prevent hotplug whilst setting up crtcs

2016-11-29 Thread Chris Wilson
ing the lockdep assertion inside the for(;;), I anticipated an error that doesn't happen! Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98826 Signed-off-by: Chris Wilson Cc: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 73 ++--- 1 file cha

[PATCH v2 3/3] drm: Protect fb_helper list manipulation with a mutex

2016-11-29 Thread Chris Wilson
Though we only walk the kernel_fb_helper_list inside a panic (or single thread debugging), we still need to protect the list manipulation on creating/removing a framebuffer device in order to prevent list corruption. Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter --- drivers/gpu/drm

[PATCH v2 2/3] drm: Pull together probe + setup for drm_fb_helper

2016-11-29 Thread Chris Wilson
drm_fb_helper_probe_connector_modes() is always called before drm_setup_crtcs(), so just move the call into drm_setup_crtcs for a small bit of code compaction. Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 37

[Intel-gfx] [PATCH v2 2/3] drm: Pull together probe + setup for drm_fb_helper

2016-11-29 Thread Chris Wilson
On Tue, Nov 29, 2016 at 10:28:03AM -0500, Sean Paul wrote: > On Tue, Nov 29, 2016 at 7:02 AM, Chris Wilson > wrote: > > drm_fb_helper_probe_connector_modes() is always called before > > drm_setup_crtcs(), so just move the call into drm_setup_crtcs for a > > smal

[PATCH v2 2/3] drm: Pull together probe + setup for drm_fb_helper

2016-11-29 Thread Chris Wilson
On Tue, Nov 29, 2016 at 09:29:06PM +0100, Daniel Vetter wrote: > On Tue, Nov 29, 2016 at 12:02:16PM +0000, Chris Wilson wrote: > > drm_fb_helper_probe_connector_modes() is always called before > > drm_setup_crtcs(), so just move the call into drm_setup_crtcs for a > > small b

Re: [PATCH] drm/i915/selftests: silence a bogus spammy warning

2017-06-14 Thread Chris Wilson
Quoting Dan Carpenter (2017-06-14 10:14:52) > These tests are reversed so it complains on every successful call and > stays quiet for every failure. Also we may as well preserve the error > code. The test is correct. The expectation here is that i915_gem_object_ggtt_pin() fails and reports ENOSPC

Re: [PATCH] drm/msm: Separate locking of buffer resources from struct_mutex

2017-06-15 Thread Chris Wilson
Quoting Rob Clark (2017-06-14 17:49:02) > On Tue, Jun 13, 2017 at 6:52 PM, Sushmita Susheelendra > wrote: > > Buffer object specific resources like pages, domains, sg list > > need not be protected with struct_mutex. They can be protected > > with a buffer object level lock. This simplifies lockin

Re: [PATCH] drm/i915: fix ifnullfree.cocci warnings

2017-06-15 Thread Chris Wilson
Quoting kbuild test robot (2017-06-15 16:23:12) > drivers/gpu/drm/i915/i915_gem_execbuffer.c:300:2-7: WARNING: NULL check > before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive > or usb_free_urb is not needed. Maybe consider reorganizing relevant code to > avoid passing

Re: [PATCH] drm/i915: select CRC32

2017-06-21 Thread Chris Wilson
Quoting Daniel Vetter (2017-06-21 10:13:41) > On Wed, Jun 21, 2017 at 04:34:20PM +1000, Nicholas Piggin wrote: > > kbuild test robot found a build failure when building with thin > > archives: > > > > http://marc.info/?l=linux-kbuild&m=149802285009737&w=2 > > > > Signed-off-by: Nicholas Piggin >

[PATCH] drm/vgem: Pin our pages for dmabuf exports

2017-06-22 Thread Chris Wilson
is desired -- but it will do for now. Reported-by: Tomi Sarvela Testcase: igt/gem_concurrent_blit/*swap*vgem* Fixes: 5ba6c9ff961a ("drm/vgem: Fix mmaping") Signed-off-by: Chris Wilson Cc: Tomi Sarvela Cc: Laura Abbott Cc: Sean Paul Cc: Matthew Auld Cc: Daniel Vetter Cc: ---

Re: [PATCH] drm/vgem: Pin our pages for dmabuf exports

2017-06-22 Thread Chris Wilson
Quoting Chris Wilson (2017-06-22 14:30:08) > static void *vgem_prime_vmap(struct drm_gem_object *obj) > { > + struct drm_vgem_gem_object *bo = to_vgem_bo(obj); > long n_pages = obj->size >> PAGE_SHIFT; > struct page **pages; > void

[PATCH v2] drm/vgem: Pin our pages for dmabuf exports

2017-06-22 Thread Chris Wilson
is desired -- but it will do for now. v2: also hold the pin across prime_vmap/vunmap Reported-by: Tomi Sarvela Testcase: igt/gem_concurrent_blit/*swap*vgem* Fixes: 5ba6c9ff961a ("drm/vgem: Fix mmaping") Signed-off-by: Chris Wilson Cc: Tomi Sarvela Cc: Laura Abbott Cc: Sean Paul Cc: Mat

Re: [PATCH v2] drm/vgem: Pin our pages for dmabuf exports

2017-06-23 Thread Chris Wilson
Quoting Daniel Vetter (2017-06-23 12:02:53) > On Thu, Jun 22, 2017 at 02:46:17PM +0100, Chris Wilson wrote: > > + /* Flush the object from the CPU cache so that importers can rely > > + * on coherent indirect access via the exported dma-address. > > + */ > &

Re: [PATCH] drm/i915: Fix an error checking test

2017-06-27 Thread Chris Wilson
Quoting Christophe JAILLET (2017-06-27 06:38:54) > 'dma_buf_vmap' returns NULL on error, not an error pointer. > > Fixes: 6cca22ede8a4 ("drm/i915: Add some mock tests for dmabuf interop") > Signed-off-by: Christophe JAILLET Thanks for the fix, reviewed and pushed. -Chris

Re: [PATCH] dma-buf/sw_sync: Fix timeline/pt overflow cases

2017-06-28 Thread Chris Wilson
Quoting Sean Paul (2017-06-28 16:51:11) > Protect against long-running processes from overflowing the timeline > and creating fences that go back in time. While we're at it, avoid > overflowing while we're incrementing the timeline. > > Signed-off-by: Sean Paul > --- > drivers/dma-buf/sw_sync.c

Re: [PATCH] dma-buf/sw_sync: Fix timeline/pt overflow cases

2017-06-28 Thread Chris Wilson
Quoting Sean Paul (2017-06-28 17:47:24) > On Wed, Jun 28, 2017 at 05:00:20PM +0100, Chris Wilson wrote: > > Quoting Sean Paul (2017-06-28 16:51:11) > > > Protect against long-running processes from overflowing the timeline > > > and creating fences that go back in tim

Re: [PATCH] dma-buf/sw_sync: Fix timeline/pt overflow cases

2017-06-28 Thread Chris Wilson
Quoting Sean Paul (2017-06-28 22:00:02) > On Wed, Jun 28, 2017 at 08:45:55PM +0100, Chris Wilson wrote: > > Quoting Sean Paul (2017-06-28 17:47:24) > > > On Wed, Jun 28, 2017 at 05:00:20PM +0100, Chris Wilson wrote: > > > > Quoting Sean Paul (2017-06-28 16:51:11)

[PATCH 4/7] dma-buf/sw-sync: Reduce irqsave/irqrestore from known context

2017-06-29 Thread Chris Wilson
If we know the context under which we are called, then we can use the simpler form of spin_lock_irq (saving the save/restore). Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Sean Paul Cc: Gustavo Padovan --- drivers/dma-buf/sw_sync.c| 15 +-- drivers/dma-buf/sync_debug.c

[PATCH 2/7] dma-buf/sw-sync: Fix the is-signaled test to handle u32 wraparound

2017-06-29 Thread Chris Wilson
Use the canonical __dma_fence_is_later() to compare the fence seqno against the timeline seqno to check if the fence is signaled. Signed-off-by: Chris Wilson Cc: Sumit Semwal Cc: Sean Paul Cc: Gustavo Padovan --- drivers/dma-buf/sw_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 6/7] dma-buf/sw-sync: Fix locking around sync_timeline lists

2017-06-29 Thread Chris Wilson
-by: Chris Wilson Cc: Sumit Semwal Cc: Sean Paul Cc: Gustavo Padovan --- drivers/dma-buf/sw_sync.c| 39 ++- drivers/dma-buf/sync_debug.c | 9 - drivers/dma-buf/sync_debug.h | 21 - 3 files changed, 26 insertions(+), 43

<    3   4   5   6   7   8   9   10   11   12   >