mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Stop channel DMA during suspend
When channels are kept open over a suspend cycle, we need to re-initialize CDMA after resume. Bug 4133027 Change-Id: I9a2737b377a9ffb37e5f98703b7928bfceab58e3 Signed-off-by: Mainak Sen <msen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2963164 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7d1a687636
commit
420b84b69d
@@ -117,6 +117,23 @@ static struct host1x_channel *acquire_unused_channel(struct host1x *host)
|
|||||||
return &chlist->channels[index];
|
return &chlist->channels[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* host1x_channel_list_stop() - disable cdma on allocated channels
|
||||||
|
* @chlist: list of host1x channels
|
||||||
|
*
|
||||||
|
* Stop DMA on the allocated channels during suspend
|
||||||
|
*/
|
||||||
|
void host1x_channel_list_stop(struct host1x_channel_list *chlist)
|
||||||
|
{
|
||||||
|
struct host1x *host = container_of(chlist, struct host1x, channel_list);
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < host->info->nb_channels; i++) {
|
||||||
|
if (!test_bit(i, chlist->allocated_channels))
|
||||||
|
continue;
|
||||||
|
host1x_channel_stop(&chlist->channels[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* host1x_channel_request() - Allocate a channel
|
* host1x_channel_request() - Allocate a channel
|
||||||
* @client: Host1x client this channel will be used to send commands to
|
* @client: Host1x client this channel will be used to send commands to
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ int host1x_channel_list_init(struct host1x_channel_list *chlist,
|
|||||||
void host1x_channel_list_free(struct host1x_channel_list *chlist);
|
void host1x_channel_list_free(struct host1x_channel_list *chlist);
|
||||||
struct host1x_channel *host1x_channel_get_index(struct host1x *host,
|
struct host1x_channel *host1x_channel_get_index(struct host1x *host,
|
||||||
unsigned int index);
|
unsigned int index);
|
||||||
|
void host1x_channel_list_stop(struct host1x_channel_list *chlist);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1015,6 +1015,7 @@ static int __maybe_unused host1x_runtime_suspend(struct device *dev)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
host1x_hw_intr_disable_all_general_intrs(host);
|
host1x_hw_intr_disable_all_general_intrs(host);
|
||||||
|
host1x_channel_list_stop(&host->channel_list);
|
||||||
host1x_intr_stop(host);
|
host1x_intr_stop(host);
|
||||||
host1x_syncpt_save(host);
|
host1x_syncpt_save(host);
|
||||||
|
|
||||||
@@ -1090,7 +1091,7 @@ release_reset:
|
|||||||
static const struct dev_pm_ops host1x_pm_ops = {
|
static const struct dev_pm_ops host1x_pm_ops = {
|
||||||
SET_RUNTIME_PM_OPS(host1x_runtime_suspend, host1x_runtime_resume,
|
SET_RUNTIME_PM_OPS(host1x_runtime_suspend, host1x_runtime_resume,
|
||||||
NULL)
|
NULL)
|
||||||
/* TODO: add system suspend-resume once driver will be ready for that */
|
SET_SYSTEM_SLEEP_PM_OPS(host1x_runtime_suspend, host1x_runtime_resume)
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_driver tegra_host1x_driver = {
|
static struct platform_driver tegra_host1x_driver = {
|
||||||
|
|||||||
Reference in New Issue
Block a user