Re: [PATCH 2/2] drm/vmwgfx: Use the linux DMA api to get valid device addresses of pages

2013-11-04 Thread Thomas Hellstrom
On 11/04/2013 05:40 PM, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 04, 2013 at 05:57:39AM -0800, Thomas Hellstrom wrote: >> The code handles three different cases: >> 1) physical page addresses. The ttm page array is used. >> 2) DMA subsystem addresses. A scatter-gath

Re: [PATCH 1/2] drm/ttm: Enable the dma page pool also for intel IOMMUs

2013-11-04 Thread Thomas Hellstrom
On 11/04/2013 05:34 PM, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 04, 2013 at 05:57:38AM -0800, Thomas Hellstrom wrote: >> Used by the vmwgfx driver > That looks OK to me. And baremetal should not be > affected as the Intel VT-d driver turns of the SWIOTLB > driver - so it

Re: [PATCH 0/2] Make the vmwgfx driver reasonably DMA-API compliant

2013-11-04 Thread Thomas Hellstrom
On 11/04/2013 05:30 PM, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 04, 2013 at 05:57:37AM -0800, Thomas Hellstrom wrote: >> These patches makes the vmwgfx driver use the DMA API to obtain valid >> device addresses rather than blindly using physical addresses. >> >> T

Re: [PATCH 2/2] drm/vmwgfx: Use the linux DMA api to get valid device addresses of pages

2013-11-04 Thread Thomas Hellstrom
On 11/04/2013 05:27 PM, Daniel Vetter wrote: > On Mon, Nov 04, 2013 at 05:57:39AM -0800, Thomas Hellstrom wrote: >> The code handles three different cases: >> 1) physical page addresses. The ttm page array is used. >> 2) DMA subsystem addresses. A scatter-gather list is used.

[PATCH 1/2] drm/ttm: Enable the dma page pool also for intel IOMMUs

2013-11-04 Thread Thomas Hellstrom
Used by the vmwgfx driver Signed-off-by: Thomas Hellstrom Reviewed-by: Jakob Bornecrantz --- drivers/gpu/drm/ttm/Makefile |6 +- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c |3 +++ include/drm/ttm/ttm_page_alloc.h | 11 ++- 3 files changed, 14 insertions

[PATCH 0/2] Make the vmwgfx driver reasonably DMA-API compliant

2013-11-04 Thread Thomas Hellstrom
These patches makes the vmwgfx driver use the DMA API to obtain valid device addresses rather than blindly using physical addresses. The main motivation is to be able to use a virtual IOMMU in the future. Other TTM drivers typically map pages one by one rather than using a scatter-gather list, bu

[PATCH 2/2] drm/vmwgfx: Use the linux DMA api to get valid device addresses of pages

2013-11-04 Thread Thomas Hellstrom
The code handles three different cases: 1) physical page addresses. The ttm page array is used. 2) DMA subsystem addresses. A scatter-gather list is used. 3) Coherent pages. The ttm dma pool is used, together with the dma_ttm array os dma_addr_t Signed-off-by: Thomas Hellstrom Reviewed-by: Jakob

[PATCH -next 0/3] vmwgfx fixes

2011-10-17 Thread Thomas Hellstrom
A couple of vmwgfx fixes on top of drm-next / drm-core-next. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulen

[PATCH 2/3] vmwgfx: Whitespace & code style in display unit

2011-10-17 Thread Thomas Hellstrom
From: Jakob Bornecrantz Signed-off-by: Jakob Bornecrantz Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c |4 +--- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c |5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c

[PATCH 3/3] vmwgfx: Add vblank stubs

2011-10-17 Thread Thomas Hellstrom
From: Jakob Bornecrantz This fixes kernel panics when running the vbltest from the drm repo. We can't just skip initializing the vblank system since it sets up certain state for us, see: "vmwgfx: Enable use of the vblank system." Signed-off-by: Jakob Bornecrantz Signed-off-by: T

[PATCH 1/3] vmwgfx: Fix display system init & close functions

2011-10-17 Thread Thomas Hellstrom
From: Jakob Bornecrantz Make sure we null the display private, make sure we catch and handle vblank failing to init and don't call vblank_cleanup if we haven't initialized the display system. Signed-off-by: Jakob Bornecrantz Signed-off-by: Thomas Hellstrom --- drivers/gpu/

