Graphe des révisions

401 Révisions

Auteur SHA1 Message Date
xinhui pan 3cd03c7f5e kfdtest: add PM4EventInterrupt test
Similar with SdmaEventInterrupt, verify event interrupt on pm4 queue.

Change-Id: I0e43f26fd0d965126985820704215d2ef5e52c1a
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 3e527bc7e8]
2018-08-24 13:21:01 +08:00
xinhui pan 973510c41f kfdtest: Let SdmaEventInterrupt test more meaningful
Simulate some workload there to verify the sDMA event interrupt.

Change-Id: Ib5ad0c238cc66898f7835e765df50427ef106b04
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: bdb1f8a066]
2018-08-24 11:27:34 +08:00
xinhui pan 3e0f1d695a kfdtest: Add some asserts in BigBufferStressTest
It should have PASS/FAIL report for the vram allocated size.

Change-Id: I546c02c2ed02f1cfb5278e0dfd7b18ade39faafb
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 1076075a1c]
2018-08-23 23:01:20 -04:00
Mike Li b5cc397824 Decouple user NodeID and sysfs NodeID
Currently, all HSA nodes are exposed to user. So the existing
implementation assumes a one to one mapping between user
NodeId and sysfs nodeId.
GPU Resource Management will provide control over the exposed
HSA nodes. This means not all HSA nodes will be exposed to the user.
Decouple it.
The mapping from user NodeId to sysfs NodeId will be local
to topology.c and topology helper functions. For others NodeId
should be sequential from 0 to Number of Nodes exposed to user.

v1: initial implementation
v2: map node id within the topology_* functions
v3: remove two static globals
v4: add bounds check got node id

Change-Id: Id12147ece41d682430f398944bbb339ca906eb1b
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>


[ROCm/ROCR-Runtime commit: 3437a356c7]
2018-08-23 16:01:32 -04:00
Kent Russell 52536ba23b kfdtest: Consolidate logic for ASSERT vs EXPECT
ASSERT failures result in immediate termination of the test. EXPECT
returns a failure but continues execution. Reserve ASSERT for required
functionality (node initialization, queue creation, etc) where the rest
of the test cannot run if that call fails. Use EXPECT everywhere else

Change-Id: I1c11326fc3ae22b50fa83b07b3b49af1e1f4e69e


[ROCm/ROCR-Runtime commit: fe33461622]
2018-08-23 06:20:18 -04:00
Kent Russell b86f145610 kfdtest: Clean up comments
Consolidate style (use /* */ for multi-line), fix typos,
use dword instad of DWORD/DWord

Change-Id: I620e45c1687550db41127e45641b7d79d28223a1


[ROCm/ROCR-Runtime commit: 414042abf7]
2018-08-23 06:20:17 -04:00
Philip Cox f85a629639 Add GFX debug trap control code
Add initial support for the kfd debugger trap support
for GFX9 chips.

   - Adding support for Enable/Disable trap support
   - Setting debug trap support data
   - Setting wave launch trap override
   - Setting wave launch mode

Change-Id: If39f2395c4b6cf56249cf76f1c44cfcbdcef891c
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: db92d5af23]
2018-08-22 14:40:15 -04:00
Felix Kuehling 8289fa25a1 libhsakmt: Fix processing of memory fault events
AMDKFD_IOC_WAIT_EVENTS with multiple events and wait_for_all = 0
returns success after any of the events have signaled. So we can't
blindly assume that a memory fault event that was in the list has
actually signaled. Check the gpu_id as an indicator whether there
really was a memory fault before processing it further.

Change-Id: I6cc311bfc184c631beaf684027176a6ca42e05c1
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 9271e69ddf]
2018-08-17 16:06:45 -04:00
Felix Kuehling 84bb9072c0 libhsakmt: Try to use CPU addr as GPU addr for userptrs
If the CPU addr of a userptr is accessible by the GPU, try to use it
instead of allocating a different GPU address. If something else is
already registered with an overlapping address range, we still need to
allocate a GPU address, because KFD does not support overlapping GPUVM
mappings.

Change-Id: I452963ee45a454f735755a0b43122b9aee5d55be
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: ab181c46c0]
2018-08-17 16:06:45 -04:00
Felix Kuehling 3dfb956bd5 libhsakmt: Add mmap-based aperture management for GFXv9 and later
If the GPU virtual address space is >= 47 bits, don't reserve virtual
address space at startup and use mmap to allocate virtual addresses.

