linux/drivers/gpu/host1x/channel.h
Mikko Perttunen 87fafcd53d gpu: host1x: Stop CDMA before suspending
Before going into suspend, wait all CDMA to go idle and stop it.
This will ensure no channel is still active while we enter
suspend, and ensures the driver doesn't think that CDMA is still
active when coming back from suspend (as HW state has been reset).

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-2-cyndis@kapsi.fi
2023-10-11 22:52:44 +02:00

46 lines
983 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Tegra host1x Channel
*
* Copyright (c) 2010-2013, NVIDIA Corporation.
*/
#ifndef __HOST1X_CHANNEL_H
#define __HOST1X_CHANNEL_H
#include <linux/io.h>
#include <linux/kref.h>
#include <linux/mutex.h>
#include "cdma.h"
struct host1x;
struct host1x_channel;
struct host1x_channel_list {
struct host1x_channel *channels;
struct mutex lock;
unsigned long *allocated_channels;
};
struct host1x_channel {
struct kref refcount;
unsigned int id;
struct mutex submitlock;
void __iomem *regs;
struct host1x_client *client;
struct device *dev;
struct host1x_cdma cdma;
};
/* channel list operations */
int host1x_channel_list_init(struct host1x_channel_list *chlist,
unsigned int num_channels);
void host1x_channel_list_free(struct host1x_channel_list *chlist);
struct host1x_channel *host1x_channel_get_index(struct host1x *host,
unsigned int index);
void host1x_channel_stop_all(struct host1x *host);
#endif