Browse Source

Merge branch 'catalyst_13.4' into bfgminer-3.0.x

Luke Dashjr 12 years ago
parent
commit
5a0986a81b
2 changed files with 16 additions and 10 deletions
  1. 7 9
      adl.c
  2. 9 1
      ocl.c

+ 7 - 9
adl.c

@@ -251,12 +251,16 @@ void init_adl(int nDevs)
 			applog(LOG_INFO, "Failed to ADL_Adapter_ID_Get. Error %d", result);
 			if (result == -10)
 				applog(LOG_INFO, "This error says the device is not enabled");
-			continue;
 		}
-
+		else
 		/* Each adapter may have multiple entries */
 		if (lpAdapterID == last_adapter)
 			continue;
+		else
+		if (!lpAdapterID)
+			applog(LOG_INFO, "Adapter returns ID 0 meaning not AMD. Card order might be confused");
+		else
+			last_adapter = lpAdapterID;
 
 		applog(LOG_DEBUG, "GPU %d "
 		       "iAdapterIndex %d "
@@ -289,12 +293,6 @@ void init_adl(int nDevs)
 			applog(LOG_ERR, "Use the gpu map feature to reliably map OpenCL to ADL");
 			devs_match = false;
 		}
-		last_adapter = lpAdapterID;
-
-		if (!lpAdapterID) {
-			applog(LOG_INFO, "Adapter returns ID 0 meaning not AMD. Card order might be confused");
-			continue;
-		}
 	}
 
 	if (devices < nDevs) {
@@ -367,7 +365,7 @@ void init_adl(int nDevs)
 		result = ADL_Adapter_ID_Get(iAdapterIndex, &lpAdapterID);
 		if (result != ADL_OK) {
 			applog(LOG_INFO, "Failed to ADL_Adapter_ID_Get. Error %d", result);
-			continue;
+			lpAdapterID = -1;
 		}
 
 		if (gpus[gpu].deven == DEV_DISABLED) {

+ 9 - 1
ocl.c

@@ -400,6 +400,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 	struct cgpu_info *cgpu = &gpus[gpu];
 	cl_platform_id platform = NULL;
 	char pbuff[256], vbuff[255];
+	char *s;
 	cl_platform_id* platforms;
 	cl_uint preferred_vwidth;
 	cl_device_id *devices;
@@ -849,7 +850,14 @@ build:
 		    strstr(name, "Wrestler" ) ||
 		    strstr(name, "Zacate" ) ||
 		    strstr(name, "WinterPark" ))
-			patchbfi = true;
+		{
+			// BFI_INT patching only works with AMD-APP up to 1084
+			if (strstr(vbuff, "ATI-Stream"))
+				patchbfi = true;
+			else
+			if ((s = strstr(vbuff, "AMD-APP")) && (s = strchr(s, '(')) && atoi(&s[1]) < 1085)
+				patchbfi = true;
+		}
 	} else
 		applog(LOG_DEBUG, "cl_amd_media_ops not found, will not set BITALIGN");