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

Commit dabca6e5 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Move out GMU init from A6XX code"

parents 46019719 1d9e50b5
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -13,7 +13,6 @@
#include "adreno_llc.h"
#include "adreno_llc.h"
#include "adreno_pm4types.h"
#include "adreno_pm4types.h"
#include "adreno_trace.h"
#include "adreno_trace.h"
#include "kgsl_gmu.h"
#include "kgsl_trace.h"
#include "kgsl_trace.h"


static struct a6xx_protected_regs {
static struct a6xx_protected_regs {
@@ -1070,7 +1069,6 @@ static int a6xx_microcode_read(struct adreno_device *adreno_dev)
{
{
	int ret;
	int ret;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	struct adreno_firmware *sqe_fw = ADRENO_FW(adreno_dev, ADRENO_FW_SQE);
	struct adreno_firmware *sqe_fw = ADRENO_FW(adreno_dev, ADRENO_FW_SQE);
	const struct adreno_a6xx_core *a6xx_core = to_a6xx_core(adreno_dev);
	const struct adreno_a6xx_core *a6xx_core = to_a6xx_core(adreno_dev);


@@ -1080,16 +1078,6 @@ static int a6xx_microcode_read(struct adreno_device *adreno_dev)
			return ret;
			return ret;
	}
	}


	ret = gmu_core_dev_load_firmware(device);
	if (ret)
		return ret;

	ret = gmu_memory_probe(device);
	if (ret)
		return ret;

	hfi_init(gmu);

	return 0;
	return 0;
}
}


+22 −2
Original line number Original line Diff line number Diff line
@@ -447,7 +447,7 @@ int gmu_prealloc_req(struct kgsl_device *device, struct gmu_block_header *blk)
 * to share with GMU in kernel mode.
 * to share with GMU in kernel mode.
 * @device: Pointer to KGSL device
 * @device: Pointer to KGSL device
 */
 */
int gmu_memory_probe(struct kgsl_device *device)
static int gmu_memory_probe(struct kgsl_device *device)
{
{
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
@@ -1562,6 +1562,24 @@ static void gmu_snapshot(struct kgsl_device *device)
	gmu->fault_count++;
	gmu->fault_count++;
}
}


static int gmu_init(struct kgsl_device *device)
{
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	struct gmu_dev_ops *ops = GMU_DEVICE_OPS(device);
	int ret;

	ret = ops->load_firmware(device);
	if (ret)
		return ret;

	ret = gmu_memory_probe(device);
	if (ret)
		return ret;

	hfi_init(gmu);

	return 0;
}
/* To be called to power on both GPU and GMU */
/* To be called to power on both GPU and GMU */
static int gmu_start(struct kgsl_device *device)
static int gmu_start(struct kgsl_device *device)
{
{
@@ -1575,7 +1593,9 @@ static int gmu_start(struct kgsl_device *device)
	case KGSL_STATE_INIT:
	case KGSL_STATE_INIT:
		gmu_aop_send_acd_state(device, test_bit(ADRENO_ACD_CTRL,
		gmu_aop_send_acd_state(device, test_bit(ADRENO_ACD_CTRL,
					&adreno_dev->pwrctrl_flag));
					&adreno_dev->pwrctrl_flag));

		ret = gmu_init(device);
		if (ret)
			return ret;
	case KGSL_STATE_SUSPEND:
	case KGSL_STATE_SUSPEND:
		WARN_ON(test_bit(GMU_CLK_ON, &device->gmu_core.flags));
		WARN_ON(test_bit(GMU_CLK_ON, &device->gmu_core.flags));


+0 −1
Original line number Original line Diff line number Diff line
@@ -218,7 +218,6 @@ unsigned int gmu_get_memtype_base(struct gmu_device *gmu,
		enum gmu_mem_type type);
		enum gmu_mem_type type);


int gmu_prealloc_req(struct kgsl_device *device, struct gmu_block_header *blk);
int gmu_prealloc_req(struct kgsl_device *device, struct gmu_block_header *blk);
int gmu_memory_probe(struct kgsl_device *device);
int gmu_cache_finalize(struct kgsl_device *device);
int gmu_cache_finalize(struct kgsl_device *device);


#endif /* __KGSL_GMU_H */
#endif /* __KGSL_GMU_H */
+0 −10
Original line number Original line Diff line number Diff line
@@ -306,16 +306,6 @@ void gmu_core_dev_enable_lm(struct kgsl_device *device)
		ops->enable_lm(device);
		ops->enable_lm(device);
}
}


int gmu_core_dev_load_firmware(struct kgsl_device *device)
{
	struct gmu_dev_ops *ops = GMU_DEVICE_OPS(device);

	if (ops && ops->load_firmware)
		return ops->load_firmware(device);

	return 0;
}

void gmu_core_dev_snapshot(struct kgsl_device *device,
void gmu_core_dev_snapshot(struct kgsl_device *device,
		struct kgsl_snapshot *snapshot)
		struct kgsl_snapshot *snapshot)
{
{
+0 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,6 @@ void gmu_core_dev_oob_clear(struct kgsl_device *device, enum oob_request req);
int gmu_core_dev_hfi_start_msg(struct kgsl_device *device);
int gmu_core_dev_hfi_start_msg(struct kgsl_device *device);
int gmu_core_dev_wait_for_lowest_idle(struct kgsl_device *device);
int gmu_core_dev_wait_for_lowest_idle(struct kgsl_device *device);
void gmu_core_dev_enable_lm(struct kgsl_device *device);
void gmu_core_dev_enable_lm(struct kgsl_device *device);
int gmu_core_dev_load_firmware(struct kgsl_device *device);
void gmu_core_dev_snapshot(struct kgsl_device *device,
void gmu_core_dev_snapshot(struct kgsl_device *device,
		struct kgsl_snapshot *snapshot);
		struct kgsl_snapshot *snapshot);
bool gmu_core_dev_gx_is_on(struct kgsl_device *device);
bool gmu_core_dev_gx_is_on(struct kgsl_device *device);