Change-Id: Ic935b03c8e78271829fc8e6cfd0e543184aff818
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: 80f2cc644c]
2018-08-17 16:06:45 -04:00
xinhui pan 7cd22e8785 kfdtest: use HSAuint64 instead of unsigned HSAint64
This should fix gtest compile errors.

code like below has trouble,

typedef char char8;
typedef unsigned char uchar8;

ASSERT_NE((uchar8)1, 0);
ASSERT_NE((unsigned char8)1, 0); // compile error here
or
ASSERT_NE((unsigned char8)1, 0);
ASSERT_NE((uchar8)1, 0); // compile error here

HSA[u]int64 are alias. So ASSERT_XX((unsigned HSAint64)..)
with ASSERT_XX((HSAuint64)..) fail to compile.

Change-Id: I4c24bc699a69bd4f37c4bc8aaaa9f1a92a24a33e
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 163fa2f3aa]
2018-08-16 16:03:52 +08:00
Yong Zhao a505c9bb05 kfdtest: Do not set GTEST_FLAG throw_on_failure
The flag makes EXPECT_* to behave like ASSERT_*, which actually work against
our favor, so disable the flag.

Change-Id: I2ea1dfeaf916b396593a504d081148abdac0fc70
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>


[ROCm/ROCR-Runtime commit: 62f7dc2a48]
2018-08-15 18:08:39 -04:00
Felix Kuehling 98c65aeaa7 libhsakmt: Fix assumptions about userptrs relative to apertures
So far we have assumed that userptrs are always memory outside
reserved SVM apertures that are mapped into the SVM aperture for
GPU access.

With an unreserved SVM aperture that covers the entire virtual
address range, this distinction will no longer be true. Userptrs
will generally be inside the unreserved SVM aperture. Take that
into consideration when registering, mapping and unmapping virtual
addresses.

We now need a retry logic when looking up buffers from addresses.
If it is not found by its GPU address, try it as a userptr.

We also need to consider the new possibility that a userptr is
registered at the same address for CPU and GPU access. So a buffer
found by its GPU address may also turn out to be a userptr. In
that case use a stricter lookup using the userptr and size (if
the size is known), to identify the correct one of multiple
overlapping objects.

Change-Id: Ia43633aaa40f9fd2a74918ae969a631d2ff68419
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 40c46cc6cb]
2018-08-15 16:07:54 -04:00
Felix Kuehling fd7827a8a1 libhsakmt: Make VA management scheme configurable per aperture
Change-Id: Ib70b038b4ef6465b03545317c6494a4e4950c107
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: d79b9c1a29]
2018-08-15 14:22:19 -04:00
Felix Kuehling f13a52479d libhsakmt: Allow dgpu and dgpu_alt aperture to be the same
Make dgpu_aperture and dgpu_alt_aperture pointers that can point to
the same actual aperture. This will be useful on GFXv9 and later,
where the MType is not defined by the aperture and we want to have
a single aperture covering the entire virtual address space.

aperture->is_coherent can no longer be a reliable indicator of
coherency. Replace it with different conditions based on mem flags
and svm.disable_cache (from HSA_DISABLE_CACHE environment).

Change-Id: Iefc415b87b8abd96e3916586485a0a55d9b27c19
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: d57026f447]
2018-08-15 14:22:19 -04:00
Felix Kuehling 6f51fce198 libhsakmt: Move unmapping into aperture_release_area
This prepares the code for an alternative aperture management method
that needs to unmap memory differently.

Change-Id: I5494aa5420f85edb8f7857f00c17e1d2e6479a51
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: 2d2181b478]
2018-08-15 14:22:19 -04:00
Felix Kuehling cc70b35f1e libhsakmt: scratch is not a manageable aperture
Only scratch_physical, for scratch-backing memory is managed by the Thunk.

Change-Id: I4716981aa908d9569584dc35f40ffd270a2f9014
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: 9d96af0150]
2018-08-15 14:22:19 -04:00
Felix Kuehling bf8a9e538c libhsakmt: Remove aperture offset parameter
This parameter was used for non-canonical GPUVM allocations on GFX7/8 APUs
only, to prevent getting NULL pointers from valid allocation after
subtracting the aperture base. The same can be achieved less intrusively
by reserving address space at the start of the aperture during
initialization.

Change-Id: I0aae773f069c2b228824ba464b0612a4d8b489ce
Signed-off-by: Felix Kuehling <felix.kuehling@gmail.com>


[ROCm/ROCR-Runtime commit: 842359a826]
2018-08-15 14:22:19 -04:00
Felix Kuehling b2599c6ab5 kfdtest: Enable more tests for gfx900
A lot of tests were disabled on gfx900 for historical reasons that
are no longer valid. The only remaining one that won't work on
gfx900 is BasicAddressWatch.