Re: [RFC PATCH v2] Utilize the PCI API in the TTM framework.

2011-01-27 Thread Thomas Hellstrom
Konrad, Dave Given our previous discussion on the list, I believe these patches shouldn't introduce any regressions in the non-Xen case, however we should probably be prepared to back them out quickly if that turns out to be the case... Thanks, Thomas On 01/07/2011 06:11 PM, Konrad Rzeszute

[PATCH 2/2] drm/ttm: Fix ttm_page_alloc.c

2010-05-26 Thread Thomas Hellstrom
Fix a number of typos misspellings and checkpatch.pl warnings. Replace "[ttm] " with TTM_PFX Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 62 +++-- 1 files changed, 36 insertions(+), 26 deletions(-) diff --git a/drivers/g

[PATCH 1/2] drm/ttm: Fix cached TTM page allocation.

2010-05-26 Thread Thomas Hellstrom
This patch fixes a regression introduced with the pool page allocator in the event that there are no highmem pages (for example x86_64), in which case cached page allocation would fail. Tested with the vmwgfx driver on a 64-bit vm. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm

Re: [patch 2/5] drivers/gpu/drm/via/via_video.c: fix off by one issue

2010-04-28 Thread Thomas Hellstrom
a...@linux-foundation.org wrote: > From: Dan Carpenter > > "fx->lock" is used as the index in "dev_priv->decoder_queue[fx->lock]" > which is an array of "VIA_NR_XVMC_LOCKS" elements. > > Signed-off-by: Dan Carpenter > Cc: David Ai

Re: [PATCH 05/13] drm/ttm: ttm_fault callback to allow driver to handle bo placement V5

2010-04-09 Thread Thomas Hellstrom
Dave Airlie wrote: > On Wed, Apr 7, 2010 at 8:21 PM, Jerome Glisse wrote: > >> On fault the driver is given the opportunity to perform any operation >> it sees fit in order to place the buffer into a CPU visible area of >> memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon >

Re: [PATCH 04/13] drm/vmwgfx: update to TTM no_wait splitted argument

2010-04-05 Thread Thomas Hellstrom
Jerome Glisse wrote: > This patch update radeon to the new no_wait splitted argument > TTM functionality. > > Compile tested only (but thing should run as there is no > operating change from driver point of view) > > Signed-off-by: Jerome Glisse > Revie

Re: [PATCH 12/13] drm/ttm: remove io_ field from TTM V4

2010-04-05 Thread Thomas Hellstrom
in first patch of the patchset > V3 update after io_mem_reserve/io_mem_free callback balancing > V4 adjust to minor cleanup > > Signed-off-by: Jerome Glisse > Jerome, see comment below, apart from that, this is Acked-by: Thomas Hellstrom > --- > d

Re: [PATCH 08/13] drm/vmwgfx: add support for new TTM fault callback V3

2010-04-05 Thread Thomas Hellstrom
sted. > > V2 don't derefence bo->mem.mm_node as it's not NULL only for >VRAM or GTT > V3 update after io_mem_reserve/io_mem_free callback balancing > > Signed-off-by: Jerome Glisse > Reviewed-by: Thomas Hellstrom > --- > drivers/gpu/drm/vmwgfx/vmwgfx

Re: unmappable vram V6

2010-04-05 Thread Thomas Hellstrom
Jerome Glisse wrote: > So in these patchset i use bool instead of atomic remove empty line > removal, and i hope addressed standing issues. Again only compile > tested for nouveau & vmwgfx. Tested this time only tested on RV710 > with special patch to force unmappable vram use. > http://people.free

Re: [PATCH 11/13] drm/vmwgfx: don't initialize TTM io memory manager field

2010-04-05 Thread Thomas Hellstrom
Jerome Glisse wrote: > This isn't needed anymore with the new TTM fault callback > > Signed-off-by: Jerome Glisse > Reviewed-by: Thomas Hellstrom > --- > drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c |6 -- > 1 files changed, 0 insertions(+), 6 deletions(-) &g

Re: [PATCH 05/13] drm/ttm: ttm_fault callback to allow driver to handle bo placement V4

