[PATCH] drm/radeon: avoid kernel segfault in vce when gpu fails to resume

2017-02-06 Thread j . glisse
From: Jérôme Glisse When GPU fails to resume we can not trust that value we write to GPU memory will post and we might get garbage (more like 0x on x86) when reading them back. This trigger out of range memory access in the kernel inside the vce resume code path. This patch use canonical

[PATCH] radeon: fix pll/ctrc mapping on dce2 and dce3 hardware

2012-11-27 Thread j . glisse
From: Jerome Glisse This fix black screen on resume issue that some people are experiencing. There is a bug in the atombios code regarding pll/crtc mapping. The atombios code reverse the logic for the pll and crtc mapping. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/atombios_crtc.c

[PATCH 1/2] radeon: fix pll/ctrc mapping on dce2 and dce3 hardware v2

2012-11-27 Thread j . glisse
From: Jerome Glisse This fix black screen on resume issue that some people are experiencing. There is a bug in the atombios code regarding pll/crtc mapping. The atombios code reverse the logic for the pll and crtc mapping. v2: DCE3 or DCE2 only have 2 crtc Signed-off-by: Jerome Glisse --- dri

[PATCH 2/2] drm/radeon: fix deadlock when bo is associated to different handle

2012-11-27 Thread j . glisse
From: Jerome Glisse There is a rare case, that seems to only happen accross suspend/resume cycle, where a bo is associated with several different handle. This lead to a deadlock in ttm buffer reservation path. This could only happen with flinked(globaly exported) object. Userspace should not reop

[PATCH] drm/radeon: track global bo name and always return the same

