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

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

Merge "msm: kgsl: Avoid redundant AOP message during GPU wake up"

parents b3a601c4 b20ab5df
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -1241,22 +1241,30 @@ static void gmu_aop_send_acd_state(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	struct kgsl_mailbox *mailbox = &gmu->mailbox;
	struct mbox_message msg;
	char msg_buf[33];
	bool state = test_bit(ADRENO_ACD_CTRL, &adreno_dev->pwrctrl_flag);
	int ret;

	if (!gmu->mailbox.client)
	if (!mailbox->client)
		return;

	if (state == mailbox->enabled)
		return;

	msg.len = scnprintf(msg_buf, sizeof(msg_buf),
			"{class: gpu, res: acd, value: %d}", state);
	msg.msg = msg_buf;

	ret = mbox_send_message(gmu->mailbox.channel, &msg);
	if (ret < 0)
	ret = mbox_send_message(mailbox->channel, &msg);
	if (ret < 0) {
		dev_err(&gmu->pdev->dev,
				"AOP mbox send message failed: %d\n", ret);
		return;
	}

	mailbox->enabled = state;
}

static void gmu_aop_mailbox_destroy(struct kgsl_device *device)
@@ -1268,13 +1276,15 @@ static void gmu_aop_mailbox_destroy(struct kgsl_device *device)
	if (!mailbox->client)
		return;

	/* Turn off ACD in AOP */
	clear_bit(ADRENO_ACD_CTRL, &adreno_dev->pwrctrl_flag);
	gmu_aop_send_acd_state(device);

	mbox_free_channel(mailbox->channel);
	mailbox->channel = NULL;

	kfree(mailbox->client);
	mailbox->client = NULL;

	clear_bit(ADRENO_ACD_CTRL, &adreno_dev->pwrctrl_flag);
}

static int gmu_aop_mailbox_init(struct kgsl_device *device,
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ enum gmu_load_mode {
};

struct kgsl_mailbox {
	bool enabled;
	struct mbox_client *client;
	struct mbox_chan *channel;
};