7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync/*
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * Copyright 2007 Nouveau Project
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync *
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * copy of this software and associated documentation files (the "Software"),
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * to deal in the Software without restriction, including without limitation
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * and/or sell copies of the Software, and to permit persons to whom the
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * Software is furnished to do so, subject to the following conditions:
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync *
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * The above copyright notice and this permission notice shall be included in
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * all copies or substantial portions of the Software.
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync *
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync * SOFTWARE.
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync */
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#ifndef __NOUVEAU_CHANNEL_H__
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define __NOUVEAU_CHANNEL_H__
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncstruct nouveau_subchannel {
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_grobj *gr;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync unsigned sequence;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync};
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncstruct nouveau_channel {
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_device *device;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync int id;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_pushbuf *pushbuf;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_grobj *nullobj;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_grobj *vram;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_grobj *gart;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync void *user_private;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync void (*hang_notify)(struct nouveau_channel *);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync void (*flush_notify)(struct nouveau_channel *);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_subchannel subc[8];
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync unsigned subc_sequence;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync};
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncint
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_channel **);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncvoid
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_channel_free(struct nouveau_channel **);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#endif