2012-11-27 Thread j . glisse
From: Jerome Glisse To avoid kernel rejecting cs if we return different global name for same bo keep track of global name and always return the same. Seems to fix issue with suspend/resume failing and repeatly printing following message : [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation -

[PATCH] drm/ttm: do not try to preserve caching state

2012-11-28 Thread j . glisse
From: Jerome Glisse It make no sense to preserve caching state especialy when moving from vram to system. It burden the page allocator to match the vram caching (often WC) which just burn CPU cycle for no good reasons. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_bo.c | 15 +++-

[RFC] drm/ttm: add minimum residency constraint for bo eviction

2012-11-28 Thread j . glisse
So i spend the day looking at ttm and eviction. The first patch i sent earlier is i believe something that should be merged. This patch however is more about discussing if other people are interested in similar mecanism to be share among driver through ttm. I could otherwise just move its logic to

[PATCH] drm/ttm: add minimum residency constraint for bo eviction

2012-11-28 Thread j . glisse
From: Jerome Glisse This patch add a minimum residency time configurable for each memory pool (VRAM, GTT, ...). Intention is to avoid having a lot of memory eviction from VRAM up to a point where the GPU pretty much spend all it's time moving things in and out. Signed-off-by: Jerome Glisse ---

[PATCH] drm/radeon: use cached memory when evicting for vram on non agp

2012-11-28 Thread j . glisse
From: Jerome Glisse Force the use of cached memory when evicting from vram on non agp hardware. Also force write combine on agp hw. This is to insure the minimum cache type change when allocating memory and improving memory eviction especialy on pci/pcie hw. Signed-off-by: Jerome Glisse --- dr

[PATCH] drm/radeon: fix rare segfault after gpu lockup on r7xx

2012-11-29 Thread j . glisse
From: Jerome Glisse If GPU reset fails the gart table ptr might be NULL avoid a kernel segfault in this rare event. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/r600.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/

[RFC] improve memory placement for radeon

2012-11-29 Thread j . glisse
So as a followup is 2 patch. The first one just stop trying to move object at each cs ioctl i believe it could be included in 3.7 as it improve performances (especialy with vram change from userspace). The second one implement a vram eviction policy. It's a simple one, buffer used for write operat

[PATCH 1/2] drm/radeon: do not move bo to different placement at each cs

2012-11-29 Thread j . glisse
From: Jerome Glisse The bo creation placement is where the bo will be. Instead of trying to move bo at each command stream let this work to another worker thread that will use more advance heuristic. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon.h| 1 + drivers/gpu/dr

[PATCH 2/2] drm/radeon: buffer memory placement work thread WIP

2012-11-29 Thread j . glisse
From: Jerome Glisse Use delayed work thread to move buffer out of vram if they haven't been use over some period of time. This allow to make room for buffer that are actively use. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon.h| 13 ++ drivers/gpu/drm/radeon/radeon_cs

[PATCH] drm/radeon: fix amd afusion gpu setup aka sumo v2

2012-12-11 Thread j . glisse
From: Jerome Glisse Set the proper number of tile pipe that should be a multiple of pipe depending on the number of se engine. Fix: https://bugs.freedesktop.org/show_bug.cgi?id=56405 https://bugs.freedesktop.org/show_bug.cgi?id=56720 v2: Don't change sumo2 Signed-off-by: Jerome Glisse Cc: sta

[PATCH] drm/radeon: fix fence driver for dma ring when wb is disabled

2012-12-12 Thread j . glisse
From: Jerome Glisse The dma ring can't write to register thus have to write to memory its fence value. This ensure that it doesn't try to use scratch register for dma ring fence driver. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/r600.c | 3 ++- drivers/gpu/drm/radeon/radeo

[PATCH] drm/radeon: fix htile buffer size computation for command stream checker

2012-12-13 Thread j . glisse
From: Jerome Glisse Fix the size computation of the htile buffer. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/evergreen_cs.c | 17 +-- drivers/gpu/drm/radeon/r600_cs.c | 92 --- drivers/gpu/drm/radeon/radeon_drv.c | 3 +- 3 files changed,

[PATCH] drm/radeon: resume fence driver to last sync sequence on lockup

2012-12-14 Thread j . glisse
From: Jerome Glisse After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon

[PATCH] drm/radeon: restore modeset late in GPU reset path

2012-12-14 Thread j . glisse
From: Jerome Glisse Modeset path seems to conflict sometimes with the memory management leading to kernel deadlock. This move modesetting reset after GPU acceleration reset. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 dele

[PATCH] drm/radeon: don't leave fence blocked process on failed GPU reset

2012-12-17 Thread j . glisse
From: Jerome Glisse Force all fence to signal if GPU reset failed so no process get stuck on waiting fence. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon.h| 1 + drivers/gpu/drm/radeon/radeon_device.c | 1 + drivers/gpu/drm/radeon/radeon_fence.c | 19 +++

[PATCH] drm/radeon: avoid deadlock in pm path when waiting for fence

2012-12-17 Thread j . glisse
From: Jerome Glisse radeon_fence_wait_empty_locked should not trigger GPU reset as no place where it's call from would benefit from such thing and it actually lead to a kernel deadlock in case the reset is triggered from pm codepath. Instead force ring completion in place where it makes sense or

[PATCH] drm/radeon: add support for MEM_WRITE packet

2012-12-19 Thread j . glisse
From: Jerome Glisse To make it easier to debug some lockup from userspace add support to MEM_WRITE packet. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/evergreen_cs.c | 29 + drivers/gpu/drm/radeon/r600_cs.c | 29 + driver

[PATCH 1/2] drm/radeon: add debugfs file for dma rings

2013-01-02 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_ring.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index ebd6956..9410e43 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c

[PATCH 2/2] drm/radeon: print dma status reg on lockup

2013-01-02 Thread j . glisse
From: Jerome Glisse To help debug dma related lockup. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/evergreen.c | 4 drivers/gpu/drm/radeon/evergreend.h | 3 +++ drivers/gpu/drm/radeon/ni.c | 4 drivers/gpu/drm/radeon/nid.h| 1 - drivers/gpu/drm/radeon/r600

[PATCH 1/2] drm/radeon: improve ring debugfs printing

2013-01-02 Thread j . glisse
From: Jerome Glisse Print 32dword before last know rptr as problem most likely comes from previous command. Also small cosmetic change to the printing. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_ring.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions

[PATCH 2/2] drm/radeon: reset dma engine on gpu reset

2013-01-02 Thread j . glisse
From: Jerome Glisse This try to reset the dma engine when performing gpu reset. Hopefully bringing back the gpu dma engine in sane state. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/evergreen.c | 30 +- drivers/gpu/drm/radeon/evergreend.h | 10 +

[PATCH] radeon/kms: force rn50 chip to always report connected on analog output

2013-01-08 Thread j . glisse
From: Jerome Glisse Those rn50 chip are often connected to console remoting hw and load detection often fails with those. Just don't try to load detect and report connect. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 8 1 file changed, 8 insertion

[PATCH 1/2] radeon/kms: fix dma relocation checking

2013-01-09 Thread j . glisse
From: Jerome Glisse We were checking the index against the size of the relocation buffer instead of against the last index. This fix kernel segfault when userspace submit ill formated command stream/relocation buffer pair. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/r600_cs.c | 6 +

[PATCH 2/2] radeon/kms: cleanup async dma packet checking

2013-01-09 Thread j . glisse
From: Jerome Glisse This simplify and cleanup the async dma checking. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/evergreen.c| 16 +- drivers/gpu/drm/radeon/evergreen_cs.c | 807 +- drivers/gpu/drm/radeon/evergreend.h | 29 +- 3 files changed

[PATCH] drm/radeon: improve semaphore debugging on lockup

2013-01-11 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon.h | 2 ++ drivers/gpu/drm/radeon/radeon_ring.c | 2 ++ drivers/gpu/drm/radeon/radeon_semaphore.c | 4 3 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/g

[PATCH] drm/radeon: fix cursor corruption on aruba and newer

2013-01-21 Thread j . glisse
From: Jerome Glisse Aruba and newer gpu does not need the avivo cursor work around, quite the opposite this work around lead to corruption. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/dr

[PATCH] drm/radeon: avoid turning off spread spectrum for used pll

2012-08-17 Thread j . glisse
From: Jerome Glisse If spread spectrum is enabled and in use for a given pll we should not turn it off as it will lead to turning off display for crtc that use the pll (this behavior was observed on chelsea edp). Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/atombios_crtc.c | 25 ++

[PATCH] drm/radeon: force dma32 on rs400, rs690, rs740 IGP

2012-08-28 Thread j . glisse
From: Jerome Glisse It seems some of those IGP dislike non dma32 page. https://bugzilla.redhat.com/show_bug.cgi?id=785375 Signed-off-by: Jerome Glisse Cc: --- drivers/gpu/drm/radeon/radeon_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/rad

[PATCH] drm/radeon: force dma32 to fix regression rs4xx,rs6xx,rs740

2012-08-28 Thread j . glisse
From: Jerome Glisse It seems some of those IGP dislike non dma32 page despite what documentation says. Fix regression since we allowed non dma32 pages. It seems it only affect some revision of those IGP chips as we don't know which one just force dma32 for all of them. https://bugzilla.redhat.co

[PATCH] drm/ttm: Pass the buffer object on backend creation

2011-10-10 Thread j . glisse
From: Jerome Glisse In case of multiple page table for GART, driver want to know which buffer object is being bind/unbind. This allow driver to bind/unbind buffer object from several different GART. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c |3 ++- drivers/gpu

[PATCH] drm/radeon/kms: consolidate GART code, fix memory fault after GPU lockup

2011-10-13 Thread j . glisse
From: Jerome Glisse After GPU lockup VRAM gart table is unpinned and thus its pointer becomes unvalid. This patch move the unpin code to a common helper function and set pointer to NULL so that page update code can check if it should update GPU page table or not. That way bo still bound to GART c

[PATCH] drm/radeon: avoid bouncing connector status btw disconnected & unknown

2011-10-24 Thread j . glisse
From: Jerome Glisse Since force handling rework of d0d0a225e6ad43314c9aa7ea081f76adc5098ad4 we could end up bouncing connector status btw disconnected and unknown. When connector status change a call to output_poll_changed happen which in turn ask again for detect but with force set. So set the

[PATCH] drm/radeon: flush read cache for gtt with fence on r6xx and newer GPU V2

2011-10-26 Thread j . glisse
From: Jerome Glisse Cayman seems to be particularly sensitive to read cache returning old data after bind/unbind to GTT. Flush read cache for GTT range with each fences for all new hw. Should fix several rendering glitches. Like V2 flush whole address space https://bugs.freedesktop.org/show_bug

[PATCH] drm/radeon: flush read cache for gtt with fence on r6xx and newer GPU V3

2011-10-26 Thread j . glisse
From: Jerome Glisse Cayman seems to be particularly sensitive to read cache returning old data after bind/unbind to GTT. Flush read cache for GTT range with each fences for all new hw. Should fix several rendering glitches. Like V2 flush whole address space V3 also flush shader read cache https

[PATCH] drm/radeon: set hpd polarity at init time so hotplug detect works

2011-10-28 Thread j . glisse
From: Jerome Glisse Polarity needs to be set accordingly to connector status (connected or disconnected). Set it up at module init so first hotplug works reliably no matter what is the initial set of connector. Signed-off-by: Jerome Glisse cc: sta...@kernel.org --- drivers/gpu/drm/radeon/radeo

[RFC] ttm merge ttm_backend & ttm_t V2

2011-11-02 Thread j . glisse
Hi, So attached is last batch of patch, i split the ttm put page fix and i fixed a bug in the pages alloc when clear flags wasn't set. I tested them on a bunch of radeon and everythings seems fine (several gl app, firefox, compositor ...). I will do more testing on agp and nouveau tomorrow. The l

[PATCH 1/8] drm/ttm: remove userspace backed ttm object support

2011-11-02 Thread j . glisse
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/d

[PATCH 2/8] drm/ttm: remove split btw highmen and lowmem page

2011-11-02 Thread j . glisse
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 3/8] drm/ttm: remove unused backend flags field