Change-Id: I11507de0dfd31262713127d6cb15cc09c14b8b9f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: d3fdaaca3a]
2018-08-15 14:22:19 -04:00
Kent Russell b2e7a6e2a8 kfdtest: Consolidate log messages for skipped tests
When skipping a test, the output should be:
Skipping test: <reason>.

This will allow for easier identification, automation and general readability

Change-Id: I98bda1c068f9dbc83aeea74f642b6101121f234d


[ROCm/ROCR-Runtime commit: f2bd7e1d52]
2018-08-14 10:11:50 -04:00
Kent Russell e50ef7ad47 kfdtest: Consolidate indentation of multi-line function calls
Make indentation consistent, which is that subsequent lines are aligned
with the variables declared above

Change-Id: I590f7768d93565145b986ad1fb6ac8e82f9c0d58


[ROCm/ROCR-Runtime commit: cb019f00cd]
2018-08-14 08:18:07 -04:00
Kent Russell 19788ae516 kfdtest: Style cleanup
Clean up the KFDTest style via CPPLint. Some warnings remain regarding
volatile variables being cast to void*. This is the command used:
cpplint.py --linelength=120
--filter=-readability/multiline_string,-readability/todo,-build/include,-runtime/references

multiline_string is due to using ISA code
todo is to avoid errors that we don't have TODO(username) instead of TODO
include is about including the folder in the header includes
references is regarding non-const references '&' being const or using
pointers. That can be addressed later

Change-Id: I3c6622da0a13dd33ab29b2bfff48be25e763b750


[ROCm/ROCR-Runtime commit: dffac0a97e]
2018-08-14 08:17:57 -04:00
xinhui pan 76f3da6bd0 kfdtest: fix a memory leak issue in MMapLarge test
When mapMemoryToGpu fails, we need unregister it with user address as
the gpu address is not available.

Change-Id: I4418eeaa7aa37008f5bffa144e2c2171f0d238fd
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 3f7b6356fd]
2018-08-10 05:26:06 -04:00
xinhui pan 17e104702a thunk: fix a memory leak
Hit queue create failure when do kfdtest with --gtest_repet=-1

fix: d89e9165("Remove the use of IS_DGPU()")

Change-Id: I04fa73f90cef13a5517dbaceb89c41dc0f821a79
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: eb5539fb10]
2018-08-10 15:51:32 +08:00
Yong Zhao 6086ae78bb Differentiate gfx700 and improve the logic by introducing is_gfx700()
Because gfx700 has local memory but other APUs don't, we should reflect
that in the code. Meanwhile, fix a bug that on gfx902 svm aperture is not
added when calling hsaKmtGetNodeMemoryProperties().

Change-Id: Id840f2db0b14fda9ee713b219a9474c15f8a9771
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>


[ROCm/ROCR-Runtime commit: 110e754f64]
2018-08-09 21:39:37 -04:00
xinhui pan ed7fc6883d thunk: fix a vm area release issue
On some asics, like tonga, the memory alignment size is as big as 0x8000.

fmm_allocate* alloc vm area with size passed in which is not aligned mostly.
But __fmm_release free vm area with vm_object_t->size which is aligned.

That might cause aperture_release_area fail to free the vm area as the
size might be bigger than zone itself or it just free another vm area
nearby unexpected.

This patch somehow will alloc more space than it needed on tonga.
gfx900+ is not affected.

Change-Id: I5a88c92b08c4e6f6bc05881798f769b55d6debe9
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 8fbf4a26ec]
2018-08-09 06:08:15 -04:00
Yong Zhao 569a2dc80f Calculate and store the first gpu mem during initializaiton
Previously we used the first dgpu mem, but after careful examination, we
found it only needs to be a GPU, so we modify the code to reflect that as
well.

Change-Id: I069d9b8e247aed55c1f885b79f743ea8e03ddf93
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>


[ROCm/ROCR-Runtime commit: fe04dd6890]
2018-08-08 13:54:09 -04:00
xinhui pan a1348526a3 kfdtest: make p2ptest go through all gpus
Implement sDMA copy packet broadcast.

Each time sDMA will copy its local vram to sysbuf and next GPU's vram.
That will verify where the p2p link is broken.
Currently we just test push of p2p.

