msm: kgsl: Consolidate all GPU information in one spot
We are starting to accumulate a lot GPU specific information,
and it is handy to keep it all in one place where new core IDs,
firmware and device functions can be easily added.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/adreno_ringbuffer.c b/drivers/gpu/msm/adreno_ringbuffer.c
index ee123fb..a4a769c 100644
--- a/drivers/gpu/msm/adreno_ringbuffer.c
+++ b/drivers/gpu/msm/adreno_ringbuffer.c
@@ -167,25 +167,15 @@
static int adreno_ringbuffer_load_pm4_ucode(struct kgsl_device *device)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
- const char *fwfile;
int i, ret = 0;
- if (adreno_is_a220(adreno_dev)) {
- fwfile = A220_PM4_470_FW;
- } else if (adreno_is_a225(adreno_dev)) {
- fwfile = A225_PM4_FW;
- } else if (adreno_is_a20x(adreno_dev)) {
- fwfile = A200_PM4_FW;
- } else {
- KGSL_DRV_ERR(device, "Could not load PM4 file\n");
- return -EINVAL;
- }
-
if (adreno_dev->pm4_fw == NULL) {
int len;
- unsigned int *ptr;
+ void *ptr;
- ret = _load_firmware(device, fwfile, (void *) &ptr, &len);
+ ret = _load_firmware(device, adreno_dev->pm4_fwfile,
+ &ptr, &len);
+
if (ret)
goto err;
@@ -215,25 +205,14 @@
static int adreno_ringbuffer_load_pfp_ucode(struct kgsl_device *device)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
- const char *fwfile;
int i, ret = 0;
- if (adreno_is_a220(adreno_dev)) {
- fwfile = A220_PFP_470_FW;
- } else if (adreno_is_a225(adreno_dev)) {
- fwfile = A225_PFP_FW;
- } else if (adreno_is_a20x(adreno_dev)) {
- fwfile = A200_PFP_FW;
- } else {
- KGSL_DRV_ERR(device, "Could not load PFP firmware\n");
- return -EINVAL;
- }
-
if (adreno_dev->pfp_fw == NULL) {
int len;
- unsigned int *ptr;
+ void *ptr;
- ret = _load_firmware(device, fwfile, (void *) &ptr, &len);
+ ret = _load_firmware(device, adreno_dev->pfp_fwfile,
+ &ptr, &len);
if (ret)
goto err;