2011-11-02 Thread j . glisse
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 insertions(+), 3 deletions(-) diff

[PATCH 4/8] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-02 Thread j . glisse
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/

[PATCH 5/8] drm/ttm: convert page allocation to use page ptr array instead of list V2

2011-11-02 Thread j . glisse
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set Signed-off-by: Jerome Glisse ---

[PATCH 6/8] drm/ttm: test for dma_address array allocation failure

2011-11-02 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2dd45ca..58ea7dc 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/

[PATCH 7/8] drm/ttm: merge ttm_backend and ttm_tt

2011-11-02 Thread j . glisse
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c| 14 ++- drivers/

[PATCH 8/8] drm/ttm: introduce callback for ttm_tt populate & unpopulate

2011-11-02 Thread j . glisse
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. Signed-off-by: Jerome Glisse

[PATCH] drm/radeon/kms: consolidate GART code, fix segfault after GPU lockup V2

2011-11-03 Thread j . glisse
From: Jerome Glisse After GPU lockup VRAM gart table is unpinned and thus its pointer becomes unvalid. This patch move the unpin code to a common helper function and set pointer to NULL so that page update code can check if it should update GPU page table or not. That way bo still bound to GART c

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator

2011-11-03 Thread j . glisse
Hi, So updated patchset, only patch 5 seen change since last set. Last 3 patch are from your patchset, modified on top of mine. Konrad so i added you dma pool allocator on top of that and added support for it to radeon. All in all it's slightly smaller than your patchset. Biggest change is use o

