Re: [RFC libdrm 0/2] Replace the build system with meson

2017-03-21 Thread Grazvydas Ignotas
It might make sense to give more attention to cmake just because many mesa-related projects are already using it: llvm, piglit, vulkan loader and demos, mesa-demos, etc. Not sure how well it supports BSDs and windows, but everyone building graphics stacks or contributing to mesa should already be c

[PATCH libdrm 3/3] amdgpu: vamgr can be a struct instead of a pointer

2017-01-28 Thread Grazvydas Ignotas
From: Alex Xie vamgr is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Signed-off-by: Alex Xie Reviewed-by: Christian König [Grazvydas Ignotas: rebase, correct a typo in commit message] --- amdgpu/amdgpu_dev

[PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer

2017-01-28 Thread Grazvydas Ignotas
From: Alex Xie vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Signed-off-by: Alex Xie Reviewed-by: Christian König [Grazvydas Ignotas: rebase, correct a typo in commit message] --- amdgpu/amdgpu_dev

[PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer

2017-01-28 Thread Grazvydas Ignotas
From: Alex Xie vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Signed-off-by: Alex Xie Reviewed-by: Christian König [Grazvydas Ignotas: rebase, correct a typo in commit message] --- amdgpu/amdgpu_dev

[PATCH libdrm 1/3] amdgpu: Free/uninit vamgr_32 in theoretically correct order

2017-01-28 Thread Grazvydas Ignotas
From: Alex Xie vamgr_32 is a region inside general VAM range. It is better to free and deinitialize it before general VAM range. Signed-off-by: Alex Xie Reviewed-by: Christian König --- amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amdgpu/amdgp

[PATCH libdrm 0/3] some -pro patches for integration

2017-01-28 Thread Grazvydas Ignotas
I've taken several patches from amdgpu-pro libdrm that look useful to me and I think can be applied already. The only things I did was rebasing, fixing some typos and dropping Change-Id. Alex Xie (3): amdgpu: Free/uninit vamgr_32 in theoretically correct order amdgpu: vamgr can be a struct ins

[PATCH 1/1] drm/amd/amdgpu: get maximum and used UVD handles (v3)

2016-12-16 Thread Grazvydas Ignotas
On Thu, Dec 15, 2016 at 4:12 PM, Christian König wrote: > > Regarding which error code to return I think that Emil has the right idea > here. > > Returning -EINVAL usually means that userspace provided an invalid value, > but in this case it doesn't matter which value the UMD provide all of them

[PATCH 1/1] drm/amd/amdgpu: get maximum and used UVD handles (v3)

2016-12-15 Thread Grazvydas Ignotas
On Thu, Dec 15, 2016 at 1:47 PM, Nath, Arindam wrote: >>-Original Message- >>From: Emil Velikov [mailto:emil.l.velikov at gmail.com] >>Sent: Thursday, December 15, 2016 5:01 PM >>To: Nath, Arindam >>Cc: David Airlie; Deucher, Alexander; amd-gfx mailing list; ML dri-devel; >>Koenig, Christi

[PATCH libdrm] xf86drm: fix aliasing violation

2016-12-13 Thread Grazvydas Ignotas
On Mon, Dec 12, 2016 at 3:59 PM, Emil Velikov wrote: > On 11 December 2016 at 18:03, Grazvydas Ignotas wrote: >> Just tell the compiler that drm_event will alias the char buffer, >> so that it has no excuse to warn or generate bad code. >> > Afacit this patch [1] from

[PATCH libdrm] xf86drm: fix aliasing violation

2016-12-11 Thread Grazvydas Ignotas
Just tell the compiler that drm_event will alias the char buffer, so that it has no excuse to warn or generate bad code. Signed-off-by: Grazvydas Ignotas --- Android.mk | 1 + configure.ac| 9 + libdrm_macros.h | 6 ++ xf86drmMode.c | 11 +++ 4 files changed

[PATCH libdrm] xf86drm: fix sign-compare warning

2016-12-11 Thread Grazvydas Ignotas
xf86drm.c:3601:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (expected < sizeof(match)) { ^ Signed-off-by: Grazvydas Ignotas --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drm.

[PATCH libdrm] tests: kms: fix shadowed declaration warning

2016-11-20 Thread Grazvydas Ignotas
There is no need to maintain the value in the shadowed variable from what I can see. Signed-off-by: Grazvydas Ignotas --- tests/kms/kms-universal-planes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms/kms-universal-planes.c b/tests/kms/kms-universal-planes.c

[PATCH libdrm] libdrm: random typo fixes

2016-11-20 Thread Grazvydas Ignotas
Just some trivial boring typo fixes all over the tree. READMEs and comments only. Signed-off-by: Grazvydas Ignotas --- README| 2 +- include/drm/README| 2 +- intel/intel_bufmgr_fake.c | 4 ++-- intel/intel_bufmgr_gem.c | 6 +++--- radeon/radeon_cs_gem.c| 10

[PATCH] drm/amdgpu: release parent fence reference

2016-10-24 Thread Grazvydas Ignotas
On Mon, Oct 24, 2016 at 12:13 PM, Christian König wrote: > Am 24.10.2016 um 04:25 schrieb zhoucm1: >> >> >> >> On 2016年10月24日 02:31, Grazvydas Ignotas wrote: >>> >>> It's done in amd_sched_hw_job_reset(), but not in normal job

Re: 答复: [PATCH] drm/amdgpu: fix fence slab teardown

2016-10-24 Thread Grazvydas Ignotas
On Mon, Oct 24, 2016 at 6:35 AM, Qu, Jim wrote: > I did observed the issue when replace kernel module use DKMS, and it maybe > get error at reboot, got calltrace: > > [ 3529.525360] > = > [ 3529.525361] BUG amd_sched_fen

[PATCH] drm/amdgpu: update kernel-doc for some functions

2016-10-23 Thread Grazvydas Ignotas
The names were wrong. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/scheduler/sched_fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/scheduler/sched_fence.c b/drivers/gpu/drm/amd/scheduler/sched_fence.c index 6b63bea..3653b5a 100644

[PATCH] drm/amdgpu: release parent fence reference

2016-10-23 Thread Grazvydas Ignotas
It's done in amd_sched_hw_job_reset(), but not in normal job processing. Leak reported by CONFIG_SLUB_DEBUG. Signed-off-by: Grazvydas Ignotas --- CONFIG_SLUB_DEBUG reports more leaks related to ioctls, but I was unable to track them down... drivers/gpu/drm/amd/scheduler/gpu_scheduler.

[PATCH] drm/amdgpu: fix a vm_flush fence leak

2016-10-23 Thread Grazvydas Ignotas
Looks like .last_flush reference is left at teardown. Leak reported by CONFIG_SLUB_DEBUG. Fixes: 41d9eb2c5a2a ("drm/amdgpu: add a fence after the VM flush") Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH] drm/amdgpu: fix sched fence slab teardown

2016-10-23 Thread Grazvydas Ignotas
get a crash in one of rcu threads because callback is called after amdgpu has already been unloaded. Fix it with a rcu_barrier(). Fixes: 189e0fb76304 ("drm/amdgpu: RCU protected amd_sched_fence_release") Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/scheduler/gpu_scheduler.

[PATCH] drm/amdgpu: fix fence slab teardown

2016-10-23 Thread Grazvydas Ignotas
a crash in one of rcu threads because callback is called after amdgpu has already been unloaded. Fix it with a rcu_barrier(). Fixes: b44135351a3a ("drm/amdgpu: RCU protected amdgpu_fence_release") Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 1

[PATCH] drm/amd/powerplay: don't give up if DPM is already running

2016-10-15 Thread Grazvydas Ignotas
Hi, On Thu, Oct 13, 2016 at 10:45 AM, Zhu, Rex wrote: > > The attached patches were also for this issue. > Disable dpm when rmmod amdgpu. It works for modprobe-rmmod-modprobe test, thanks. However with GPU passthrough (giving control of the GPU to a Windows virtual machine using iommu, then shu

[PATCH] drm/amd/powerplay: don't give up if DPM is already running

2016-10-09 Thread Grazvydas Ignotas
ice_init+0x1aeb/0x2490 [amdgpu] Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index f

[PATCH] drm/amdgpu: use .early_unregister hook to remove DP AUX i2c

2016-10-09 Thread Grazvydas Ignotas
7;i2c-12' To fix it, we can use the .early_unregister hook to unregister the i2c adapter before drm_connector's sysfs is torn down. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-)

[PATCH] drm: use the right function name in documentation

2016-10-09 Thread Grazvydas Ignotas
There is no late_unregister(), it looks like the comment meant late_register(). Also fix a typo while at it. Signed-off-by: Grazvydas Ignotas --- include/drm/drm_connector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_connector.h b/include/drm

[PATCH] drm/amdgpu: warn if dp aux is still attached on free

2016-10-03 Thread Grazvydas Ignotas
t and warn early. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c| 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/a

[PATCH] drm/amdgpu/dce11: add missing drm_mode_config_cleanup call

2016-10-03 Thread Grazvydas Ignotas
All other amdgpu/dce_v* files have this call, it's only mysteriously missing from dce_v11_0.c since the file was added and causes leaks. Fixes: aaa36a976bbb ("drm/amdgpu: Add initial VI support") Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 +

[PATCH] drm/amdgpu: also track late init state

2016-10-03 Thread Grazvydas Ignotas
Successful sw_init() and hw_init() states are tracked, but not late_init(). Various error paths may result in amdgpu_fini() being called before .late init is done, so late_init needs to be tracked to avoid unexpected or multiple .late_fini() calls. Signed-off-by: Grazvydas Ignotas --- drivers

[PATCH] drm/amdgpu: disable CRTCs before teardown

2016-09-27 Thread Grazvydas Ignotas
On Mon, Sep 26, 2016 at 8:29 PM, Lukas Wunner wrote: > On Sun, Sep 25, 2016 at 11:34:48PM +0300, Grazvydas Ignotas wrote: >> Some code called by drm_crtc_force_disable_all() wants to wait for all >> fences, so only do fence teardown after CRTCs are disabled. > > Ugh, how e

[PATCH] drm/amdgpu/i2c: add const where appropriate

2016-09-25 Thread Grazvydas Ignotas
Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 14 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h | 14 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu/vce3: don't forget to tear down some rings

2016-09-25 Thread Grazvydas Ignotas
We can use .num_rings for that. Fixes: 6f0359ff7307 ("vce3: add support for third vce ring") Cc: Alex Deucher Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH] drm/amdgpu: disable CRTCs before teardown

2016-09-25 Thread Grazvydas Ignotas
Some code called by drm_crtc_force_disable_all() wants to wait for all fences, so only do fence teardown after CRTCs are disabled. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH] drm/amdgpu: clear ring pointer in amdgpu_device on teardown

