writing custom driver for VGA emulation ?

2020-02-17 Thread Yusuf Altıparmak
Hello AMD team; I have E 9171 GPU and want to use it on a embedded system which has limited MMIO space on PCIe bus (MAX 512 MB). I received feedbacks that I can only use VGA emulation with this memory space. I was unable to get 'amdgpu' driver working with Xorg due to I had many errors(firmwares

[PATCH] drm/amdgpu: fix the wrong logic checking when secure buffer is created

2020-02-17 Thread Huang Rui
While the current amdgpu doesn't support TMZ, it will return the error if user mode would like to allocate secure buffer. Fixes: 17d907c drm/amdgpu: implement TMZ accessor (v3) Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1

[RFC PATCH v5] drm/amdgpu: Remove kfd eviction fence before release bo

2020-02-17 Thread xinhui pan
No need to trigger eviction as the memory mapping will not be used anymore. All pt/pd bos share same resv, hence the same shared eviction fence. Everytime page table is freed, the fence will be signled and that cuases kfd unexcepted evictions. Signed-off-by: xinhui pan CC: Christian König CC:

RE: [PATCH] drm/amdgpu/smu: add an update table lock

2020-02-17 Thread Quan, Evan
Hi Alex, Did you seen any issue caused by this? Regards, Evan -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Tuesday, February 18, 2020 5:38 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdgpu/smu: add an update table lock The

[PATCH 3/3] drm/amdgpu: fix colliding of preemption

2020-02-17 Thread Monk Liu
what: some os preemption path is messed up with world switch preemption fix: cleanup those logics so os preemption not mixed with world switch this patch is a general fix for issues comes from SRIOV MCBP, but there is still UMD side issues not resovlved yet, so this patch cannot fix all world

[PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV

2020-02-17 Thread Monk Liu
SWDEV-220810 - some register access from VF is wrong 1) we shouldn't load PSP kdb and sys/sos for VF, they are supposed to be handled by hypervisor 2) ih reroute doesn't work on VF thus we should avoid calling it, besides VF should not use those PSP register sets for PF 3) shouldn't load SMU

[PATCH 2/3] drm/amdgpu: fix memory leak during TDR test

2020-02-17 Thread Monk Liu
fix system memory leak regression introduced by this previous change of 201331 - Single VF Mode Test Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c

[PATCH] drm/amdgpu/smu: add an update table lock

2020-02-17 Thread Alex Deucher
The driver uses a staging buffer to update tables in the SMU. Add a lock to make sure we don't try and do this concurrently by accident. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 7 ++- drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 + 2 files

Re: [PATCH 4/8] drm/nouveau: don't use ttm bo->offset

2020-02-17 Thread Nirmoy
On 2/17/20 4:57 PM, Alex Deucher wrote: On Mon, Feb 17, 2020 at 10:02 AM Nirmoy Das wrote: Store ttm bo->offset in struct nouveau_bo instead. Signed-off-by: Nirmoy Das Christian König Missing Acked or Reviewed prefix for Christian. :facepalm: Thanks Alex. Nirmoy Alex ---

Re: [PATCH 4/8] drm/nouveau: don't use ttm bo->offset

2020-02-17 Thread Alex Deucher
On Mon, Feb 17, 2020 at 10:02 AM Nirmoy Das wrote: > > Store ttm bo->offset in struct nouveau_bo instead. > > Signed-off-by: Nirmoy Das > Christian König Missing Acked or Reviewed prefix for Christian. Alex > --- > drivers/gpu/drm/nouveau/dispnv04/crtc.c | 6 +++--- >

Re: [PATCH] drm/amdgpu: Add a GEM_CREATE mask and bugfix

2020-02-17 Thread Christian König
Am 17.02.20 um 15:44 schrieb Alex Deucher: On Fri, Feb 14, 2020 at 7:17 PM Luben Tuikov wrote: Add a AMDGPU_GEM_CREATE_MASK and use it to check for valid/invalid GEM create flags coming in from userspace. Fix a bug in checking whether TMZ is supported at GEM create time. Signed-off-by: Luben