[PATCH 01/11] drm/ttm: remove userspace backed ttm object support

2011-11-03 Thread j . glisse
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/d

[PATCH 02/11] drm/ttm: remove split btw highmen and lowmem page

2011-11-03 Thread j . glisse
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 03/11] drm/ttm: remove unused backend flags field

2011-11-03 Thread j . glisse
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 insertions(+), 3 deletions(-) diff

[PATCH 04/11] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-03 Thread j . glisse
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 files changed, 4 insertions(+), 1

[PATCH 05/11] drm/ttm: convert page allocation to use page ptr array instead of list V3

2011-11-03 Thread j . glisse
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 chec

[PATCH 06/11] drm/ttm: test for dma_address array allocation failure

2011-11-03 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2dd45ca..58ea7dc 100644 --- a/drivers

[PATCH 07/11] drm/ttm: merge ttm_backend and ttm_tt

2011-11-03 Thread j . glisse
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c| 14 ++- drivers/

[PATCH 08/11] drm/ttm: introduce callback for ttm_tt populate & unpopulate

2011-11-03 Thread j . glisse
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. Signed-off-by: Jerome Glisse

[PATCH 09/11] ttm: Provide DMA aware TTM page pool code.

2011-11-03 Thread j . glisse
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 10/11] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-03 Thread j . glisse
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 11/11] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on

2011-11-03 Thread j . glisse
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. CC: Dave Airlie CC: Alex Deucher Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Jerome Glisse

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator [FULL]

2011-11-07 Thread j . glisse
Ok so here is full patchset, including nouveau support, Ben if you could review (if change to nouveau in patch 7 are correct then others change to nouveau are more than likely 100% correct :)). So been tested on R7XX,EVERGREEN,CAICOS,CAYMAN with SWIOTLB. Also tested on NV50. I still need to test A

[PATCH 01/12] drm/ttm: remove userspace backed ttm object support

2011-11-07 Thread j . glisse
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/d

[PATCH 02/12] drm/ttm: remove split btw highmen and lowmem page

2011-11-07 Thread j . glisse
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 03/12] drm/ttm: remove unused backend flags field

2011-11-07 Thread j . glisse
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 insertions(+), 3 deletions(-) diff

[PATCH 04/12] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-07 Thread j . glisse
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 files changed, 4 insertions(+), 1

[PATCH 05/12] drm/ttm: convert page allocation to use page ptr array instead of list V3

2011-11-07 Thread j . glisse
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 chec

[PATCH 06/12] drm/ttm: test for dma_address array allocation failure

2011-11-07 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2dd45ca..58ea7dc 100644 --- a/drivers

[PATCH 07/12] drm/ttm: merge ttm_backend and ttm_tt