2010-04-05 Thread Thomas Hellstrom
m any necessary task for mapping to succeed > V4 minor cleanup, atomic_t -> bool as member is protected by reserve >mecanism from concurent access > > Signed-off-by: Jerome Glisse > Reviewed-by: Thomas Hellstrom > --- > drivers/gpu/drm/ttm/ttm_bo.c

Re: [PATCH 01/13] drm/ttm: split no_wait argument in 2 GPU or reserve wait

2010-04-05 Thread Thomas Hellstrom
> > This patch break the API to other modules, update to others > driver are following in separate patches. > > Signed-off-by: Jerome Glisse > Acked-by: Thomas Hellstrom > --- > drivers/gpu/drm/ttm/ttm_bo.c | 57 >

Re: [PATCH] drm/ttm: ttm_fault callback to allow driver to handle bo placement V3

2010-03-24 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Wed, Mar 24, 2010 at 07:27:57PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On fault the driver is given the opportunity to perform any operation >>> it sees fit in order to place the buffer into a CPU vi

Re: [PATCH] drm/ttm: ttm_fault callback to allow driver to handle bo placement V3

2010-03-24 Thread Thomas Hellstrom
Jerome Glisse wrote: > On fault the driver is given the opportunity to perform any operation > it sees fit in order to place the buffer into a CPU visible area of > memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon > should keep working properly. Future patch will take advantag

Re: Unmappable VRAM patchset V4

2010-03-17 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Mar 01, 2010 at 01:03:38PM +0100, Thomas Hellstrom wrote: > >> Dave Airlie wrote: >> >>> On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse wrote: >>> >>> >>>> Updated patchset, to apply cleanly

Re: [PATCH 1/9] drm/ttm: ttm_fault callback to allow driver to handle bo placement V2

2010-03-17 Thread Thomas Hellstrom
Jerome Glisse wrote: > On fault the driver is given the opportunity to perform any operation > it sees fit in order to place the buffer into a CPU visible area of > memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon > should keep working properly. Future patch will take advantag

Re: [PATCH 1/4] drm/ttm: split no_wait argument in 2 GPU or reserve wait

2010-03-17 Thread Thomas Hellstrom
> > This patch break the API to other modules, update to others > driver are following in separate patches. > > Signed-off-by: Jerome Glisse > Acked-by: Thomas Hellstrom > --- > drivers/gpu/drm/ttm/ttm_bo.c | 57 >

Re: [Patch RFC] ttm: nouveau accelerated on Xen pv-ops kernel

2010-03-16 Thread Thomas Hellstrom
Arvind R wrote: > On Thu, Mar 11, 2010 at 4:32 PM, Pekka Paalanen wrote: > >> I'm adding dri-devel@ to CC, since this suggested patch touches >> TTM code, and none of the Nouveau code. TTM patches go via >> dri-de...@. >> >> Thanks. >> >> >> This is a NAK in its current form. First, At m

Re: [PATCH] drm/ttm: use drm calloc large and free large

2010-03-16 Thread Thomas Hellstrom
Dave Airlie wrote: > Now that the drm core can do this, lets just use it, split the code out > so TTM doesn't have to drag all of drmP.h in. > > Acked-by: Thomas Hellstrom It's funny, though. The original code used code similar to "is_vmalloc_addr()" now in l

Re: [RFC] drm/ttm: add pool wc/uc page allocator

2010-03-03 Thread Thomas Hellstrom
Luca Barbieri wrote: >> ^^^ Luca, I've never seen this show up high on a profile (yet). Do you see >> that with Nouveau? I used to have an rb-tree implementation of drm_mm_xxx >> lying around, but I didn't use it because I didn't have a case where it >> showed up? >> > > Yes, before I did user

Re: [RFC] drm/ttm: add pool wc/uc page allocator

2010-03-03 Thread Thomas Hellstrom
Luca Barbieri wrote: > While this is almost surely a good idea, note that userspace caching > and suballocation substantially improves Mesa performance even on PCIe > systems. > This is mostly due to the unavoidable overhead of kernel calls and > pagetable modifications, > as well as the avoidab

Re: [PATCH 2/2] drm/ttm: don't write to bo->reserved without holding glob->lru_lock

2010-03-01 Thread Thomas Hellstrom
Maarten Maathuis wrote: > - The headerfile says you can't write to it without holding the lock. > NAK. The header-file is incorrect. It should say that the lru_lock needs to be held only when we transition from 0 to 1. That guarantees that if the lru lock is held, and we read 0, we can safel