test result on 2 cpus, 4 gpus, numa enabled system.
[ RUN      ] KFDQMTest.P2PTest
[          ] Test 2 -> 3
[          ] PASS 2 -> 3
[          ] Test 3 -> 4
[          ] PASS 3 -> 4
[          ] Test 4 -> 5
[          ] PASS 4 -> 5
[          ] Test 5 -> 0
[          ] PASS 5 -> 0
[       OK ] KFDQMTest.P2PTest (190 ms)

Change-Id: Ie6fb2604109e39465b8a873b3bb42abc6259825a


[ROCm/ROCR-Runtime commit: 9d6d0911e4]
2018-08-07 21:13:37 -04:00
Yong Zhao d89e91656b Remove the use of IS_DGPU()
The information can be obtained directly from node id. Also improve the
whole logic for future compatibility.

Change-Id: I130733be4e7930d5953d5e81409905e60c2ec35e
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>


[ROCm/ROCR-Runtime commit: 4bb90d048c]
2018-08-07 18:07:04 -04:00
Felix Kuehling c19dd2582d libhsakmt: Fix problems init_svm_apertures
Unset ret_addr when unmapping the address space reservation. Otherwise
it may try to unmap it again later.

Remember the actual map_size and use it instead of len outside the
reservation loops.

Change-Id: I1a6b3fecfb59e22a713e5ed49c3ed37914cb6fb5
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: c21927f425]
2018-08-03 22:09:52 -04:00
Felix Kuehling fe2c2d1736 libhsakmt: Fix pkg-config file paths
Both the include and libpath were incorrect after recent build
system changes. Use the proper GNUInstallDirs definitions in
libhsakmt.pc.in to write the proper locations.

This is needed for end users building KFDTest, which depends on
correct pkg-config information.

Change-Id: Ia45f36f054c2a607a77e7ecbcbd9eb7edd067348
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: dd6f34b7f5]
2018-08-03 20:17:09 -04:00
Felix Kuehling 046dd07a7c kfdtest: Blacklist Fragmentation test on all chips
This test has been intermittently failing for various reasons and
was already disabled on all chips except Ellesmere. It stresses
memory management in unusual ways by having lots of memory allocated
but +# not mapped, which is not relevant to compute applications over
ROCr.



Change-Id: I6b791ca7e2e0fcfe93fc720063b4b56acfded751
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 5c742f3e5e]
2018-08-03 20:14:46 -04:00
Eric Huang 6f330cf658 KFDEvictTest: change buffer size and add GFX vram allocation
This is to coordinate kfd kernel vram limit change, and adding
GFX vram allocation with submission of command nop is to
trigger eviction.



Change-Id: I18615cd13cfde034aae09c188ae3a82babde97b9
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: 3167e3b964]
2018-08-03 15:44:32 -04:00
Eric Huang 7162162847 Kfdtest: Change and move drm device function into KFDBaseComponentTest
It is for other test to reuse this function.

Change-Id: Ib0dbc1a267a5bbcd8078ab3265677b53531f86f3
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: f8d19104aa]
2018-08-03 15:43:28 -04:00
Yong Zhao 2f6d819f6c Change the confusing type and name in topology
node is used repeatedly and excessively, which caused unnecessary confusion.

Change-Id: I4ae4171887df5e5b85209a5af8a636e6d72e5e82
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>


[ROCm/ROCR-Runtime commit: 08b6685dd5]
2018-08-03 12:00:17 -04:00
Kent Russell c380c7b6cb spec: Only remove ldconf file if uninstalling
$1 is passed in during install/upgrade/uninstall. If this is an
uninstall, remove the ldconf file, otherwise leave it. In yum-based
systems, the uninstall from the old package is executed after the
post-install of the newer package, which will undo the ldconf work from
the newer package.

Change-Id: I1681cb3bc65f0bd802bce5703187ae5f4d3f3530


[ROCm/ROCR-Runtime commit: b629dd1888]
2018-08-03 07:33:26 -04:00
Yong Zhao ff0028e97a kfdtest: Evaluate whether a node is APU based on spec
This will facilitate the user cases that some APU asics is used as dGPU.

Change-Id: Ib3a79ae31a03e7a618c7785166f56282a7617127
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: f3e7870784]
2018-08-02 11:36:40 -04:00
xinhui pan fe9d4bce46 kfdtest: make the output of QueueLatency test more readable
Change-Id: Ib33ac25509b23f2e5869bde126e3f11ef60f017e
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 86552aba4b]
2018-08-01 10:06:33 +08:00
Yong Zhao a242051cd7 kfdtest: Add run utility files for kfdtest
A README.txt file is added to help the opensource community to use kfdtest
effectively.

After building, run_kfdtest.sh in the building output folder can be used
to run the test.