2011-11-07 Thread j . glisse
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/nouveau/

[PATCH 08/12] drm/ttm: introduce callback for ttm_tt populate & unpopulate

2011-11-07 Thread j . glisse
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. Signed-off-by: Jerome Glisse

[PATCH 09/12] ttm: Provide DMA aware TTM page pool code.

2011-11-07 Thread j . glisse
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 10/12] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-07 Thread j . glisse
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 11/12] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on

2011-11-07 Thread j . glisse
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. CC: Dave Airlie CC: Alex Deucher Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Jerome Glisse

[PATCH 12/12] nouveau/ttm/dma: Enable the TTM DMA pool if device can only do 32-bit DMA.

2011-11-07 Thread j . glisse
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. CC: Ben Skeggs CC: Francisco Jerez

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator

2011-11-09 Thread j . glisse
So i did an overhaul of ttm_memory, i believe the simplification i did make sense. See patch 5 for a longer explanation. Thomas with the ttm_memory change the allocation of pages won't happen if the accounting report that we are going over the limit and bo shrinker failed to free any memory to mak

[PATCH 01/13] drm/ttm: remove userspace backed ttm object support

2011-11-09 Thread j . glisse
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 02/13] drm/ttm: remove split btw highmen and lowmem page

2011-11-09 Thread j . glisse
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 03/13] drm/ttm: remove unused backend flags field

2011-11-09 Thread j . glisse
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 04/13] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-09 Thread j . glisse
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 05/13] drm/ttm: overhaul memory accounting

2011-11-09 Thread j . glisse
From: Jerome Glisse This is an overhaul of the ttm memory accounting. This tries to keep the same global behavior while removing the whole zone concept. It keeps a distrinction for dma32 so that we make sure that ttm don't starve the dma32 zone. There is 3 threshold for memory allocation : - max

[PATCH 06/13] drm/ttm: convert page allocation to use page ptr array instead of list V4

2011-11-09 Thread j . glisse
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 chec

[PATCH 07/13] drm/ttm: test for dma_address array allocation failure

2011-11-09 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 303bbb

[PATCH 08/13] drm/ttm: merge ttm_backend and ttm_tt V2

2011-11-09 Thread j . glisse
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. V2 Rebase on top of memory accountign overhaul Signed-off-by: Jerome Glisse Reviewed-by: Konr

[PATCH 09/13] drm/ttm: introduce callback for ttm_tt populate & unpopulate V2

2011-11-09 Thread j . glisse
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 11/13] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-09 Thread j . glisse
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 12/13] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on V2

2011-11-09 Thread j . glisse
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask CC: Dave Airlie CC: Alex Deucher Signed-off-by: K

[PATCH 13/13] drm/nouveau: enable the TTM DMA pool on 32-bit DMA only device V2

2011-11-09 Thread j . glisse
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask

Isolate dma information from ttm_tt

2011-11-09 Thread j . glisse
This apply on top of the ttm_tt & backend merge patchset. Cheers, Jerome ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 14/14] drm/ttm: isolate dma data from ttm_tt

2011-11-09 Thread j . glisse
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c | 18 + drivers/gpu/drm/nou

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator V4

2011-11-10 Thread j . glisse
So squeezed all to avoid any memory accouting messing, seems to work ok so far. Cheers, Jerome ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 01/13] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-10 Thread j . glisse
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 02/13] drm/ttm: remove userspace backed ttm object support

2011-11-10 Thread j . glisse
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 03/13] drm/ttm: remove split btw highmen and lowmem page

2011-11-10 Thread j . glisse
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 04/13] drm/ttm: remove unused backend flags field

2011-11-10 Thread j . glisse
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 05/13] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-10 Thread j . glisse
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 06/13] drm/ttm: test for dma_address array allocation failure

2011-11-10 Thread j . glisse
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 3fb4c6

[PATCH 07/13] drm/ttm: page allocation use page array instead of list

2011-11-10 Thread j . glisse
From: Jerome Glisse Use the ttm_tt pages array for pages allocations, move the list unwinding into the page allocation functions. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 85 +- drivers/gpu/drm/ttm/ttm_tt.c | 36 +++

[PATCH 09/13] drm/ttm: introduce callback for ttm_tt populate & unpopulate V4

2011-11-10 Thread j . glisse
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 08/13] drm/ttm: merge ttm_backend and ttm_tt V4

2011-11-10 Thread j . glisse
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting chang

[PATCH 10/13] drm/ttm: provide dma aware ttm page pool code V7

2011-11-10 Thread j . glisse
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

  1   2   3   4   >