2016-09-25 Thread Grazvydas Ignotas
This is in symmetry to setup done in amdgpu_ring_init. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 777f11b..e1fa873

[PATCH] drm/amdgpu: don't leave dangling pointers around

2016-09-25 Thread Grazvydas Ignotas
it's better to clear them and get NULL dereference so that it's obvious what's going wrong. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[PATCH 0/4] some optimization for evergreen cs

2015-09-23 Thread Grazvydas Ignotas
On Sun, Aug 23, 2015 at 3:57 AM, Grazvydas Ignotas wrote: > These patches try to reduce CPU usage of register command checker > without affecting functionality. > For me this gives 3-4% perf improvement in glxgears and ~1% CPU usage > reduction > in "The Talos Principle"

[PATCH 4/4] drm/radeon: remove volatile qualifier

2015-08-23 Thread Grazvydas Ignotas
barriers or accessor functions should be used, but it doesn't look like that is needed here. While at it, change the type to match the one in radeon_ib structure. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/radeon/evergreen_cs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH 3/4] drm/radeon: refactor register check loop

2015-08-23 Thread Grazvydas Ignotas
(PACKET3_SET_CONTEXT_REG_END >> 7) < REG_SAFE_BM_SIZE. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/radeon/evergreen_cs.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 4453799