Change-Id: I9612d9d5a63bd4cdc3a328efd9961d3cc92a6ba5
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 1d43938ac7]
2018-07-31 00:02:04 -04:00
Yong Zhao adbd297f4c kfdtest: Use libhsakmt to replace all the occurrences of thunk
Thunk is an internal name and we'd better reference it using the library name.

Change-Id: I20042bda546e5249530311d3de30c71d99379033
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: f8472a055c]
2018-07-31 00:02:04 -04:00
Yong Zhao 880119d3a3 kfdtest: Add kfdtest source code
The code is a snapshot up to this commit around July 31 2018.

commit b00fadff36a3
Author: xinhui pan <xinhui.pan@amd.com>
Date:   Mon Jul 30 09:53:03 2018 +0800

    kfdtest: skip MMapLarge test on apu

    

Change-Id: I40e9a5a18e5c8f075e5290bb80532f1a3f689058
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 6df62c78b8]
2018-07-31 00:00:34 -04:00
Kent Russell c3bfa17a39 RPM: Add /opt/rocm/lib64 to lib path
CentOS+cmake suffix the "lib" folder with 64 when building 64-bit
packages

Fixes: 146d8ec61b: Clean up cmake install and package



Change-Id: If029afd6e198b812116f3d3b3921b5486a1be355


[ROCm/ROCR-Runtime commit: 3719ec2557]
2018-07-25 20:00:44 -04:00
Sean Keely ca57c58fa9 Fix git describe command to retrieve version tags correctly.
Change-Id: I33282e8130d092e2f56b2f5947946d3c0ee22c60


[ROCm/ROCR-Runtime commit: 63f2a0d280]
2018-07-10 19:49:00 -05:00
xinhui pan 8e589d853f use rbtree instead of vm_objects list
simple test of mapping many system memory to gpu.
before
[ RUN      ] KFDMemoryTest.MMap
[          ] Using ISA for GFXIP 9.0
[          ] successfully register/map 32GB system memory to gpu
[       OK ] KFDMemoryTest.MMap (36932 ms)

after
[ RUN      ] KFDMemoryTest.MMap
[          ] Using ISA for GFXIP 9.0
[          ] successfully register/map 32GB system memory to gpu
[       OK ] KFDMemoryTest.MMap (11441 ms)

So there is 11s VS 36s improvement.

Looks like we can do something similar with vm_area too.

Change-Id: I0349aacdeddec3534016d28176f0fabf632c61fc
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: ab9017715f]
2018-07-08 22:38:22 -04:00
Felix Kuehling 16246764ce Fix wrong loop termination condition
Compare with gpu_mem_count instead of deprecated NUM_OF_SUPPORTED_GPUS
to prevent overflows in case no dGPUs are present.

Change-Id: I71fcb7503ba4c20bffadbdb04cefc4e4027a7df7
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: d3228f363e]
2018-07-05 17:04:40 -04:00
Yong Zhao fff19d25ea Set the write permission according to the flag when allocating host cpu mem
Change-Id: I758c2b5b1799e968fa852646e1494fabb68c782d
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 4839882fc8]
2018-07-03 20:39:01 -04:00
Slava Grigorev 7fc9f24d21 Fix 'strncpy' truncating warnings when compiling with gcc 8
Change-Id: Ib145bab9450281da05f70dea34433b83438a756b
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>


[ROCm/ROCR-Runtime commit: 89e35574e3]
2018-06-29 17:06:08 -04:00
Yong Zhao f55e9ffafb Simplify if else logic for hsaKmtAllocMemory()
The new logic is easier to follow.

Change-Id: I69759a45c5dedaefeff831a2367253d3a4486bd3
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 4eaaf9694d]
2018-06-29 14:39:52 -04:00
Yong Zhao 21dcd70ed4 Rename two variable names in doorbells structure
There were two doorbells, one embedded in another, which are very confusing.
Change the member variable name to mapping to differentiate them. Also,
rename doorbells_mutex to just mutext for brevity.

Change-Id: Iaa14a1a3ee09449a9089fc1fb39c916fdf32fb44
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 5972fac417]
2018-06-28 16:04:35 -04:00
Yong Zhao 7c860f44b6 Fix a bug that fmm_init_process_apertures() returns incorrect value
If opening drm render device fails (usually when the user is not a member
of video group), fmm_init_process_apertures() still returns success,
resulting in weird segfault in a later stage.

Change-Id: Ifbde4481629988944ad7f384d59753c88e287fa9
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 77ec699460]
2018-06-28 16:03:07 -04:00