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_NOTIFIER_H__
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define __NOUVEAU_NOTIFIER_H__
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFIER_SIZE 32
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_TIME_0 0x00000000
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_TIME_1 0x00000004
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_RETURN_VALUE 0x00000008
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE 0x0000000C
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_STATUS_MASK 0xFF000000
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_STATUS_SHIFT 24
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_STATUS_COMPLETED 0x00
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_STATUS_IN_PROCESS 0x01
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_ERROR_CODE_MASK 0x0000FFFF
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#define NV_NOTIFY_STATE_ERROR_CODE_SHIFT 0
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncstruct nouveau_notifier {
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_channel *channel;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync uint32_t handle;
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync};
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncint
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int count,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync struct nouveau_notifier **);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncvoid
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_free(struct nouveau_notifier **);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncvoid
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_reset(struct nouveau_notifier *, int id);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncuint32_t
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_status(struct nouveau_notifier *, int id);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncuint32_t
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_return_val(struct nouveau_notifier *, int id);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncint
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsyncnouveau_notifier_wait_status(struct nouveau_notifier *, int id, uint32_t status,
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync double timeout);
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync
7a0d67332f33bc21290d63bc7c8150b0cf0a4b21vboxsync#endif