msm: kgsl: Establish a standard GPU ID scheme for the KGSL core
Establish a standard generic format for a GPU ID in the KGSL core:
[0:15] - GPU specific identifier
[16:31] - 0x0002 for 2D or 0x0003 for 3D
Add a KGSL core function to get the GPU ID from the devices and
GPU specific functions to return them. For Z180, the ID will be
0x0002000B4 (0xB4 = 180). For 3D, the ID will be 0x00030000 ORed
with the GPU identifier (anywhere from 205 to 225).
Change-Id: Ic0dedbadddb3f587121913b9c226e2bda466f84e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_device.h b/drivers/gpu/msm/kgsl_device.h
index 1c55199..3ef11ce 100644
--- a/drivers/gpu/msm/kgsl_device.h
+++ b/drivers/gpu/msm/kgsl_device.h
@@ -89,6 +89,7 @@
void (*power_stats)(struct kgsl_device *device,
struct kgsl_power_stats *stats);
void (*irqctrl)(struct kgsl_device *device, int state);
+ unsigned int (*gpuid)(struct kgsl_device *device);
/* Optional functions - these functions are not mandatory. The
driver will check that the function pointer is not NULL before
calling the hook */
@@ -240,6 +241,11 @@
return device->ftbl->idle(device, timeout);
}
+static inline unsigned int kgsl_gpuid(struct kgsl_device *device)
+{
+ return device->ftbl->gpuid(device);
+}
+
static inline int kgsl_create_device_sysfs_files(struct device *root,
const struct device_attribute **list)
{