msm: kgsl: increase valid timestamp range
The existing timestamp_cmp function returns a different result depending on the order of the input parameters due to having an asymetric valid window. When no rollover is detected the window is 2^31 but when a rollover is detected the window is 25000. This change makes the rollover window symmetric at 2^31.
This commit is contained in:
		| @@ -24,6 +24,9 @@ | ||||
|  | ||||
| #define KGSL_NAME "kgsl" | ||||
|  | ||||
| /* Timestamp window used to detect rollovers */ | ||||
| #define KGSL_TIMESTAMP_WINDOW 0x80000000 | ||||
|  | ||||
| /*cache coherency ops */ | ||||
| #define DRM_KGSL_GEM_CACHE_OP_TO_DEV	0x0001 | ||||
| #define DRM_KGSL_GEM_CACHE_OP_FROM_DEV	0x0002 | ||||
| @@ -193,7 +196,7 @@ static inline int timestamp_cmp(unsigned int new, unsigned int old) | ||||
| 	if (ts_diff == 0) | ||||
| 		return 0; | ||||
|  | ||||
| 	return ((ts_diff > 0) || (ts_diff < -20000)) ? 1 : -1; | ||||
| 	return ((ts_diff > 0) || (ts_diff < -KGSL_TIMESTAMP_WINDOW)) ? 1 : -1; | ||||
| } | ||||
|  | ||||
| static inline void | ||||
|   | ||||
		Reference in New Issue
	
	Block a user