Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0fb6443 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Add ADRENO_DEPRECATED to identify unsupported targets



Very soon we will start removing support for some pre-production and
obsolete targets from the driver. In order to prevent confusion
add a new flag to identify GPU targets as deprecated so that we don't
accidently match as a different target or otherwise behave badly without
a clue to the poor developer trying to figure out whats going on.

Change-Id: Ic0dedbad8fbfbf6b40bdbec24169ad4649edd28f
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 7faae93a
Loading
Loading
Loading
Loading
+22 −6
Original line number Diff line number Diff line
@@ -782,9 +782,9 @@ static void adreno_update_soc_hw_revision_quirks(
	}
}

static void
adreno_identify_gpu(struct adreno_device *adreno_dev)
static int adreno_identify_gpu(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	const struct adreno_reg_offsets *reg_offsets;
	struct adreno_gpudev *gpudev;
	int i;
@@ -792,10 +792,23 @@ adreno_identify_gpu(struct adreno_device *adreno_dev)
	adreno_dev->gpucore = _get_gpu_core(adreno_dev->chipid);

	if (adreno_dev->gpucore == NULL) {
		dev_crit(KGSL_DEVICE(adreno_dev)->dev,
		dev_crit(&device->pdev->dev,
			"Unknown GPU chip ID %8.8X\n", adreno_dev->chipid);
		BUG();
		return;
		return -ENODEV;
	}

	/*
	 * Identify non-longer supported targets and spins and print a helpful
	 * message
	 */
	if (adreno_dev->gpucore->features & ADRENO_DEPRECATED) {
		dev_err(&device->pdev->dev,
			"Support for GPU %d.%d.%d.%d has been deprecated\n",
			adreno_dev->gpucore->core,
			adreno_dev->gpucore->major,
			adreno_dev->gpucore->minor,
			adreno_dev->gpucore->patchid);
		return -ENODEV;
	}

	/*
@@ -821,6 +834,8 @@ adreno_identify_gpu(struct adreno_device *adreno_dev)
	/* Do target specific identification */
	if (gpudev->platform_setup != NULL)
		gpudev->platform_setup(adreno_dev);

	return 0;
}

static const struct platform_device_id adreno_id_table[] = {
@@ -1325,7 +1340,8 @@ static int adreno_probe(struct platform_device *pdev)
	adreno_update_soc_hw_revision_quirks(adreno_dev, pdev);

	/* Get the chip ID from the DT and set up target specific parameters */
	adreno_identify_gpu(adreno_dev);
	if (adreno_identify_gpu(adreno_dev))
		return -ENODEV;

	status = adreno_of_get_power(adreno_dev, pdev);
	if (status) {
+3 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
 */
@@ -126,7 +126,8 @@
#define ADRENO_ECP BIT(18)
/* Cooperative reset enabled GMU */
#define ADRENO_COOP_RESET BIT(19)

/* Indicates that the specific target is no longer supported */
#define ADRENO_DEPRECATED BIT(20)
/*
 * Adreno GPU quirks - control bits for various workarounds
 */