[PATCH 2/4] drm/radeon: split evergreen_cs_check_reg

2015-08-23 Thread Grazvydas Ignotas
allee-save registers which according to perf is taking significant amount of time. To avoid this, we can reuse evergreen_is_safe_reg() to do the early check directly in register loop. Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/radeon/evergreen_cs.c | 49 +++--

[PATCH 1/4] drm/radeon: simplify register checker

2015-08-23 Thread Grazvydas Ignotas
To avoid having to distinguish between CAYMAN or older on every register check, place a pointer in evergreen_cs_track and use it unconditionally. Also make use of the fact that both reg_safe_bm[] arrays are of the same length to remove another CAYMAN check. Signed-off-by: Grazvydas Ignotas

[PATCH 0/4] some optimization for evergreen cs

2015-08-23 Thread Grazvydas Ignotas
These patches try to reduce CPU usage of register command checker without affecting functionality. For me this gives 3-4% perf improvement in glxgears and ~1% CPU usage reduction in "The Talos Principle" CS thread. Grazvydas Ignotas (4): drm/radeon: simplify register checker drm/rad

[PATCH] drm/omap: fix plane rotation

2014-04-08 Thread Grazvydas Ignotas
Gra?vydas On Mon, Apr 7, 2014 at 8:17 PM, Rob Clark wrote: > On Mon, Apr 7, 2014 at 6:32 AM, Grazvydas Ignotas > wrote: >> On Sun, Apr 6, 2014 at 12:45 AM, Rob Clark wrote: >>> On Sat, Apr 5, 2014 at 2:33 PM, Grazvydas Ignotas >>> wrote: >>>> Plane

[PATCH] drm/omap: fix plane rotation

2014-04-07 Thread Grazvydas Ignotas
On Sun, Apr 6, 2014 at 12:45 AM, Rob Clark wrote: > On Sat, Apr 5, 2014 at 2:33 PM, Grazvydas Ignotas > wrote: >> Plane rotation with omapdrm is currently broken. >> It seems omap_plane_mode_set() expects width and height in screen >> coordinates, so pass it like t

[PATCH] drm/omap: fix plane rotation

2014-04-05 Thread Grazvydas Ignotas
Plane rotation with omapdrm is currently broken. It seems omap_plane_mode_set() expects width and height in screen coordinates, so pass it like that. Cc: Rob Clark Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/omapdrm/omap_plane.c |8 1 file changed, 8 insertions(+) diff