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

Commit 3eaabcc6 authored by Lynus Vaz's avatar Lynus Vaz
Browse files

msm: kgsl: Use a pre-initialization device state



In some cases like the charging logo, the kgsl device is registered
but not opened by any process. In such cases, the suspend and resume
should be nop's until the first-time initialization is done. Make
this an explicit NONE state and check this in the suspend and resume
path.

CRs-Fixed: 775538
Change-Id: Ib55acb4826b2c4b10f50880030d6f7c2a0e845ec
Signed-off-by: default avatarLynus Vaz <lvaz@codeaurora.org>
parent dbd98701
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -401,7 +401,7 @@ struct kgsl_device {
	.wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).wait_queue),\
	.active_cnt_wq = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).active_cnt_wq),\
	.mutex = __MUTEX_INITIALIZER((_dev).mutex),\
	.state = KGSL_STATE_INIT,\
	.state = KGSL_STATE_NONE,\
	.ver_major = DRIVER_VERSION_MAJOR,\
	.ver_minor = DRIVER_VERSION_MINOR

+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1835,7 +1835,8 @@ int _suspend(struct kgsl_device *device)
{
	int ret = 0;

	if (KGSL_STATE_SUSPEND == device->state)
	if ((KGSL_STATE_SUSPEND == device->state) ||
		(KGSL_STATE_NONE == device->state))
		return ret;

	/* drain to prevent from more commands being submitted */