Re: Unmappable VRAM patchset V4

2010-03-01 Thread Thomas Hellstrom
Dave Airlie wrote: > On Fri, Feb 26, 2010 at 3:01 AM, Jerome Glisse wrote: > >> Updated patchset, to apply cleanly on top of TTM split no_wait argument. >> Compile tested for nouveau+vmwgfx, test in progress for radeon. >> >> So with the new change radeon won't wait for bo reserving other bo >>

Re: Unmappable VRAM patchset V3

2010-02-24 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Wed, Feb 24, 2010 at 01:37:42PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On Tue, Feb 23, 2010 at 02:05:50PM +0100, Thomas Hellstrom wrote: >>> >>>> Jerome Glisse wrote: >>>

Re: Unmappable VRAM patchset V3

2010-02-24 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Tue, Feb 23, 2010 at 02:05:50PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On Mon, Feb 22, 2010 at 08:58:28PM +0100, Thomas Hellstrom wrote: >>> >>>> Jerome Glisse wrote: >>>

Re: [PATCH] drm/ttm: handle OOM in ttm_tt_swapout

2010-02-23 Thread Thomas Hellstrom
RR(to_page); >>>goto out_err; >>> - >>> + } >>> >> If that is true and the rest is just nice cleanups then I'm okay with it,. >> >> Reviewed-by: Dave Airlie >> >> I'll need

Re: Unmappable VRAM patchset V3

2010-02-23 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Feb 22, 2010 at 08:58:28PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On Mon, Feb 22, 2010 at 06:30:24PM +0100, Thomas Hellstrom wrote: >>> >>>> Jerome Glisse wrote: >>>>

Re: Unmappable VRAM patchset V3

2010-02-22 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Feb 22, 2010 at 06:30:24PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> Thomas i think i addressed your concern here, the ttm_bo_validate >>> didn't needed a new argument or i did not understand

Re: Unmappable VRAM patchset V3

2010-02-22 Thread Thomas Hellstrom
Jerome Glisse wrote: > Thomas i think i addressed your concern here, the ttm_bo_validate > didn't needed a new argument or i did not understand what was > necessary beside no_wait. In this patchset we check the value > of callback in case of EBUSY (call set_need_resched) or ERESTARTSYS > we return

Re: [PATCH][RFC] time: add wait_interruptible_timeout macro to sleep (w. timeout) until wake_up

2010-02-21 Thread Thomas Hellstrom
Rafał Miłecki wrote: > Signed-off-by: Rafał Miłecki > --- > We try to implement some PM in radeon KMS and we need to sync with VLBANK for > reclocking engine/memory. The easiest and cleanest way seems to be sleeping in > timer handler just before reclocking. Then our IRQ handler calls wake_up and

[PATCH] drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.

2010-02-21 Thread Thomas Hellstrom
Intercept query commands and apply relocations to their guest pointers. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 108 ++- 1 files changed, 92 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b

Re: [PATCH 1/9] drm/ttm: add ttm_fault callback to allow driver to handle bo placement

2010-02-21 Thread Thomas Hellstrom
Jerome, I think this could and should be accomplished in the following way (like the old ttm did). 1: For kernel maps: a) reserve the bo. b) validate the bo into a mappable segment of vram, perhaps using range validation. c) idle any accelerated move. d) call ttm_bo_kmap. 2: For fault: a) in b

Re: vesafb handover

2010-02-15 Thread Thomas Hellstrom
Dave Airlie wrote: > On Mon, Feb 15, 2010 at 8:04 PM, Thomas Hellstrom wrote: > >> Hi, Dave! >> >> Could you point me to what's needed in drm fb setup to utilize the >> vesafb handover mechanism? >> > > In intel_fb.c > >

[PATCH] drm/vmwgfx: Use fb handover mechanism instead of stealth mode.

2010-02-15 Thread Thomas Hellstrom
When the vmwgfx module is loaded on top of vesafb, it would operate in stealth mode in parallel with vesafb, evicting VRAM on dropmaster. Change that to use the vesafb handover mechanism, like other drmfb drivers. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 49

vesafb handover

2010-02-15 Thread Thomas Hellstrom
Hi, Dave! Could you point me to what's needed in drm fb setup to utilize the vesafb handover mechanism? Thanks, Thomas -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healin

