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

Commit 5040ac5d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Enable A6XX preemption through sysfs"

parents 8d2f3026 38e57d7a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1333,8 +1333,7 @@ static int adreno_init(struct kgsl_device *device)

	}

	if (nopreempt == false &&
		ADRENO_FEATURE(adreno_dev, ADRENO_PREEMPTION)) {
	if (nopreempt == false) {
		int r = 0;

		if (gpudev->preemption_init)
+15 −2
Original line number Diff line number Diff line
@@ -528,6 +528,7 @@ enum adreno_device_flags {
	ADRENO_DEVICE_ISDB_ENABLED = 12,
	ADRENO_DEVICE_CACHE_FLUSH_TS_SUSPENDED = 13,
	ADRENO_DEVICE_HARD_RESET = 14,
	ADRENO_DEVICE_PREEMPTION_EXECUTION = 15,
};

/**
@@ -1550,11 +1551,23 @@ static inline void adreno_set_preempt_state(struct adreno_device *adreno_dev,
	smp_wmb();
}

static inline bool adreno_is_preemption_enabled(
static inline bool adreno_is_preemption_execution_enabled(
				struct adreno_device *adreno_dev)
{
	return test_bit(ADRENO_DEVICE_PREEMPTION_EXECUTION, &adreno_dev->priv);
}

static inline bool adreno_is_preemption_setup_enabled(
				struct adreno_device *adreno_dev)
{
	return test_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv);
}

static inline bool adreno_is_preemption_enabled(
				struct adreno_device *adreno_dev)
{
	return 0;
}
/**
 * adreno_ctx_get_rb() - Return the ringbuffer that a context should
 * use based on priority
@@ -1578,7 +1591,7 @@ static inline struct adreno_ringbuffer *adreno_ctx_get_rb(
	 * ringbuffer
	 */

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_execution_enabled(adreno_dev))
		return &(adreno_dev->ringbuffers[0]);

	/*
+3 −3
Original line number Diff line number Diff line
@@ -567,7 +567,7 @@ static void a6xx_start(struct adreno_device *adreno_dev)
		kgsl_regrmw(device, A6XX_PC_DBG_ECO_CNTL, 0, (1 << 8));

	/* Enable the GMEM save/restore feature for preemption */
	if (adreno_is_preemption_enabled(adreno_dev))
	if (adreno_is_preemption_setup_enabled(adreno_dev))
		kgsl_regwrite(device, A6XX_RB_CONTEXT_SWITCH_GMEM_SAVE_RESTORE,
			0x1);

@@ -773,7 +773,7 @@ static int a6xx_post_start(struct adreno_device *adreno_dev)
	struct adreno_ringbuffer *rb = adreno_dev->cur_rb;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_execution_enabled(adreno_dev))
		return 0;

	cmds = adreno_ringbuffer_allocspace(rb, 42);
@@ -2295,7 +2295,7 @@ static void a6xx_cp_callback(struct adreno_device *adreno_dev, int bit)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	if (adreno_is_preemption_enabled(adreno_dev))
	if (adreno_is_preemption_execution_enabled(adreno_dev))
		a6xx_preemption_trigger(adreno_dev);

	adreno_dispatcher_schedule(device);
+4 −4
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ void a6xx_preemption_schedule(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_execution_enabled(adreno_dev))
		return;

	mutex_lock(&device->mutex);
@@ -453,7 +453,7 @@ void a6xx_preemption_start(struct adreno_device *adreno_dev)
	struct adreno_ringbuffer *rb;
	unsigned int i;

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_execution_enabled(adreno_dev))
		return;

	/* Force the state to be clear */
@@ -631,7 +631,7 @@ void a6xx_preemption_context_destroy(struct kgsl_context *context)
	struct kgsl_device *device = context->device;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_setup_enabled(adreno_dev))
		return;

	gpumem_free_entry(context->user_ctxt_record);
@@ -642,7 +642,7 @@ int a6xx_preemption_context_init(struct kgsl_context *context)
	struct kgsl_device *device = context->device;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	if (!adreno_is_preemption_enabled(adreno_dev))
	if (!adreno_is_preemption_setup_enabled(adreno_dev))
		return 0;

	context->user_ctxt_record = gpumem_alloc_entry(context->dev_priv,
+1 −1
Original line number Diff line number Diff line
@@ -2139,7 +2139,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
	 * Deleting uninitialized timer will block for ever on kernel debug
	 * disable build. Hence skip del timer if it is not initialized.
	 */
	if (adreno_is_preemption_enabled(adreno_dev))
	if (adreno_is_preemption_execution_enabled(adreno_dev))
		del_timer_sync(&adreno_dev->preempt.timer);

	mutex_lock(&device->mutex);
Loading