Re: [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset

2020-02-17 Thread Christian König
Am 17.02.20 um 16:04 schrieb Nirmoy Das: Switch over to GEM VRAM's implementation to retrieve bo->offset Signed-off-by: Nirmoy Das Acked-by: Christian König --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 4/8] drm/nouveau: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Store ttm bo->offset in struct nouveau_bo instead. Signed-off-by: Nirmoy Das Christian König --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 6 +++--- drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/overlay.c | 6 +++---

[PATCH 5/8] drm/qxl: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
This patch also removes slot->gpu_offset which is not required as VRAM and PRIV slot are in separate PCI bar Signed-off-by: Nirmoy Das Acked-by: Christian König Acked-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 6 ++ drivers/gpu/drm/qxl/qxl_kms.c| 5 ++---

[PATCH 3/8] drm/vmwgfx: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset within vmwgfx driver itself without depending on bo->offset Signed-off-by: Nirmoy Das Acked-by: Christian König --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-

[PATCH 6/8] drm/vram-helper: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset within vram-helper without depending on bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index

[PATCH 1/8] drm/amdgpu: move ttm bo->offset to amdgpu_bo

2020-02-17 Thread Nirmoy Das
GPU address should belong to driver not in memory management. This patch moves ttm bo.offset and gpu_offset calculation to amdgpu driver. Signed-off-by: Nirmoy Das Acked-by: Huang Rui Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 22 ++--

[PATCH 2/8] drm/radeon: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset in radeon_bo_gpu_offset without depending on bo->offset Signed-off-by: Nirmoy Das Reviewed-and-tested-by: Christian König --- drivers/gpu/drm/radeon/radeon.h| 1 + drivers/gpu/drm/radeon/radeon_object.h | 16 +++- drivers/gpu/drm/radeon/radeon_ttm.c

[PATCH 0/8] do not store GPU address in TTM

2020-02-17 Thread Nirmoy Das
With this patch series I am trying to remove GPU address dependency in TTM and moving GPU address calculation to individual drm drivers. I tested this patch series on qxl, bochs and amdgpu. Christian tested it on radeon HW. It would be nice if someone test this for nouveau and vmgfx. Nirmoy Das

[PATCH 8/8] drm/ttm: do not keep GPU dependent addresses

2020-02-17 Thread Nirmoy Das
GPU address handling is device specific and should be handle by its device driver. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/ttm/ttm_bo.c| 7 --- include/drm/ttm/ttm_bo_api.h| 2 -- include/drm/ttm/ttm_bo_driver.h | 1 - 3 files changed, 10 deletions(-) diff --git

[PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset

2020-02-17 Thread Nirmoy Das
Switch over to GEM VRAM's implementation to retrieve bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index

Re: [PATCH] drm/amdgpu: Add a GEM_CREATE mask and bugfix

2020-02-17 Thread Alex Deucher
On Fri, Feb 14, 2020 at 7:17 PM Luben Tuikov wrote: > > Add a AMDGPU_GEM_CREATE_MASK and use it to check > for valid/invalid GEM create flags coming in from > userspace. > > Fix a bug in checking whether TMZ is supported at > GEM create time. > > Signed-off-by: Luben Tuikov > --- >

Re: [PATCH 6/7] drm/bochs: don't use ttm bo->offset

2020-02-17 Thread Nirmoy
On 2/17/20 1:41 PM, Gerd Hoffmann wrote: On Mon, Feb 17, 2020 at 11:18:40AM +0100, Nirmoy Das wrote: Calculate GPU offset within bochs driver itself without depending on bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/bochs/bochs_kms.c | 3 ++-

Re: [PATCH 6/7] drm/bochs: don't use ttm bo->offset

2020-02-17 Thread Gerd Hoffmann
On Mon, Feb 17, 2020 at 11:18:40AM +0100, Nirmoy Das wrote: > Calculate GPU offset within bochs driver itself without depending on > bo->offset > > Signed-off-by: Nirmoy Das > --- > drivers/gpu/drm/bochs/bochs_kms.c | 3 ++- > drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- > 2 files changed,

Re: [PATCH 5/7] drm/qxl: don't use ttm bo->offset

2020-02-17 Thread Gerd Hoffmann
On Mon, Feb 17, 2020 at 11:18:39AM +0100, Nirmoy Das wrote: > This patch also removes slot->gpu_offset which is not required as > VRAM and PRIV slot are in separate PCI bar Well, gpu_offset is still in struct qxlslot ... Other than that the patch looks fine, and this is minor enough that I'll

Re: [PATCH 4/7] drm/nouveau: don't use ttm bo->offset

2020-02-17 Thread Christian König
Am 17.02.20 um 11:18 schrieb Nirmoy Das: Store ttm bo->offset in struct nouveau_bo instead. Signed-off-by: Nirmoy Das Acked-by: Christian König for this one and patch #5 and #6 in this series. --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 6 +++---

Re: [PATCH 3/7] drm/vmwgfx: don't use ttm bo->offset

2020-02-17 Thread Nirmoy
On 2/17/20 12:09 PM, Christian König wrote: Am 17.02.20 um 11:18 schrieb Nirmoy Das: Calculate GPU offset within vmwgfx driver itself without depending on bo->offset Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++--   drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c  

Re: [PATCH 3/7] drm/vmwgfx: don't use ttm bo->offset

2020-02-17 Thread Christian König
Am 17.02.20 um 11:18 schrieb Nirmoy Das: Calculate GPU offset within vmwgfx driver itself without depending on bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c| 2 +-

Re: [PATCH 1/7] drm/amdgpu: move ttm bo->offset to amdgpu_bo

2020-02-17 Thread Christian König
Am 17.02.20 um 11:18 schrieb Nirmoy Das: GPU address should belong to driver not in memory management. This patch moves ttm bo.offset and gpu_offset calculation to amdgpu driver. Signed-off-by: Nirmoy Das Acked-by: Huang Rui Reviewed-by: Christian König ---

Re: [PATCH] drm/amdgpu: drop the non-sense firmware version check on arcturus

2020-02-17 Thread Christian König
Am 17.02.20 um 11:32 schrieb Evan Quan: As the firmware versions of arcturus are different from other gfx9 ASICs. And the warning("CP firmware version too old, please update!") caused by this check can be eliminated. Change-Id: I04ab0e435b6ff9712be502e6ebb8d6e1f0a776d8 Signed-off-by: Evan Quan

[PATCH] drm/amdgpu: drop the non-sense firmware version check on arcturus

2020-02-17 Thread Evan Quan
As the firmware versions of arcturus are different from other gfx9 ASICs. And the warning("CP firmware version too old, please update!") caused by this check can be eliminated. Change-Id: I04ab0e435b6ff9712be502e6ebb8d6e1f0a776d8 Signed-off-by: Evan Quan ---

[PATCH 5/7] drm/qxl: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
This patch also removes slot->gpu_offset which is not required as VRAM and PRIV slot are in separate PCI bar Signed-off-by: Nirmoy Das --- drivers/gpu/drm/qxl/qxl_drv.h| 5 ++--- drivers/gpu/drm/qxl/qxl_kms.c| 5 ++--- drivers/gpu/drm/qxl/qxl_object.h | 5 -

[PATCH 6/7] drm/bochs: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset within bochs driver itself without depending on bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/bochs/bochs_kms.c | 3 ++- drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 0/6] do not store GPU address in TTM

2020-02-17 Thread Nirmoy Das
With this patch series I am trying to remove GPU address dependency in TTM and moving GPU address calculation to individual drm drivers. I tested this patch series on qxl, bochs and amdgpu. Christian tested it on radeon HW. It would be nice if someone test this for nouveau and vmgfx. Nirmoy

[PATCH 3/7] drm/vmwgfx: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset within vmwgfx driver itself without depending on bo->offset Signed-off-by: Nirmoy Das --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-

[PATCH 4/7] drm/nouveau: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Store ttm bo->offset in struct nouveau_bo instead. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 6 +++--- drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/overlay.c | 6 +++--- drivers/gpu/drm/nouveau/dispnv50/base507c.c |

[PATCH 2/7] drm/radeon: don't use ttm bo->offset

2020-02-17 Thread Nirmoy Das
Calculate GPU offset in radeon_bo_gpu_offset without depending on bo->offset Signed-off-by: Nirmoy Das Reviewed-and-tested-by: Christian König --- drivers/gpu/drm/radeon/radeon.h| 1 + drivers/gpu/drm/radeon/radeon_object.h | 16 +++- drivers/gpu/drm/radeon/radeon_ttm.c

[PATCH 7/7] drm/ttm: do not keep GPU dependent addresses

2020-02-17 Thread Nirmoy Das
GPU address handling is device specific and should be handle by its device driver. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/ttm/ttm_bo.c| 7 --- include/drm/ttm/ttm_bo_api.h| 2 -- include/drm/ttm/ttm_bo_driver.h | 1 - 3 files changed, 10 deletions(-) diff --git

[PATCH 1/7] drm/amdgpu: move ttm bo->offset to amdgpu_bo

2020-02-17 Thread Nirmoy Das
GPU address should belong to driver not in memory management. This patch moves ttm bo.offset and gpu_offset calculation to amdgpu driver. Signed-off-by: Nirmoy Das Acked-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 22 ++--