Re: [PATCH 1/2] drm: Fix a bug in the range manager. When searching for free space in a range, the function could return a node extending outside of the given range.

2010-02-12 Thread Thomas Hellstrom
Michel Dänzer wrote: > On Fri, 2010-02-12 at 00:17 +0100, Thomas Hellstrom wrote: > >> Signed-off-by: Thomas Hellstrom >> > > Please make a proper short description of the change on the first line > of the commit message. > > > Done. That short de

[PATCH 1/2 RESEND] drm: Fix a bug in the range manager.

2010-02-12 Thread Thomas Hellstrom
When searching for free space in a range, the function could return a node extending outside of the given range. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/drm_mm.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm

[PATCH 1/2] drm: Fix a bug in the range manager. When searching for free space in a range, the function could return a node extending outside of the given range.

2010-02-11 Thread Thomas Hellstrom
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/drm_mm.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index cdec329..2ac074c 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -405,7 +405,8

[PATCH 2/2] drm/ttm: Fix a bug occuring when validating a buffer object in a range.

2010-02-11 Thread Thomas Hellstrom
If the buffer object was already in the requested memory type, but outside of the requested range it was never moved into the requested range. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers

[PATCH 0/2] last minute range validation fixes.

2010-02-11 Thread Thomas Hellstrom
This patch series contains two pretty important bugfixes to the new validate-in-range functionality. The first bug could case a buffer object to be validated outside of the requested range, the other one could cause a buffer object to remain at its current offset even though that offset was outsid

[PATCH] drm/vmwgfx: Drop scanout flag compat and add execbuf ioctl parameter members. Bumps major.

2010-02-09 Thread Thomas Hellstrom
From: Jakob Bornecrantz Even if this bumps the version to 1 it does not mean the driver is out of staging. From what we know this is the last backwards incompatible change to the driver. Signed-off-by: Jakob Bornecrantz Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Re: [PATCH] drm/vmwgfx: Bump major and drop scanout flag compat

2010-02-09 Thread Thomas Hellstrom
Jakob Bornecrantz wrote: > Even if this bumps the version to 1 it does not mean the driver is > out of staging. From what we know this is the last backwards > incompatible change to the driver. > > Signed-off-by: Jakob Bornecrantz > --- > drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |6 +++--- >

[PATCH] vmwgfx: Fix a circular locking dependency bug.

2010-02-08 Thread Thomas Hellstrom
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 17 + drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 13 +++-- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx

[PATCH 0/1 RESEND] vmwgfx: Update the user-space interface.

2010-02-05 Thread Thomas Hellstrom
Resending with correct email time-stamp. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and manag

[PATCH] vmwgfx: Update the user-space interface.

2010-02-05 Thread Thomas Hellstrom
When time-based throttling is implemented, we need to bump minor. When the old way of detecting scanout is removed, we need to bump major. In the meantime, this change should not break existing user-space. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |6

Re: Failing via_cmdbuf_wait

2010-02-05 Thread Thomas Hellstrom
Robert Högberg wrote: > Hello. > > I'm trying to debug an issue I'm having with my Via CN400 board. The problem > I see is that every time I watch a specific DVD using XvMC the display > freezes completely after a short time. > > The freeze seems to be caused by a failing via_cmdbuf_wait. I don't

[PATCH] vmwgfx: Update the user-space interface.

2010-02-05 Thread Thomas Hellstrom
When time-based throttling is implemented, we need to bump minor. When the old way of detecting scanout is removed, we need to bump major. In the meantime, this change should not break existing user-space. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |6

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Feb 01, 2010 at 11:35:21AM +1000, Dave Airlie wrote: > >> On Thu, Jan 28, 2010 at 7:26 PM, Luca Barbieri >> wrote: >> >>> Currently TTM tries to preserve the previous caching even for moves >>> between unrelated memory spaces. >>> >>> This results for instan

Re: [PATCH] drm/ttm: remove padding from ttm_ref_object on 64bit builds

