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

Commit cd727c6e authored by Lynus Vaz's avatar Lynus Vaz Committed by Gerrit - the friendly Code Review server
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 0ff56cbd
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line 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
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -399,7 +399,7 @@ struct kgsl_device {
	.wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).wait_queue),\
	.wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).wait_queue),\
	.active_cnt_wq = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).active_cnt_wq),\
	.active_cnt_wq = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).active_cnt_wq),\
	.mutex = __MUTEX_INITIALIZER((_dev).mutex),\
	.mutex = __MUTEX_INITIALIZER((_dev).mutex),\
	.state = KGSL_STATE_INIT,\
	.state = KGSL_STATE_NONE,\
	.ver_major = DRIVER_VERSION_MAJOR,\
	.ver_major = DRIVER_VERSION_MAJOR,\
	.ver_minor = DRIVER_VERSION_MINOR
	.ver_minor = DRIVER_VERSION_MINOR


+3 −2
Original line number Original line 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
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -1757,7 +1757,8 @@ int _suspend(struct kgsl_device *device)
{
{
	int ret = 0;
	int ret = 0;


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


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