5383c976362d5b18656cf7b9248b2063a764a203vboxsync/*
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * Copyright 2008 Nouveau Project
5383c976362d5b18656cf7b9248b2063a764a203vboxsync *
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * copy of this software and associated documentation files (the "Software"),
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * to deal in the Software without restriction, including without limitation
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * and/or sell copies of the Software, and to permit persons to whom the
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * Software is furnished to do so, subject to the following conditions:
5383c976362d5b18656cf7b9248b2063a764a203vboxsync *
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * The above copyright notice and this permission notice shall be included in
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * all copies or substantial portions of the Software.
5383c976362d5b18656cf7b9248b2063a764a203vboxsync *
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5383c976362d5b18656cf7b9248b2063a764a203vboxsync * SOFTWARE.
5383c976362d5b18656cf7b9248b2063a764a203vboxsync */
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#ifndef __NOUVEAU_DRMIF_H__
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#define __NOUVEAU_DRMIF_H__
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#include <stdint.h>
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#include <xf86drm.h>
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#include "nouveau_device.h"
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncstruct nouveau_device_priv {
6d24c9146acaffc214996545d2e9cb9cc624d953vboxsync struct nouveau_device base;
70b521b96cedac62bb1081a93eae1363a52b8b3evboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsync int fd;
5383c976362d5b18656cf7b9248b2063a764a203vboxsync drm_context_t ctx;
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync drmLock *lock;
5383c976362d5b18656cf7b9248b2063a764a203vboxsync int needs_close;
5383c976362d5b18656cf7b9248b2063a764a203vboxsync};
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#define nouveau_device(n) ((struct nouveau_device_priv *)(n))
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncint
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncnouveau_device_open_existing(struct nouveau_device **, int close,
5383c976362d5b18656cf7b9248b2063a764a203vboxsync int fd, drm_context_t ctx);
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncint
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncnouveau_device_open(struct nouveau_device **, const char *busid);
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncvoid
f7d3e0f8a1bc1085e9a5e8f30d1ba1ceec85b366vboxsyncnouveau_device_close(struct nouveau_device **);
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncint
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncnouveau_device_get_param(struct nouveau_device *, uint64_t param, uint64_t *v);
5383c976362d5b18656cf7b9248b2063a764a203vboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncint
5383c976362d5b18656cf7b9248b2063a764a203vboxsyncnouveau_device_set_param(struct nouveau_device *, uint64_t param, uint64_t val);
4bd3e7685494afe7c303fc131c66e685023b6b4avboxsync
5383c976362d5b18656cf7b9248b2063a764a203vboxsync#endif
5383c976362d5b18656cf7b9248b2063a764a203vboxsync