2010-01-30 Thread Thomas Hellstrom
tm_object.c > @@ -109,8 +109,8 @@ struct ttm_ref_object { > struct drm_hash_item hash; > struct list_head head; > struct kref kref; > - struct ttm_base_object *obj; > enum ttm_ref_type ref_type; > + struct ttm_base_object *obj; >

Re: [PATCH] drm/ttm: Avoid conflicting reserve_memtype during ttm_tt_set_page_caching.

2010-01-26 Thread Thomas Hellstrom
blem that the core kernel complains if you try to move directly from wc to uc? In that case it looks OK to me: Acked-by: Thomas Hellstrom > >> Fixes errors like: >> >>> reserve_ram_pages_type failed 0x15b7a000-0x15b7b000, track 0x8, req 0x10 >>> >

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-25 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Thu, Jan 21, 2010 at 01:59:26PM +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On Thu, Jan 21, 2010 at 04:49:39AM +0100, Luca Barbieri wrote: >>> >>>>> We had to do a similar thing in the &

Re: [patch] drm/ttm: remove unnecessary save_flags and ttm_flag_masked in ttm_bo_util.c

2010-01-21 Thread Thomas Hellstrom
Yuan, Shengquan wrote: > On Wed, Jan 20, 2010 at 6:48 PM, Thomas Hellstrom wrote: > >> Yuan, >> This looks like an old leftover from a previous cleanup. >> >> Although, when I look at the code, it seems save_flags should be removed >> completely. >>

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-21 Thread Thomas Hellstrom
Luca Barbieri wrote: >> At a first glance: >> >> 1) We probably *will* need a delayed destroyed workqueue to avoid wasting >> memory that otherwise should be freed to the system. At the very least, the >> delayed delete process should optionally be run by a system shrinker. >> > You are right.

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-21 Thread Thomas Hellstrom
Luca Barbieri wrote: >> We had to do a similar thing in the >> Poulsbo driver and it turned out that we could save a significant amount of >> CPU by using a delayed workqueue, collecting objects and destroying them >> periodically. >> > Yes, indeed, we don't really care about a fence expiring

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-21 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Thu, Jan 21, 2010 at 04:49:39AM +0100, Luca Barbieri wrote: > >>> We had to do a similar thing in the >>> Poulsbo driver and it turned out that we could save a significant amount of >>> CPU by using a delayed workqueue, collecting objects and destroying them >>> periodi

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Luca Barbieri wrote: > When designing this, we should also keep in mind that some drivers > (e.g. nouveau) have multiple FIFO channels, and thus we would like a > buffer to be referenced for reading by multiple channels at once (and > be destroyed only when all fences are expired, obviously). > Als

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Luca Barbieri wrote: >> Also note that the delayed delete list is not in fence order but in >> deletion-time order, which perhaps gives room for more optimizations. >> > You are right. > I think then that ttm_bo_delayed_delete may still need to be changed, > because it stops when ttm_bo_cleanu

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Luca Barbieri wrote: > Yes it's fine. I sent your patch to Dave with an expanded commit > comment for merging. > > Here is a possible redesign of the mechanism inspired by this issue. > It seems that what we are racing against is buffer eviction, due to > delayed deletion buffers being still kept o

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Thomas Hellstrom wrote: Yes, it looks correct. Although it seems a little unintuitive to enter the loop with the spinlock held, and exit it with the spinlock not held. I've attached yet another patch to have that fixed. Could you take a look at whether it seems OK with you and, in that

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Thomas Hellstrom wrote: Thomas Hellstrom wrote: Yes, it looks correct. Although it seems a little unintuitive to enter the loop with the spinlock held, and exit it with the spinlock not held. I've attached yet another patch to have that fixed. Could you take a look at whether it see

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-20 Thread Thomas Hellstrom
Luca Barbieri wrote: >> Would nentry=list_first_entry(&entry->ddestroy, ) work? >> > Yes, it seems a bit less intuitive, but if that's the accepted > practice, let's do that instead. > > >> Here nentry may have been removed from the list by another process, which >> would trigger the u

Re: [patch] drm/ttm: remove unnecessary save_flags and ttm_flag_masked in ttm_bo_util.c

2010-01-20 Thread Thomas Hellstrom
Yuan, This looks like an old leftover from a previous cleanup. Although, when I look at the code, it seems save_flags should be removed completely. Can you take a look at that and respin the patch? Thanks, Thomas Yuan, Shengquan wrote: > commit d60326ac977a5e99047b44f9b313ff79cd3a14b4 > Autho

Re: [PATCH] drm/ttm: Fix race condition in ttm_bo_delayed_delete

