Commit Graph

209 Commits (ebbb8f9cbfc3b51d52e6fe3b146ea824030eb48a)

Author SHA1 Message Date
monk.liu 3b50db9d9f amdgpu: fix segfault when resources are NULL
Signed-off-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05 13:47:49 -04:00
Christian König c68d58aa14 amdgpu: compare the primary device names instead
Instead of taking a look at the device major/minor we
just compare the primary device name to figure out if
two fds are pointing to the same device.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:49 -04:00
Christian König 6dc2eaf2cc amdgpu: add public bo list interface v3
v2: cleanup comments and function parameter
v3: rebased on internal branch

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
Christian König 9c2afffedb amdgpu: cleanup public interface v2
Remove the mostly unused device parameter, for the few cases
where we really need it keep a copy in the context structure.

v2: rebased on internal branch

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
monk.liu 9c3bec246e amdgpu: do not call BO_LIST ioctl when no resource referred
Signed-off-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
monk.liu 83d9369583 amdgpu: fix an error of bo_list handler
original method is just totally wrong, it loses the bo_list handler at
all after command stream accomplished

Signed-off-by: Monk.Liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
monk.liu cc01c3cb5a amdgpu: add missing mutex lock/unlock pair
Signed-off-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
monk.liu 2f2c8ac0f4 amdgpu: support non-page-aligned userptr
Signed-off-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
Alex Deucher 0936139536 drm: add libdrm_amdgpu (v7)
This is the new ioctl wrapper used by the new admgpu driver.
It's primarily used by xf86-video-amdgpu and mesa.

v2: fix amdgpu_drm.h install
v3: Integrate some of the sugestions from Emil:
    clean up Makefile.am, configure.ac
    capitalize header guards
    fix _FILE_OFFSET_BITS with config.h
    use drm_mmap/drm_munmap
    Remove unused ARRAY_SIZE macro
    use shared list implementation
    use shared math implementation
    use drmGetNodeTypeFromFd helper
v4: remove unused tiling defines
v5: include amdgpu.h in Makefile.am
v6: update amdgpu_drm.h
v7: libdrm.h -> libdrm_macros.h

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00