P4 to Git Change 1152849 by skudchad@skudchad_test_win_opencl2 on 2015/05/20 17:15:00

EPR #403782 - IOMMU2/SVM
	- Update the caching and hit logic for resource cache to reflect allocation attributes for SVM. Else it can give wrong hits leading to hangs if a regular surface is used for shader upload etc. IOMMUv2 strictly needs shader and command buffers to have EXECUTE attribute.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/7572/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#217 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#80 edit
Tá an tiomantas seo le fáil i:
foreman
2015-05-20 17:28:59 -04:00
tuismitheoir 24ac37876f
tiomantas 4f338e5578
D'athraigh 2 comhad le 19 breiseanna agus 15 scriosta
+11 -8
Féach ar an gComhad
@@ -91,6 +91,7 @@ Resource::Resource(
cal_.imageType_ = 0;
cal_.SVMRes_ = false;
cal_.scratch_ = false;
cal_.isAllocExecute_ = false;
}
Resource::Resource(
@@ -135,6 +136,7 @@ Resource::Resource(
cal_.imageType_ = imageType;
cal_.SVMRes_ = false;
cal_.scratch_ = false;
cal_.isAllocExecute_ = false;
switch (imageType) {
case CL_MEM_OBJECT_IMAGE2D:
@@ -363,7 +365,7 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap)
if (memType == Shader){
if(dev().settings().svmFineGrainSystem_) {
desc.isAllocExecute = true;
cal_.isAllocExecute_ = desc.isAllocExecute = true;
}
// force to use remote memory for HW DEBUG or use
// local memory once we determine if FGS is supported
@@ -2058,13 +2060,14 @@ ResourceCache::findCalResource(Resource::CalResourceDesc* desc)
(entry->depth_ == desc->depth_) &&
(entry->channelOrder_ == desc->channelOrder_) &&
(entry->format_ == desc->format_) &&
(entry->flags_ == desc->flags_)) {
ref = it.second;
delete it.first;
// Remove the found etry from the cache
resCache_.remove(it);
cacheSize_ -= size;
break;
(entry->flags_ == desc->flags_) &&
(entry->isAllocExecute_ == desc->isAllocExecute_)) {
ref = it.second;
delete it.first;
// Remove the found etry from the cache
resCache_.remove(it);
cacheSize_ -= size;
break;
}
}