2010-01-18 Thread Thomas Hellstrom
Luca, Good catch. Some comments inline: Luca Barbieri wrote: > + entry = list_first_entry(&bdev->ddestroy, > + struct ttm_buffer_object, ddestroy); > + kref_get(&entry->list_kref); > > - if (next != &bdev->ddestroy) { > - nentry = list_entry

[PATCH 1/2] ttm: Allow system memory as a busy placement.

2010-01-16 Thread Thomas Hellstrom
This is needed to fix a vmwgfx memory usage bug. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index da37021..c7733c3 100644 --- a

[PATCH 2/2] vmwgfx: Optimize memory footprint for DMA buffers.

2010-01-16 Thread Thomas Hellstrom
Use VRAM whenever there is free space for DMA buffers, but use system GMR memory if using VRAM would cause an eviction. This significantly reduces the guest system memory usage for VMs with a large amount of VRAM allocated. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx

[PATCH 10/10] ttm: Make sure system buffer objects has offset == 0.

2010-01-13 Thread Thomas Hellstrom
This is a convention that the vmwgfx driver has come to rely on. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 7a64f07..da37021 100644

[PATCH 08/10] vmwgfx: Implement basic pm operations.

2010-01-13 Thread Thomas Hellstrom
callbacks. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 62 ++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |2 + 2 files changed, 63 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vm

[PATCH 07/10] ttm: Export symbols needed for vmwgfx suspend / resume operations.

2010-01-13 Thread Thomas Hellstrom
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |1 + drivers/gpu/drm/ttm/ttm_lock.c |2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e10a04e..7a64f07 100644 --- a/drivers/gpu/drm

[PATCH 06/10] vmwgfx: Implement a swap_notify callback.

2010-01-13 Thread Thomas Hellstrom
Unbind GMR bindings on the buffer about to be swapped out. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c

[PATCH 05/10] ttm: Add a swap_notify callback.

2010-01-13 Thread Thomas Hellstrom
driver must then release any private GPU bindings on those buffers. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c|3 +++ include/drm/ttm/ttm_bo_driver.h |5 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu

[PATCH 02/10] vmwgfx: Fix an error path causing an oops.

2010-01-13 Thread Thomas Hellstrom
An error happening before the snooper.image member had been set up would cause a kfree of an arbitrary pointer. Set up the snooper.image member early. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 39 - 1 files changed, 21

[PATCH 03/10] vmwgfx: Make fence sequences continous across a VT switch.

2010-01-13 Thread Thomas Hellstrom
A vt switch in stealth mode would take down the FIFO, and re- initialize fence sequence numbers. This patch saves the current state of the fence sequence when the FIFO is disabled. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |1 + drivers/gpu/drm/vmwgfx

[PATCH 01/10] vmwgfx: Don't promote updates from GMR-backed scanouts to fullscreen.

2010-01-13 Thread Thomas Hellstrom
That's unnecessary since partial screen updates from GMRs are fast. Also fix cliprect pointer dereferencing Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/v

[PATCH 0/10] vmwgfx bug-fixes

2010-01-13 Thread Thomas Hellstrom
This patch series contains a number of bug fixes for the vmwgfx driver. Some fixes has required minimal changes to TTM, most notably a swap_notify callback, since the vmwgfx driver has driver-private GPU bindings. -- This

[PATCH 09/10] ttm: Kill some leftover debug messages.

2010-01-13 Thread Thomas Hellstrom
Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_lock.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_lock.c b/drivers/gpu/drm/ttm/ttm_lock.c index 3d172ef..de41e55 100644 --- a/drivers/gpu/drm/ttm/ttm_lock.c +++ b/drivers/gpu/drm

[PATCH 04/10] vmwgfx: Use bo_driver::move_notify to unbind GMRs.

2010-01-13 Thread Thomas Hellstrom
This was previously done explicitly for overlay- and fb buffers. Now it's done for any buffer leaving the SYSTEM memory region. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |1 + drivers/gp

Re: [TTM] general protection fault in ttm_tt_swapout, to_virtual looks screwed up

2010-01-10 Thread Thomas Hellstrom
I've seen something similar with openchrome, but I think I traced that down to the DMA engines causing memory corruption. Note that IIRC kmap_atomic may return page_address(page) for a lowmem page. Any idea what may cause kmap_atomic to behave in this way? /Thomas Maarten Maathuis wrote: > I've

[PATCH RESEND] drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.

2009-12-22 Thread Thomas Hellstrom
Improve the command verifier to catch all occurences of surface handles, and translate to SIDs. This way DMA buffers and 3D surfaces share a common handle space, which makes it possible for the kms code to differentiate. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

[PATCH] drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.

2009-12-22 Thread Thomas Hellstrom
Improve the command verifier to catch all occurences of surface handles, and translate to SIDs. This way DMA buffers and 3D surfaces share a common handle space, which makes it possible for the kms code to differentiate. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Re: [PATCH 2/3] drm/vmwgfx: fixup unlocked ioctl code on top of Arnd's work.

2009-12-21 Thread Thomas Hellstrom
Dave Airlie wrote: > From: Dave Airlie > > For some reason these ioctls have no DRM flags, which just seems wrong, > so I guess that needs reviewing also before staging exit. > > Signed-off-by: Dave Airlie > Dave, is the DRM_UNLOCKED stuff going in for 2.6.33? Otherwise, I'll provide a patch

Re: [PATCH] drm/mm: fix logic for selection of best fit block

2009-12-21 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Dec 21, 2009 at 01:53:37PM +1000, Dave Airlie wrote: > >> From: Bob Gleitsmann >> >> This is from bug 25728. >> >> [airlied: I'm just forwarding the patch for review, Thomas, ickle?] >> > > Looks good t

Re: Another TTM race bug.

2009-12-16 Thread Thomas Hellstrom
Ben Skeggs wrote: > On Wed, 2009-12-16 at 12:11 +0100, Thomas Hellstrom wrote: > >> Jerome Glisse wrote: >> >>> On Wed, 2009-12-16 at 11:56 +0100, Thomas Hellstrom wrote: >>> >>> >>>> Hi guys, >>>> >&

Re: Another TTM race bug.

2009-12-16 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Wed, 2009-12-16 at 11:56 +0100, Thomas Hellstrom wrote: > >> Hi guys, >> >> There is another TTM race bug that I'm going to fix but which doesn't >> yet affect any upstream code AFAICT. >> >> The effect is tha

Another TTM race bug.

2009-12-16 Thread Thomas Hellstrom
Hi guys, There is another TTM race bug that I'm going to fix but which doesn't yet affect any upstream code AFAICT. The effect is that it may cause a deadlock in extremely rare cases if there are two processes validating at the same time, and one process needs to evict a buffer on which ttm_bo

[PATCH 1/2] drm/ttm: Delayed delete fixes.

2009-12-15 Thread Thomas Hellstrom
1) Remove from lru before reserving so we avoid competing with evicting processes. 2) Avoid calling kref_put() on bo::list_kref while spinlocked. 3) Additional refcounting bug-checking. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c |7 --- 1 files changed, 4

[PATCH 2/2] drm/ttm: Fix potential ttm_mem_evict_first races.

2009-12-15 Thread Thomas Hellstrom
lru lock. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_bo.c | 36 +++- 1 files changed, 31 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 488f255..0d6646d 100644 --- a/drivers/gpu/drm

Re: TTM eviction & ghost object

2009-12-14 Thread Thomas Hellstrom
Jerome Glisse wrote: > Hi Thomas, > > Dave find out the root of a strange oops we did encouter. > I spend sometimes today trying to hack ttm around but > in the end my solution is wrong. > > So when we move an object a ttm ghost object is created. > If GPU takes time to evict the bo the ghost objec

Re: [RFC] Add verbose debug information when eviction fails

2009-12-10 Thread Thomas Hellstrom
Jerome Glisse wrote: > This patch series add printing of all informations necessary to > understand why getting memory space fails. I have mixed feeling > on letting this enabled by default or only enabling it with debug > compile flags. > > Cheers, > Jerome > > Jerome, This is Acked-By me, alth

Re: [PATCH 0/2] RFC: Upstreaming the vmwgfx driver

2009-12-10 Thread Thomas Hellstrom
Jakob Bornecrantz wrote: > This patch series add the vmwgfx driver to the kernel tree inside > the staging tree. I split the patch in two parts as the svga > headers fail checkpatch quite hard. The svga* headers are shared > between a lot of different components but I can understand if they > get r

  1   2   >